Compare commits
3937 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ac30c27c3f | |||
| 105c3ad9af | |||
| 25fb362c8b | |||
| 54b3673488 | |||
| 3e8b3b5f7c | |||
| 3319192abc | |||
| 423f41d7d3 | |||
| c27283c0d8 | |||
| 58816f0f3a | |||
| b79742b222 | |||
| b8c8161d58 | |||
| 2621d6a3e0 | |||
| 742cee9108 | |||
| 9f07674dfa | |||
| a08a768f50 | |||
| cfcb5684a0 | |||
| 0f121bdf37 | |||
| 3231f0aad0 | |||
| fe0600866c | |||
| 604e42bde8 | |||
| 7a02d6e4ed | |||
| bcc79b38b8 | |||
| 26d36e28fa | |||
| ccdd55a607 | |||
| 06da2071b4 | |||
| 7f804cd8c8 | |||
| ffd9ab12c6 | |||
| 5928b78c45 | |||
| 85f80cfbd1 | |||
| e7271179f7 | |||
| b6fd878834 | |||
| 508cf11b88 | |||
| 25bdc076cd | |||
| 30d45356a3 | |||
| 585a66ba21 | |||
| a2f6c27221 | |||
| a892a990f7 | |||
| 3bfe17a14f | |||
| ddd6ebc58d | |||
| 1b5c0c68dd | |||
| 3e6f9faf71 | |||
| ad72168143 | |||
| 4fc8276f0f | |||
| aad035c4b5 | |||
| 560d6776af | |||
| c7a9a8e8f1 | |||
| c2cd0c994f | |||
| c729d6d65a | |||
| 5785ebb384 | |||
| b32ad80c23 | |||
| 2b79a3691f | |||
| cff39ec3a9 | |||
| c4bdc930ca | |||
| 14b9b12211 | |||
| d45d8eb4bc | |||
| c5e6665010 | |||
| 1b5a479bbd | |||
| fc92040d7f | |||
| b3073bbf1e | |||
| 63a107acbc | |||
| 07646c2124 | |||
| b45cea1434 | |||
| 3648a058d1 | |||
| 90479eaad6 | |||
| 1de2ceca9b | |||
| 8fc281e034 | |||
| 2093134420 | |||
| 818dd88390 | |||
| be4bb48476 | |||
| 1c8cb3b7d3 | |||
| 1ede0f4706 | |||
| 78703cfe47 | |||
| c72a5a5775 | |||
| d09dd29054 | |||
| ed711c0e59 | |||
| fa6114719d | |||
| c8b9cc9fe5 | |||
| b70a1edbc7 | |||
| 14e5aa57c8 | |||
| cdc49d166e | |||
| 7b65f93953 | |||
| d878a286bc | |||
| ce35554a55 | |||
| 1f17109203 | |||
| 4739eb3601 | |||
| 40a84dd477 | |||
| 309f409554 | |||
| a6f8e4f6b3 | |||
| 596db2c29c | |||
| 1fd33f611c | |||
| 5e3bacbd9b | |||
| 7cdb5f3123 | |||
| a168aa2df3 | |||
| 87fe93ee9a | |||
| 039e295e53 | |||
| 0fd888a42e | |||
| 1e71285de8 | |||
| a2200bd01e | |||
| 9a9455a696 | |||
| 19a698682b | |||
| 3baf79f929 | |||
| 74d47943e9 | |||
| d9c78cf495 | |||
| 8e4a09d9e5 | |||
| 67ac8bf070 | |||
| ef5225b776 | |||
| 48b0583866 | |||
| f528aada24 | |||
| 1f45f05f8d | |||
| b8fcbb68b0 | |||
| 4ab9a2a3a8 | |||
| 85c0219aed | |||
| 10e218e224 | |||
| 69d044cd8d | |||
| 7062efeb3e | |||
| cee53fcecf | |||
| ef8e92cbe3 | |||
| 7c73c3b75c | |||
| 1e826f5ccf | |||
| 96561c16ad | |||
| bd85f23ed9 | |||
| 557e1c3694 | |||
| c785b14c18 | |||
| 3751d5d5c1 | |||
| 45bb51ded8 | |||
| c3b424eb11 | |||
| 01ef9ecca4 | |||
| 0eb6bf6a67 | |||
| 4aab8db420 | |||
| 9263999ad1 | |||
| 4d9b56c7f1 | |||
| d0afef47f8 | |||
| af53ce6f76 | |||
| c0589cab05 | |||
| f35babad98 | |||
| 8369cb2af6 | |||
| 07d49b1bd8 | |||
| 5c8aab7917 | |||
| 14093c86a9 | |||
| e153df4d5b | |||
| 3e0c356b0b | |||
| 5fce74a2a6 | |||
| 7c418f7ea5 | |||
| dac72ff371 | |||
| baf22527b0 | |||
| 4cba60b27f | |||
| 5e539f71e6 | |||
| 9000407a77 | |||
| 4b6f8d2f62 | |||
| 688097faa9 | |||
| f08579d201 | |||
| 47fdaf6902 | |||
| 22c0f0d635 | |||
| a886e28f87 | |||
| 65104b5909 | |||
| 5605b4ee70 | |||
| 3ecba8e57f | |||
| 0c8bda4f41 | |||
| 458dbbd15d | |||
| b1aa87b515 | |||
| b637bd3866 | |||
| b4557789f8 | |||
| 63169d7679 | |||
| 5d705c0e9c | |||
| 682924b51a | |||
| 598c90f376 | |||
| e4962054a4 | |||
| 436c245d13 | |||
| 8891d85f75 | |||
| 763550c472 | |||
| d2ddb9882f | |||
| 64ac6a59c4 | |||
| acd9d6ff24 | |||
| f4b95c0226 | |||
| 177084b1f4 | |||
| aff0484ea2 | |||
| ef1eff6d48 | |||
| b407d12ed1 | |||
| e8bfce4ebd | |||
| be5f780977 | |||
| 9e39c8cd64 | |||
| 3356a76c9b | |||
| e29747170f | |||
| d6159a35aa | |||
| 0019ea28c3 | |||
| e899de88ff | |||
| bb111d325f | |||
| 73906f9f29 | |||
| b20d7ff48c | |||
| 8262d56574 | |||
| 257b9a2015 | |||
| ff07595519 | |||
| 6023794081 | |||
| a1189fa37a | |||
| 5a2a2f49ed | |||
| 6c372d1781 | |||
| 1669d0fdbd | |||
| 47b4c649f1 | |||
| ead67d8e67 | |||
| 8c4ba3257c | |||
| 05c4aa5017 | |||
| f84b2f072f | |||
| 9b122e5449 | |||
| 246b9f3182 | |||
| bf6854d121 | |||
| eebd48e51d | |||
| 9767cc84b0 | |||
| 11b0b6958f | |||
| cb1f30e9d2 | |||
| ec943b38a2 | |||
| 68f0393cf3 | |||
| fe26db4d36 | |||
| e3e4decabf | |||
| 6537909fd2 | |||
| 26ced19e18 | |||
| 3d85a89cc9 | |||
| 16944b0c4c | |||
| c4cc3ad81e | |||
| 0674a58502 | |||
| a809f33418 | |||
| bf33a1827c | |||
| 57ef6dae91 | |||
| 758f1bcdee | |||
| fa6fd5980e | |||
| 3762f1e50d | |||
| 5aaee670d1 | |||
| 9916f0e5c5 | |||
| 9eba0ac58c | |||
| 13493ec051 | |||
| b7a7a5c582 | |||
| 213527ca71 | |||
| dc7ac22f84 | |||
| 16d1577722 | |||
| bd6a7dea7e | |||
| 6433eebe1e | |||
| 35b7cf4c98 | |||
| c733d03525 | |||
| aef5113d49 | |||
| b21fce4d6f | |||
| be8d8ded3f | |||
| a5a2d43d7c | |||
| da878c36bd | |||
| 11e2965b5c | |||
| 4203f53b67 | |||
| d4c3905355 | |||
| 307da1fe39 | |||
| 44b2df27ea | |||
| 5ee0cea672 | |||
| df6607e236 | |||
| e32c49c12c | |||
| 8693031b06 | |||
| b644d5b2ae | |||
| 5e8852af80 | |||
| b6f8eface7 | |||
| fe23e0cc6e | |||
| bdca52a95d | |||
| 33d2618e5b | |||
| 2bc8723824 | |||
| 4ecf05aa13 | |||
| 1705638e25 | |||
| 5db0f47710 | |||
| ee173dc3a2 | |||
| 591a6c8671 | |||
| 6c189511af | |||
| a06223b844 | |||
| 9232ddf0ab | |||
| 1c14d872a8 | |||
| 98fc131d47 | |||
| 8ad31d2559 | |||
| 46dde3f8f7 | |||
| 8318eed068 | |||
| 778199ceb1 | |||
| 6b48a72d42 | |||
| 07a366b608 | |||
| d07ea31400 | |||
| aa357b9ae8 | |||
| 78ecb115f3 | |||
| 6cf006b02b | |||
| 7a356d3294 | |||
| fb56c14853 | |||
| fbf8231642 | |||
| f881282a8b | |||
| 435ef04c34 | |||
| f2ba41af46 | |||
| b4c77afdc4 | |||
| 2d9e02b0a7 | |||
| 9e84804eb0 | |||
| fb5df32990 | |||
| a1e725ffeb | |||
| 9cbecbd8cb | |||
| 1a4b5413bd | |||
| 124f5d0097 | |||
| 684089ba81 | |||
| b6bd02daf0 | |||
| 973bf5abdf | |||
| 80a9abcfc8 | |||
| 2c803dbe66 | |||
| 8454949eea | |||
| 7a9841bb2a | |||
| 22b1400018 | |||
| 44b8556dc6 | |||
| a342107021 | |||
| 1c9718389f | |||
| 5430e1d310 | |||
| 9abb908226 | |||
| 38562155d4 | |||
| 4f74cbe510 | |||
| 528b2d6c7b | |||
| 7884356e90 | |||
| 38f35df7b6 | |||
| fcb853792d | |||
| b72f6da853 | |||
| 623ddd966c | |||
| 9ff52cf063 | |||
| 8f5e94c155 | |||
| 6b7ce37374 | |||
| 66e57ae19b | |||
| 0d207a6c0d | |||
| 0b080aeefc | |||
| 867e9210d7 | |||
| 77f8ce503d | |||
| 530ea688e4 | |||
| 11a442272d | |||
| f87e396958 | |||
| 8d54bcbc0d | |||
| 03c86ae43b | |||
| ce21db2ce3 | |||
| 153a2d2b40 | |||
| e73fce2d60 | |||
| d43edb19d2 | |||
| 14205d3d1c | |||
| 30b804e0bc | |||
| 153f1cc50a | |||
| fc3179b698 | |||
| d4a55f4b06 | |||
| 03a5b5be1a | |||
| ad39615141 | |||
| 691d87978b | |||
| ebf54d6acd | |||
| 5f15c661c6 | |||
| c0ab0dee6b | |||
| 73e50b970d | |||
| 11858dce1a | |||
| a64053fd68 | |||
| 1ede5cbc4c | |||
| bb66b97251 | |||
| 6e07e07cd0 | |||
| a270ac7f02 | |||
| 7f3cb4d3c9 | |||
| 42b518cf7e | |||
| c24fba89e8 | |||
| 5b225ad59f | |||
| 8ebe9d7dc2 | |||
| 9beb2d8ae0 | |||
| 12099b3144 | |||
| 2aa2c1811f | |||
| af1ff4439d | |||
| 51bdf1e3ed | |||
| d7a899f984 | |||
| 707523c679 | |||
| e04de77f82 | |||
| be9cebbc8f | |||
| e3bc2273d3 | |||
| c20756136a | |||
| 066e3006bf | |||
| bbb0effe23 | |||
| ad174eb12c | |||
| 1c33c012ad | |||
| 3c82e1a58d | |||
| dbcb5df172 | |||
| dafb6b5c92 | |||
| 84d0d396ed | |||
| 56b9b38c9c | |||
| 05fb57baff | |||
| cc46f2d7e6 | |||
| 1f3433464c | |||
| b0f5796c90 | |||
| 0f87c4485d | |||
| 5e0489dcc0 | |||
| 949200cd3e | |||
| 2d512121f1 | |||
| 7a2802a5e0 | |||
| f0459e3891 | |||
| 1fd8c50d95 | |||
| 65fe9b0927 | |||
| 619d605a9e | |||
| b8721b6475 | |||
| a94b9d38b0 | |||
| c382ce5260 | |||
| fc56e70172 | |||
| 8c8242345e | |||
| 130f7905ba | |||
| 912072e60c | |||
| bdeccd889f | |||
| 009ac37a7d | |||
| 44ae306e6b | |||
| a7e808b35b | |||
| 46735d6b3d | |||
| 71441819e5 | |||
| 1a7ea2d235 | |||
| 4438163da1 | |||
| b7eda71673 | |||
| 0fcbd43db9 | |||
| 4de513eb01 | |||
| 9245308ff2 | |||
| 7be259217a | |||
| c9a789bf76 | |||
| 3cd2f735a7 | |||
| b61ac15c47 | |||
| fb47945930 | |||
| 247c776a1b | |||
| eb1d4811de | |||
| d646fbb94f | |||
| 98f09e4f27 | |||
| 7a6f5b6ee5 | |||
| 8ff155a2c9 | |||
| f7dcaa4a68 | |||
| dcd2bbaa3d | |||
| 5a36c57c57 | |||
| 662fce38bd | |||
| 4dd67cdd54 | |||
| 47a9c8d731 | |||
| 9a081369c8 | |||
| 208f4c3e27 | |||
| c618e02695 | |||
| 61c6f82f74 | |||
| e6bd91ada0 | |||
| e585939ac2 | |||
| 3576e13e9a | |||
| 470ed777c2 | |||
| 7195b2e907 | |||
| 32a03344b3 | |||
| 9e7902455d | |||
| 68cf570b58 | |||
| 1c69eb2b73 | |||
| 6a9f3040e1 | |||
| 190fc4301e | |||
| 22a89a272e | |||
| 4c46bde315 | |||
| 0578430fd0 | |||
| 33e13aa7e7 | |||
| b9f4c15ec0 | |||
| 15500d4ee9 | |||
| 2528fc4555 | |||
| f8719c1230 | |||
| 33c59fa51b | |||
| 2b6f8a075e | |||
| ac771f951d | |||
| e297984e59 | |||
| 8b12379eb3 | |||
| 2064f1cb80 | |||
| e377199e41 | |||
| a8f977ed9e | |||
| 44bee7d0ba | |||
| c100328a6f | |||
| 1672c93a2d | |||
| 2a3029a62c | |||
| 53b2e19d96 | |||
| 132093c80e | |||
| 5c9f83c3a8 | |||
| 712c04b2ad | |||
| 39dadad534 | |||
| a026d35c97 | |||
| 7ccdea7822 | |||
| 09ae45c566 | |||
| deeb4acbe5 | |||
| 5eb98b745f | |||
| 74fec275c7 | |||
| a0c0df6e9d | |||
| 0ae8cc4467 | |||
| f36f478281 | |||
| 0227c03366 | |||
| 8157e7cac8 | |||
| ae634bb87e | |||
| 2af86e363c | |||
| e9bee80f4b | |||
| cc30e1aa47 | |||
| 854bc1db60 | |||
| d3837de571 | |||
| e1ff3f4674 | |||
| ceb4cb59ac | |||
| fc9fdca3f6 | |||
| 6296453ef3 | |||
| 04926374f7 | |||
| a186af32ec | |||
| 7ac9d3b679 | |||
| 2e5b01faca | |||
| 2337bf204c | |||
| b2a7dac11b | |||
| c6ed5a8e6b | |||
| d97cdb9fbf | |||
| 692d9dd4ae | |||
| 260865de6d | |||
| 438e057dc8 | |||
| 59433bfcd5 | |||
| 96728a83f6 | |||
| f5e65e4ad9 | |||
| c95f6c8c56 | |||
| 73c2115968 | |||
| 5d6aecc599 | |||
| 2085d318bb | |||
| c77dec6d6a | |||
| dc34d5b350 | |||
| ca835ba68a | |||
| ce56351554 | |||
| d60b292ef1 | |||
| eb377f425c | |||
| 4c4e4fc772 | |||
| 6401eefb26 | |||
| ea6f3ff5ed | |||
| 97581d8635 | |||
| 6bac4a535b | |||
| 0a5b518aea | |||
| 94da0dbd4d | |||
| 87e38118a5 | |||
| ba8fd825ec | |||
| 2c981cf940 | |||
| 11f7b167ae | |||
| 06c6c8212d | |||
| b89961f01d | |||
| 59df7e7104 | |||
| bbf7e6332c | |||
| 8c3b3f7ab4 | |||
| 47987efb75 | |||
| ed8ebda804 | |||
| d4da0e052d | |||
| 6705a6ecc9 | |||
| dfa968863a | |||
| 70885ada67 | |||
| 71b21fe793 | |||
| 1f4ebf1501 | |||
| dcb3169f56 | |||
| 772706ca4c | |||
| 77594dc66c | |||
| 0dc00b8104 | |||
| 758897a929 | |||
| 5c4af45bf5 | |||
| effd379c25 | |||
| a6b7c9c309 | |||
| 85c4392b34 | |||
| c3bac7c92b | |||
| 45d41267f5 | |||
| 869e10027d | |||
| 246b593783 | |||
| d22017bfca | |||
| c7965405d3 | |||
| d7358848e1 | |||
| 989f954432 | |||
| 4d88296485 | |||
| 086e1c34dd | |||
| e6c6a7fb8b | |||
| 32830d45ff | |||
| 223979c088 | |||
| 0ea0c21fed | |||
| 7a921cbdf9 | |||
| 9db7de29fb | |||
| 63e690ca11 | |||
| a19b721c26 | |||
| 73ea020525 | |||
| 2c10348408 | |||
| 028277bd2d | |||
| 67a341fded | |||
| 44879dd9f3 | |||
| 6ae54ae27b | |||
| bf8a20c4b9 | |||
| 55bc9eda9a | |||
| e296f81a37 | |||
| d69a4173fa | |||
| 4a08e8cd0b | |||
| 7779742ac1 | |||
| 091b6711ae | |||
| d0442e140b | |||
| 714e07b1dc | |||
| 001ab05f1a | |||
| f30d71da6c | |||
| d22ac91ee1 | |||
| cbf880fb71 | |||
| 8fd3064905 | |||
| e83c387ebe | |||
| 3b5cd4845e | |||
| c0487a634e | |||
| c299a65aab | |||
| 62a9c38754 | |||
| 67fe5e1107 | |||
| 1778113b71 | |||
| 8637754d6a | |||
| 083c4fc855 | |||
| 251fb86ab0 | |||
| 5853332db7 | |||
| 860926d731 | |||
| eb889920e6 | |||
| c96057296a | |||
| 863d963e97 | |||
| 0cf4b378f9 | |||
| a8bebcba55 | |||
| 6fa5e2cc7c | |||
| ff0bb52689 | |||
| 298c9fea22 | |||
| 244f3dfb89 | |||
| 28366d35d2 | |||
| c4733a6eab | |||
| f6b5f02501 | |||
| 338fb6cc7e | |||
| 833c100850 | |||
| 9d01396737 | |||
| 1e39c691dc | |||
| bc63eaea48 | |||
| 795170635f | |||
| b52e885cde | |||
| 079411eee8 | |||
| d66bd5f70f | |||
| 9f1ee5bd28 | |||
| a66147705f | |||
| 3a63b62486 | |||
| 28a5d4d4f0 | |||
| 6761d4a30c | |||
| ed94626411 | |||
| 40a598b0ab | |||
| ea528a1ced | |||
| caf5894152 | |||
| 3956b21cb7 | |||
| 35ab3b0cd8 | |||
| db27ea923d | |||
| 4260f68f85 | |||
| c4102f3b18 | |||
| 9710044134 | |||
| 39767b8d46 | |||
| e5a792515e | |||
| 8f67c910ab | |||
| 136295f70e | |||
| 6b3c47a42a | |||
| 60a7f9b3f2 | |||
| d22672b156 | |||
| dc970c513a | |||
| 2bcc755fca | |||
| ed93c77433 | |||
| 92446de9d9 | |||
| 2e5d20c315 | |||
| 31ec26a7a1 | |||
| 8d2b6f6054 | |||
| b073ead988 | |||
| 97083ebba4 | |||
| 713ae91e27 | |||
| ee645d054d | |||
| df6ee9c29d | |||
| fc1408e643 | |||
| 214d3d0f1a | |||
| edc92843a7 | |||
| cdefb969ec | |||
| 266db1336d | |||
| e2d82394f6 | |||
| 38c444cfa1 | |||
| 5c52521a0a | |||
| 5aae9b5536 | |||
| 42423588c8 | |||
| ce3fdeda5e | |||
| 805c778f91 | |||
| aafcf44581 | |||
| da7472fe81 | |||
| 75fe95eeb1 | |||
| efc8779275 | |||
| 81780d1932 | |||
| 85d0fff233 | |||
| fe1e7a1bdb | |||
| f63ec52479 | |||
| 6312bf5323 | |||
| f8f067ca7c | |||
| c7738b8b37 | |||
| 643c15c4e9 | |||
| 0c7f763889 | |||
| b85fc50854 | |||
| edd0965c1a | |||
| 766f1b2b01 | |||
| 984aa44220 | |||
| b85a68e8a1 | |||
| 4cf41305e0 | |||
| c4e99dbdb2 | |||
| 42e1d4d752 | |||
| 5637c22363 | |||
| 7e30a0f464 | |||
| 2553e45d76 | |||
| 250ce63527 | |||
| 5fc6f59821 | |||
| 7c1ab47262 | |||
| 6b5ee57718 | |||
| d846eac0f1 | |||
| fefeba03b8 | |||
| 56ac7f2572 | |||
| 3a3d264cb5 | |||
| 2ae5a7ff39 | |||
| 2e17ea1490 | |||
| cbe119b457 | |||
| 960f4ceefc | |||
| 5ad060f150 | |||
| 1ff4f77eaf | |||
| a8e15ce18a | |||
| 3ee56627eb | |||
| cedc023922 | |||
| 8189577e8f | |||
| b57daef75a | |||
| 62258a1f1a | |||
| dab1dda903 | |||
| 1a61ef0440 | |||
| 4eb1267c5c | |||
| e9766f1b76 | |||
| b21e226b1c | |||
| 99717b7902 | |||
| bad2d7f121 | |||
| 8413cd7b0a | |||
| d59486295d | |||
| f81a02ed5e | |||
| 69d08b6691 | |||
| c95c4c32e6 | |||
| b46fc2fc49 | |||
| 5a3cf5d9ac | |||
| 7542d38681 | |||
| ce072f25e2 | |||
| d5bb951237 | |||
| 4c0b5bbc62 | |||
| 51a6862bf4 | |||
| b6c827b17a | |||
| 17c4b2387e | |||
| f712b8aca4 | |||
| 91d0229bc5 | |||
| b7c539ad7a | |||
| 0c231e6578 | |||
| 77674be1c1 | |||
| 70903d46e6 | |||
| f86c079acf | |||
| 38d57eb02c | |||
| d5e44f6224 | |||
| 3fbc3a3f00 | |||
| 427270884c | |||
| 73233fd347 | |||
| d971c4e0f6 | |||
| 7f25720bd3 | |||
| f2c82d3cf4 | |||
| d53a1d10ab | |||
| 5b181ed28c | |||
| c1e2b75a49 | |||
| 08b47616b6 | |||
| 13d58ac355 | |||
| 96329a6e29 | |||
| 9f257ee9f8 | |||
| 8cd0aab129 | |||
| ccb2d89744 | |||
| aa3c97f918 | |||
| 7a988c73a6 | |||
| 9b18bd4cd7 | |||
| b81cf01456 | |||
| daabbba5fc | |||
| bbf7a070e7 | |||
| 27a8c074fa | |||
| 855d6935d9 | |||
| 35570a5ebf | |||
| 21e7206f7a | |||
| 1b33abf287 | |||
| 0838e3209e | |||
| 9485fe2693 | |||
| cf402c8954 | |||
| 0327e76320 | |||
| a120414d32 | |||
| d995bfbdfb | |||
| 36aace57ca | |||
| c6bd5d09f8 | |||
| 23a0116975 | |||
| f72f6fe9c5 | |||
| b00acff9dd | |||
| 284d2c43f9 | |||
| 0a08f9595e | |||
| 29c29d0074 | |||
| efd52a0547 | |||
| 4f2bda26fc | |||
| a14dd8ea51 | |||
| 6f9f5f7918 | |||
| 1f500aad53 | |||
| 34eb85683c | |||
| 6fab5a885f | |||
| 38f93461d1 | |||
| 6182f5346d | |||
| afefecf1f0 | |||
| ed03e41f88 | |||
| f14a06938c | |||
| e91042af97 | |||
| 617a488a0a | |||
| 854919b5e2 | |||
| 8f788cb522 | |||
| 6078f25aa7 | |||
| 4484e8c3f0 | |||
| b6bcdade81 | |||
| 6adf086ed1 | |||
| e7fc5228d5 | |||
| 23f03a19e8 | |||
| 2060f02636 | |||
| e34b5f1f55 | |||
| e083c1471c | |||
| d9eba43360 | |||
| 3506d03dc5 | |||
| 24eb544046 | |||
| 6a1f0aed36 | |||
| a0c433a065 | |||
| 6229733fbb | |||
| 7e971eb032 | |||
| 01ce1c31d1 | |||
| 212fd4b340 | |||
| 659f3d856a | |||
| 8cded28c45 | |||
| 454fbce4c6 | |||
| 26738762ea | |||
| cd5edc38ff | |||
| 5250911a40 | |||
| 45e48c2499 | |||
| 15901589a5 | |||
| bdecd3c180 | |||
| 61de5e8835 | |||
| 3b3fffa962 | |||
| 63ad2cce72 | |||
| da2caa0881 | |||
| 93b06f2a39 | |||
| f2d5542e66 | |||
| 7584f29ec7 | |||
| 9fd244cf9c | |||
| bb722d5824 | |||
| 5de70628d7 | |||
| e33c684b49 | |||
| d9dbb1565a | |||
| 34992d8a8f | |||
| 9d7c186a4f | |||
| 702193a6c7 | |||
| bbe00f6505 | |||
| 70a80b84d7 | |||
| c8cc681591 | |||
| 8604f5a02f | |||
| 26ff4fd6b7 | |||
| 4bfd019c0d | |||
| 82bc41f4ad | |||
| 01abb255b2 | |||
| cc713a0091 | |||
| 93032be4ab | |||
| 26964efa7e | |||
| f0ded46753 | |||
| 47d251a818 | |||
| b018c91135 | |||
| d910d2c572 | |||
| f384d87044 | |||
| bd52bcf8d4 | |||
| d58bd1c916 | |||
| 22d49ae96a | |||
| 3b6e3fb3b4 | |||
| d287ba44ce | |||
| 4c133ab5bf | |||
| ee0eb70de4 | |||
| 4b0b65c0c5 | |||
| d0ea8d5262 | |||
| 9b505984f2 | |||
| 9adb534c7f | |||
| c3fb1419fd | |||
| dd233c9f38 | |||
| 9e01f2817f | |||
| 8831bd0918 | |||
| b2b9f535dc | |||
| a880ce89d1 | |||
| 06cbe4a0bc | |||
| a6a4081894 | |||
| bcf4a6209e | |||
| 4d71df70db | |||
| 05f2aaf2b9 | |||
| 1dcc6858b4 | |||
| 52e2800fb5 | |||
| d74e031d4e | |||
| 2ae687cf00 | |||
| a196ee1957 | |||
| 81fcadac38 | |||
| 4966d50e52 | |||
| e860f7fb14 | |||
| 5911b3c1f1 | |||
| 77371e973f | |||
| b0a2f9f65a | |||
| e80bdf120b | |||
| 8d3235cd7c | |||
| 51462226a7 | |||
| 094c4057be | |||
| 2f89d15079 | |||
| c4dab6e644 | |||
| 72375d9e3d | |||
| 674373dd6c | |||
| 7eb5da73fe | |||
| 12d8b795f7 | |||
| 0ed770633b | |||
| 19257b3121 | |||
| 32434dd848 | |||
| 9cdb74efc7 | |||
| 0e5c54709d | |||
| 35db227af4 | |||
| a6ba47265f | |||
| 62246f75c8 | |||
| a6d8d1144c | |||
| 5ef7f8bf3e | |||
| 09fc492257 | |||
| a78ba8a271 | |||
| 263e5beb26 | |||
| 7ae680d9d1 | |||
| c07b0dc373 | |||
| c5b3359c4b | |||
| a7fbd6c9a9 | |||
| 5cbcd07ff1 | |||
| 047d59df0c | |||
| 41687af077 | |||
| 6353575208 | |||
| 974ea68cf9 | |||
| 0f0de47c83 | |||
| 8a3d15d4fe | |||
| 422f5c0008 | |||
| 5a14644cd4 | |||
| 4e4325a2bf | |||
| 79dc835378 | |||
| 9404cd5cd8 | |||
| 9ef24509cb | |||
| 4b54d7ece1 | |||
| a9180ce187 | |||
| c0423d513d | |||
| b6323861a5 | |||
| a451bb574e | |||
| fe551148d8 | |||
| 1675a82efd | |||
| 71a975c685 | |||
| 3813c09be6 | |||
| 3b7d0bc3fc | |||
| 2230975e55 | |||
| 787619cdba | |||
| 7d70be42af | |||
| 9671a654b7 | |||
| 6963157e63 | |||
| 9452c6b08c | |||
| 035875825e | |||
| 837e06e85b | |||
| 9e3132c3fc | |||
| 843d0ed298 | |||
| f7f4c049fc | |||
| 1072540e3e | |||
| 0c8c13b8b7 | |||
| 303a109286 | |||
| f0dc38cadd | |||
| 4efa2266e6 | |||
| 1f7a1e4078 | |||
| 2ead9b1f21 | |||
| ddf5b52360 | |||
| f66468ffcd | |||
| d3405da5c4 | |||
| 020d282868 | |||
| 137821c866 | |||
| e6d2e05b6e | |||
| 7b889a10cc | |||
| 1e1c2007a3 | |||
| 660f491310 | |||
| 670660c244 | |||
| 3d960064ef | |||
| f6d2409b20 | |||
| 39bc897b93 | |||
| 5f35f2ac7d | |||
| e1eb075604 | |||
| d19d9ccd0b | |||
| b4b4ae7a78 | |||
| 149fa9d750 | |||
| 791070c158 | |||
| 3bd2114815 | |||
| 46de48593c | |||
| acd384ae2d | |||
| b77666cbba | |||
| 128ee67bba | |||
| 7417033d7f | |||
| e8a940172c | |||
| 290bdc4566 | |||
| 220aab1fd0 | |||
| 8e9f456029 | |||
| aa450b56f1 | |||
| 6d70f3c237 | |||
| 6384541345 | |||
| ffb014ca3d | |||
| 3c3f92f29b | |||
| 24255f7883 | |||
| 40fa836b81 | |||
| b71caa94ac | |||
| 39658c0c52 | |||
| 9b8522e734 | |||
| 9875bf9c7b | |||
| 4ce4cf5242 | |||
| 52110e0647 | |||
| 19ce0cdc09 | |||
| 2e58f312d5 | |||
| 7523d01e0f | |||
| 7972cb5bdc | |||
| 685d5d3ea3 | |||
| 9f7caf90e3 | |||
| f453194e32 | |||
| 440c637b1f | |||
| d95809a069 | |||
| 6aac972bda | |||
| df3fddc026 | |||
| 1ce49b60d9 | |||
| 8b5b23e6c0 | |||
| 26f329d186 | |||
| 5ace4438e2 | |||
| b8e10225f9 | |||
| 224facf3ba | |||
| 9c12d8ff22 | |||
| 3b4339c8e0 | |||
| 8e12c4cb00 | |||
| efe1678088 | |||
| 2f5be3559e | |||
| 960668ecf1 | |||
| 83084467c6 | |||
| 8464ab6a23 | |||
| 74ec128e62 | |||
| 194c6b8bee | |||
| 69272edba6 | |||
| 38531459df | |||
| b3e3c68f15 | |||
| 5029dff73a | |||
| 689dee9944 | |||
| 68f9898171 | |||
| 08622a41b4 | |||
| 669a3277ff | |||
| e6bd681227 | |||
| 0c5cfdddba | |||
| d08ce79d04 | |||
| bab52c132d | |||
| cc1efd2a46 | |||
| 8297d963bf | |||
| a17c41b4e1 | |||
| b055747d4f | |||
| 4ef76866a5 | |||
| 675ccd4510 | |||
| 31a925b4f0 | |||
| d153575e59 | |||
| 3afc62e525 | |||
| f8446b227b | |||
| 8f937bda0f | |||
| 9d1208bf95 | |||
| e7591439f4 | |||
| fef0b1dd46 | |||
| 3281a1982e | |||
| b8486a489d | |||
| f97d791fe8 | |||
| 657a6c9511 | |||
| 38514c291d | |||
| f138be2e6c | |||
| ecda02c099 | |||
| e9560da4e2 | |||
| 6406cece57 | |||
| f7e787958e | |||
| 8912b9880e | |||
| 3ac9e0933f | |||
| c1be0cf3bf | |||
| 48919330d7 | |||
| ba12c489ec | |||
| dbccf5fbad | |||
| 509bbddac1 | |||
| 11ccc498fd | |||
| 836d14c8af | |||
| 5a4babb0fd | |||
| 4e08d35661 | |||
| 7186b72a56 | |||
| 2b40ebdbc0 | |||
| cae2d929ab | |||
| 34336ebfce | |||
| f38d0e92e7 | |||
| 854365e6ce | |||
| 3529554c88 | |||
| 2a1f19b776 | |||
| 324b2da3ec | |||
| 07f6896622 | |||
| 8417e21e8d | |||
| 404b15b3c3 | |||
| 02473324f4 | |||
| ed68e864c2 | |||
| bc3065939f | |||
| d1e91433ad | |||
| 4e7e895822 | |||
| 2bccf3f2af | |||
| 3586c7613a | |||
| b1c8c0a448 | |||
| 5a18c3f8ea | |||
| 3055de0444 | |||
| 6811195345 | |||
| 5f12a4f7b5 | |||
| e748fc294b | |||
| 082815f93e | |||
| 2da52d0309 | |||
| 702423158c | |||
| 969e2d8c57 | |||
| 5a60a5bebd | |||
| 44840dbbcf | |||
| d6b2230b92 | |||
| 0e0345824e | |||
| d917cfa43f | |||
| 813e753e3d | |||
| c4b3b967d9 | |||
| b41fcf3734 | |||
| ecad586739 | |||
| 64036e0478 | |||
| 9c6539ea2d | |||
| a97dc349b7 | |||
| 243bc0d06e | |||
| e7df81ade0 | |||
| 743f5f07cb | |||
| 3ed603074c | |||
| e8310e6c50 | |||
| 3ca634138d | |||
| d8bef46c2a | |||
| ae83ab5436 | |||
| a00111a863 | |||
| 7416fe91fc | |||
| e4631f93bd | |||
| f2df9b469a | |||
| 4b7f9c38a6 | |||
| a666318b95 | |||
| aa811b6eef | |||
| 321e6d3a86 | |||
| 56ba5a765b | |||
| aa4fb80465 | |||
| d68c748976 | |||
| 8a21e0fcb8 | |||
| 408581b7bc | |||
| 416d66a438 | |||
| 5672ba887b | |||
| 14123d67e1 | |||
| 69b3828086 | |||
| a44c54b428 | |||
| dc5a439ec9 | |||
| 81f05daff2 | |||
| 456f83671a | |||
| d7b4b2fd49 | |||
| 27807f3a61 | |||
| fcf7751008 | |||
| 1cda2977bb | |||
| 6221fecf3b | |||
| 80dc122742 | |||
| 929f518ef3 | |||
| 6fae5863cf | |||
| 56704888b5 | |||
| 266504a0ac | |||
| 08d05e245d | |||
| 6f584049a2 | |||
| 52129a3d71 | |||
| 27ad98ee98 | |||
| d90850e697 | |||
| 717d99795c | |||
| 8e4ad3dfcb | |||
| be1c9100cc | |||
| 65750aea12 | |||
| 0e27b68ba7 | |||
| 6c01658d37 | |||
| 8e451126ac | |||
| 7ae1b51753 | |||
| 0d6297fef0 | |||
| d01235ce2d | |||
| 38709058a3 | |||
| efe430733b | |||
| 3465106456 | |||
| 24128ba450 | |||
| 298eb46a31 | |||
| f245799479 | |||
| 82cb8fe5bd | |||
| b18e337781 | |||
| f3311bb5e5 | |||
| 8a1ce6ba64 | |||
| ca6783ba9a | |||
| 78bfd54ad4 | |||
| 52be47ca89 | |||
| 19cf749944 | |||
| 178bcfc8df | |||
| 83cb137721 | |||
| 8edf35a9e3 | |||
| 6930cbc064 | |||
| 450c8245ed | |||
| 88d7feda5c | |||
| c9c436e6fc | |||
| f4091b1027 | |||
| 174fb97172 | |||
| ed3ac91263 | |||
| 377bdae6a9 | |||
| 3d2386f903 | |||
| a21c9f9861 | |||
| cdcef4c8ee | |||
| 1e9d1c1dd9 | |||
| 399478c2cd | |||
| c86cfef58e | |||
| 7a996648bb | |||
| f438554fc1 | |||
| 8d5d545f3f | |||
| d511fd6529 | |||
| a19a9b5585 | |||
| f3dd9596cf | |||
| 115255c162 | |||
| 984f5c6914 | |||
| fa845fa5c0 | |||
| 579096c6a8 | |||
| 7e938b2363 | |||
| 0d2c4c24b4 | |||
| d0338cddf7 | |||
| d15300a549 | |||
| b9d8d9383a | |||
| 85cf918aeb | |||
| b5add0f027 | |||
| b238107a99 | |||
| 68608ef894 | |||
| 5447521ce5 | |||
| 247af0ebbf | |||
| 3e5f0e5c37 | |||
| 9fdc458d69 | |||
| 4a669fd86e | |||
| 8edef32c76 | |||
| 307015382d | |||
| 471e807ea2 | |||
| bb4b12f253 | |||
| 432bca26ae | |||
| 5f6caf33f0 | |||
| 60dc4abc2b | |||
| e2d0a63b98 | |||
| 0fc55de769 | |||
| 570ca1c87f | |||
| 6e666b63fa | |||
| 2ac47548b0 | |||
| a79ffdb485 | |||
| daf2d3a02e | |||
| e9d9bad643 | |||
| f34bd724e3 | |||
| fd13a495de | |||
| 7dfe9415c4 | |||
| 080e503954 | |||
| a4db58f5f2 | |||
| 009aa3dcb9 | |||
| b46c66b4c7 | |||
| 039e729881 | |||
| c152c20d70 | |||
| 917f08c534 | |||
| ae5d95d462 | |||
| 925d6889a6 | |||
| 231f322b60 | |||
| 2a5f5c0dc2 | |||
| 5d5a4f804b | |||
| 9c2f48cd1d | |||
| fac9d74344 | |||
| 5dfc22a604 | |||
| 660bc34157 | |||
| 70b9271cd8 | |||
| 8da7361794 | |||
| 896562238c | |||
| 0cc4b555d1 | |||
| e76abf875f | |||
| adcb9864df | |||
| 2a9895b7f0 | |||
| 2ad7051746 | |||
| 02ce78482c | |||
| 61755ed017 | |||
| ae38ae9aff | |||
| b5cf7fba2e | |||
| 449c41aca2 | |||
| 2043181501 | |||
| a2f7f371dc | |||
| 29cde1a618 | |||
| c570d60f45 | |||
| 893175f511 | |||
| c197b54774 | |||
| 124d0de325 | |||
| fdae12c52e | |||
| 59c549ac86 | |||
| 1ec18bdf64 | |||
| 42467ba40f | |||
| 9f51bce2aa | |||
| 8f84fca0f2 | |||
| 0e3ab35e32 | |||
| 119126c60c | |||
| 5c42a3cbc4 | |||
| 6133590903 | |||
| eec64ef1c0 | |||
| 8afa6e59b2 | |||
| 9f49232cac | |||
| bc7e30517b | |||
| fe902cbb13 | |||
| 42f3296791 | |||
| 08b03db5fa | |||
| f842c206f3 | |||
| c0255208cc | |||
| 77c2ca6862 | |||
| e8ebb005fd | |||
| c64bbcf87a | |||
| 89f14ec5ac | |||
| 1673ba217c | |||
| a273768c4d | |||
| bc8b71cbc1 | |||
| 9d6df238d5 | |||
| fd628d8345 | |||
| d4e0da3f80 | |||
| 8cfabf0ead | |||
| b3b07c8248 | |||
| 6f8544281a | |||
| d1b5dcfdad | |||
| a462b4518c | |||
| 77bf86eaa5 | |||
| b3db9255e4 | |||
| f5bd044096 | |||
| a2997a1109 | |||
| b0f8611f49 | |||
| de97d3a7aa | |||
| 0e98da2306 | |||
| 5a064be490 | |||
| ec0005195d | |||
| a974ee009e | |||
| cc02a147d3 | |||
| 9ee9efeb76 | |||
| decd2b4f5a | |||
| 9f3b42bd71 | |||
| 4dcb63436c | |||
| a443682aaf | |||
| 4a55ba3067 | |||
| 3f6b826ab0 | |||
| 37a3800597 | |||
| 6d99516489 | |||
| 74daf9145a | |||
| 92e90101e2 | |||
| d8d09b5472 | |||
| 5de1ea3fd4 | |||
| 9136cbfcf2 | |||
| 07b3897499 | |||
| 737080274a | |||
| e4f6eb04e8 | |||
| bbfca3fc0d | |||
| ff01e26c5c | |||
| 2b60de32f9 | |||
| 3449bd3842 | |||
| fc40b0ed6b | |||
| 426c69710c | |||
| a63fdf6c45 | |||
| 4154a1026f | |||
| b5127e68de | |||
| dd000caad7 | |||
| 86fff9800f | |||
| 2679e4f526 | |||
| 1e431edf09 | |||
| 67f1f0fea3 | |||
| beabc88f79 | |||
| e086b7a522 | |||
| dd1afe85ae | |||
| 60bccf0f10 | |||
| 73535e0c04 | |||
| 16311b36b0 | |||
| 537187687d | |||
| 403f585a19 | |||
| 8dd19d1446 | |||
| 71552f7ffe | |||
| b2a7f0fd11 | |||
| 529efd6ac8 | |||
| ed61023dd3 | |||
| 28cdfa9feb | |||
| bf474f0cdb | |||
| d27f6c8fa7 | |||
| 6f71d04aa4 | |||
| 3de47c201c | |||
| e3e5b46cbf | |||
| 4cd9e5754e | |||
| ceab44b9ab | |||
| 0138a95567 | |||
| d86469c2f5 | |||
| 97a67746f1 | |||
| fd6295c2f5 | |||
| f483c3b9ca | |||
| 98943fc9e8 | |||
| 2bd6265a17 | |||
| 5feba39ff7 | |||
| e11e67df28 | |||
| c15027b95e | |||
| 6cb036d35f | |||
| cc0c3fc98d | |||
| 86720f90cd | |||
| 3721941ffb | |||
| 4fdeeace66 | |||
| 1c890f85c5 | |||
| 6cd62a9fd0 | |||
| 1e7ded2163 | |||
| a7262d34f0 | |||
| ebf28f8da0 | |||
| d511153836 | |||
| 2f211e4e5a | |||
| a5ecbd0b2b | |||
| 8d986e77d1 | |||
| 3d643fbc0b | |||
| cd71125277 | |||
| 55ca625371 | |||
| 81546d357c | |||
| 3acc900363 | |||
| 6b0d29a72d | |||
| 442abcc6f1 | |||
| c7b7d1f71f | |||
| 62d7bf2159 | |||
| 07e13b8613 | |||
| f1f31e22f9 | |||
| 9a0232bc87 | |||
| 8e83ad7b65 | |||
| 703b1636c8 | |||
| f898ebff3f | |||
| 455d07e05b | |||
| fd9977d3bd | |||
| f6777825d5 | |||
| 893a4e34a1 | |||
| 4ac6c23ced | |||
| f27e77c7e0 | |||
| 286d2962c6 | |||
| 37721d6b8a | |||
| 8ba74a7f7d | |||
| 506fdec6df | |||
| de5a3451cd | |||
| 23bd197bd4 | |||
| f10c812301 | |||
| ae51ce2349 | |||
| fa6e2bfe02 | |||
| faf0a0d851 | |||
| 8ae3401ffa | |||
| 9d68c16c62 | |||
| 59f1077a36 | |||
| 4e62ec7458 | |||
| 12f36cf31f | |||
| 093ecc0a02 | |||
| da4bf43fb2 | |||
| 11eeab0a1a | |||
| 3208a7713f | |||
| 97f62571ff | |||
| c31c0c40a4 | |||
| 12f00a5e16 | |||
| 0da893695e | |||
| 5f08cca849 | |||
| 72e5578595 | |||
| bf04758285 | |||
| 7d15cc0dfd | |||
| 05c5058dfd | |||
| 91c98a9533 | |||
| e86e72804b | |||
| 34622933f3 | |||
| c407c786cc | |||
| ecb3d93918 | |||
| 667cb64c29 | |||
| 359258c3d3 | |||
| 9d18bba1df | |||
| 8204737efa | |||
| 4622914610 | |||
| ea376e7751 | |||
| cd7fbae583 | |||
| f9731de777 | |||
| cbe83ad8dd | |||
| 4666f190db | |||
| de97c8e20f | |||
| 09673c928c | |||
| c923cb54d3 | |||
| 218e823fdc | |||
| 5a7327492a | |||
| c9f3871c68 | |||
| ff3bfa1ca2 | |||
| 7e01c81154 | |||
| ab1c05aa71 | |||
| 817fec9684 | |||
| 58181c5c17 | |||
| 60d5dd40f7 | |||
| 02a1bffc12 | |||
| f2c8db75bf | |||
| 665f316a3b | |||
| de7bbb5661 | |||
| 4456d9fcf1 | |||
| d1f31d6fda | |||
| 5fe3ea6440 | |||
| 942f26509b | |||
| 241dedef4e | |||
| eb90e509f9 | |||
| b2ca9edde2 | |||
| f81192373f | |||
| 99a9fd8505 | |||
| e0aa74d380 | |||
| 095c8fa19b | |||
| 9c24bb9d75 | |||
| 3468a7ebcf | |||
| 8ea7da56ec | |||
| 4bf0deecb6 | |||
| e551e2bc5d | |||
| 5e14310071 | |||
| 168cd9bb7a | |||
| 6b6cd11fbe | |||
| fcd6b64f8f | |||
| 9c8773252a | |||
| ce494f8847 | |||
| 15057ffc5e | |||
| 73b108765e | |||
| c2897cddd6 | |||
| d9403c2ed2 | |||
| be9a599beb | |||
| eb63558c6d | |||
| e18db20630 | |||
| db88c539fb | |||
| c6bdedf3b0 | |||
| 94d1488259 | |||
| 8b3c250702 | |||
| 07b9379a7c | |||
| 8d758b9088 | |||
| 544fe531a3 | |||
| 6f3c50eba2 | |||
| f8afee3325 | |||
| 9923f96431 | |||
| dd665e7363 | |||
| da8883d5d3 | |||
| 2113fce2fb | |||
| 9e5daa1737 | |||
| c7ee8cadde | |||
| c0b90d01bd | |||
| 6ae7f450f1 | |||
| 3c27bf0a6a | |||
| b01583f54b | |||
| 8140ab459f | |||
| 6c4f968373 | |||
| d0283265cc | |||
| 009370f73c | |||
| e8088d1216 | |||
| 1ee749a9a8 | |||
| 6124783180 | |||
| 592543c47f | |||
| be1511bd7a | |||
| fcd579a7b5 | |||
| 0e733b20de | |||
| 80c25b8ced | |||
| a93a81997f | |||
| a852d5caca | |||
| 06532e3263 | |||
| 63a54dd70d | |||
| c2430d3af1 | |||
| b54adebfc7 | |||
| 491d5528ed | |||
| 7460d215fd | |||
| 5bf6c25652 | |||
| 0fb8ad8c5a | |||
| aeee0758c2 | |||
| 83b77ced9e | |||
| 405d7cb70c | |||
| 0ce4930c0f | |||
| a3dc623270 | |||
| 3b0afe92e3 | |||
| 09cc127dd9 | |||
| 9cb88b3a8d | |||
| f3d7c5da9d | |||
| bc13128afe | |||
| befe93784f | |||
| 732eef6c02 | |||
| 4185fcb6cd | |||
| 850416d530 | |||
| abee3539b8 | |||
| 07f33a3809 | |||
| 1d09408e38 | |||
| 99156c61e4 | |||
| c63db8842c | |||
| 9cb7339067 | |||
| 5e9eb9c3bb | |||
| a775b428f4 | |||
| cf1c86bb2f | |||
| 7843b23ee1 | |||
| f0a5641cf0 | |||
| 3fe90d9e8d | |||
| 3d486a8ba9 | |||
| 11980346c9 | |||
| 6a408301d7 | |||
| 9b10895c38 | |||
| 6fcd0e0421 | |||
| 37cc5e5c11 | |||
| 38a809b483 | |||
| d2edeafffe | |||
| b839b86895 | |||
| af181395fc | |||
| 265331117e | |||
| 725b0c606d | |||
| 0e6cd8cd0e | |||
| ff219c6035 | |||
| 612d169b78 | |||
| 8801abb93a | |||
| 1f3fbe91e2 | |||
| 91809c09d4 | |||
| bf394d4f56 | |||
| 6f0c74cf76 | |||
| 428d66598d | |||
| 2cd035d530 | |||
| cb0ebad210 | |||
| 3cc3974466 | |||
| 45b7da6666 | |||
| 6cb00e681b | |||
| 40a3b5c918 | |||
| a519aa8350 | |||
| 8cf6255d5d | |||
| fc65f181a7 | |||
| 16fa3697db | |||
| de55d64781 | |||
| fd269f3adc | |||
| 3472f75ae0 | |||
| d4b83bcf6f | |||
| 1c7bff4d36 | |||
| 5e33d5535d | |||
| 141c7ef340 | |||
| 73aeda1507 | |||
| 2c802735bd | |||
| 865445e29b | |||
| 8f31211557 | |||
| d88d078f4a | |||
| 5102241ac2 | |||
| 4ee66a2680 | |||
| 294d649012 | |||
| d29b82566e | |||
| c6a5e905bc | |||
| 8cc9642b96 | |||
| 03a84cb208 | |||
| 3f495689c0 | |||
| ad3e50f90f | |||
| 628acbf0b4 | |||
| dbcddcf5e2 | |||
| eda3c9084e | |||
| 178d0e0e85 | |||
| d23cf861f1 | |||
| dca9ae6ab5 | |||
| aa66ddcd86 | |||
| f2d39d0e82 | |||
| f59bc86ac5 | |||
| 09ccd7e436 | |||
| 2310ba137f | |||
| 9fdb6f0dad | |||
| 281f8be76f | |||
| 224bae383c | |||
| f55bb7165c | |||
| 006d989304 | |||
| 00c975b469 | |||
| e36c4f75e0 | |||
| 41577b5018 | |||
| 17e169e652 | |||
| 75a52219e0 | |||
| c53828787a | |||
| d2c13bc4c1 | |||
| 2f54482592 | |||
| 482a371bb0 | |||
| da923f8a3d | |||
| cf27d4c2ca | |||
| 24c23dc5f6 | |||
| cfde5698c7 | |||
| 70b537c8c2 | |||
| dc1a57e71c | |||
| 724159c8b4 | |||
| a86e44deb4 | |||
| 93e20c0853 | |||
| 8b631d486c | |||
| 48e6db3a2f | |||
| 224503d2dc | |||
| ad55cced13 | |||
| e55949dbfa | |||
| 8669dac5e7 | |||
| 2d0dbf4949 | |||
| 10b92d45d1 | |||
| 4966ab565a | |||
| 1837f40ed4 | |||
| e38bf8d51f | |||
| ff9f348ec2 | |||
| c2d3c857b6 | |||
| b8ba902657 | |||
| 33daa81e6f | |||
| 68d3f6f536 | |||
| 4ef66e6901 | |||
| e72d098ea1 | |||
| 8474cd8064 | |||
| 27e56b6199 | |||
| bdeb08e045 | |||
| acb8f82f84 | |||
| b465992178 | |||
| c73d19161b | |||
| d564c25241 | |||
| b2ad49bac8 | |||
| 5f46b32616 | |||
| 64a555caca | |||
| 02f15810ee | |||
| e3b73f9ea0 | |||
| 381260a493 | |||
| e4435a9308 | |||
| 22e67db0f2 | |||
| c3e19f34fa | |||
| ca90c05b0a | |||
| 744b56b12d | |||
| 694d4e01a0 | |||
| 459ab17d74 | |||
| cfe058dc82 | |||
| ce857ab1da | |||
| caf863be4d | |||
| 5882f9defb | |||
| f31282623a | |||
| 25c09c5088 | |||
| a2b8d3a885 | |||
| 76d52b4bb3 | |||
| 593b9a494d | |||
| d886fd55d3 | |||
| a751a06d01 | |||
| a5fb8c95f4 | |||
| ac352cd083 | |||
| b63c77ca7d | |||
| 9e2dfcaba3 | |||
| 7db3599648 | |||
| 461bf12c4f | |||
| 51d287d9b0 | |||
| 878a116c4a | |||
| 3a6abe1656 | |||
| 9748007cd3 | |||
| 6bb5dd2125 | |||
| f721f2cbaa | |||
| 59aca7566e | |||
| e0cff6b0b4 | |||
| c1abf80b40 | |||
| 5ca02a5053 | |||
| d8d72c4327 | |||
| 25b10c5e3e | |||
| 6d9e542cde | |||
| 043adab2ce | |||
| 1c803e725b | |||
| 0b435afd1d | |||
| 3aafb60629 | |||
| 0be60890e7 | |||
| fdf24545af | |||
| e454f59f97 | |||
| aac93b9063 | |||
| 001dc7cf57 | |||
| 5a57564b0c | |||
| 01ac9f02d2 | |||
| 2636fb457e | |||
| 28c125618a | |||
| 046e522851 | |||
| 6877e5e3ba | |||
| 90fb4396fe | |||
| d8f76f5aee | |||
| f382ba0319 | |||
| 8e9cdc5fea | |||
| da328c078a | |||
| cef58da879 | |||
| 595392428d | |||
| 3e11598941 | |||
| 262d3d0755 | |||
| 906146d8f6 | |||
| f12cb9b519 | |||
| 53ac34db35 | |||
| 74dab18174 | |||
| af69803ee0 | |||
| 3a029efbd3 | |||
| 68a62f897d | |||
| 7b571aab70 | |||
| b5a7637b49 | |||
| 52a68875fc | |||
| 88d05a08cf | |||
| 79420e52a2 | |||
| f77e2acfbe | |||
| c167a1228e | |||
| b81fd13232 | |||
| 7a431e85f6 | |||
| f618247937 | |||
| b50ab149d6 | |||
| 56853de0ef | |||
| 1228787355 | |||
| b72d435ce8 | |||
| bc25f4d6ad | |||
| 9c193e0282 | |||
| c5a1f8930f | |||
| 233450a7ca | |||
| 8bd678afc0 | |||
| 8ad1bc1970 | |||
| 10cc2c080c | |||
| 2709a3e49a | |||
| 90e0a89e9b | |||
| 8b8385b0a4 | |||
| a6770813b1 | |||
| e9fab57a0e | |||
| 82545a7b56 | |||
| 22f413be3a | |||
| 9814a92a25 | |||
| cd951af664 | |||
| 2df1220144 | |||
| b8073b4e75 | |||
| 232c97cc82 | |||
| 5ce0261265 | |||
| bd68d382bd | |||
| 12fc6e6145 | |||
| 6d61e36f5d | |||
| 824b9aa628 | |||
| 487fd4dc2a | |||
| e88d45b1bf | |||
| cb14697aa0 | |||
| 6e8b94a7e1 | |||
| 18e3e74070 | |||
| c08ac779f4 | |||
| 2031944792 | |||
| fafcce6d5f | |||
| 986a39fcfb | |||
| 75202ac55b | |||
| 1076727c75 | |||
| 740354d2c9 | |||
| e6146e4ecb | |||
| 4a89432d39 | |||
| 312ff7e8f5 | |||
| 727f54dd32 | |||
| 71b9caf65a | |||
| 5872144165 | |||
| abbd244376 | |||
| 1471afcfe6 | |||
| b5f91a6e75 | |||
| b2577833f9 | |||
| 31ea9068de | |||
| 9fc50fcce5 | |||
| a9425fcf2a | |||
| eb1b8b748a | |||
| f2985f12c1 | |||
| 2aedd0633f | |||
| 7b25483b67 | |||
| 3f31976080 | |||
| 422a9f1fdc | |||
| d2beafca4d | |||
| 5681781ab0 | |||
| 05d6c8df60 | |||
| 07449abfc6 | |||
| 72c84cb8aa | |||
| bf8a48e3bd | |||
| c465b6699a | |||
| edb9a97c17 | |||
| 445c7dd884 | |||
| 2985f2d6e3 | |||
| a279aebf31 | |||
| cbd7d3d614 | |||
| 5640e81eb5 | |||
| 4114df50c2 | |||
| 1f9c8f757a | |||
| 3a75e6a357 | |||
| 782a11b47f | |||
| 39039514d1 | |||
| 263294d263 | |||
| 43f4ed49b4 | |||
| 16e8d6349e | |||
| f1ab5abe2e | |||
| c3e162b442 | |||
| 7b6ad026c6 | |||
| 9d1993cdee | |||
| ba66992ee3 | |||
| a58974eac8 | |||
| 2ac3c66c80 | |||
| d1ebc47867 | |||
| 5cb0fe63b8 | |||
| 789ed767e2 | |||
| f446501339 | |||
| 98a924874f | |||
| b6cc7af8cd | |||
| 88aea70100 | |||
| c96bc6231c | |||
| a276391e87 | |||
| ee3e5cfe1f | |||
| 9cb87552b8 | |||
| bb643070bd | |||
| 5da166b26b | |||
| caab6cbc60 | |||
| 16f40fb69c | |||
| 3960555e45 | |||
| 96c4e87bf5 | |||
| 5a1b756c14 | |||
| 3853dffce2 | |||
| 87d51665dc | |||
| d93e95b614 | |||
| 75219be066 | |||
| da5b047c58 | |||
| b016fbc9e4 | |||
| 07ea311b3a | |||
| 40e19e0c95 | |||
| 411265d83a | |||
| d627f9cb83 | |||
| 1c2849a736 | |||
| 28b964aeb0 | |||
| 65fbc57221 | |||
| 6f487f910c | |||
| 646c908a93 | |||
| 9abaf80099 | |||
| 8ec9f84c1b | |||
| 14e9323154 | |||
| fedd35989c | |||
| 722e6b8ac5 | |||
| d2889786a2 | |||
| c6e2f070ee | |||
| 34bf82d81c | |||
| 2734c98716 | |||
| e58292bb11 | |||
| 0ebc221011 | |||
| c29616b341 | |||
| 3f24da47a0 | |||
| d5b4a31c37 | |||
| 728736ccdd | |||
| 2f5a6eb993 | |||
| b1c3e09155 | |||
| 7773631401 | |||
| 5e7531b9bf | |||
| 4f708ab9ee | |||
| 0b5816d6d6 | |||
| 976d707596 | |||
| d10c44ed3a | |||
| e459d01927 | |||
| 1e9c266457 | |||
| 6e8a5f3a5f | |||
| 53769ae1bd | |||
| 6e84db45f2 | |||
| 1af7e32c93 | |||
| 6e70258d82 | |||
| 570e41f8e0 | |||
| fd5fbab115 | |||
| e06b33162d | |||
| ddff65d288 | |||
| e91589cab5 | |||
| 36648805b8 | |||
| fafdc213ed | |||
| cc83a9df3b | |||
| 8fd52666b7 | |||
| 48def8fa5b | |||
| 480996b140 | |||
| 1012a3e312 | |||
| c69dfff16e | |||
| c12af57bdd | |||
| 91f67b683b | |||
| a3c22eb836 | |||
| 98a3cbdf84 | |||
| 09347ba92a | |||
| fc3314ea96 | |||
| c0f1913e44 | |||
| f35a2c8a04 | |||
| 0f28879f8d | |||
| 17a4222c31 | |||
| 9a8fa12718 | |||
| 0541371a0e | |||
| 7aa86c50c6 | |||
| 2a096effa7 | |||
| 8a6171caa5 | |||
| 6da5138683 | |||
| eac63f7265 | |||
| 8f00342612 | |||
| 8f490e8ecd | |||
| 8fcaac5f1d | |||
| 0b1e45b6b5 | |||
| ce9cd13e42 | |||
| b391e93466 | |||
| a2646f9871 | |||
| eb5974322f | |||
| 137a38b3c6 | |||
| 08b6428d5c | |||
| 2eaf5cdc01 | |||
| 7361b4e079 | |||
| c364c6a787 | |||
| 16ad4936ee | |||
| 776eafa0ce | |||
| 9b928ee835 | |||
| ae73330314 | |||
| 5a9896c78c | |||
| 13a5a96117 | |||
| 06ef95fbea | |||
| badeb29901 | |||
| 02c0b69adb | |||
| 3cc0383db7 | |||
| a12220d234 | |||
| 25056f49c4 | |||
| 5815d90eb4 | |||
| 16b7d204d2 | |||
| 8e1991c1e1 | |||
| 71a378a3fb | |||
| ff1f6d3d4f | |||
| 3d665148ca | |||
| be2f993155 | |||
| 31774b7262 | |||
| ffc11bfda3 | |||
| 804ee1183b | |||
| 2f8a41d810 | |||
| 6e6170ae1c | |||
| caa6db8617 | |||
| 9a37acee3e | |||
| e0d5cdd5e1 | |||
| 582329ffc6 | |||
| 5ae6586803 | |||
| e810eabd32 | |||
| 6849192b39 | |||
| 6832910187 | |||
| a239eaf630 | |||
| 14897b23b7 | |||
| 6ef4cecf57 | |||
| 7b0b0440ef | |||
| 45dda65ce9 | |||
| 9ecedfdf3c | |||
| e47493e81b | |||
| 4624377942 | |||
| 10c5d87f18 | |||
| 831858ce7e | |||
| af90f03323 | |||
| 26f6b89530 | |||
| 501c14fc65 | |||
| 4adb9a2683 | |||
| abd61538ea | |||
| 7592b87a90 | |||
| b3dfa4f5a2 | |||
| ecf78dbafe | |||
| cfa0079c3d | |||
| b7d5d70a92 | |||
| cdf38d15d2 | |||
| 6462201aac | |||
| 023d385af8 | |||
| 0aefaec46e | |||
| 6019e02457 | |||
| 6255f3b07d | |||
| bc91ad0f4d | |||
| 2f7fe35f5c | |||
| 8175630619 | |||
| 43d3ccce95 | |||
| 9913c9059c | |||
| 5bd83516ba | |||
| 1519a2b468 | |||
| a7668ff57f | |||
| 1e021cdbba | |||
| a8fcf71f9c | |||
| 3bc6c53eb3 | |||
| b8a27d8a4c | |||
| 48c75105e2 | |||
| aad97aaea1 | |||
| 8f7e70d959 | |||
| 5f43360711 | |||
| 67e647a2ca | |||
| 746be46f1e | |||
| 6305d4edf9 | |||
| 6beec80b60 | |||
| 82733e1943 | |||
| 93e850404e | |||
| 2e3113b5f2 | |||
| 80b544aa78 | |||
| ddcaf4972f | |||
| 66cf864ee0 | |||
| 3896c39ceb | |||
| 916967a7d7 | |||
| aad293df1a | |||
| b08c3186be | |||
| 7795305c9f | |||
| 06dacf04b5 | |||
| b7c7148937 | |||
| 2d37c6b5e2 | |||
| 39629c5c7a | |||
| 4bacfcf847 | |||
| daa93a7226 | |||
| 096fc86f17 | |||
| 82781e620a | |||
| c0f13f7084 | |||
| eafddd9e33 | |||
| 83321c5be7 | |||
| 22e1da5e76 | |||
| 3064cf8101 | |||
| 8f9e1100c8 | |||
| 721ad404d2 | |||
| 8c00dcd02d | |||
| 32d3d1fbe5 | |||
| 6f1e76198a | |||
| 3aefa2b4e1 | |||
| b7a320fbbd | |||
| ec68e012f9 | |||
| c598fe7aa9 | |||
| 39f836b495 | |||
| ef6f9f6ded | |||
| a800d21a31 | |||
| fe67504ffc | |||
| dc92a79fcc | |||
| 714da1aa7c | |||
| 46e4f2d48c | |||
| 5b7f701878 | |||
| c0fdef7a12 | |||
| 317417d541 | |||
| e896da8064 | |||
| a7f77c27f7 | |||
| 6c4148a949 | |||
| bc9481db1b | |||
| 8229c0ed3d | |||
| edb9595721 | |||
| 7eacfe19f6 | |||
| 63c5b2ab32 | |||
| e338c3938b | |||
| 8483b17995 | |||
| 6ce793d582 | |||
| ee2940c159 | |||
| f272171099 | |||
| 909b512493 | |||
| 0acd37a328 | |||
| 61cd591ad5 | |||
| 30c25cb722 | |||
| a27a51124f | |||
| a114dbcd76 | |||
| 1e30077a65 | |||
| f4efeabcf3 | |||
| 972515938c | |||
| 7d576117f9 | |||
| 4a7f6af8d9 | |||
| 3a0894aaea | |||
| 5abeec85cc | |||
| 4485e6b869 | |||
| 288581cb43 | |||
| c47082f725 | |||
| 1b5f2579a5 | |||
| 01bb63b1a6 | |||
| 5804ce5f84 | |||
| bf74c0c749 | |||
| 0993ee08e6 | |||
| b25eb39fba | |||
| 9a91b188df | |||
| 596546df5a | |||
| 712a514c6d | |||
| b353cd4ecb | |||
| e7b459573e | |||
| cf7e5028a4 | |||
| 629c290faa | |||
| 4b0d8557b4 | |||
| de9a2fd556 | |||
| c51ce40d8d | |||
| 9c1c3bffbe | |||
| d8b1c3118a | |||
| e833904b02 | |||
| d7cb5a6e9e | |||
| b7d967361d | |||
| 93dcd704c5 | |||
| 3064560027 | |||
| 8c62a893a9 | |||
| a77a75660b | |||
| 4d9add5e7c | |||
| 1256d648c1 | |||
| 5ae2349f36 | |||
| 1dc2f6a164 | |||
| d86c33c09e | |||
| f935c789bd | |||
| 02594c8239 | |||
| ee715d9d36 | |||
| 3b8c34e47c | |||
| f2c5dc2b5c | |||
| e6df1ddcc0 | |||
| 8f9db92bf0 | |||
| 39e679806b | |||
| b84d831d8f | |||
| a70d305806 | |||
| 0724a9efa2 | |||
| 74e13a4ef6 | |||
| 18fa6ca961 | |||
| 78fdcf75e7 | |||
| f83306b0bf | |||
| fba8e84370 | |||
| 26e5a07905 | |||
| 7037da80cb | |||
| f14b712f07 | |||
| 2823953489 | |||
| 22b78fec71 | |||
| cdf70e0b77 | |||
| 98aee31c5a | |||
| 24278e0eca | |||
| 2dbac65613 | |||
| dcad0e286a | |||
| 4c87c9a545 | |||
| 2d6dd873cd | |||
| f98b03b61f | |||
| eac5147a45 | |||
| bebd437a7e | |||
| 669a54d071 | |||
| 79cb025d25 | |||
| 67e8e0a367 | |||
| f961a2e3b4 | |||
| df794b88b0 | |||
| 2416d49dba | |||
| 2a6f11b390 | |||
| 7a5c8dd586 | |||
| d5bdf78a29 | |||
| 5a6869fc5e | |||
| d5ead0d315 | |||
| e2748c319e | |||
| d0c2addf91 | |||
| 0b0c8723eb | |||
| d58188d7ba | |||
| 2a7c65c019 | |||
| 145f411324 | |||
| 46302084e7 | |||
| 45e9e9c938 | |||
| 2b48443b95 | |||
| 3ae43edc3e | |||
| fe1b0e70b9 | |||
| 8cf62e560e | |||
| f92c10ef71 | |||
| bb63ec0c83 | |||
| e676d0bdcf | |||
| ff359ed118 | |||
| 9cfdce91a1 | |||
| 31a41b795e | |||
| 442cf3e937 | |||
| 3cab629a67 | |||
| dcf3e0776e | |||
| 02ca97804e | |||
| d18d19870f | |||
| c5737d01c6 | |||
| 5d6d058965 | |||
| 74b3580b69 | |||
| b449545ae0 | |||
| ed6fb7cc43 | |||
| 2f4d6fc2a1 | |||
| fbc268e993 | |||
| 743421881e | |||
| f4540c2793 | |||
| 5aa6daf58f | |||
| 8b0c772423 | |||
| 978d578f4e | |||
| d05597ccdb | |||
| 56c64c8045 | |||
| 8c1aa3ee15 | |||
| 935302b620 | |||
| 3b26031692 | |||
| 339021ac15 | |||
| 73b00b844b | |||
| 3c872ab611 | |||
| 93ebce4162 | |||
| ab405901ee | |||
| fd34d11eec | |||
| 2cafa84b75 | |||
| f2276bb70c | |||
| b1f7543436 | |||
| b7fd09740b | |||
| 8bd7823b70 | |||
| 747d53790c | |||
| 8c9ef2eef4 | |||
| ad02c8d510 | |||
| 0f1bb8545d | |||
| 048cb7993d | |||
| d9b53b476f | |||
| 9bedf0d13e | |||
| be48a330b4 | |||
| 4874a81dc5 | |||
| 94cbfd6a5c | |||
| b2111b3c3d | |||
| 37b22ec99d | |||
| 00205bfa58 | |||
| 588d364efe | |||
| cfb41c4dab | |||
| d032bc5691 | |||
| 2798827066 | |||
| d8cc6b4c39 | |||
| b54a33efce | |||
| d2ad84453d | |||
| 92acfcf454 | |||
| 39524318aa | |||
| 7e8e288ba2 | |||
| f8c64b1fb4 | |||
| f8ad9d13f8 | |||
| a465c1aa0a | |||
| 4d85a49666 | |||
| 7b276e38f4 | |||
| 16fe7919a0 | |||
| 94b3cdf9e7 | |||
| 85b63de631 | |||
| fea6fd1a70 | |||
| 0233fbff51 | |||
| 4f21cef3af | |||
| ea5110cec3 | |||
| 54b6616ec9 | |||
| 18b8a7d473 | |||
| 721a0c8bcb | |||
| 02c263fc19 | |||
| 94441d7df3 | |||
| 147c50e7ca | |||
| ea17e08ae6 | |||
| 64ab14b237 | |||
| a3d6919431 | |||
| 5f6afca18a | |||
| e4a2a60f55 | |||
| 900389d857 | |||
| cd23a2ecaf | |||
| d072eba687 | |||
| f6392baab3 | |||
| 30acfb89c3 | |||
| ef7166057a | |||
| a2ab685ba9 | |||
| da85fba015 | |||
| 080e42ec9f | |||
| d140cffc08 | |||
| d1fbccc9ce | |||
| d2883fc554 | |||
| 952098c00f | |||
| 9479bcf77b | |||
| 26b5eebc17 | |||
| 1c82e8b1d5 | |||
| abdfcf9d0b | |||
| 55c317c1cf | |||
| 59effb3412 | |||
| 6b9a6c50fe | |||
| 72fdcf120c | |||
| 0b4105915a | |||
| 3c3e3baa14 | |||
| 10983338d8 | |||
| 3247152ff7 | |||
| 55b83af845 | |||
| d640aba903 | |||
| 75fa95c7ff | |||
| c4ec38f358 | |||
| ec8519b969 | |||
| f095dec43d | |||
| dc6c21833d | |||
| 08dd95e52b | |||
| a86317ce5a | |||
| e477a0b8fc | |||
| ff1708a899 | |||
| ef563f038d | |||
| c8bb83b824 | |||
| 63276a3f84 | |||
| a342de6143 | |||
| 9954b36ec7 | |||
| 903cb8d7e5 | |||
| 9b41f846d6 | |||
| 620e937473 | |||
| 573f112b37 | |||
| 0ca4c189a5 | |||
| a71cb5f521 | |||
| 6a0ce1850a | |||
| b5a4e21c81 | |||
| bee6b84733 | |||
| 7ce45a3bae | |||
| 63b97d6817 | |||
| c125f5376c | |||
| 3e412a2a1f | |||
| ff90ddbd2f | |||
| fae7ddc611 | |||
| 1f05275ac4 | |||
| 469926c5e1 | |||
| 614cb88116 | |||
| 5cb1a2f26d | |||
| ea8473943b | |||
| 9bc5ce300e | |||
| 139173caa0 | |||
| 0fc6ec2df9 | |||
| d209cc5671 | |||
| aa4b74c194 | |||
| fc81d79807 | |||
| 6c36013e2a | |||
| 3e34bd64bf | |||
| c88e0a0eb9 | |||
| 5c31037c04 | |||
| 5764ee7a2a | |||
| bcad7afcc9 | |||
| 583b6d92ec | |||
| 0cf7bb056e | |||
| bd517cf915 | |||
| a3d400b5cc | |||
| db7bde0a6f | |||
| daad7d71f9 | |||
| 6de3a6090a | |||
| 629206c0dc | |||
| 6e3e2cf0f3 | |||
| 03219a9a4e | |||
| a19a13136c | |||
| 0a4820f4f8 | |||
| 116638f352 | |||
| fe4ab0abbb | |||
| a62eeaaecc | |||
| 11b409907e | |||
| befc0f62b8 | |||
| 3cf80b0831 | |||
| 2709dc2e36 | |||
| 1653991b9d | |||
| 8155ef5e67 | |||
| 507798c541 | |||
| 9883e1e8b8 | |||
| e5de176b16 | |||
| 0f233beff9 | |||
| dba249554d | |||
| 1d2351bf85 | |||
| cf335a5dc4 | |||
| 4a6ef91eb3 | |||
| 961fc27215 | |||
| 9d8e8028a6 | |||
| 476b9020ce | |||
| d234493b4a | |||
| 428e51b619 | |||
| ef65299dff | |||
| 48c1f0f03d | |||
| e2a2709ad0 | |||
| 5d768bd3cf | |||
| 8c046429cc | |||
| a2293d94f6 | |||
| f22001d527 | |||
| 9e49a33b3c | |||
| 30fe3dc6f5 | |||
| ad38e9f0fe | |||
| 78c37ff8b6 | |||
| 8587ae5883 | |||
| 5f8cf18a5a | |||
| bc94d92cba | |||
| 31bf130b1c | |||
| 619b8e473f | |||
| eaf3787ae6 | |||
| 72dcbefff4 | |||
| c054d8e7dc | |||
| d76e801c47 | |||
| 942d984dc5 | |||
| 316bd8d155 | |||
| 6cbdeb9411 | |||
| e4bfe81712 | |||
| d62e95d0f8 | |||
| 233f2e478a | |||
| ae21783680 | |||
| 88476fe698 | |||
| be4e85f0f2 | |||
| 9b2907dc64 | |||
| 99c5366f50 | |||
| 9afdb429fa | |||
| 0b21474b79 | |||
| 432f0c3630 | |||
| 0e33636aaf | |||
| dc90ab3cee | |||
| 991fd015de | |||
| a8688bff85 | |||
| 1e28611435 | |||
| 07cb56e1ea | |||
| 5416782392 | |||
| e6a47bfa89 | |||
| 99ea666bf2 | |||
| 881dafcdff | |||
| deebe3ca1f | |||
| 4d27198ad7 | |||
| 8d383ea15c | |||
| ef3a011919 | |||
| 31b91c10ec | |||
| 46e7207e93 | |||
| e84f356a29 | |||
| 3a9cc0ab63 | |||
| c13ebc8692 | |||
| e7d0aedfb4 | |||
| f9497e35e4 | |||
| bdad5ef745 | |||
| 55b348f4fc | |||
| 9ee9523680 | |||
| a182743561 | |||
| 6b4b86434d | |||
| faaef03604 | |||
| 18954ee5b8 | |||
| e6b2be2bc9 | |||
| 303a9de045 | |||
| cd2eb59da6 | |||
| a4a25dc28d | |||
| 0bb15b2ff7 | |||
| 0c1bfefbc8 | |||
| 69a3db491c | |||
| 8d13aa3f2e | |||
| 8cd00287cd | |||
| fdad4019e5 | |||
| 655acc746d | |||
| e2d2c9d377 | |||
| 7ab1e64aab | |||
| 948758f758 | |||
| 67c02274cb | |||
| d18b91e828 | |||
| 4b516273f6 | |||
| 26d3bfe9c2 | |||
| f9eb3f8476 | |||
| 1356a17e84 | |||
| 68978a0109 | |||
| 796d96f06b | |||
| 152feb898e | |||
| c1786df2a6 | |||
| fe376abe6c | |||
| 4ad91a6fa8 | |||
| 39cf935929 | |||
| 872e41825e | |||
| fed1418c0e | |||
| 2d1d996c50 | |||
| e84fc6426c | |||
| d177b1adea | |||
| 1003c42310 | |||
| 4272ec7a82 | |||
| a404f2e6fa | |||
| 85648da706 | |||
| 681fb1eeaa | |||
| ffb0454424 | |||
| cae85c6247 | |||
| 91c9fd3c3c | |||
| 1589b72699 | |||
| af986d8f4c | |||
| 73d9b58dfc | |||
| 518c028a3d | |||
| 714ff6c32e | |||
| 1f2eafc4f2 | |||
| 3f3873ceb5 | |||
| bddad4d766 | |||
| 20dce26b1d | |||
| 1365c830b2 | |||
| 3a2b13c02b | |||
| e7f278b5d2 | |||
| e6c628caba | |||
| 1189503b4d | |||
| 6909a15400 | |||
| 2df18c91e9 | |||
| bf1e29e227 | |||
| f01059283a | |||
| 0d489518ab | |||
| 5fc77fe89e | |||
| fcd300ad4d | |||
| ba83767706 | |||
| 7b249790f5 | |||
| 8ce3943e09 | |||
| 267de68441 | |||
| 0eebfb0aaa | |||
| 4d5bdf1419 | |||
| 5986448d67 | |||
| 35e04bdbe3 | |||
| 5e73d68e4a | |||
| cc6ba726eb | |||
| 42f961816c | |||
| 982e536ad2 | |||
| 5c08bd6a73 | |||
| 7624c89d12 | |||
| 250fb15592 | |||
| 3e26971044 | |||
| 4340899833 | |||
| fdc5fa34be | |||
| 2032b15acf | |||
| d675c67f79 | |||
| 853234f7d7 | |||
| 47af5c1b5c | |||
| 00e637645c | |||
| 068883a441 | |||
| 43a95d709d | |||
| 73d63c508a | |||
| c0a1dab09d | |||
| e642e39324 | |||
| dfb2598e41 | |||
| cd8bcd4c02 | |||
| 4e28a007c8 | |||
| 4ba915bbdd | |||
| 31bbf56ff1 | |||
| 19acaf3f86 | |||
| 3080fb2806 | |||
| bddff3b70a | |||
| 9d9a7cf370 | |||
| fcbbdc87fc | |||
| 71292a7617 | |||
| 90c021fc31 | |||
| e70875ad5c | |||
| 6aef58318c | |||
| c9f994d92d | |||
| c71c5eb422 | |||
| 39db6bb461 | |||
| 1af4848324 | |||
| c1c586a072 | |||
| 5983813d12 | |||
| e93aaf3957 | |||
| 819c955cca | |||
| daaa5059e9 | |||
| e3f55a75a3 | |||
| d5bbea097b | |||
| d1a7c85e95 | |||
| 2494fcf8d8 | |||
| 0191955ab6 | |||
| 60f6566c78 | |||
| 32fd9223ff | |||
| 8ce1de036a | |||
| 5225ca8fc2 | |||
| 67342781b7 | |||
| c267ca2584 | |||
| fbee6d4017 | |||
| 4c52b65374 | |||
| 13d2f8fa59 | |||
| bd65f81074 | |||
| 23c7028b2a | |||
| c153215d6d | |||
| 2c70f5168a | |||
| dab80497bb | |||
| ba6ac5019e | |||
| e5dd03dbcb | |||
| 899b06d6db | |||
| 8a945a1a52 | |||
| 61342946a4 | |||
| 61a5459ccb | |||
| 12d1f8202d | |||
| 384cb5e415 | |||
| d8bed3b0ce | |||
| 29165af761 | |||
| 140a42fbcb | |||
| 289ef4c6d4 | |||
| f7b7c234b7 | |||
| 4ea1b8cffc | |||
| 507638e6d8 | |||
| 2be045593a | |||
| bdd458d2ae | |||
| 6cab4d7100 | |||
| cd6f95c90d | |||
| 35898a6cdf | |||
| 74b6d5c2ed | |||
| 6c40dc0631 | |||
| a671c43862 | |||
| 62c8f2ac34 | |||
| 62e2d8d9a7 | |||
| 1fa301b719 | |||
| a7728c9067 | |||
| e508d6db5d | |||
| 084106ced6 | |||
| 579a88b7c4 | |||
| 1c4db01e19 | |||
| 14efde9190 | |||
| e12cfc89de | |||
| 3a51a6ded7 | |||
| 0e8ea4f27c | |||
| d48617a3e8 | |||
| f81b00d488 | |||
| f15c679fea | |||
| 095608530f | |||
| 912e3fc213 | |||
| 3141cc9bc7 | |||
| 81340e9d5c | |||
| 78a92c7d43 | |||
| 31dcdea27b | |||
| 2e2f92f4f6 | |||
| a7d85480a8 | |||
| 12c13e6193 | |||
| 9350476263 | |||
| 9d6dc46812 | |||
| 6d1c9f2764 | |||
| 94b0d9dfd5 | |||
| 23923af487 | |||
| be50130c3f | |||
| 94c81c73c5 | |||
| 23a5cd5cff | |||
| 08c0c90a05 | |||
| 2647b77c01 | |||
| 55a2a5c8e5 | |||
| 430aa9af89 | |||
| 173fb060cb | |||
| 47e2e0bd58 | |||
| f2e2786959 | |||
| 4f706ed69c | |||
| bef2ee8f72 | |||
| ca3e82341d | |||
| b4c4c4cc89 | |||
| 8717bdffa9 | |||
| cbd56fc4f5 | |||
| e01528137e | |||
| 15e946053b | |||
| a7e4e07a80 | |||
| 3e40f22d15 | |||
| 4246d83f2a | |||
| 07a2e0b55a | |||
| ec3c899955 | |||
| 1a5d5c96ed | |||
| 79d03ece66 | |||
| 6069be7a93 | |||
| ab501842c8 | |||
| aead66ccbf | |||
| 8660b41833 | |||
| 509e09c2c5 | |||
| 506951a5a4 | |||
| ab5dd3ae6f | |||
| 0cd03ca9e6 | |||
| f3ee2ac9ef | |||
| 2d7bf06dea | |||
| 411dfd9a3f | |||
| 17f34f5127 | |||
| 5dd3437da9 | |||
| 6a2eefaf3f | |||
| ec2e53dc6b | |||
| 36a134798b | |||
| 5195b2b1b4 | |||
| c4558d2ca7 | |||
| 6ec6303933 | |||
| 1629feb15e | |||
| 8ecf3dcc80 | |||
| f3c9143a81 | |||
| 3428499492 | |||
| 0d28f378a7 | |||
| 87f1a9d9dc | |||
| e8d9ea116a | |||
| 2c98a37512 | |||
| 546619ee24 | |||
| 7880753099 | |||
| d9dd3a7eda | |||
| 9709f7f821 | |||
| e64f6a1db3 | |||
| 4375422c09 | |||
| 03b059c1d5 | |||
| a87de1b565 | |||
| 561e7cd5a9 | |||
| 6545df2b15 | |||
| 3a87a40593 | |||
| 04902965fe | |||
| 6627cc9666 | |||
| 1bf9e41c26 | |||
| 482d470bf2 | |||
| 7da5714fd9 | |||
| a792bae121 | |||
| 7c2b2620c1 | |||
| 26f1e2c9e3 | |||
| 10150957ff | |||
| d557ba2d97 | |||
| c9df9c93ed | |||
| 9a310c312e | |||
| 3eb3f66e96 | |||
| 10c706d9a5 | |||
| 2e2dbf6c33 | |||
| 0fa0946a46 | |||
| 14e0cbde9c | |||
| 43e74a9c61 | |||
| fee20573d2 | |||
| 5fd88bf801 | |||
| 46fa645555 | |||
| bbe12bf4b1 | |||
| 74cbf1877b | |||
| d78fe3b4d4 | |||
| b7761beee9 | |||
| 42b55c60e7 | |||
| 6cd3310171 | |||
| ee508f85b4 | |||
| e47d21024c | |||
| 54827f7267 | |||
| ae4420e604 | |||
| 011362bf1c | |||
| a6754e29a6 | |||
| b897a5d20a | |||
| 4dae27c1d4 | |||
| fd06f70387 | |||
| 692502b177 | |||
| 0a7b9c03e4 | |||
| edd4359554 | |||
| e61849c3c4 | |||
| 6db1ee634d | |||
| 1cf4791f95 | |||
| 57361e2943 | |||
| e69f76de87 | |||
| 71225da135 | |||
| d3c9aff2f4 | |||
| 79e8ed47d5 | |||
| e5b59a6bad | |||
| 3da3eee15f | |||
| 42b748a881 | |||
| a43e03b549 | |||
| 809ba66290 | |||
| 4237043f38 | |||
| cdeac05e88 | |||
| 824b0f832a | |||
| bf7cf0ee9d | |||
| 8df825abc5 | |||
| f1f51521f4 | |||
| 88fd748dd5 | |||
| 1c4e89d2bf | |||
| f4c712dafc | |||
| fe86869f37 | |||
| 25672cdc47 | |||
| 7372583cab | |||
| e40347dd53 | |||
| b90540c1eb | |||
| b6ec618f97 | |||
| ad2b2c9c62 | |||
| 11fd944f53 | |||
| 0648f1d0a2 | |||
| c89d2cf138 | |||
| da09477be8 | |||
| c36e692411 | |||
| b5c33ec26b | |||
| e6e60795b7 | |||
| afe221c29d | |||
| 5928b85ec1 | |||
| 70ee62f43f | |||
| 056f93f3e4 | |||
| 1d0f2c16e0 | |||
| bd71c1200e | |||
| a1b1f6be63 | |||
| 5f27e9b6e7 | |||
| 3f44e07b7c | |||
| 5ffc6ffca5 | |||
| b756b80786 | |||
| b01c17d1a0 | |||
| 2d94db4945 | |||
| 181854fc35 | |||
| 92c9a0a9aa | |||
| ba5e2e3f0f | |||
| 43ebd4450d | |||
| 63df801b03 | |||
| 6069071e4d | |||
| 12edfeb216 | |||
| 27cfdc897b | |||
| 22497757e9 | |||
| 896097da0d | |||
| 3d2aa622f1 | |||
| ec7b351cf0 | |||
| fc97e3d2b8 | |||
| 1d914d820b | |||
| d2e6f6fef0 | |||
| c1df79b713 | |||
| 3181c566c0 | |||
| d8664c8da4 | |||
| 318d7276c0 | |||
| 658079af55 | |||
| b61bcb6ad6 | |||
| fffadb975b | |||
| f3cd908d5c | |||
| 4a83d43a8f | |||
| ac75b62f4d | |||
| 8616d340bb | |||
| 406eff5ef0 | |||
| 9873d909d0 | |||
| 2d46830ba8 | |||
| a7ca705552 | |||
| 6664116042 | |||
| 944b9f3ae6 | |||
| 044dcb0790 | |||
| 29c1dc2c07 | |||
| 3e3665a13b | |||
| 99a9a1e38d | |||
| d66825515d | |||
| 669ebc594c | |||
| 1b87f9312b | |||
| 325dd0308b | |||
| 85d23e2c32 | |||
| 19e1631697 | |||
| 24a19a0dd9 | |||
| 51c107656f | |||
| 06907cb942 | |||
| b81e0f9e4c | |||
| 4907dedf69 | |||
| af25d47dd9 | |||
| f16ec62b4a | |||
| 1636531d4a | |||
| 6cd2665e12 | |||
| 4b8d617364 | |||
| 31ca42bf1a | |||
| d11bdfedb6 | |||
| 653db28675 | |||
| 4701affbf9 | |||
| 63a559310c | |||
| 108e879266 | |||
| b610155956 | |||
| 8e88e531de | |||
| 8690c02972 | |||
| 0388ba5032 | |||
| 2a6f4e19cc | |||
| e79a7c2261 | |||
| 240c209360 | |||
| 411e21210c | |||
| c8ba041a38 | |||
| b9a8c6414d | |||
| dabac03820 | |||
| 0cd3cd3e05 | |||
| 1bde52623b | |||
| be2d606193 | |||
| d6989c1847 | |||
| cbffd14539 | |||
| 052692ac8c | |||
| 2c3e3b583a | |||
| 98404e12c5 | |||
| 97d50a0692 | |||
| 2c70cef453 | |||
| 1491dcdc92 | |||
| 3f7e6c990f | |||
| bdbbde4d36 | |||
| c305949435 | |||
| 00e87adcfd | |||
| bc8fba9cc4 | |||
| 9a63754b43 | |||
| efd729d0b8 | |||
| e38dc93a66 | |||
| efde3219bd | |||
| a94a7d4495 | |||
| 7613d749ec | |||
| 31aef6460d | |||
| cf1bd9b61b | |||
| 642e850dfe | |||
| 69388f032e | |||
| cbdc32e95e | |||
| d8239a39c9 | |||
| b2de24db73 | |||
| 27c76960b4 | |||
| 4f031c11c6 | |||
| 0fb092f2a5 | |||
| e1ea7a28c3 | |||
| 7464843e53 | |||
| 5f40f732a9 | |||
| 52467c54e3 | |||
| 969cf67ba8 | |||
| 688e5a3af6 | |||
| 52b342464b | |||
| 0011a50c0b | |||
| b3be4d11e3 | |||
| b2b31b0421 | |||
| 5f3b25b43a | |||
| a9647152f7 | |||
| e98d1c0cb7 | |||
| 1e6a533ac7 | |||
| c6a00e157d | |||
| 0506bf0352 | |||
| 7a61fd3055 | |||
| 698f4fd450 | |||
| 7c9062fd3d | |||
| 612d11bd03 | |||
| c63f370d8b | |||
| c76dd371f3 | |||
| 5d6fb5a56b | |||
| f231ebb0ad | |||
| e0ff129dd1 | |||
| 980b9aaab3 | |||
| 29036504e6 | |||
| d07328417f | |||
| 2545372a76 | |||
| c1a6767187 | |||
| c5ca199163 | |||
| dd067847dd | |||
| ce853bc252 | |||
| e9653f1029 | |||
| 83208d8b89 | |||
| 37838a49ec | |||
| 52bf72787f | |||
| 621864be18 | |||
| 114550b0f7 | |||
| fb16583964 | |||
| 3fc471eb32 | |||
| d2964c1fa4 | |||
| 369bef5e1e | |||
| 8fa301ec05 | |||
| 1dbc0b448a | |||
| e27a1f98aa | |||
| 5a60160035 | |||
| 9ca6bb9296 | |||
| 8ec5b1cd84 | |||
| 181d593cee | |||
| eb9e6434f1 | |||
| 2b719b6dc0 | |||
| fc25abdbfd | |||
| 89d8c34cae | |||
| b8d2343765 | |||
| c0b4bf2f94 | |||
| 96a992fadb | |||
| 32aa5ad415 | |||
| 24c5e7d6cd | |||
| e5718ed264 | |||
| 7a4d851201 | |||
| cb52ca220e | |||
| 6c571b30d2 | |||
| ebe2a5e2cc | |||
| 8b4de95919 | |||
| 7e2fa38519 | |||
| 47fc7f22b0 | |||
| 012af73844 | |||
| 68cc9b2059 | |||
| 53e0979f29 | |||
| 5d745a60dc | |||
| ff64f908be | |||
| 40f5f73658 | |||
| 68ec7ac095 | |||
| 4ca8cb05fa | |||
| 6bd041f800 | |||
| 982f7cba59 | |||
| 1b6bd42201 | |||
| 4967771df5 | |||
| a5705d3308 | |||
| 0e81313477 | |||
| 5dd15b3c47 | |||
| 7a05ad7023 | |||
| 52eb61736d | |||
| b48159b104 | |||
| 154433b2e9 | |||
| 058eb9e709 | |||
| 8557614322 | |||
| 937214bc59 | |||
| 447580a6b7 | |||
| 418a12dd03 | |||
| 5db254f3a5 | |||
| 530c17f4f7 | |||
| a254507be1 | |||
| 2b4f858caf | |||
| cb694f944c | |||
| 1ba5b27f45 | |||
| f2d4453b04 | |||
| 5d37b42576 | |||
| 1ad53bc889 | |||
| f241a63e86 | |||
| 796c1b46c2 | |||
| 270bfad96f | |||
| 6e1e537b5f | |||
| eb7cd7ccce | |||
| 473af155fc | |||
| 16d31bc5e6 | |||
| 8cb8298c03 | |||
| b942da3f68 | |||
| ceee6049dc | |||
| d82f0b62a5 | |||
| a725676346 | |||
| d593e47554 | |||
| b2c113e5b1 | |||
| c3696f7897 | |||
| 1f60d6374c | |||
| 7ba0bda244 | |||
| b736b8616b | |||
| e4d5e7c78b | |||
| 54d6aee028 | |||
| c61fe621b0 | |||
| 697b699873 | |||
| 6cc6ca9f3c | |||
| 1568930da6 | |||
| 8f5d9b2c0e | |||
| d648957864 | |||
| fd7a0950a7 | |||
| a58c5f5a4c | |||
| 58787f80a1 | |||
| 1eb9460f2b | |||
| ebae8dad0a | |||
| 12d8e0ef38 | |||
| ce0f713f03 | |||
| 9fc7197c4f | |||
| 6aff1545c2 | |||
| bfff7ff5f9 | |||
| d9b0b56e3e | |||
| 6d3c4e6efc | |||
| 47df9eb156 | |||
| 2b7f984de8 | |||
| 95ce623da4 | |||
| a59cf50f03 | |||
| 6ea50567b6 | |||
| a7e659abd1 | |||
| 936aeed0a5 | |||
| 205e1d88b3 | |||
| 631675fdd6 | |||
| a8c9898253 | |||
| ad01829b23 | |||
| a9645eda73 | |||
| ea1bad8724 | |||
| bb1e08a6be | |||
| 795729a0b7 | |||
| d92344f383 | |||
| 5934132b55 | |||
| 921ee1464b | |||
| 8df2c3d707 | |||
| c846e33a10 | |||
| 16b4b9bf40 | |||
| cdfef3bf9e | |||
| 5addbcbbb0 | |||
| 6661018691 | |||
| 13acb06d1a | |||
| e8582c8655 | |||
| 28aaa94022 | |||
| 06f3df0ff4 | |||
| 598d929aba | |||
| 1d61484992 | |||
| b019ee09c6 | |||
| f99353f649 | |||
| 11d9642639 | |||
| cd347fa110 | |||
| 427fd58ef2 | |||
| e9ab9f51fc | |||
| 00e0e85793 | |||
| 1ef01be4b5 | |||
| 25ba18e8a7 | |||
| 05f91dc293 | |||
| 0e094f6618 | |||
| f507724b5c | |||
| 4fe4e589fb | |||
| 19d1a6babc | |||
| 2e40123557 | |||
| 3b31a9233d | |||
| 3af57957d5 | |||
| 4f30e014a4 | |||
| 6906d146bb | |||
| 7904d87ddd | |||
| 4185c1e422 | |||
| 220384997f | |||
| 831ff350f2 | |||
| 9ee7471bd5 | |||
| 1568d2d602 | |||
| 87accc624f | |||
| 18251b784f | |||
| c8d4193f08 | |||
| ea7ec448dd | |||
| 06a4c301cd | |||
| c12a98510c | |||
| 71c12360c7 | |||
| 5c468d7591 | |||
| 80294e1034 | |||
| ac20cf0060 | |||
| 34e34910fd | |||
| 27c35174bc | |||
| ee6a239679 | |||
| 2fb0911e2a | |||
| 0503f08f67 | |||
| 5ba772df93 | |||
| 8ad141de6f | |||
| af0ab4e8ad | |||
| 7172154da7 | |||
| 1749b95b57 | |||
| 5d63c6b526 | |||
| 7a2cd15173 | |||
| 7c3c5ae08e | |||
| a4e5751cff | |||
| e14fbda502 | |||
| 5a27a84f5a | |||
| 321c29fe1c | |||
| c5858de567 | |||
| 43382a0ac6 | |||
| af78355570 | |||
| c2743e6dad | |||
| df72f5e37c | |||
| 31c71b4a48 | |||
| ddbd590bef | |||
| 61e6d8af96 | |||
| 3bdfc6b499 | |||
| 8ff9b44abb | |||
| 536c5a900a | |||
| 7846fa5829 | |||
| 3895c083cb | |||
| de156c59e4 | |||
| 633078004a | |||
| 7aeda3b0c7 | |||
| 94213bb398 | |||
| bf6415accd | |||
| 0f602e0e13 | |||
| 65ddf980e0 | |||
| 09a4d14f8f | |||
| 1af2f5b214 | |||
| 7258ddc318 | |||
| f54a5c6591 | |||
| d26f7f696d | |||
| 160b58cf61 | |||
| 6bc0ce8046 | |||
| a180e90a6d | |||
| ffda60996d | |||
| 6df5ddb973 | |||
| 4eb4186b5c | |||
| 973e3f8f7e | |||
| 2c99aa4ea9 | |||
| 7777be6fc1 | |||
| 5d1cafdebc | |||
| ce21a9d250 | |||
| dfd3425e65 | |||
| 8cfc9c7493 | |||
| 00486d39e2 | |||
| 20a5bf424f | |||
| 1446e5bb50 | |||
| 4514fc12bd | |||
| ab0a907c7a | |||
| 7e1413badf | |||
| 024c15d4d3 | |||
| 6a163b8cc5 | |||
| 8a7ba5a709 | |||
| ce4d04290e | |||
| 59c8def566 | |||
| f1168f7c59 | |||
| 7fd3dd9ebf | |||
| 220e4ad8a6 | |||
| 81474be103 | |||
| 318d06efda | |||
| 18930a43f2 | |||
| 9c8666573b | |||
| b96037f160 | |||
| d58beb8f4c | |||
| 3d415d653b | |||
| d5a8675d1e | |||
| 5de059789d | |||
| f839713a94 | |||
| 18b69cac99 | |||
| 817947e373 | |||
| 35a0e0c625 | |||
| b95cddb0c7 | |||
| cd154ad357 | |||
| 143f542bd6 | |||
| 9c99fc7bb1 | |||
| 3e7d42b023 | |||
| 1bd235616f | |||
| d5e86f7190 | |||
| f210180aa6 | |||
| e687a91243 | |||
| ccc37b5dc5 | |||
| a029e70863 | |||
| 2ff8b9fb20 | |||
| d35d00f301 | |||
| 170439f91c | |||
| c72d97c64a | |||
| e485047a10 | |||
| d69de9c332 | |||
| 840ae2f86b | |||
| 1f3a117744 | |||
| f5188cdb32 | |||
| 1be5222e66 | |||
| a4bb9eaa55 | |||
| 791f8e3b9a | |||
| 02d1c9f6d2 | |||
| 6135b450c2 | |||
| aa614e83f2 | |||
| 878926f57c | |||
| ac86ee8fa9 | |||
| eaa644dc20 | |||
| d8d0c0d2fe | |||
| 659a3d88c6 | |||
| 66d0b25448 | |||
| 2ea881301a | |||
| 2bb63ad051 | |||
| 9e5403aeb3 | |||
| 48eb66383b | |||
| 3c2e0fff07 | |||
| 446993eaa6 | |||
| 09fbda603c | |||
| d92b44e93f | |||
| 9bcaa1e498 | |||
| b0da8319b7 | |||
| b7d0bfa972 | |||
| 1dac13be16 | |||
| 266c3d4753 | |||
| 9a02add930 | |||
| d9a95aae09 | |||
| fd7da9d61a | |||
| 94c30924dd | |||
| 237ab974dd | |||
| 67bc9acbe0 | |||
| b13a8ab4e3 | |||
| 9c3981bc8e | |||
| ed0918d097 | |||
| 5e954f4f76 | |||
| 4273c52efc | |||
| 4a2d61bc84 | |||
| 5f46534b72 | |||
| f38fb61c62 | |||
| 6c8d6aaf71 | |||
| 74007d5e5d | |||
| ad4b0f092b | |||
| b02225dd80 | |||
| 70e5068e37 | |||
| aed76b2a0a | |||
| 18d40102f7 | |||
| 5b467ff82a | |||
| e4eecd247c | |||
| f11c6c3cf4 | |||
| 6b0857dcff | |||
| 752449bbc0 | |||
| 77076191c7 | |||
| faeedf1355 | |||
| 4978af50e4 | |||
| 6d6c1a9672 | |||
| 4a6779469c | |||
| eada1fe12c | |||
| 1ded37d253 | |||
| 64158b1b10 | |||
| ce97a7e7a6 | |||
| c0b53d6b48 | |||
| 68cdc95da5 | |||
| 6b53479ac3 | |||
| 7d95311a01 | |||
| c53a822c4e | |||
| 5b18e90cac | |||
| 2e29348b9c | |||
| b9e7e46198 | |||
| 879e2d920c | |||
| ae17ef4d68 | |||
| e40776ba79 | |||
| 13b7df5d39 | |||
| 1f870af5cf | |||
| 9bef0a8683 | |||
| c87c75a45b | |||
| b5fa247eb3 | |||
| d17322948d | |||
| 05a7466a5a | |||
| a4a4e572a0 | |||
| e5a485e50b | |||
| c329942482 | |||
| 790a8bf814 | |||
| 449e7c1049 | |||
| f1e2446f17 | |||
| 4a998e5374 | |||
| c9ad88b3ff | |||
| 3ab08e0d7a | |||
| 169c8c47c0 | |||
| 2234d0fe0a | |||
| 6360ef1790 | |||
| 89da242cd2 | |||
| 66000240ac | |||
| 0baf295c1b | |||
| b6f8700b8b | |||
| dbd49a55c6 | |||
| 5ad68cfe30 | |||
| bb77249ac8 | |||
| df84e89d46 | |||
| fcfdd1551b | |||
| 9d1a2dd376 | |||
| 279ec3d8a3 | |||
| 0044141631 | |||
| 626133c0eb | |||
| 8cc09d1c91 | |||
| b7a6c93e96 | |||
| ef1c5af608 | |||
| b600cba180 | |||
| 667da92934 | |||
| 3730c53c9e | |||
| 96c86580f0 | |||
| b0569639a9 | |||
| 76418fe1b4 | |||
| 29c2e84fa1 | |||
| 5f1253598c | |||
| c9132a4bdb | |||
| 201f0f3a9f | |||
| 4243558319 | |||
| 38746a5ef9 | |||
| dfaa668b31 | |||
| 597d07bf24 | |||
| 8f1a8450be | |||
| bd1f413481 | |||
| 2b7a00d42d | |||
| dc7e143de5 | |||
| 3caff5a107 | |||
| 7dafb164e8 | |||
| 9834fc7f70 | |||
| 3775d28d24 | |||
| 860d7bd3f1 | |||
| 0df3e955c8 | |||
| 10e9d383d4 | |||
| c1da446653 | |||
| 20186b5049 | |||
| 1098edea98 | |||
| 3d910a9a42 | |||
| c74c592dd3 | |||
| 5a4aa9096b | |||
| 6d0fae09c5 | |||
| 85f2009175 | |||
| 3e1c04b356 | |||
| 8cde1c18c4 | |||
| ed55011ede | |||
| fe53f6f2d7 | |||
| cd39256361 | |||
| 98c67389b0 | |||
| 88cc03b9e2 | |||
| ff29320a34 | |||
| 145e0aa827 | |||
| b881e095e9 | |||
| 218399afcb | |||
| dc51630803 | |||
| 089a6ee07d | |||
| 6029cc40f2 | |||
| 3b71721a33 | |||
| a99c8e3c7c | |||
| c79b52b334 | |||
| 5d951451c5 | |||
| c2563da820 | |||
| 311a3b3e47 | |||
| 470afd78d5 | |||
| 16727a9c5e | |||
| 54106f6f9b | |||
| 402199d70f | |||
| 339e40d423 | |||
| e65676ffa9 | |||
| 1e60319be2 | |||
| ec9740e747 | |||
| 58f436e749 | |||
| 6c01854fec | |||
| 82433d946e | |||
| 43a61d0ab9 | |||
| 1b499a6fd5 | |||
| b5e7724e76 | |||
| 95734b8b9a | |||
| 7e758970cf | |||
| b0d9fba418 | |||
| 12becc6120 | |||
| db9cbe6cdd | |||
| feec20ac3e | |||
| 225dba754d | |||
| f298d0451e | |||
| 964c1bfd6c | |||
| 3ffc0edac9 | |||
| 27b24132a0 | |||
| cef2c59ae2 | |||
| 4346514b9d | |||
| 9f2afffca1 | |||
| 2084665cc1 | |||
| e6ab29346e | |||
| 05cebd1017 | |||
| 4b49d57f97 | |||
| 1337cf4f04 | |||
| c51e52614e | |||
| 383f6aff2b | |||
| d0e532e7ce | |||
| 82f31b6436 | |||
| e6595f05bc | |||
| 505dacf152 | |||
| fa43e80206 | |||
| 47ee010b64 | |||
| 30d7fcd288 | |||
| 5a20d41fb2 | |||
| 1626df7e46 | |||
| b952017a3a | |||
| bd9775e0eb | |||
| 6e02477fc6 | |||
| 9c94a6943d | |||
| 37da5589e4 | |||
| 51ea1e3bed | |||
| 73555c1df1 | |||
| 294d94a2d9 | |||
| 4f6a407393 | |||
| 09022b1000 | |||
| 9ef074c7ef | |||
| 3b764d45f2 | |||
| 774b5be7d7 | |||
| f31ed4e9f2 | |||
| 9501869aa1 | |||
| 0b5ef1d8f9 | |||
| 0d94c78e63 | |||
| 6fa75cf993 | |||
| 82840282fb | |||
| 49b295e332 | |||
| 06486b6537 | |||
| 96d7034c96 | |||
| f6f58b7615 | |||
| 8e5980b307 | |||
| a8cfefac07 | |||
| ebc4fa3e81 | |||
| 571bd63644 | |||
| 26e03fa794 | |||
| 140d40b5bc | |||
| ff3df64a26 | |||
| 367b8e7129 | |||
| 9e2bb9e9d2 | |||
| 5a043ddacb | |||
| fb1d7d3982 | |||
| 3269c88d02 | |||
| 8dfe7138df | |||
| d99ae7b21c | |||
| d14f22d059 | |||
| 6cb2518a81 | |||
| 120c3261b4 | |||
| 56ba26ab24 | |||
| 21e254d05f | |||
| 2c8b485ba0 | |||
| 851ae920b9 | |||
| 12f4f35cfa | |||
| 0be2728e19 | |||
| 028ce2dd9f | |||
| 693e7a38fa | |||
| b37f3e1b93 | |||
| f6bb62a76c | |||
| d5aa7aae43 | |||
| 1065eb17de | |||
| 6a996fcd0a | |||
| 0fb45cccbc | |||
| bbf7508d41 | |||
| 36e691c2db | |||
| 0d6386f391 | |||
| 0b52abeaf8 | |||
| d7fd8e3ca6 | |||
| 5d3a612003 | |||
| 9eda0aa245 | |||
| 08f192ee0e | |||
| 78cbb90ef6 | |||
| 5bd85bd4eb | |||
| 13fec1cd9a | |||
| 455bdc3819 | |||
| 472a71fb8f | |||
| 6397640df8 | |||
| 04c67c3f4b | |||
| a74e07dc40 | |||
| f6ba1eaebd | |||
| 61c4a88ab4 | |||
| 3c562afd49 | |||
| bed3260e45 | |||
| a324b58145 | |||
| 84c5899faf | |||
| 50b5d72bb2 | |||
| 6f0531b3f7 | |||
| 11f618fdef | |||
| 7c7782cd4c | |||
| 23fb4734ea | |||
| e353c39522 | |||
| 4ffd03fe3e | |||
| 31131c17ef | |||
| b005ee3cda | |||
| c71ed13f1a | |||
| 9d2fd7a27f | |||
| 889e7807cb | |||
| 0d4c10b56c | |||
| 7a7264db33 | |||
| ae47cdaad8 | |||
| efa538f9d7 | |||
| 0d15fc35d7 | |||
| 861ce9e733 | |||
| 9c6b935770 | |||
| 102f8cf993 | |||
| 652c5901f8 | |||
| a8b5912340 | |||
| 52cf911c60 | |||
| 7a466b7fb7 | |||
| 5abd3fabfa | |||
| a169c5bcac | |||
| 184007e1e0 | |||
| 4760ec63e2 | |||
| f153143c9d | |||
| 1f3f6f4664 | |||
| 1941f3d916 | |||
| 126b636edf | |||
| 9eb280c367 | |||
| dd9df4f36f | |||
| ffa258d334 | |||
| 0a0ccb54bf | |||
| 89b944c397 | |||
| 0d43c822cd | |||
| 46a472acf9 | |||
| 29a7a619bc | |||
| a010f802ca | |||
| c273c0e42b | |||
| d3e9e1296c | |||
| d53327f8bb | |||
| 475fb0d8c8 | |||
| 6cd67be087 | |||
| 4446aa5d17 | |||
| 2e6ce1c94a | |||
| 538498f21f | |||
| 529d0dbbbe | |||
| afe984ca29 | |||
| 293f276f87 | |||
| cf9769fe65 | |||
| 9ba553643c | |||
| b23a5f2312 | |||
| f71780609d | |||
| 7bbf4bbaeb | |||
| 07a5720c17 | |||
| 8a785fefc2 | |||
| 55ee7065be | |||
| 64935ccee6 | |||
| f691746771 | |||
| cf5dbdbdb5 | |||
| db676256d7 | |||
| e1ac43e1b8 | |||
| bb1749d3da | |||
| 8236b3d034 | |||
| 9b1a2e50f2 | |||
| d9b5cafdee | |||
| 0489f9c342 | |||
| b7be8b19ef | |||
| 50fb51dd0d | |||
| 2b4f44c0b2 | |||
| 95a66afbe6 | |||
| b82d2caa6b | |||
| 1e4f95dee3 | |||
| e360746265 | |||
| 152c2b87a4 | |||
| bf8b066d97 | |||
| b78d0a8e5b | |||
| d36580f1dc | |||
| d949ef1b8a | |||
| 9e59ccd9af | |||
| cb58a773c9 | |||
| 5531a615e6 | |||
| 98cdbb759b | |||
| 4d88cfed95 | |||
| b9b9eb7fb2 | |||
| d1e74044f9 | |||
| 004df937ed | |||
| 069aa9fb2a | |||
| 9f0c5899d6 | |||
| c9cd80c089 | |||
| 369c667faa | |||
| 8ec47b7e27 | |||
| 27403162ad | |||
| 91b4596c0b | |||
| d7a4f3ed20 | |||
| 4b72ecda0d | |||
| 63088515b4 | |||
| 2d29023931 | |||
| 618d2c85ab | |||
| 351d6eabb8 | |||
| b005d2fbd7 | |||
| 1b41cb0e80 | |||
| 60cb52bd23 | |||
| 134ee1eff0 | |||
| ea00c3a07f | |||
| 8f4d8f82ed | |||
| 03747e3106 | |||
| 36ab30d3e9 | |||
| ae1fc37eeb | |||
| 1a92526ba0 | |||
| 3095d01144 | |||
| 1570bee4b8 | |||
| 22d018c4cd | |||
| 980dfc8f4b | |||
| 72f1206585 | |||
| 5b89d137fc | |||
| 7dc48425c1 | |||
| 8095c34e49 | |||
| ce0a7fda5c | |||
| 8002295397 | |||
| fb80c1419c | |||
| 24019fa7b2 | |||
| 6383288311 | |||
| 7645f9a3dd | |||
| 99b4b36935 | |||
| fcab9b2f8e | |||
| e9ee084231 | |||
| 641efa9b34 | |||
| aed250d3b0 | |||
| bbb7435041 | |||
| 54839b293b | |||
| 2fbd9453dd | |||
| 0aed6d8c19 | |||
| 51dd8cb5c3 | |||
| b8c0b3af73 | |||
| e948842faa | |||
| c7e77730fe | |||
| 6bd45f9697 | |||
| dadd93bb84 | |||
| 4c29c93283 | |||
| c3bba76d32 | |||
| b09412a79a | |||
| 18e1799980 | |||
| b4615f2452 | |||
| e9835d4a2c | |||
| e69744c7ca | |||
| 228c33d44d | |||
| b7ea1f4d44 | |||
| 6f8fb71d15 | |||
| e49fcd4b21 | |||
| b9ae34cc3b | |||
| 15fa50f24e | |||
| 3f65b54a1e | |||
| 6a0ad1b001 | |||
| 1521eea324 | |||
| ae96537b8d | |||
| 3d47c8ab9f | |||
| c3d84c8f05 | |||
| f0eadc783d | |||
| 231de946a0 | |||
| 7f5ae1cdc2 | |||
| dfd5fd388e | |||
| b00e0fcf69 | |||
| b89c4fec3e | |||
| 9b24db3a76 | |||
| 9b24ca7a28 | |||
| 8169a8e4bb | |||
| 6568a94b0e | |||
| fb448461df | |||
| 270c851645 | |||
| 36f76bf288 | |||
| facb412e62 | |||
| 5621258b9d | |||
| 9f268065de | |||
| e7ae71bd73 | |||
| cb22cbca62 | |||
| 6864a3ebcd | |||
| 83948a298c | |||
| d2bb2c71b4 | |||
| 021656d821 | |||
| e1b7380bc6 | |||
| bdc263bc34 | |||
| 8f04ab07ed | |||
| 48514b0e93 | |||
| 424d5e22d2 | |||
| f5b3c38c27 | |||
| 2fb95556a5 | |||
| d48de0afb0 | |||
| 9223174c0c | |||
| 90d0e69a56 | |||
| f07c35d9ae | |||
| 48a339fd17 | |||
| e3d38f704f | |||
| 7f5cc96842 | |||
| fa2fa5b4bf | |||
| 35b00bf8bc | |||
| fc122630d4 | |||
| 18918db012 | |||
| f405395f97 | |||
| 7411012db9 | |||
| e8525a6f14 | |||
| cd33be1491 | |||
| 6cb083be1a | |||
| f52c644af7 | |||
| e56c6914d2 | |||
| 33559ca0ea | |||
| ebec856a36 | |||
| 03627a62eb | |||
| 90dd215b8c | |||
| 08d22a8033 | |||
| 8c6622dd82 | |||
| b98b3241e7 | |||
| 9d2d5102f6 | |||
| 143a75616c | |||
| 9ccc36382b | |||
| 329520168b | |||
| d1343f5415 | |||
| dbc8f76b52 | |||
| b22ba86183 | |||
| b2b8cb17cd | |||
| 0aae7a5168 | |||
| caf5a57875 | |||
| 726760a38e | |||
| bacc193638 | |||
| a7bc421137 | |||
| c41be3a964 | |||
| 76fb1d9db0 | |||
| c6cac4b205 | |||
| 1d0071302a | |||
| 665aaa0ef5 | |||
| 2a16f50f7f | |||
| 1ac0ae8172 | |||
| 9d0bd55ec0 | |||
| c497de1963 | |||
| 74e18dc8c9 | |||
| f8d9242743 | |||
| c28747aef6 | |||
| 3d184b3a59 | |||
| 65ecaab2c4 | |||
| 58421029c4 | |||
| 3689560617 | |||
| afe493f187 | |||
| 602c436e1c | |||
| abbd3ae239 | |||
| 713bff01e1 | |||
| f55afc27a9 | |||
| fe46a45915 | |||
| 1c32a284e1 | |||
| 356904d198 | |||
| 2a5506dae6 | |||
| fa5311718e | |||
| e3fbfc4bda | |||
| 5c84ad30a1 | |||
| 0865fca90a | |||
| 640de81571 | |||
| da8194d659 | |||
| 6651795f6d | |||
| 9c2fe3b25d | |||
| fe49046a96 | |||
| 1f64087a3b | |||
| bba74b9056 | |||
| 1a2da9d608 | |||
| 883885dc0b | |||
| 3d74112aa3 | |||
| 25aeb2e086 | |||
| 41495e5d2a | |||
| 1f46098b23 | |||
| 5f3ea1005a | |||
| 8b9a46bb39 | |||
| 0fe32fa0d3 | |||
| 68078427aa | |||
| 7433a021db | |||
| bd04990af3 | |||
| a7f3b6fd57 | |||
| 222750b846 | |||
| 1a36a2d759 | |||
| 9989988cb7 | |||
| 4e55be9762 | |||
| c7e4c90cb5 | |||
| f151ba7c53 | |||
| e7ad52ee9f | |||
| b97ce7732b | |||
| d058ef769c | |||
| 5f55afda0f | |||
| f69337be65 | |||
| 2eb73e5b4b | |||
| 74914c5916 | |||
| 1cfd2c4475 | |||
| 4856066a81 | |||
| f729f21e6c | |||
| a7971b55ee | |||
| e6a660a200 | |||
| 7816843dfb | |||
| c37c90613f | |||
| c3e0669435 | |||
| ecbc9d1b08 | |||
| 694a2b774e | |||
| 3d0983e7d0 | |||
| 3d9c76a80d | |||
| d94ce7094e | |||
| e1a9f08a91 | |||
| b487dcee27 | |||
| 8e19af530b | |||
| 78aef474a5 | |||
| dbfd07f11e | |||
| 75e81bc969 | |||
| 51f64049ab | |||
| 51b54a4d6b | |||
| 38333f01e3 | |||
| 26e1418897 | |||
| 01aa74e4a8 | |||
| 73491d4ffa | |||
| 82536b298c | |||
| 62d3dcaf64 | |||
| 09d0d81a43 | |||
| 17d400f72a | |||
| b930b874fe | |||
| a71053ae15 | |||
| ebf713c5a6 | |||
| 6bd044f9be | |||
| 3c04f2fef9 | |||
| dab3d6c6d6 | |||
| 1dbbbc55f6 | |||
| 2eafb235ba | |||
| 10647890ef | |||
| 7370c49ff3 | |||
| 3c8084b2c7 | |||
| 582825934c | |||
| 2c7de61027 | |||
| 21aedb518c | |||
| fc962de3dd | |||
| f240690ff5 | |||
| b7b3761c09 | |||
| a4f73bc705 | |||
| 634a1f3162 | |||
| b523c2810e | |||
| 2331c5991a | |||
| 5835669dd9 | |||
| a94d0771fe | |||
| 9b5a3fd2b6 | |||
| 1908842255 | |||
| 64754a08b4 | |||
| f75a3c8f60 | |||
| 2267c84d6a | |||
| a1158c9515 | |||
| 9816ec3aa0 | |||
| c09b0f511e | |||
| 6e06fdf638 | |||
| 14050c7302 | |||
| 3642b267a0 | |||
| c16daed87d | |||
| 2203cb1dcf | |||
| 2fe52451e1 | |||
| ad524798fa | |||
| 125359e30e | |||
| 259b57c64a | |||
| cb9c1030a9 | |||
| ca3f621b3b | |||
| 51bb9dced4 | |||
| 8793d75811 | |||
| 1a1fb622fa | |||
| 3737993bb2 | |||
| 313af89d36 | |||
| f256153a2b | |||
| 2bd8db5f7a | |||
| 8cacbe3567 | |||
| d1533b606b | |||
| c03677bd96 | |||
| a8480f66e0 | |||
| 6b148d1d4c | |||
| 0dfbb5de73 | |||
| ab7a45aede | |||
| 22b9afdb60 | |||
| b5f376f834 | |||
| 59d0b1da4e | |||
| 96fb8b968f | |||
| 470ffaf167 | |||
| 2e06e8152e | |||
| 80dbe1a67f | |||
| 3fdeb72999 | |||
| bb0695e76c | |||
| 711f9eadc5 | |||
| 10d9c3e412 | |||
| dd382b2afc | |||
| 123c4ba1a8 | |||
| 0299ab7660 | |||
| f232351720 | |||
| 6e77f80d5f | |||
| 34590bc884 | |||
| 2ba5ada9f8 | |||
| ba3838f54c | |||
| 3c7d48933f | |||
| 52112006d4 | |||
| 50b42f8593 | |||
| d1fff053c2 | |||
| cd8f286791 | |||
| 38e41e0ea8 | |||
| bbf3c80d04 | |||
| bf8e6dbc8e | |||
| 8a305b19af | |||
| faab4ed6db | |||
| 19db12e090 | |||
| a26bc227d8 | |||
| d751e350c6 | |||
| e55c8410b4 | |||
| ad83fb325c | |||
| d0b7c9a9af | |||
| 230ba0d360 | |||
| 0002cc0af3 | |||
| 08d61163ea | |||
| 7218ccfe66 | |||
| 98787ddb3b | |||
| b0ce69f1e1 | |||
| 60f3ed3543 | |||
| d16953d392 | |||
| 9ede2d6753 | |||
| c4360ee834 | |||
| 1fc3654ca4 | |||
| 6a6fbea5ee | |||
| 061fe50835 | |||
| c5e780ffb2 | |||
| ba29a19e82 | |||
| d84c619882 | |||
| 69c9d95f10 | |||
| 072dfc600c | |||
| f3cbdcd59d | |||
| e22e9993d7 | |||
| abbbaa222b | |||
| feb241439e | |||
| 4d57af9ed2 | |||
| 8b9a454e2f | |||
| e29a1ddef7 | |||
| b7be0dc633 | |||
| cb61112490 | |||
| 82a28d3365 | |||
| 6d870cb558 | |||
| 3d4be9aee3 | |||
| 3019122685 | |||
| 1eb66198c0 | |||
| fd56797b77 | |||
| 77458e5795 | |||
| fdc8479635 | |||
| 7f5f67163b | |||
| 8736a14599 | |||
| 97e31c8873 | |||
| 7aefdd3e1f | |||
| 5f6a236550 | |||
| 2eeab1feb0 | |||
| f3b61f58ef | |||
| 2d1409c706 | |||
| f0468a145f | |||
| a7bac1f084 | |||
| 2037068428 | |||
| 8d1d227dac | |||
| 017e44cf4d | |||
| 06868cb694 | |||
| 0a4cffd759 | |||
| 0f1606fbd3 | |||
| 347f6f20b7 | |||
| cf98ddf979 | |||
| 42424618af | |||
| 26c77fbaa0 | |||
| 6f1efc851f | |||
| 8987350b5b | |||
| 0c53c00325 | |||
| fb8ced95b0 | |||
| 57a288a242 | |||
| 382af8437c | |||
| b11e086589 | |||
| a4308b96f6 | |||
| e6a4ef9eb8 | |||
| 5ef3b80596 | |||
| 458322e548 | |||
| 268e2eee4c | |||
| 49295f8eff | |||
| b6ac09aa1a |
@@ -0,0 +1,33 @@
|
||||
Standard: Cpp11
|
||||
UseTab: ForIndentation
|
||||
TabWidth: 1
|
||||
IndentWidth: 1
|
||||
AccessModifierOffset: -1
|
||||
PointerAlignment: Left
|
||||
NamespaceIndentation: All
|
||||
ColumnLimit: 200
|
||||
BreakBeforeBraces: Allman
|
||||
BreakConstructorInitializersBeforeComma: true
|
||||
BreakBeforeBinaryOperators: false
|
||||
BreakBeforeTernaryOperators: false
|
||||
AlwaysBreakTemplateDeclarations: true
|
||||
AllowShortIfStatementsOnASingleLine: true
|
||||
AllowShortBlocksOnASingleLine: true
|
||||
AllowShortCaseLabelsOnASingleLine: true
|
||||
AllowShortFunctionsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: true
|
||||
Cpp11BracedListStyle: true
|
||||
IndentCaseLabels: false
|
||||
SortIncludes: false
|
||||
ReflowComments: true
|
||||
AlignConsecutiveAssignments: true
|
||||
AlignTrailingComments: true
|
||||
AlignAfterOpenBracket: DontAlign
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
BinPackArguments: true
|
||||
BinPackParameters: true
|
||||
AlwaysBreakAfterReturnType: None
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
IndentWrappedFunctionNames: false
|
||||
|
||||
#SpaceAfterTemplateKeyword: false
|
||||
@@ -0,0 +1,7 @@
|
||||
root = true
|
||||
|
||||
[*.{h,cpp,hpp}]
|
||||
charset = utf-8
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
trim_trailing_whitespace = true
|
||||
+27
-5
@@ -30,24 +30,35 @@
|
||||
*.dump
|
||||
*.wav
|
||||
|
||||
/libs
|
||||
/build
|
||||
/bin
|
||||
/lib
|
||||
/tmp
|
||||
/ipch
|
||||
/rpcs3/Debug
|
||||
/rpcs3/Release
|
||||
/llvm_build
|
||||
/Vulkan/Vulkan-build
|
||||
/Vulkan/glslang-build
|
||||
|
||||
/wxWidgets/lib
|
||||
/bin/rpcs3.ini
|
||||
/bin/rpcs3.ipdb
|
||||
/bin/rpcs3.iobj
|
||||
/bin/FragmentProgram.txt
|
||||
/bin/VertexProgram.txt
|
||||
/bin/*.hlsl
|
||||
/bin/BreakPoints.dat
|
||||
/bin/textures
|
||||
/bin/*.lib
|
||||
/bin/*.exp
|
||||
rpcs3/git-version.h
|
||||
|
||||
# Visual Studio Profiler Files
|
||||
# Visual Studio Files
|
||||
*.ipch
|
||||
*.vspx
|
||||
*.psess
|
||||
*.VC.*
|
||||
|
||||
# Copyrighted files
|
||||
/bin/data/
|
||||
@@ -61,6 +72,17 @@ rpcs3/git-version.h
|
||||
!/bin/dev_hdd0/game/TEST12345/
|
||||
|
||||
# Ignore other system generated files
|
||||
bin/dev_hdd0/log.txt
|
||||
x64/Debug/emucore.lib
|
||||
x64/Release/emucore.lib
|
||||
bin/dev_hdd0/*.txt
|
||||
x64/*
|
||||
rpcs3/x64/*
|
||||
rpcs3-tests/x64/*
|
||||
|
||||
# cmake
|
||||
Makefile
|
||||
*CMakeFiles*
|
||||
CMakeCache.txt
|
||||
*cmake_install.cmake*
|
||||
|
||||
# cotire
|
||||
rpcs3/cotire/*
|
||||
rpcs3/rpcs3_*_cotire.cmake
|
||||
|
||||
+36
-3
@@ -1,10 +1,43 @@
|
||||
[submodule "wxWidgets"]
|
||||
path = wxWidgets
|
||||
url = https://github.com/DHrpcs3/wxWidgets.git
|
||||
url = https://github.com/wxWidgets/wxWidgets
|
||||
ignore = dirty
|
||||
[submodule "rpcs3-ffmpeg"]
|
||||
path = ffmpeg
|
||||
path = 3rdparty/ffmpeg
|
||||
url = https://github.com/hrydgard/ppsspp-ffmpeg
|
||||
[submodule "asmjit"]
|
||||
path = asmjit
|
||||
url = https://github.com/kobalicekp/asmjit
|
||||
url = https://github.com/kobalicek/asmjit
|
||||
ignore = dirty
|
||||
[submodule "llvm"]
|
||||
path = llvm
|
||||
url = https://github.com/llvm-mirror/llvm
|
||||
branch = release_40
|
||||
[submodule "rsx_program_decompiler"]
|
||||
path = rsx_program_decompiler
|
||||
url = https://github.com/Zangetsu38/rsx_program_decompiler
|
||||
[submodule "GSL"]
|
||||
path = 3rdparty/GSL
|
||||
url = https://github.com/Microsoft/GSL.git
|
||||
[submodule "libpng"]
|
||||
path = 3rdparty/libpng
|
||||
url = https://github.com/RPCS3/libpng
|
||||
ignore = dirty
|
||||
[submodule "Vulkan/glslang"]
|
||||
path = Vulkan/glslang
|
||||
url = https://github.com/KhronosGroup/glslang.git
|
||||
[submodule "Vulkan/Vulkan-LoaderAndValidationLayers"]
|
||||
path = Vulkan/Vulkan-LoaderAndValidationLayers
|
||||
url = https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers
|
||||
[submodule "Utilities/yaml-cpp"]
|
||||
path = Utilities/yaml-cpp
|
||||
url = https://github.com/RPCS3/yaml-cpp
|
||||
[submodule "3rdparty/pugixml"]
|
||||
path = 3rdparty/pugixml
|
||||
url = https://github.com/RPCS3/pugixml
|
||||
[submodule "3rdparty/cereal"]
|
||||
path = 3rdparty/cereal
|
||||
url = https://github.com/USCiLab/cereal.git
|
||||
[submodule "rsx-debugger"]
|
||||
path = rsx-debugger
|
||||
url = https://github.com/RPCS3/rsx-debugger.git
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"userBlacklist": ["AlexAltea", "tambry", "DHrpcs3"]
|
||||
}
|
||||
+80
-24
@@ -1,35 +1,91 @@
|
||||
language: cpp
|
||||
sudo: false
|
||||
dist: trusty
|
||||
|
||||
os:
|
||||
- linux
|
||||
#- osx
|
||||
|
||||
osx_image: xcode6.4
|
||||
|
||||
compiler:
|
||||
- clang
|
||||
- gcc
|
||||
- clang
|
||||
- gcc
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
cache:
|
||||
ccache: true
|
||||
directories:
|
||||
- $HOME/hombebrew_cache
|
||||
|
||||
env:
|
||||
global:
|
||||
- secure: "Vf+FY48nip9JppMnq11105NealdErSWsoUhHo63/V3V+LKfA9guenxCp93/qoSIdSGC/sJwb0yIIMGvkTT/rxDJNh6Z+BWUTb2E0WEIIQbvTJNOSUzoq7dfF1LT61XjVjByFzcbC2xjtaBowmcAYEs1jGUUuEjYVCMmD5lY8hUg="
|
||||
# Which Travis environment to run Coverity on
|
||||
- coverity_scan_run_condition='"$TRAVIS_OS_NAME" = linux -a "$CC" = gcc'
|
||||
# Test mode is for testing if it's working with Coverity. Change to true if testing, to avoid reaching the quota.
|
||||
- coverity_scan_script_test_mode=false
|
||||
|
||||
matrix:
|
||||
exclude:
|
||||
- os: osx
|
||||
compiler: gcc
|
||||
|
||||
git:
|
||||
submodules: false
|
||||
|
||||
before_install:
|
||||
- echo "yes" | sudo apt-key adv --fetch-keys http://repos.codelite.org/CodeLite.asc
|
||||
- echo "yes" | sudo apt-add-repository 'deb http://repos.codelite.org/wx3.0/ubuntu/ precise universe'
|
||||
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
|
||||
- sudo apt-get update
|
||||
- sudo apt-get install libwxgtk3.0-dev libopenal-dev freeglut3-dev libglew-dev
|
||||
- sudo apt-get install aria2 -qq
|
||||
- download_extract() { aria2c -x 16 $1 -o $2 && tar -xf $2; }
|
||||
# Travis uses CMake 2.8.7. We require 2.8.8. Grab latest
|
||||
- sudo apt-get install -qq g++-4.8
|
||||
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
|
||||
- sudo apt-get install lib32stdc++6 -qq &&
|
||||
aria2c -x 16 http://www.cmake.org/files/v2.8/cmake-2.8.12.1-Linux-i386.sh &&
|
||||
chmod a+x cmake-2.8.12.1-Linux-i386.sh &&
|
||||
sudo ./cmake-2.8.12.1-Linux-i386.sh --skip-license --prefix=/usr;
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$CXX" = "g++" ]; then
|
||||
export CXX="g++-5" CC="gcc-5" CXXFLAGS="-Wno-format-security";
|
||||
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01';
|
||||
fi;
|
||||
# Add coverall for C++ so coverall.io could be triggered. Even it should be --coverage and gcov.
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
pip install --user cpp-coveralls requests[security];
|
||||
else
|
||||
brew update; brew update;
|
||||
brew install ccache glew wxwidgets llvm40;
|
||||
fi;
|
||||
|
||||
before_script:
|
||||
- git submodule update --init --recursive
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake ..
|
||||
- git submodule update --init rsx_program_decompiler asmjit 3rdparty/ffmpeg 3rdparty/pugixml 3rdparty/GSL 3rdparty/libpng Utilities/yaml-cpp 3rdparty/cereal
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake ..
|
||||
|
||||
script:
|
||||
- make
|
||||
# Add a command to show all the variables. May be useful for debugging Travis.
|
||||
#- echo "--Shell Export Lists START--" ; export -p; echo "--Shell Export Lists STOP--";
|
||||
# And to ensure the versions of toolchain
|
||||
- echo "--CXX version?"; "$CXX" --version; echo "--CXX version confirmed";
|
||||
- if [ "$COVERITY_SCAN_BRANCH" != 1 ]; then make -j 3; fi
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-4.0
|
||||
packages:
|
||||
- cmake
|
||||
- libopenal-dev
|
||||
- freeglut3-dev
|
||||
- libglew-dev
|
||||
- libc6-dev
|
||||
- llvm-4.0
|
||||
- llvm-4.0-dev
|
||||
- libedit-dev
|
||||
- g++-5
|
||||
- gcc-5
|
||||
- libstdc++-5-dev
|
||||
- lib32stdc++6
|
||||
- zlib1g-dev
|
||||
- libwxgtk3.0-dev
|
||||
coverity_scan:
|
||||
project:
|
||||
name: $TRAVIS_REPO_SLUG
|
||||
description: "PS3 emulator/debugger"
|
||||
notification_email: nekotekina@gmail.com
|
||||
build_command: "make -j 3"
|
||||
branch_pattern: coverity_scan
|
||||
|
||||
after_success:
|
||||
- if [ "$COVERITY_SCAN_BRANCH" != 1 ] && [ "$TRAVIS_OS_NAME" = linux ]; then coveralls --extension .c --extension .cpp --extension .h; fi
|
||||
|
||||
Vendored
+10358
-11247
File diff suppressed because it is too large
Load Diff
+1
Submodule 3rdparty/GSL added at 96eaf274f8
@@ -348,6 +348,51 @@ AL_API void AL_APIENTRY alGetSourcei64vSOFT(ALuint source, ALenum param, ALint64
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ALC_EXT_DEFAULT_FILTER_ORDER
|
||||
#define ALC_EXT_DEFAULT_FILTER_ORDER 1
|
||||
#define ALC_DEFAULT_FILTER_ORDER 0x1100
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_deferred_updates
|
||||
#define AL_SOFT_deferred_updates 1
|
||||
#define AL_DEFERRED_UPDATES_SOFT 0xC002
|
||||
typedef ALvoid (AL_APIENTRY*LPALDEFERUPDATESSOFT)(void);
|
||||
typedef ALvoid (AL_APIENTRY*LPALPROCESSUPDATESSOFT)(void);
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
AL_API ALvoid AL_APIENTRY alDeferUpdatesSOFT(void);
|
||||
AL_API ALvoid AL_APIENTRY alProcessUpdatesSOFT(void);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_block_alignment
|
||||
#define AL_SOFT_block_alignment 1
|
||||
#define AL_UNPACK_BLOCK_ALIGNMENT_SOFT 0x200C
|
||||
#define AL_PACK_BLOCK_ALIGNMENT_SOFT 0x200D
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_MSADPCM
|
||||
#define AL_SOFT_MSADPCM 1
|
||||
#define AL_FORMAT_MONO_MSADPCM_SOFT 0x1302
|
||||
#define AL_FORMAT_STEREO_MSADPCM_SOFT 0x1303
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_source_length
|
||||
#define AL_SOFT_source_length 1
|
||||
/*#define AL_BYTE_LENGTH_SOFT 0x2009*/
|
||||
/*#define AL_SAMPLE_LENGTH_SOFT 0x200A*/
|
||||
/*#define AL_SEC_LENGTH_SOFT 0x200B*/
|
||||
#endif
|
||||
|
||||
#ifndef ALC_SOFT_pause_device
|
||||
#define ALC_SOFT_pause_device 1
|
||||
typedef void (ALC_APIENTRY*LPALCDEVICEPAUSESOFT)(ALCdevice *device);
|
||||
typedef void (ALC_APIENTRY*LPALCDEVICERESUMESOFT)(ALCdevice *device);
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
ALC_API void ALC_APIENTRY alcDevicePauseSOFT(ALCdevice *device);
|
||||
ALC_API void ALC_APIENTRY alcDeviceResumeSOFT(ALCdevice *device);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+187
@@ -0,0 +1,187 @@
|
||||
EXPORTS
|
||||
alAuxiliaryEffectSlotf
|
||||
alAuxiliaryEffectSlotfv
|
||||
alAuxiliaryEffectSloti
|
||||
alAuxiliaryEffectSlotiv
|
||||
alBuffer3f
|
||||
alBuffer3i
|
||||
alBufferData
|
||||
alBufferSamplesSOFT
|
||||
alBufferSubDataSOFT
|
||||
alBufferSubSamplesSOFT
|
||||
alBufferf
|
||||
alBufferfv
|
||||
alBufferi
|
||||
alBufferiv
|
||||
alDeferUpdatesSOFT
|
||||
alDeleteAuxiliaryEffectSlots
|
||||
alDeleteBuffers
|
||||
alDeleteEffects
|
||||
alDeleteFilters
|
||||
alDeleteFontsoundsSOFT
|
||||
alDeletePresetsSOFT
|
||||
alDeleteSoundfontsSOFT
|
||||
alDeleteSources
|
||||
alDisable
|
||||
alDistanceModel
|
||||
alDopplerFactor
|
||||
alDopplerVelocity
|
||||
alEffectf
|
||||
alEffectfv
|
||||
alEffecti
|
||||
alEffectiv
|
||||
alEnable
|
||||
alFilterf
|
||||
alFilterfv
|
||||
alFilteri
|
||||
alFilteriv
|
||||
alFontsound2iSOFT
|
||||
alFontsoundModulatoriSOFT
|
||||
alFontsoundiSOFT
|
||||
alFontsoundivSOFT
|
||||
alGenAuxiliaryEffectSlots
|
||||
alGenBuffers
|
||||
alGenEffects
|
||||
alGenFilters
|
||||
alGenFontsoundsSOFT
|
||||
alGenPresetsSOFT
|
||||
alGenSoundfontsSOFT
|
||||
alGenSources
|
||||
alGetAuxiliaryEffectSlotf
|
||||
alGetAuxiliaryEffectSlotfv
|
||||
alGetAuxiliaryEffectSloti
|
||||
alGetAuxiliaryEffectSlotiv
|
||||
alGetBoolean
|
||||
alGetBooleanv
|
||||
alGetBuffer3f
|
||||
alGetBuffer3i
|
||||
alGetBufferSamplesSOFT
|
||||
alGetBufferf
|
||||
alGetBufferfv
|
||||
alGetBufferi
|
||||
alGetBufferiv
|
||||
alGetDouble
|
||||
alGetDoublev
|
||||
alGetEffectf
|
||||
alGetEffectfv
|
||||
alGetEffecti
|
||||
alGetEffectiv
|
||||
alGetEnumValue
|
||||
alGetError
|
||||
alGetFilterf
|
||||
alGetFilterfv
|
||||
alGetFilteri
|
||||
alGetFilteriv
|
||||
alGetFloat
|
||||
alGetFloatv
|
||||
alGetFontsoundModulatorivSOFT
|
||||
alGetFontsoundivSOFT
|
||||
alGetInteger
|
||||
alGetInteger64SOFT
|
||||
alGetInteger64vSOFT
|
||||
alGetIntegerv
|
||||
alGetListener3f
|
||||
alGetListener3i
|
||||
alGetListenerf
|
||||
alGetListenerfv
|
||||
alGetListeneri
|
||||
alGetListeneriv
|
||||
alGetPresetivSOFT
|
||||
alGetProcAddress
|
||||
alGetSoundfontivSOFT
|
||||
alGetSource3dSOFT
|
||||
alGetSource3f
|
||||
alGetSource3i
|
||||
alGetSource3i64SOFT
|
||||
alGetSourcedSOFT
|
||||
alGetSourcedvSOFT
|
||||
alGetSourcef
|
||||
alGetSourcefv
|
||||
alGetSourcei
|
||||
alGetSourcei64SOFT
|
||||
alGetSourcei64vSOFT
|
||||
alGetSourceiv
|
||||
alGetString
|
||||
alIsAuxiliaryEffectSlot
|
||||
alIsBuffer
|
||||
alIsBufferFormatSupportedSOFT
|
||||
alIsEffect
|
||||
alIsEnabled
|
||||
alIsExtensionPresent
|
||||
alIsFilter
|
||||
alIsFontsoundSOFT
|
||||
alIsPresetSOFT
|
||||
alIsSoundfontSOFT
|
||||
alIsSource
|
||||
alListener3f
|
||||
alListener3i
|
||||
alListenerf
|
||||
alListenerfv
|
||||
alListeneri
|
||||
alListeneriv
|
||||
alLoadSoundfontSOFT
|
||||
alMidiEventSOFT
|
||||
alMidiGainSOFT
|
||||
alMidiPauseSOFT
|
||||
alMidiPlaySOFT
|
||||
alMidiResetSOFT
|
||||
alMidiSoundfontSOFT
|
||||
alMidiSoundfontvSOFT
|
||||
alMidiStopSOFT
|
||||
alMidiSysExSOFT
|
||||
alPresetFontsoundsSOFT
|
||||
alPresetiSOFT
|
||||
alPresetivSOFT
|
||||
alProcessUpdatesSOFT
|
||||
alSoundfontPresetsSOFT
|
||||
alSource3dSOFT
|
||||
alSource3f
|
||||
alSource3i
|
||||
alSource3i64SOFT
|
||||
alSourcePause
|
||||
alSourcePausev
|
||||
alSourcePlay
|
||||
alSourcePlayv
|
||||
alSourceQueueBuffers
|
||||
alSourceRewind
|
||||
alSourceRewindv
|
||||
alSourceStop
|
||||
alSourceStopv
|
||||
alSourceUnqueueBuffers
|
||||
alSourcedSOFT
|
||||
alSourcedvSOFT
|
||||
alSourcef
|
||||
alSourcefv
|
||||
alSourcei
|
||||
alSourcei64SOFT
|
||||
alSourcei64vSOFT
|
||||
alSourceiv
|
||||
alSpeedOfSound
|
||||
alcCaptureCloseDevice
|
||||
alcCaptureOpenDevice
|
||||
alcCaptureSamples
|
||||
alcCaptureStart
|
||||
alcCaptureStop
|
||||
alcCloseDevice
|
||||
alcCreateContext
|
||||
alcDestroyContext
|
||||
alcDevicePauseSOFT
|
||||
alcDeviceResumeSOFT
|
||||
alcGetContextsDevice
|
||||
alcGetCurrentContext
|
||||
alcGetEnumValue
|
||||
alcGetError
|
||||
alcGetInteger64vSOFT
|
||||
alcGetIntegerv
|
||||
alcGetProcAddress
|
||||
alcGetString
|
||||
alcGetThreadContext
|
||||
alcIsExtensionPresent
|
||||
alcIsRenderFormatSupportedSOFT
|
||||
alcLoopbackOpenDeviceSOFT
|
||||
alcMakeContextCurrent
|
||||
alcOpenDevice
|
||||
alcProcessContext
|
||||
alcRenderSamplesSOFT
|
||||
alcSetThreadContext
|
||||
alcSuspendContext
|
||||
BIN
Binary file not shown.
Vendored
+1295
File diff suppressed because it is too large
Load Diff
Vendored
+263
@@ -0,0 +1,263 @@
|
||||
/***************************************************************************
|
||||
*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
*
|
||||
* File: audiodefs.h
|
||||
* Content: Basic constants and data types for audio work.
|
||||
*
|
||||
* Remarks: This header file defines all of the audio format constants and
|
||||
* structures required for XAudio2 and XACT work. Providing these
|
||||
* in a single location avoids certain dependency problems in the
|
||||
* legacy audio headers (mmreg.h, mmsystem.h, ksmedia.h).
|
||||
*
|
||||
* NOTE: Including the legacy headers after this one may cause a
|
||||
* compilation error, because they define some of the same types
|
||||
* defined here without preprocessor guards to avoid multiple
|
||||
* definitions. If a source file needs one of the old headers,
|
||||
* it must include it before including audiodefs.h.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __AUDIODEFS_INCLUDED__
|
||||
#define __AUDIODEFS_INCLUDED__
|
||||
|
||||
#include <windef.h> // For WORD, DWORD, etc.
|
||||
|
||||
#pragma pack(push, 1) // Pack structures to 1-byte boundaries
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* WAVEFORMATEX: Base structure for many audio formats. Format-specific
|
||||
* extensions can be defined for particular formats by using a non-zero
|
||||
* cbSize value and adding extra fields to the end of this structure.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _WAVEFORMATEX_
|
||||
|
||||
#define _WAVEFORMATEX_
|
||||
typedef struct tWAVEFORMATEX
|
||||
{
|
||||
WORD wFormatTag; // Integer identifier of the format
|
||||
WORD nChannels; // Number of audio channels
|
||||
DWORD nSamplesPerSec; // Audio sample rate
|
||||
DWORD nAvgBytesPerSec; // Bytes per second (possibly approximate)
|
||||
WORD nBlockAlign; // Size in bytes of a sample block (all channels)
|
||||
WORD wBitsPerSample; // Size in bits of a single per-channel sample
|
||||
WORD cbSize; // Bytes of extra data appended to this struct
|
||||
} WAVEFORMATEX;
|
||||
|
||||
#endif
|
||||
|
||||
// Defining pointer types outside of the #if block to make sure they are
|
||||
// defined even if mmreg.h or mmsystem.h is #included before this file
|
||||
|
||||
typedef WAVEFORMATEX *PWAVEFORMATEX, *NPWAVEFORMATEX, *LPWAVEFORMATEX;
|
||||
typedef const WAVEFORMATEX *PCWAVEFORMATEX, *LPCWAVEFORMATEX;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* WAVEFORMATEXTENSIBLE: Extended version of WAVEFORMATEX that should be
|
||||
* used as a basis for all new audio formats. The format tag is replaced
|
||||
* with a GUID, allowing new formats to be defined without registering a
|
||||
* format tag with Microsoft. There are also new fields that can be used
|
||||
* to specify the spatial positions for each channel and the bit packing
|
||||
* used for wide samples (e.g. 24-bit PCM samples in 32-bit containers).
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _WAVEFORMATEXTENSIBLE_
|
||||
|
||||
#define _WAVEFORMATEXTENSIBLE_
|
||||
typedef struct
|
||||
{
|
||||
WAVEFORMATEX Format; // Base WAVEFORMATEX data
|
||||
union
|
||||
{
|
||||
WORD wValidBitsPerSample; // Valid bits in each sample container
|
||||
WORD wSamplesPerBlock; // Samples per block of audio data; valid
|
||||
// if wBitsPerSample=0 (but rarely used).
|
||||
WORD wReserved; // Zero if neither case above applies.
|
||||
} Samples;
|
||||
DWORD dwChannelMask; // Positions of the audio channels
|
||||
GUID SubFormat; // Format identifier GUID
|
||||
} WAVEFORMATEXTENSIBLE;
|
||||
|
||||
#endif
|
||||
|
||||
typedef WAVEFORMATEXTENSIBLE *PWAVEFORMATEXTENSIBLE, *LPWAVEFORMATEXTENSIBLE;
|
||||
typedef const WAVEFORMATEXTENSIBLE *PCWAVEFORMATEXTENSIBLE, *LPCWAVEFORMATEXTENSIBLE;
|
||||
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Define the most common wave format tags used in WAVEFORMATEX formats.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef WAVE_FORMAT_PCM // Pulse Code Modulation
|
||||
|
||||
// If WAVE_FORMAT_PCM is not defined, we need to define some legacy types
|
||||
// for compatibility with the Windows mmreg.h / mmsystem.h header files.
|
||||
|
||||
// Old general format structure (information common to all formats)
|
||||
typedef struct waveformat_tag
|
||||
{
|
||||
WORD wFormatTag;
|
||||
WORD nChannels;
|
||||
DWORD nSamplesPerSec;
|
||||
DWORD nAvgBytesPerSec;
|
||||
WORD nBlockAlign;
|
||||
} WAVEFORMAT, *PWAVEFORMAT, NEAR *NPWAVEFORMAT, FAR *LPWAVEFORMAT;
|
||||
|
||||
// Specific format structure for PCM data
|
||||
typedef struct pcmwaveformat_tag
|
||||
{
|
||||
WAVEFORMAT wf;
|
||||
WORD wBitsPerSample;
|
||||
} PCMWAVEFORMAT, *PPCMWAVEFORMAT, NEAR *NPPCMWAVEFORMAT, FAR *LPPCMWAVEFORMAT;
|
||||
|
||||
#define WAVE_FORMAT_PCM 0x0001
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef WAVE_FORMAT_ADPCM // Microsoft Adaptive Differental PCM
|
||||
|
||||
// Replicate the Microsoft ADPCM type definitions from mmreg.h.
|
||||
|
||||
typedef struct adpcmcoef_tag
|
||||
{
|
||||
short iCoef1;
|
||||
short iCoef2;
|
||||
} ADPCMCOEFSET;
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4200) // Disable zero-sized array warnings
|
||||
|
||||
typedef struct adpcmwaveformat_tag {
|
||||
WAVEFORMATEX wfx;
|
||||
WORD wSamplesPerBlock;
|
||||
WORD wNumCoef;
|
||||
ADPCMCOEFSET aCoef[]; // Always 7 coefficient pairs for MS ADPCM
|
||||
} ADPCMWAVEFORMAT;
|
||||
|
||||
#pragma warning(pop)
|
||||
|
||||
#define WAVE_FORMAT_ADPCM 0x0002
|
||||
|
||||
#endif
|
||||
|
||||
// Other frequently used format tags
|
||||
|
||||
#ifndef WAVE_FORMAT_UNKNOWN
|
||||
#define WAVE_FORMAT_UNKNOWN 0x0000 // Unknown or invalid format tag
|
||||
#endif
|
||||
|
||||
#ifndef WAVE_FORMAT_IEEE_FLOAT
|
||||
#define WAVE_FORMAT_IEEE_FLOAT 0x0003 // 32-bit floating-point
|
||||
#endif
|
||||
|
||||
#ifndef WAVE_FORMAT_MPEGLAYER3
|
||||
#define WAVE_FORMAT_MPEGLAYER3 0x0055 // ISO/MPEG Layer3
|
||||
#endif
|
||||
|
||||
#ifndef WAVE_FORMAT_DOLBY_AC3_SPDIF
|
||||
#define WAVE_FORMAT_DOLBY_AC3_SPDIF 0x0092 // Dolby Audio Codec 3 over S/PDIF
|
||||
#endif
|
||||
|
||||
#ifndef WAVE_FORMAT_WMAUDIO2
|
||||
#define WAVE_FORMAT_WMAUDIO2 0x0161 // Windows Media Audio
|
||||
#endif
|
||||
|
||||
#ifndef WAVE_FORMAT_WMAUDIO3
|
||||
#define WAVE_FORMAT_WMAUDIO3 0x0162 // Windows Media Audio Pro
|
||||
#endif
|
||||
|
||||
#ifndef WAVE_FORMAT_WMASPDIF
|
||||
#define WAVE_FORMAT_WMASPDIF 0x0164 // Windows Media Audio over S/PDIF
|
||||
#endif
|
||||
|
||||
#ifndef WAVE_FORMAT_EXTENSIBLE
|
||||
#define WAVE_FORMAT_EXTENSIBLE 0xFFFE // All WAVEFORMATEXTENSIBLE formats
|
||||
#endif
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Define the most common wave format GUIDs used in WAVEFORMATEXTENSIBLE
|
||||
* formats. Note that including the Windows ksmedia.h header after this
|
||||
* one will cause build problems; this cannot be avoided, since ksmedia.h
|
||||
* defines these macros without preprocessor guards.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef __cplusplus // uuid() and __uuidof() are only available in C++
|
||||
|
||||
#ifndef KSDATAFORMAT_SUBTYPE_PCM
|
||||
struct __declspec(uuid("00000001-0000-0010-8000-00aa00389b71")) KSDATAFORMAT_SUBTYPE_PCM_STRUCT;
|
||||
#define KSDATAFORMAT_SUBTYPE_PCM __uuidof(KSDATAFORMAT_SUBTYPE_PCM_STRUCT)
|
||||
#endif
|
||||
|
||||
#ifndef KSDATAFORMAT_SUBTYPE_ADPCM
|
||||
struct __declspec(uuid("00000002-0000-0010-8000-00aa00389b71")) KSDATAFORMAT_SUBTYPE_ADPCM_STRUCT;
|
||||
#define KSDATAFORMAT_SUBTYPE_ADPCM __uuidof(KSDATAFORMAT_SUBTYPE_ADPCM_STRUCT)
|
||||
#endif
|
||||
|
||||
#ifndef KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
|
||||
struct __declspec(uuid("00000003-0000-0010-8000-00aa00389b71")) KSDATAFORMAT_SUBTYPE_IEEE_FLOAT_STRUCT;
|
||||
#define KSDATAFORMAT_SUBTYPE_IEEE_FLOAT __uuidof(KSDATAFORMAT_SUBTYPE_IEEE_FLOAT_STRUCT)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Speaker positions used in the WAVEFORMATEXTENSIBLE dwChannelMask field.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef SPEAKER_FRONT_LEFT
|
||||
#define SPEAKER_FRONT_LEFT 0x00000001
|
||||
#define SPEAKER_FRONT_RIGHT 0x00000002
|
||||
#define SPEAKER_FRONT_CENTER 0x00000004
|
||||
#define SPEAKER_LOW_FREQUENCY 0x00000008
|
||||
#define SPEAKER_BACK_LEFT 0x00000010
|
||||
#define SPEAKER_BACK_RIGHT 0x00000020
|
||||
#define SPEAKER_FRONT_LEFT_OF_CENTER 0x00000040
|
||||
#define SPEAKER_FRONT_RIGHT_OF_CENTER 0x00000080
|
||||
#define SPEAKER_BACK_CENTER 0x00000100
|
||||
#define SPEAKER_SIDE_LEFT 0x00000200
|
||||
#define SPEAKER_SIDE_RIGHT 0x00000400
|
||||
#define SPEAKER_TOP_CENTER 0x00000800
|
||||
#define SPEAKER_TOP_FRONT_LEFT 0x00001000
|
||||
#define SPEAKER_TOP_FRONT_CENTER 0x00002000
|
||||
#define SPEAKER_TOP_FRONT_RIGHT 0x00004000
|
||||
#define SPEAKER_TOP_BACK_LEFT 0x00008000
|
||||
#define SPEAKER_TOP_BACK_CENTER 0x00010000
|
||||
#define SPEAKER_TOP_BACK_RIGHT 0x00020000
|
||||
#define SPEAKER_RESERVED 0x7FFC0000
|
||||
#define SPEAKER_ALL 0x80000000
|
||||
#define _SPEAKER_POSITIONS_
|
||||
#endif
|
||||
|
||||
#ifndef SPEAKER_STEREO
|
||||
#define SPEAKER_MONO (SPEAKER_FRONT_CENTER)
|
||||
#define SPEAKER_STEREO (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT)
|
||||
#define SPEAKER_2POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY)
|
||||
#define SPEAKER_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_BACK_CENTER)
|
||||
#define SPEAKER_QUAD (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT)
|
||||
#define SPEAKER_4POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT)
|
||||
#define SPEAKER_5POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT)
|
||||
#define SPEAKER_7POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_FRONT_LEFT_OF_CENTER | SPEAKER_FRONT_RIGHT_OF_CENTER)
|
||||
#define SPEAKER_5POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT)
|
||||
#define SPEAKER_7POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT)
|
||||
#endif
|
||||
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
#endif // #ifndef __AUDIODEFS_INCLUDED__
|
||||
Vendored
+65
@@ -0,0 +1,65 @@
|
||||
// comdecl.h: Macros to facilitate COM interface and GUID declarations.
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
#ifndef _COMDECL_H_
|
||||
#define _COMDECL_H_
|
||||
|
||||
#ifndef _XBOX
|
||||
#include <basetyps.h> // For standard COM interface macros
|
||||
#else
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4061)
|
||||
#include <xtl.h> // Required by xobjbase.h
|
||||
#include <xobjbase.h> // Special definitions for Xbox build
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
// The DEFINE_CLSID() and DEFINE_IID() macros defined below allow COM GUIDs to
|
||||
// be declared and defined in such a way that clients can obtain the GUIDs using
|
||||
// either the __uuidof() extension or the old-style CLSID_Foo / IID_IFoo names.
|
||||
// If using the latter approach, the client can also choose whether to get the
|
||||
// GUID definitions by defining the INITGUID preprocessor constant or by linking
|
||||
// to a GUID library. This works in either C or C++.
|
||||
|
||||
#ifndef _MSC_VER
|
||||
|
||||
#define DEFINE_UUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) __CRT_UUID_DECL(name, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8)
|
||||
#define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) class className; DEFINE_UUID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
|
||||
#define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) struct interfaceName; DEFINE_UUID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
|
||||
|
||||
#elif __cplusplus
|
||||
|
||||
#define DECLSPEC_UUID_WRAPPER(x) __declspec(uuid(#x))
|
||||
#ifdef INITGUID
|
||||
|
||||
#define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
|
||||
class DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) className; \
|
||||
EXTERN_C const GUID DECLSPEC_SELECTANY CLSID_##className = __uuidof(className)
|
||||
|
||||
#define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
|
||||
interface DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) interfaceName; \
|
||||
EXTERN_C const GUID DECLSPEC_SELECTANY IID_##interfaceName = __uuidof(interfaceName)
|
||||
|
||||
#else // INITGUID
|
||||
|
||||
#define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
|
||||
class DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) className; \
|
||||
EXTERN_C const GUID CLSID_##className
|
||||
|
||||
#define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
|
||||
interface DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) interfaceName; \
|
||||
EXTERN_C const GUID IID_##interfaceName
|
||||
|
||||
#endif // INITGUID
|
||||
|
||||
#else // __cplusplus
|
||||
|
||||
#define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
|
||||
DEFINE_GUID(CLSID_##className, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8)
|
||||
|
||||
#define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
|
||||
DEFINE_GUID(IID_##interfaceName, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8)
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif // #ifndef _COMDECL_H_
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
*
|
||||
* File: dxsdkver.h
|
||||
* Content: DirectX SDK Version Include File
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef _DXSDKVER_H_
|
||||
#define _DXSDKVER_H_
|
||||
|
||||
#define _DXSDK_PRODUCT_MAJOR 9
|
||||
#define _DXSDK_PRODUCT_MINOR 29
|
||||
#define _DXSDK_BUILD_MAJOR 1962
|
||||
#define _DXSDK_BUILD_MINOR 0
|
||||
|
||||
#endif // _DXSDKVER_H_
|
||||
|
||||
Vendored
+718
@@ -0,0 +1,718 @@
|
||||
/***************************************************************************
|
||||
*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
*
|
||||
* File: xma2defs.h
|
||||
* Content: Constants, data types and functions for XMA2 compressed audio.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __XMA2DEFS_INCLUDED__
|
||||
#define __XMA2DEFS_INCLUDED__
|
||||
|
||||
#include <sal.h> // Markers for documenting API semantics
|
||||
#include <winerror.h> // For S_OK, E_FAIL
|
||||
#include <audiodefs.h> // Basic data types and constants for audio work
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* Overview
|
||||
***************************************************************************/
|
||||
|
||||
// A typical XMA2 file contains these RIFF chunks:
|
||||
//
|
||||
// 'fmt' or 'XMA2' chunk (or both): A description of the XMA data's structure
|
||||
// and characteristics (length, channels, sample rate, loops, block size, etc).
|
||||
//
|
||||
// 'seek' chunk: A seek table to help navigate the XMA data.
|
||||
//
|
||||
// 'data' chunk: The encoded XMA2 data.
|
||||
//
|
||||
// The encoded XMA2 data is structured as a set of BLOCKS, which contain PACKETS,
|
||||
// which contain FRAMES, which contain SUBFRAMES (roughly speaking). The frames
|
||||
// in a file may also be divided into several subsets, called STREAMS.
|
||||
//
|
||||
// FRAME: A variable-sized segment of XMA data that decodes to exactly 512 mono
|
||||
// or stereo PCM samples. This is the smallest unit of XMA data that can
|
||||
// be decoded in isolation. Frames are an arbitrary number of bits in
|
||||
// length, and need not be byte-aligned. See "XMA frame structure" below.
|
||||
//
|
||||
// SUBFRAME: A region of bits in an XMA frame that decodes to 128 mono or stereo
|
||||
// samples. The XMA decoder cannot decode a subframe in isolation; it needs
|
||||
// a whole frame to work with. However, it can begin emitting the frame's
|
||||
// decoded samples at any one of the four subframe boundaries. Subframes
|
||||
// can be addressed for seeking and looping purposes.
|
||||
//
|
||||
// PACKET: A 2Kb region containing a 32-bit header and some XMA frames. Frames
|
||||
// can (and usually do) span packets. A packet's header includes the offset
|
||||
// in bits of the first frame that begins within that packet. All of the
|
||||
// frames that begin in a given packet belong to the same "stream" (see the
|
||||
// Multichannel Audio section below).
|
||||
//
|
||||
// STREAM: A set of packets within an XMA file that all contain data for the
|
||||
// same mono or stereo component of a PCM file with more than two channels.
|
||||
// The packets comprising a given stream may be interleaved with each other
|
||||
// more or less arbitrarily; see Multichannel Audio.
|
||||
//
|
||||
// BLOCK: An array of XMA packets; or, to break it down differently, a series of
|
||||
// consecutive XMA frames, padded at the end with reserved data. A block
|
||||
// must contain at least one 2Kb packet per stream, and it can hold up to
|
||||
// 4095 packets (8190Kb), but its size is typically in the 32Kb-128Kb range.
|
||||
// (The size chosen involves a trade-off between memory use and efficiency
|
||||
// of reading from permanent storage.)
|
||||
//
|
||||
// XMA frames do not span blocks, so a block is guaranteed to begin with a
|
||||
// set of complete frames, one per stream. Also, a block in a multi-stream
|
||||
// XMA2 file always contains the same number of samples for each stream;
|
||||
// see Multichannel Audio.
|
||||
//
|
||||
// The 'data' chunk in an XMA2 file is an array of XMA2WAVEFORMAT.BlockCount XMA
|
||||
// blocks, all the same size (as specified in XMA2WAVEFORMAT.BlockSizeInBytes)
|
||||
// except for the last one, which may be shorter.
|
||||
|
||||
|
||||
// MULTICHANNEL AUDIO: the XMA decoder can only decode raw XMA data into either
|
||||
// mono or stereo PCM data. In order to encode a 6-channel file (say), the file
|
||||
// must be deinterleaved into 3 stereo streams that are encoded independently,
|
||||
// producing 3 encoded XMA data streams. Then the packets in these 3 streams
|
||||
// are interleaved to produce a single XMA2 file, and some information is added
|
||||
// to the file so that the original 6-channel audio can be reconstructed at
|
||||
// decode time. This works using the concept of an XMA stream (see above).
|
||||
//
|
||||
// The frames for all the streams in an XMA file are interleaved in an arbitrary
|
||||
// order. To locate a frame that belongs to a given stream in a given XMA block,
|
||||
// you must examine the first few packets in the block. Here (and only here) the
|
||||
// packets are guaranteed to be presented in stream order, so that all frames
|
||||
// beginning in packet 0 belong to stream 0 (the first stereo pair), etc.
|
||||
//
|
||||
// (This means that when decoding multi-stream XMA files, only entire XMA blocks
|
||||
// should be submitted to the decoder; otherwise it cannot know which frames
|
||||
// belong to which stream.)
|
||||
//
|
||||
// Once you have one frame that belongs to a given stream, you can find the next
|
||||
// one by looking at the frame's 'NextFrameOffsetBits' value (which is stored in
|
||||
// its first 15 bits; see XMAFRAME below). The GetXmaFrameBitPosition function
|
||||
// uses this technique.
|
||||
|
||||
|
||||
// SEEKING IN XMA2 FILES: Here is some pseudocode to find the byte position and
|
||||
// subframe in an XMA2 file which will contain sample S when decoded.
|
||||
//
|
||||
// 1. Traverse the seek table to find the XMA2 block containing sample S. The
|
||||
// seek table is an array of big-endian DWORDs, one per block in the file.
|
||||
// The Nth DWORD is the total number of PCM samples that would be obtained
|
||||
// by decoding the entire XMA file up to the end of block N. Hence, the
|
||||
// block we want is the first one whose seek table entry is greater than S.
|
||||
// (See the GetXmaBlockContainingSample helper function.)
|
||||
//
|
||||
// 2. Calculate which frame F within the block found above contains sample S.
|
||||
// Since each frame decodes to 512 samples, this is straightforward. The
|
||||
// first frame in the block produces samples X to X + 512, where X is the
|
||||
// seek table entry for the prior block. So F is (S - X) / 512.
|
||||
//
|
||||
// 3. Find the bit offset within the block where frame F starts. Since frames
|
||||
// are variable-sized, this can only be done by traversing all the frames in
|
||||
// the block until we reach frame F. (See GetXmaFrameBitPosition.)
|
||||
//
|
||||
// 4. Frame F has four 128-sample subframes. To find the subframe containing S,
|
||||
// we can use the formula (S % 512) / 128.
|
||||
//
|
||||
// In the case of multi-stream XMA files, sample S is a multichannel sample with
|
||||
// parts coming from several frames, one per stream. To find all these frames,
|
||||
// steps 2-4 need to be repeated for each stream N, using the knowledge that the
|
||||
// first packets in a block are presented in stream order. The frame traversal
|
||||
// in step 3 must be started at the first frame in the Nth packet of the block,
|
||||
// which will be the first frame for stream N. (And the packet header will tell
|
||||
// you the first frame's start position within the packet.)
|
||||
//
|
||||
// Step 1 can be performed using the GetXmaBlockContainingSample function below,
|
||||
// and steps 2-4 by calling GetXmaDecodePositionForSample once for each stream.
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* XMA constants
|
||||
***************************************************************************/
|
||||
|
||||
// Size of the PCM samples produced by the XMA decoder
|
||||
#define XMA_OUTPUT_SAMPLE_BYTES 2u
|
||||
#define XMA_OUTPUT_SAMPLE_BITS (XMA_OUTPUT_SAMPLE_BYTES * 8u)
|
||||
|
||||
// Size of an XMA packet
|
||||
#define XMA_BYTES_PER_PACKET 2048u
|
||||
#define XMA_BITS_PER_PACKET (XMA_BYTES_PER_PACKET * 8u)
|
||||
|
||||
// Size of an XMA packet header
|
||||
#define XMA_PACKET_HEADER_BYTES 4u
|
||||
#define XMA_PACKET_HEADER_BITS (XMA_PACKET_HEADER_BYTES * 8u)
|
||||
|
||||
// Sample blocks in a decoded XMA frame
|
||||
#define XMA_SAMPLES_PER_FRAME 512u
|
||||
|
||||
// Sample blocks in a decoded XMA subframe
|
||||
#define XMA_SAMPLES_PER_SUBFRAME 128u
|
||||
|
||||
// Maximum encoded data that can be submitted to the XMA decoder at a time
|
||||
#define XMA_READBUFFER_MAX_PACKETS 4095u
|
||||
#define XMA_READBUFFER_MAX_BYTES (XMA_READBUFFER_MAX_PACKETS * XMA_BYTES_PER_PACKET)
|
||||
|
||||
// Maximum size allowed for the XMA decoder's output buffers
|
||||
#define XMA_WRITEBUFFER_MAX_BYTES (31u * 256u)
|
||||
|
||||
// Required byte alignment of the XMA decoder's output buffers
|
||||
#define XMA_WRITEBUFFER_BYTE_ALIGNMENT 256u
|
||||
|
||||
// Decode chunk sizes for the XMA_PLAYBACK_INIT.subframesToDecode field
|
||||
#define XMA_MIN_SUBFRAMES_TO_DECODE 1u
|
||||
#define XMA_MAX_SUBFRAMES_TO_DECODE 8u
|
||||
#define XMA_OPTIMAL_SUBFRAMES_TO_DECODE 4u
|
||||
|
||||
// LoopCount<255 means finite repetitions; LoopCount=255 means infinite looping
|
||||
#define XMA_MAX_LOOPCOUNT 254u
|
||||
#define XMA_INFINITE_LOOP 255u
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* XMA format structures
|
||||
***************************************************************************/
|
||||
|
||||
// The currently recommended way to express format information for XMA2 files
|
||||
// is the XMA2WAVEFORMATEX structure. This structure is fully compliant with
|
||||
// the WAVEFORMATEX standard and contains all the information needed to parse
|
||||
// and manage XMA2 files in a compact way.
|
||||
|
||||
#define WAVE_FORMAT_XMA2 0x166
|
||||
|
||||
typedef struct XMA2WAVEFORMATEX
|
||||
{
|
||||
WAVEFORMATEX wfx;
|
||||
// Meaning of the WAVEFORMATEX fields here:
|
||||
// wFormatTag; // Audio format type; always WAVE_FORMAT_XMA2
|
||||
// nChannels; // Channel count of the decoded audio
|
||||
// nSamplesPerSec; // Sample rate of the decoded audio
|
||||
// nAvgBytesPerSec; // Used internally by the XMA encoder
|
||||
// nBlockAlign; // Decoded sample size; channels * wBitsPerSample / 8
|
||||
// wBitsPerSample; // Bits per decoded mono sample; always 16 for XMA
|
||||
// cbSize; // Size in bytes of the rest of this structure (34)
|
||||
|
||||
WORD NumStreams; // Number of audio streams (1 or 2 channels each)
|
||||
DWORD ChannelMask; // Spatial positions of the channels in this file,
|
||||
// stored as SPEAKER_xxx values (see audiodefs.h)
|
||||
DWORD SamplesEncoded; // Total number of PCM samples the file decodes to
|
||||
DWORD BytesPerBlock; // XMA block size (but the last one may be shorter)
|
||||
DWORD PlayBegin; // First valid sample in the decoded audio
|
||||
DWORD PlayLength; // Length of the valid part of the decoded audio
|
||||
DWORD LoopBegin; // Beginning of the loop region in decoded sample terms
|
||||
DWORD LoopLength; // Length of the loop region in decoded sample terms
|
||||
BYTE LoopCount; // Number of loop repetitions; 255 = infinite
|
||||
BYTE EncoderVersion; // Version of XMA encoder that generated the file
|
||||
WORD BlockCount; // XMA blocks in file (and entries in its seek table)
|
||||
} XMA2WAVEFORMATEX, *PXMA2WAVEFORMATEX;
|
||||
|
||||
|
||||
// The legacy XMA format structures are described here for reference, but they
|
||||
// should not be used in new content. XMAWAVEFORMAT was the structure used in
|
||||
// XMA version 1 files. XMA2WAVEFORMAT was used in early XMA2 files; it is not
|
||||
// placed in the usual 'fmt' RIFF chunk but in its own 'XMA2' chunk.
|
||||
|
||||
#ifndef WAVE_FORMAT_XMA
|
||||
#define WAVE_FORMAT_XMA 0x0165
|
||||
|
||||
// Values used in the ChannelMask fields below. Similar to the SPEAKER_xxx
|
||||
// values defined in audiodefs.h, but modified to fit in a single byte.
|
||||
#ifndef XMA_SPEAKER_LEFT
|
||||
#define XMA_SPEAKER_LEFT 0x01
|
||||
#define XMA_SPEAKER_RIGHT 0x02
|
||||
#define XMA_SPEAKER_CENTER 0x04
|
||||
#define XMA_SPEAKER_LFE 0x08
|
||||
#define XMA_SPEAKER_LEFT_SURROUND 0x10
|
||||
#define XMA_SPEAKER_RIGHT_SURROUND 0x20
|
||||
#define XMA_SPEAKER_LEFT_BACK 0x40
|
||||
#define XMA_SPEAKER_RIGHT_BACK 0x80
|
||||
#endif
|
||||
|
||||
|
||||
// Used in XMAWAVEFORMAT for per-stream data
|
||||
typedef struct XMASTREAMFORMAT
|
||||
{
|
||||
DWORD PsuedoBytesPerSec; // Used by the XMA encoder (typo preserved for legacy reasons)
|
||||
DWORD SampleRate; // The stream's decoded sample rate (in XMA2 files,
|
||||
// this is the same for all streams in the file).
|
||||
DWORD LoopStart; // Bit offset of the frame containing the loop start
|
||||
// point, relative to the beginning of the stream.
|
||||
DWORD LoopEnd; // Bit offset of the frame containing the loop end.
|
||||
BYTE SubframeData; // Two 4-bit numbers specifying the exact location of
|
||||
// the loop points within the frames that contain them.
|
||||
// SubframeEnd: Subframe of the loop end frame where
|
||||
// the loop ends. Ranges from 0 to 3.
|
||||
// SubframeSkip: Subframes to skip in the start frame to
|
||||
// reach the loop. Ranges from 0 to 4.
|
||||
BYTE Channels; // Number of channels in the stream (1 or 2)
|
||||
WORD ChannelMask; // Spatial positions of the channels in the stream
|
||||
} XMASTREAMFORMAT;
|
||||
|
||||
// Legacy XMA1 format structure
|
||||
typedef struct XMAWAVEFORMAT
|
||||
{
|
||||
WORD FormatTag; // Audio format type (always WAVE_FORMAT_XMA)
|
||||
WORD BitsPerSample; // Bit depth (currently required to be 16)
|
||||
WORD EncodeOptions; // Options for XMA encoder/decoder
|
||||
WORD LargestSkip; // Largest skip used in interleaving streams
|
||||
WORD NumStreams; // Number of interleaved audio streams
|
||||
BYTE LoopCount; // Number of loop repetitions; 255 = infinite
|
||||
BYTE Version; // XMA encoder version that generated the file.
|
||||
// Always 3 or higher for XMA2 files.
|
||||
XMASTREAMFORMAT XmaStreams[1]; // Per-stream format information; the actual
|
||||
// array length is in the NumStreams field.
|
||||
} XMAWAVEFORMAT;
|
||||
|
||||
|
||||
// Used in XMA2WAVEFORMAT for per-stream data
|
||||
typedef struct XMA2STREAMFORMAT
|
||||
{
|
||||
BYTE Channels; // Number of channels in the stream (1 or 2)
|
||||
BYTE RESERVED; // Reserved for future use
|
||||
WORD ChannelMask; // Spatial positions of the channels in the stream
|
||||
} XMA2STREAMFORMAT;
|
||||
|
||||
// Legacy XMA2 format structure (big-endian byte ordering)
|
||||
typedef struct XMA2WAVEFORMAT
|
||||
{
|
||||
BYTE Version; // XMA encoder version that generated the file.
|
||||
// Always 3 or higher for XMA2 files.
|
||||
BYTE NumStreams; // Number of interleaved audio streams
|
||||
BYTE RESERVED; // Reserved for future use
|
||||
BYTE LoopCount; // Number of loop repetitions; 255 = infinite
|
||||
DWORD LoopBegin; // Loop begin point, in samples
|
||||
DWORD LoopEnd; // Loop end point, in samples
|
||||
DWORD SampleRate; // The file's decoded sample rate
|
||||
DWORD EncodeOptions; // Options for the XMA encoder/decoder
|
||||
DWORD PsuedoBytesPerSec; // Used internally by the XMA encoder
|
||||
DWORD BlockSizeInBytes; // Size in bytes of this file's XMA blocks (except
|
||||
// possibly the last one). Always a multiple of
|
||||
// 2Kb, since XMA blocks are arrays of 2Kb packets.
|
||||
DWORD SamplesEncoded; // Total number of PCM samples encoded in this file
|
||||
DWORD SamplesInSource; // Actual number of PCM samples in the source
|
||||
// material used to generate this file
|
||||
DWORD BlockCount; // Number of XMA blocks in this file (and hence
|
||||
// also the number of entries in its seek table)
|
||||
XMA2STREAMFORMAT Streams[1]; // Per-stream format information; the actual
|
||||
// array length is in the NumStreams field.
|
||||
} XMA2WAVEFORMAT;
|
||||
|
||||
#endif // #ifndef WAVE_FORMAT_XMA
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* XMA packet structure (in big-endian form)
|
||||
***************************************************************************/
|
||||
|
||||
typedef struct XMA2PACKET
|
||||
{
|
||||
int FrameCount : 6; // Number of XMA frames that begin in this packet
|
||||
int FrameOffsetInBits : 15; // Bit of XmaData where the first complete frame begins
|
||||
int PacketMetaData : 3; // Metadata stored in the packet (always 1 for XMA2)
|
||||
int PacketSkipCount : 8; // How many packets belonging to other streams must be
|
||||
// skipped to find the next packet belonging to this one
|
||||
BYTE XmaData[XMA_BYTES_PER_PACKET - sizeof(DWORD)]; // XMA encoded data
|
||||
} XMA2PACKET;
|
||||
|
||||
// E.g. if the first DWORD of a packet is 0x30107902:
|
||||
//
|
||||
// 001100 000001000001111 001 00000010
|
||||
// | | | |____ Skip 2 packets to find the next one for this stream
|
||||
// | | |___________ XMA2 signature (always 001)
|
||||
// | |_____________________ First frame starts 527 bits into packet
|
||||
// |________________________________ Packet contains 12 frames
|
||||
|
||||
|
||||
// Helper functions to extract the fields above from an XMA packet. (Note that
|
||||
// the bitfields cannot be read directly on little-endian architectures such as
|
||||
// the Intel x86, as they are laid out in big-endian form.)
|
||||
|
||||
__inline DWORD GetXmaPacketFrameCount(__in_bcount(1) const BYTE* pPacket)
|
||||
{
|
||||
return (DWORD)(pPacket[0] >> 2);
|
||||
}
|
||||
|
||||
__inline DWORD GetXmaPacketFirstFrameOffsetInBits(__in_bcount(3) const BYTE* pPacket)
|
||||
{
|
||||
return ((DWORD)(pPacket[0] & 0x3) << 13) |
|
||||
((DWORD)(pPacket[1]) << 5) |
|
||||
((DWORD)(pPacket[2]) >> 3);
|
||||
}
|
||||
|
||||
__inline DWORD GetXmaPacketMetadata(__in_bcount(3) const BYTE* pPacket)
|
||||
{
|
||||
return (DWORD)(pPacket[2] & 0x7);
|
||||
}
|
||||
|
||||
__inline DWORD GetXmaPacketSkipCount(__in_bcount(4) const BYTE* pPacket)
|
||||
{
|
||||
return (DWORD)(pPacket[3]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* XMA frame structure
|
||||
***************************************************************************/
|
||||
|
||||
// There is no way to represent the XMA frame as a C struct, since it is a
|
||||
// variable-sized string of bits that need not be stored at a byte-aligned
|
||||
// position in memory. This is the layout:
|
||||
//
|
||||
// XMAFRAME
|
||||
// {
|
||||
// LengthInBits: A 15-bit number representing the length of this frame.
|
||||
// XmaData: Encoded XMA data; its size in bits is (LengthInBits - 15).
|
||||
// }
|
||||
|
||||
// Size in bits of the frame's initial LengthInBits field
|
||||
#define XMA_BITS_IN_FRAME_LENGTH_FIELD 15
|
||||
|
||||
// Special LengthInBits value that marks an invalid final frame
|
||||
#define XMA_FINAL_FRAME_MARKER 0x7FFF
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* XMA helper functions
|
||||
***************************************************************************/
|
||||
|
||||
// We define a local ASSERT macro to equal the global one if it exists.
|
||||
// You can define XMA2DEFS_ASSERT in advance to override this default.
|
||||
#ifndef XMA2DEFS_ASSERT
|
||||
#ifdef ASSERT
|
||||
#define XMA2DEFS_ASSERT ASSERT
|
||||
#else
|
||||
#define XMA2DEFS_ASSERT(a) /* No-op by default */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
// GetXmaBlockContainingSample: Use a given seek table to find the XMA block
|
||||
// containing a given decoded sample. Note that the seek table entries in an
|
||||
// XMA file are stored in big-endian form and may need to be converted prior
|
||||
// to calling this function.
|
||||
|
||||
__inline HRESULT GetXmaBlockContainingSample
|
||||
(
|
||||
DWORD nBlockCount, // Blocks in the file (= seek table entries)
|
||||
__in_ecount(nBlockCount) const DWORD* pSeekTable, // Pointer to the seek table data
|
||||
DWORD nDesiredSample, // Decoded sample to locate
|
||||
__out DWORD* pnBlockContainingSample, // Index of the block containing the sample
|
||||
__out DWORD* pnSampleOffsetWithinBlock // Position of the sample in this block
|
||||
)
|
||||
{
|
||||
DWORD nPreviousTotalSamples = 0;
|
||||
DWORD nBlock;
|
||||
DWORD nTotalSamplesSoFar;
|
||||
|
||||
XMA2DEFS_ASSERT(pSeekTable);
|
||||
XMA2DEFS_ASSERT(pnBlockContainingSample);
|
||||
XMA2DEFS_ASSERT(pnSampleOffsetWithinBlock);
|
||||
|
||||
for (nBlock = 0; nBlock < nBlockCount; ++nBlock)
|
||||
{
|
||||
nTotalSamplesSoFar = pSeekTable[nBlock];
|
||||
if (nTotalSamplesSoFar > nDesiredSample)
|
||||
{
|
||||
*pnBlockContainingSample = nBlock;
|
||||
*pnSampleOffsetWithinBlock = nDesiredSample - nPreviousTotalSamples;
|
||||
return S_OK;
|
||||
}
|
||||
nPreviousTotalSamples = nTotalSamplesSoFar;
|
||||
}
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
// GetXmaFrameLengthInBits: Reads a given frame's LengthInBits field.
|
||||
|
||||
__inline DWORD GetXmaFrameLengthInBits
|
||||
(
|
||||
__in_bcount(nBitPosition / 8 + 3)
|
||||
__in const BYTE* pPacket, // Pointer to XMA packet[s] containing the frame
|
||||
DWORD nBitPosition // Bit offset of the frame within this packet
|
||||
)
|
||||
{
|
||||
DWORD nRegion;
|
||||
DWORD nBytePosition = nBitPosition / 8;
|
||||
DWORD nBitOffset = nBitPosition % 8;
|
||||
|
||||
if (nBitOffset < 2) // Only need to read 2 bytes (and might not be safe to read more)
|
||||
{
|
||||
nRegion = (DWORD)(pPacket[nBytePosition+0]) << 8 |
|
||||
(DWORD)(pPacket[nBytePosition+1]);
|
||||
return (nRegion >> (1 - nBitOffset)) & 0x7FFF; // Last 15 bits
|
||||
}
|
||||
else // Need to read 3 bytes
|
||||
{
|
||||
nRegion = (DWORD)(pPacket[nBytePosition+0]) << 16 |
|
||||
(DWORD)(pPacket[nBytePosition+1]) << 8 |
|
||||
(DWORD)(pPacket[nBytePosition+2]);
|
||||
return (nRegion >> (9 - nBitOffset)) & 0x7FFF; // Last 15 bits
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// GetXmaFrameBitPosition: Calculates the bit offset of a given frame within
|
||||
// an XMA block or set of blocks. Returns 0 on failure.
|
||||
|
||||
__inline DWORD GetXmaFrameBitPosition
|
||||
(
|
||||
__in_bcount(nXmaDataBytes) const BYTE* pXmaData, // Pointer to XMA block[s]
|
||||
DWORD nXmaDataBytes, // Size of pXmaData in bytes
|
||||
DWORD nStreamIndex, // Stream within which to seek
|
||||
DWORD nDesiredFrame // Frame sought
|
||||
)
|
||||
{
|
||||
const BYTE* pCurrentPacket;
|
||||
DWORD nPacketsExamined = 0;
|
||||
DWORD nFrameCountSoFar = 0;
|
||||
DWORD nFramesToSkip;
|
||||
DWORD nFrameBitOffset;
|
||||
|
||||
XMA2DEFS_ASSERT(pXmaData);
|
||||
XMA2DEFS_ASSERT(nXmaDataBytes % XMA_BYTES_PER_PACKET == 0);
|
||||
|
||||
// Get the first XMA packet belonging to the desired stream, relying on the
|
||||
// fact that the first packets for each stream are in consecutive order at
|
||||
// the beginning of an XMA block.
|
||||
|
||||
pCurrentPacket = pXmaData + nStreamIndex * XMA_BYTES_PER_PACKET;
|
||||
for (;;)
|
||||
{
|
||||
// If we have exceeded the size of the XMA data, return failure
|
||||
if (pCurrentPacket + XMA_BYTES_PER_PACKET > pXmaData + nXmaDataBytes)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// If the current packet contains the frame we are looking for...
|
||||
if (nFrameCountSoFar + GetXmaPacketFrameCount(pCurrentPacket) > nDesiredFrame)
|
||||
{
|
||||
// See how many frames in this packet we need to skip to get to it
|
||||
XMA2DEFS_ASSERT(nDesiredFrame >= nFrameCountSoFar);
|
||||
nFramesToSkip = nDesiredFrame - nFrameCountSoFar;
|
||||
|
||||
// Get the bit offset of the first frame in this packet
|
||||
nFrameBitOffset = XMA_PACKET_HEADER_BITS + GetXmaPacketFirstFrameOffsetInBits(pCurrentPacket);
|
||||
|
||||
// Advance nFrameBitOffset to the frame of interest
|
||||
while (nFramesToSkip--)
|
||||
{
|
||||
nFrameBitOffset += GetXmaFrameLengthInBits(pCurrentPacket, nFrameBitOffset);
|
||||
}
|
||||
|
||||
// The bit offset to return is the number of bits from pXmaData to
|
||||
// pCurrentPacket plus the bit offset of the frame of interest
|
||||
return (DWORD)(pCurrentPacket - pXmaData) * 8 + nFrameBitOffset;
|
||||
}
|
||||
|
||||
// If we haven't found the right packet yet, advance our counters
|
||||
++nPacketsExamined;
|
||||
nFrameCountSoFar += GetXmaPacketFrameCount(pCurrentPacket);
|
||||
|
||||
// And skip to the next packet belonging to the same stream
|
||||
pCurrentPacket += XMA_BYTES_PER_PACKET * (GetXmaPacketSkipCount(pCurrentPacket) + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// GetLastXmaFrameBitPosition: Calculates the bit offset of the last complete
|
||||
// frame in an XMA block or set of blocks.
|
||||
|
||||
__inline DWORD GetLastXmaFrameBitPosition
|
||||
(
|
||||
__in_bcount(nXmaDataBytes) const BYTE* pXmaData, // Pointer to XMA block[s]
|
||||
DWORD nXmaDataBytes, // Size of pXmaData in bytes
|
||||
DWORD nStreamIndex // Stream within which to seek
|
||||
)
|
||||
{
|
||||
const BYTE* pLastPacket;
|
||||
DWORD nBytesToNextPacket;
|
||||
DWORD nFrameBitOffset;
|
||||
DWORD nFramesInLastPacket;
|
||||
|
||||
XMA2DEFS_ASSERT(pXmaData);
|
||||
XMA2DEFS_ASSERT(nXmaDataBytes % XMA_BYTES_PER_PACKET == 0);
|
||||
XMA2DEFS_ASSERT(nXmaDataBytes >= XMA_BYTES_PER_PACKET * (nStreamIndex + 1));
|
||||
|
||||
// Get the first XMA packet belonging to the desired stream, relying on the
|
||||
// fact that the first packets for each stream are in consecutive order at
|
||||
// the beginning of an XMA block.
|
||||
pLastPacket = pXmaData + nStreamIndex * XMA_BYTES_PER_PACKET;
|
||||
|
||||
// Search for the last packet belonging to the desired stream
|
||||
for (;;)
|
||||
{
|
||||
nBytesToNextPacket = XMA_BYTES_PER_PACKET * (GetXmaPacketSkipCount(pLastPacket) + 1);
|
||||
XMA2DEFS_ASSERT(nBytesToNextPacket);
|
||||
if (pLastPacket + nBytesToNextPacket + XMA_BYTES_PER_PACKET > pXmaData + nXmaDataBytes)
|
||||
{
|
||||
break; // The next packet would extend beyond the end of pXmaData
|
||||
}
|
||||
pLastPacket += nBytesToNextPacket;
|
||||
}
|
||||
|
||||
// The last packet can sometimes have no seekable frames, in which case we
|
||||
// have to use the previous one
|
||||
if (GetXmaPacketFrameCount(pLastPacket) == 0)
|
||||
{
|
||||
pLastPacket -= nBytesToNextPacket;
|
||||
}
|
||||
|
||||
// Found the last packet. Get the bit offset of its first frame.
|
||||
nFrameBitOffset = XMA_PACKET_HEADER_BITS + GetXmaPacketFirstFrameOffsetInBits(pLastPacket);
|
||||
|
||||
// Traverse frames until we reach the last one
|
||||
nFramesInLastPacket = GetXmaPacketFrameCount(pLastPacket);
|
||||
while (--nFramesInLastPacket)
|
||||
{
|
||||
nFrameBitOffset += GetXmaFrameLengthInBits(pLastPacket, nFrameBitOffset);
|
||||
}
|
||||
|
||||
// The bit offset to return is the number of bits from pXmaData to
|
||||
// pLastPacket plus the offset of the last frame in this packet.
|
||||
return (DWORD)(pLastPacket - pXmaData) * 8 + nFrameBitOffset;
|
||||
}
|
||||
|
||||
|
||||
// GetXmaDecodePositionForSample: Obtains the information needed to make the
|
||||
// decoder generate audio starting at a given sample position relative to the
|
||||
// beginning of the given XMA block: the bit offset of the appropriate frame,
|
||||
// and the right subframe within that frame. This data can be passed directly
|
||||
// to the XMAPlaybackSetDecodePosition function.
|
||||
|
||||
__inline HRESULT GetXmaDecodePositionForSample
|
||||
(
|
||||
__in_bcount(nXmaDataBytes) const BYTE* pXmaData, // Pointer to XMA block[s]
|
||||
DWORD nXmaDataBytes, // Size of pXmaData in bytes
|
||||
DWORD nStreamIndex, // Stream within which to seek
|
||||
DWORD nDesiredSample, // Sample sought
|
||||
__out DWORD* pnBitOffset, // Returns the bit offset within pXmaData of
|
||||
// the frame containing the sample sought
|
||||
__out DWORD* pnSubFrame // Returns the subframe containing the sample
|
||||
)
|
||||
{
|
||||
DWORD nDesiredFrame = nDesiredSample / XMA_SAMPLES_PER_FRAME;
|
||||
DWORD nSubFrame = (nDesiredSample % XMA_SAMPLES_PER_FRAME) / XMA_SAMPLES_PER_SUBFRAME;
|
||||
DWORD nBitOffset = GetXmaFrameBitPosition(pXmaData, nXmaDataBytes, nStreamIndex, nDesiredFrame);
|
||||
|
||||
XMA2DEFS_ASSERT(pnBitOffset);
|
||||
XMA2DEFS_ASSERT(pnSubFrame);
|
||||
|
||||
if (nBitOffset)
|
||||
{
|
||||
*pnBitOffset = nBitOffset;
|
||||
*pnSubFrame = nSubFrame;
|
||||
return S_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// GetXmaSampleRate: Obtains the legal XMA sample rate (24, 32, 44.1 or 48Khz)
|
||||
// corresponding to a generic sample rate.
|
||||
|
||||
__inline DWORD GetXmaSampleRate(DWORD dwGeneralRate)
|
||||
{
|
||||
DWORD dwXmaRate = 48000; // Default XMA rate for all rates above 44100Hz
|
||||
|
||||
if (dwGeneralRate <= 24000) dwXmaRate = 24000;
|
||||
else if (dwGeneralRate <= 32000) dwXmaRate = 32000;
|
||||
else if (dwGeneralRate <= 44100) dwXmaRate = 44100;
|
||||
|
||||
return dwXmaRate;
|
||||
}
|
||||
|
||||
|
||||
// Functions to convert between WAVEFORMATEXTENSIBLE channel masks (combinations
|
||||
// of the SPEAKER_xxx flags defined in audiodefs.h) and XMA channel masks (which
|
||||
// are limited to eight possible speaker positions: left, right, center, low
|
||||
// frequency, side left, side right, back left and back right).
|
||||
|
||||
__inline DWORD GetStandardChannelMaskFromXmaMask(BYTE bXmaMask)
|
||||
{
|
||||
DWORD dwStandardMask = 0;
|
||||
|
||||
if (bXmaMask & XMA_SPEAKER_LEFT) dwStandardMask |= SPEAKER_FRONT_LEFT;
|
||||
if (bXmaMask & XMA_SPEAKER_RIGHT) dwStandardMask |= SPEAKER_FRONT_RIGHT;
|
||||
if (bXmaMask & XMA_SPEAKER_CENTER) dwStandardMask |= SPEAKER_FRONT_CENTER;
|
||||
if (bXmaMask & XMA_SPEAKER_LFE) dwStandardMask |= SPEAKER_LOW_FREQUENCY;
|
||||
if (bXmaMask & XMA_SPEAKER_LEFT_SURROUND) dwStandardMask |= SPEAKER_SIDE_LEFT;
|
||||
if (bXmaMask & XMA_SPEAKER_RIGHT_SURROUND) dwStandardMask |= SPEAKER_SIDE_RIGHT;
|
||||
if (bXmaMask & XMA_SPEAKER_LEFT_BACK) dwStandardMask |= SPEAKER_BACK_LEFT;
|
||||
if (bXmaMask & XMA_SPEAKER_RIGHT_BACK) dwStandardMask |= SPEAKER_BACK_RIGHT;
|
||||
|
||||
return dwStandardMask;
|
||||
}
|
||||
|
||||
__inline BYTE GetXmaChannelMaskFromStandardMask(DWORD dwStandardMask)
|
||||
{
|
||||
BYTE bXmaMask = 0;
|
||||
|
||||
if (dwStandardMask & SPEAKER_FRONT_LEFT) bXmaMask |= XMA_SPEAKER_LEFT;
|
||||
if (dwStandardMask & SPEAKER_FRONT_RIGHT) bXmaMask |= XMA_SPEAKER_RIGHT;
|
||||
if (dwStandardMask & SPEAKER_FRONT_CENTER) bXmaMask |= XMA_SPEAKER_CENTER;
|
||||
if (dwStandardMask & SPEAKER_LOW_FREQUENCY) bXmaMask |= XMA_SPEAKER_LFE;
|
||||
if (dwStandardMask & SPEAKER_SIDE_LEFT) bXmaMask |= XMA_SPEAKER_LEFT_SURROUND;
|
||||
if (dwStandardMask & SPEAKER_SIDE_RIGHT) bXmaMask |= XMA_SPEAKER_RIGHT_SURROUND;
|
||||
if (dwStandardMask & SPEAKER_BACK_LEFT) bXmaMask |= XMA_SPEAKER_LEFT_BACK;
|
||||
if (dwStandardMask & SPEAKER_BACK_RIGHT) bXmaMask |= XMA_SPEAKER_RIGHT_BACK;
|
||||
|
||||
return bXmaMask;
|
||||
}
|
||||
|
||||
|
||||
// LocalizeXma2Format: Modifies a XMA2WAVEFORMATEX structure in place to comply
|
||||
// with the current platform's byte-ordering rules (little- or big-endian).
|
||||
|
||||
__inline HRESULT LocalizeXma2Format(__inout XMA2WAVEFORMATEX* pXma2Format)
|
||||
{
|
||||
#define XMASWAP2BYTES(n) ((WORD)(((n) >> 8) | (((n) & 0xff) << 8)))
|
||||
#define XMASWAP4BYTES(n) ((DWORD)((n) >> 24 | (n) << 24 | ((n) & 0xff00) << 8 | ((n) & 0xff0000) >> 8))
|
||||
|
||||
if (pXma2Format->wfx.wFormatTag == WAVE_FORMAT_XMA2)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
else if (XMASWAP2BYTES(pXma2Format->wfx.wFormatTag) == WAVE_FORMAT_XMA2)
|
||||
{
|
||||
pXma2Format->wfx.wFormatTag = XMASWAP2BYTES(pXma2Format->wfx.wFormatTag);
|
||||
pXma2Format->wfx.nChannels = XMASWAP2BYTES(pXma2Format->wfx.nChannels);
|
||||
pXma2Format->wfx.nSamplesPerSec = XMASWAP4BYTES(pXma2Format->wfx.nSamplesPerSec);
|
||||
pXma2Format->wfx.nAvgBytesPerSec = XMASWAP4BYTES(pXma2Format->wfx.nAvgBytesPerSec);
|
||||
pXma2Format->wfx.nBlockAlign = XMASWAP2BYTES(pXma2Format->wfx.nBlockAlign);
|
||||
pXma2Format->wfx.wBitsPerSample = XMASWAP2BYTES(pXma2Format->wfx.wBitsPerSample);
|
||||
pXma2Format->wfx.cbSize = XMASWAP2BYTES(pXma2Format->wfx.cbSize);
|
||||
pXma2Format->NumStreams = XMASWAP2BYTES(pXma2Format->NumStreams);
|
||||
pXma2Format->ChannelMask = XMASWAP4BYTES(pXma2Format->ChannelMask);
|
||||
pXma2Format->SamplesEncoded = XMASWAP4BYTES(pXma2Format->SamplesEncoded);
|
||||
pXma2Format->BytesPerBlock = XMASWAP4BYTES(pXma2Format->BytesPerBlock);
|
||||
pXma2Format->PlayBegin = XMASWAP4BYTES(pXma2Format->PlayBegin);
|
||||
pXma2Format->PlayLength = XMASWAP4BYTES(pXma2Format->PlayLength);
|
||||
pXma2Format->LoopBegin = XMASWAP4BYTES(pXma2Format->LoopBegin);
|
||||
pXma2Format->LoopLength = XMASWAP4BYTES(pXma2Format->LoopLength);
|
||||
pXma2Format->BlockCount = XMASWAP2BYTES(pXma2Format->BlockCount);
|
||||
return S_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
return E_FAIL; // Not a recognizable XMA2 format
|
||||
}
|
||||
|
||||
#undef XMASWAP2BYTES
|
||||
#undef XMASWAP4BYTES
|
||||
}
|
||||
|
||||
|
||||
#endif // #ifndef __XMA2DEFS_INCLUDED__
|
||||
+1
Submodule 3rdparty/cereal added at 42a45b6e15
+1
Submodule 3rdparty/ffmpeg added at 2f6023d14a
+1
Submodule 3rdparty/libpng added at ea77a6fd49
Vendored
+3768
File diff suppressed because it is too large
Load Diff
Vendored
+2529
File diff suppressed because it is too large
Load Diff
+924
@@ -0,0 +1,924 @@
|
||||
|
||||
/*=========================================================================*\
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
File: D2D1_1Helper.h
|
||||
|
||||
Module Name: D2D
|
||||
|
||||
Description: Helper files over the D2D interfaces and APIs.
|
||||
|
||||
\*=========================================================================*/
|
||||
#pragma once
|
||||
|
||||
#ifndef _D2D1_1HELPER_H_
|
||||
#define _D2D1_1HELPER_H_
|
||||
|
||||
#ifndef _D2D1_1_H_
|
||||
#include <d2d1_1.h>
|
||||
#endif // #ifndef _D2D1_H_
|
||||
|
||||
#ifndef D2D_USE_C_DEFINITIONS
|
||||
|
||||
#include <winapifamily.h>
|
||||
|
||||
#pragma region Application Family
|
||||
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
|
||||
|
||||
namespace D2D1
|
||||
{
|
||||
template<>
|
||||
struct TypeTraits<INT32>
|
||||
{
|
||||
typedef D2D1_POINT_2L Point;
|
||||
typedef D2D1_RECT_L Rect;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct TypeTraits<LONG>
|
||||
{
|
||||
typedef D2D1_POINT_2L Point;
|
||||
typedef D2D1_RECT_L Rect;
|
||||
};
|
||||
|
||||
class Matrix4x3F : public D2D1_MATRIX_4X3_F
|
||||
{
|
||||
public:
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
inline
|
||||
Matrix4x3F(
|
||||
FLOAT m11, FLOAT m12, FLOAT m13,
|
||||
FLOAT m21, FLOAT m22, FLOAT m23,
|
||||
FLOAT m31, FLOAT m32, FLOAT m33,
|
||||
FLOAT m41, FLOAT m42, FLOAT m43
|
||||
)
|
||||
{
|
||||
_11 = m11;
|
||||
_12 = m12;
|
||||
_13 = m13;
|
||||
|
||||
_21 = m21;
|
||||
_22 = m22;
|
||||
_23 = m23;
|
||||
|
||||
_31 = m31;
|
||||
_32 = m32;
|
||||
_33 = m33;
|
||||
|
||||
_41 = m41;
|
||||
_42 = m42;
|
||||
_43 = m43;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
inline
|
||||
Matrix4x3F()
|
||||
{
|
||||
_11 = 1;
|
||||
_12 = 0;
|
||||
_13 = 0;
|
||||
|
||||
_21 = 0;
|
||||
_22 = 1;
|
||||
_23 = 0;
|
||||
|
||||
_31 = 0;
|
||||
_32 = 0;
|
||||
_33 = 1;
|
||||
|
||||
_41 = 0;
|
||||
_42 = 0;
|
||||
_43 = 0;
|
||||
}
|
||||
};
|
||||
|
||||
class Matrix4x4F : public D2D1_MATRIX_4X4_F
|
||||
{
|
||||
public:
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
inline
|
||||
Matrix4x4F(
|
||||
FLOAT m11, FLOAT m12, FLOAT m13, FLOAT m14,
|
||||
FLOAT m21, FLOAT m22, FLOAT m23, FLOAT m24,
|
||||
FLOAT m31, FLOAT m32, FLOAT m33, FLOAT m34,
|
||||
FLOAT m41, FLOAT m42, FLOAT m43, FLOAT m44
|
||||
)
|
||||
{
|
||||
_11 = m11;
|
||||
_12 = m12;
|
||||
_13 = m13;
|
||||
_14 = m14;
|
||||
|
||||
_21 = m21;
|
||||
_22 = m22;
|
||||
_23 = m23;
|
||||
_24 = m24;
|
||||
|
||||
_31 = m31;
|
||||
_32 = m32;
|
||||
_33 = m33;
|
||||
_34 = m34;
|
||||
|
||||
_41 = m41;
|
||||
_42 = m42;
|
||||
_43 = m43;
|
||||
_44 = m44;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
inline
|
||||
Matrix4x4F()
|
||||
{
|
||||
_11 = 1;
|
||||
_12 = 0;
|
||||
_13 = 0;
|
||||
_14 = 0;
|
||||
|
||||
_21 = 0;
|
||||
_22 = 1;
|
||||
_23 = 0;
|
||||
_24 = 0;
|
||||
|
||||
_31 = 0;
|
||||
_32 = 0;
|
||||
_33 = 1;
|
||||
_34 = 0;
|
||||
|
||||
_41 = 0;
|
||||
_42 = 0;
|
||||
_43 = 0;
|
||||
_44 = 1;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
inline
|
||||
bool
|
||||
operator==(
|
||||
const Matrix4x4F& r
|
||||
) const
|
||||
{
|
||||
return _11 == r._11 && _12 == r._12 && _13 == r._13 && _14 == r._14 &&
|
||||
_21 == r._21 && _22 == r._22 && _23 == r._23 && _24 == r._24 &&
|
||||
_31 == r._31 && _32 == r._32 && _33 == r._33 && _34 == r._34 &&
|
||||
_41 == r._41 && _42 == r._42 && _43 == r._43 && _44 == r._44;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
inline
|
||||
bool
|
||||
operator!=(
|
||||
const Matrix4x4F& r
|
||||
) const
|
||||
{
|
||||
return !(*this == r);
|
||||
}
|
||||
|
||||
static
|
||||
COM_DECLSPEC_NOTHROW
|
||||
inline
|
||||
Matrix4x4F
|
||||
Translation(FLOAT x, FLOAT y, FLOAT z)
|
||||
{
|
||||
Matrix4x4F translation;
|
||||
|
||||
translation._11 = 1.0; translation._12 = 0.0; translation._13 = 0.0; translation._14 = 0.0;
|
||||
translation._21 = 0.0; translation._22 = 1.0; translation._23 = 0.0; translation._24 = 0.0;
|
||||
translation._31 = 0.0; translation._32 = 0.0; translation._33 = 1.0; translation._34 = 0.0;
|
||||
translation._41 = x; translation._42 = y; translation._43 = z; translation._44 = 1.0;
|
||||
|
||||
return translation;
|
||||
}
|
||||
|
||||
static
|
||||
COM_DECLSPEC_NOTHROW
|
||||
inline
|
||||
Matrix4x4F
|
||||
Scale(FLOAT x, FLOAT y, FLOAT z)
|
||||
{
|
||||
Matrix4x4F scale;
|
||||
|
||||
scale._11 = x; scale._12 = 0.0; scale._13 = 0.0; scale._14 = 0.0;
|
||||
scale._21 = 0.0; scale._22 = y; scale._23 = 0.0; scale._24 = 0.0;
|
||||
scale._31 = 0.0; scale._32 = 0.0; scale._33 = z; scale._34 = 0.0;
|
||||
scale._41 = 0.0; scale._42 = 0.0; scale._43 = 0.0; scale._44 = 1.0;
|
||||
|
||||
return scale;
|
||||
}
|
||||
|
||||
static
|
||||
COM_DECLSPEC_NOTHROW
|
||||
inline
|
||||
Matrix4x4F
|
||||
RotationX(FLOAT degreeX)
|
||||
{
|
||||
FLOAT angleInRadian = degreeX * (3.141592654f / 180.0f);
|
||||
|
||||
FLOAT sinAngle = 0.0;
|
||||
FLOAT cosAngle = 0.0;
|
||||
D2D1SinCos(angleInRadian, &sinAngle, &cosAngle);
|
||||
|
||||
Matrix4x4F rotationX(
|
||||
1, 0, 0, 0,
|
||||
0, cosAngle, sinAngle, 0,
|
||||
0, -sinAngle, cosAngle, 0,
|
||||
0, 0, 0, 1
|
||||
);
|
||||
|
||||
return rotationX;
|
||||
}
|
||||
|
||||
static
|
||||
COM_DECLSPEC_NOTHROW
|
||||
inline
|
||||
Matrix4x4F
|
||||
RotationY(FLOAT degreeY)
|
||||
{
|
||||
FLOAT angleInRadian = degreeY * (3.141592654f / 180.0f);
|
||||
|
||||
FLOAT sinAngle = 0.0;
|
||||
FLOAT cosAngle = 0.0;
|
||||
D2D1SinCos(angleInRadian, &sinAngle, &cosAngle);
|
||||
|
||||
Matrix4x4F rotationY(
|
||||
cosAngle, 0, -sinAngle, 0,
|
||||
0, 1, 0, 0,
|
||||
sinAngle, 0, cosAngle, 0,
|
||||
0, 0, 0, 1
|
||||
);
|
||||
|
||||
return rotationY;
|
||||
}
|
||||
|
||||
static
|
||||
COM_DECLSPEC_NOTHROW
|
||||
inline
|
||||
Matrix4x4F
|
||||
RotationZ(FLOAT degreeZ)
|
||||
{
|
||||
FLOAT angleInRadian = degreeZ * (3.141592654f / 180.0f);
|
||||
|
||||
FLOAT sinAngle = 0.0;
|
||||
FLOAT cosAngle = 0.0;
|
||||
D2D1SinCos(angleInRadian, &sinAngle, &cosAngle);
|
||||
|
||||
Matrix4x4F rotationZ(
|
||||
cosAngle, sinAngle, 0, 0,
|
||||
-sinAngle, cosAngle, 0, 0,
|
||||
0, 0, 1, 0,
|
||||
0, 0, 0, 1
|
||||
);
|
||||
|
||||
return rotationZ;
|
||||
}
|
||||
|
||||
//
|
||||
// 3D Rotation matrix for an arbitrary axis specified by x, y and z
|
||||
//
|
||||
static
|
||||
COM_DECLSPEC_NOTHROW
|
||||
inline
|
||||
Matrix4x4F
|
||||
RotationArbitraryAxis(FLOAT x, FLOAT y, FLOAT z, FLOAT degree)
|
||||
{
|
||||
// Normalize the vector represented by x, y, and z
|
||||
FLOAT magnitude = D2D1Vec3Length(x, y, z);
|
||||
x /= magnitude;
|
||||
y /= magnitude;
|
||||
z /= magnitude;
|
||||
|
||||
FLOAT angleInRadian = degree * (3.141592654f / 180.0f);
|
||||
|
||||
FLOAT sinAngle = 0.0;
|
||||
FLOAT cosAngle = 0.0;
|
||||
D2D1SinCos(angleInRadian, &sinAngle, &cosAngle);
|
||||
|
||||
FLOAT oneMinusCosAngle = 1 - cosAngle;
|
||||
|
||||
Matrix4x4F rotationArb(
|
||||
1 + oneMinusCosAngle * (x * x - 1),
|
||||
z * sinAngle + oneMinusCosAngle * x * y,
|
||||
-y * sinAngle + oneMinusCosAngle * x * z,
|
||||
0,
|
||||
|
||||
-z * sinAngle + oneMinusCosAngle * y * x,
|
||||
1 + oneMinusCosAngle * (y * y - 1),
|
||||
x * sinAngle + oneMinusCosAngle * y * z,
|
||||
0,
|
||||
|
||||
y * sinAngle + oneMinusCosAngle * z * x,
|
||||
-x * sinAngle + oneMinusCosAngle * z * y,
|
||||
1 + oneMinusCosAngle * (z * z - 1) ,
|
||||
0,
|
||||
|
||||
0, 0, 0, 1
|
||||
);
|
||||
|
||||
return rotationArb;
|
||||
}
|
||||
|
||||
static
|
||||
COM_DECLSPEC_NOTHROW
|
||||
inline
|
||||
Matrix4x4F
|
||||
SkewX(FLOAT degreeX)
|
||||
{
|
||||
FLOAT angleInRadian = degreeX * (3.141592654f / 180.0f);
|
||||
|
||||
FLOAT tanAngle = D2D1Tan(angleInRadian);
|
||||
|
||||
Matrix4x4F skewX(
|
||||
1, 0, 0, 0,
|
||||
tanAngle, 1, 0, 0,
|
||||
0, 0, 1, 0,
|
||||
0, 0, 0, 1
|
||||
);
|
||||
|
||||
return skewX;
|
||||
}
|
||||
|
||||
static
|
||||
COM_DECLSPEC_NOTHROW
|
||||
inline
|
||||
Matrix4x4F
|
||||
SkewY(FLOAT degreeY)
|
||||
{
|
||||
FLOAT angleInRadian = degreeY * (3.141592654f / 180.0f);
|
||||
|
||||
FLOAT tanAngle = D2D1Tan(angleInRadian);
|
||||
|
||||
Matrix4x4F skewY(
|
||||
1, tanAngle, 0, 0,
|
||||
0, 1, 0, 0,
|
||||
0, 0, 1, 0,
|
||||
0, 0, 0, 1
|
||||
);
|
||||
|
||||
return skewY;
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
COM_DECLSPEC_NOTHROW
|
||||
inline
|
||||
Matrix4x4F
|
||||
PerspectiveProjection(FLOAT depth)
|
||||
{
|
||||
float proj = 0;
|
||||
|
||||
if (depth > 0)
|
||||
{
|
||||
proj = -1/depth;
|
||||
}
|
||||
|
||||
Matrix4x4F projection(
|
||||
1, 0, 0, 0,
|
||||
0, 1, 0, 0,
|
||||
0, 0, 1, proj,
|
||||
0, 0, 0, 1
|
||||
);
|
||||
|
||||
return projection;
|
||||
}
|
||||
|
||||
//
|
||||
// Functions for convertion from the base D2D1_MATRIX_4X4_f to
|
||||
// this type without making a copy
|
||||
//
|
||||
static
|
||||
COM_DECLSPEC_NOTHROW
|
||||
inline
|
||||
const Matrix4x4F*
|
||||
ReinterpretBaseType(const D2D1_MATRIX_4X4_F *pMatrix)
|
||||
{
|
||||
return static_cast<const Matrix4x4F *>(pMatrix);
|
||||
}
|
||||
|
||||
static
|
||||
COM_DECLSPEC_NOTHROW
|
||||
inline
|
||||
Matrix4x4F*
|
||||
ReinterpretBaseType(D2D1_MATRIX_4X4_F *pMatrix)
|
||||
{
|
||||
return static_cast<Matrix4x4F *>(pMatrix);
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
inline
|
||||
FLOAT
|
||||
Determinant() const
|
||||
{
|
||||
FLOAT minor1 = _41 * (_12 * (_23 * _34 - _33 * _24) - _13 * (_22 * _34 - _24 * _32) + _14 * (_22 * _33 - _23 * _32));
|
||||
FLOAT minor2 = _42 * (_11 * (_21 * _34 - _31 * _24) - _13 * (_21 * _34 - _24 * _31) + _14 * (_21 * _33 - _23 * _31));
|
||||
FLOAT minor3 = _43 * (_11 * (_22 * _34 - _32 * _24) - _12 * (_21 * _34 - _24 * _31) + _14 * (_21 * _32 - _22 * _31));
|
||||
FLOAT minor4 = _44 * (_11 * (_22 * _33 - _32 * _23) - _12 * (_21 * _33 - _23 * _31) + _13 * (_21 * _32 - _22 * _31));
|
||||
|
||||
return minor1 - minor2 + minor3 - minor4;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
inline
|
||||
bool
|
||||
IsIdentity() const
|
||||
{
|
||||
return _11 == 1.f && _12 == 0.f && _13 == 0.f && _14 == 0.f
|
||||
&& _21 == 0.f && _22 == 1.f && _23 == 0.f && _24 == 0.f
|
||||
&& _31 == 0.f && _32 == 0.f && _33 == 1.f && _34 == 0.f
|
||||
&& _41 == 0.f && _42 == 0.f && _43 == 0.f && _44 == 1.f;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
inline
|
||||
void
|
||||
SetProduct(const Matrix4x4F &a, const Matrix4x4F &b)
|
||||
{
|
||||
_11 = a._11 * b._11 + a._12 * b._21 + a._13 * b._31 + a._14 * b._41;
|
||||
_12 = a._11 * b._12 + a._12 * b._22 + a._13 * b._32 + a._14 * b._42;
|
||||
_13 = a._11 * b._13 + a._12 * b._23 + a._13 * b._33 + a._14 * b._43;
|
||||
_14 = a._11 * b._14 + a._12 * b._24 + a._13 * b._34 + a._14 * b._44;
|
||||
|
||||
_21 = a._21 * b._11 + a._22 * b._21 + a._23 * b._31 + a._24 * b._41;
|
||||
_22 = a._21 * b._12 + a._22 * b._22 + a._23 * b._32 + a._24 * b._42;
|
||||
_23 = a._21 * b._13 + a._22 * b._23 + a._23 * b._33 + a._24 * b._43;
|
||||
_24 = a._21 * b._14 + a._22 * b._24 + a._23 * b._34 + a._24 * b._44;
|
||||
|
||||
_31 = a._31 * b._11 + a._32 * b._21 + a._33 * b._31 + a._34 * b._41;
|
||||
_32 = a._31 * b._12 + a._32 * b._22 + a._33 * b._32 + a._34 * b._42;
|
||||
_33 = a._31 * b._13 + a._32 * b._23 + a._33 * b._33 + a._34 * b._43;
|
||||
_34 = a._31 * b._14 + a._32 * b._24 + a._33 * b._34 + a._34 * b._44;
|
||||
|
||||
_41 = a._41 * b._11 + a._42 * b._21 + a._43 * b._31 + a._44 * b._41;
|
||||
_42 = a._41 * b._12 + a._42 * b._22 + a._43 * b._32 + a._44 * b._42;
|
||||
_43 = a._41 * b._13 + a._42 * b._23 + a._43 * b._33 + a._44 * b._43;
|
||||
_44 = a._41 * b._14 + a._42 * b._24 + a._43 * b._34 + a._44 * b._44;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
inline
|
||||
Matrix4x4F
|
||||
operator*(const Matrix4x4F &matrix) const
|
||||
{
|
||||
Matrix4x4F result;
|
||||
|
||||
result.SetProduct(*this, matrix);
|
||||
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class Matrix5x4F : public D2D1_MATRIX_5X4_F
|
||||
{
|
||||
public:
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
inline
|
||||
Matrix5x4F(
|
||||
FLOAT m11, FLOAT m12, FLOAT m13, FLOAT m14,
|
||||
FLOAT m21, FLOAT m22, FLOAT m23, FLOAT m24,
|
||||
FLOAT m31, FLOAT m32, FLOAT m33, FLOAT m34,
|
||||
FLOAT m41, FLOAT m42, FLOAT m43, FLOAT m44,
|
||||
FLOAT m51, FLOAT m52, FLOAT m53, FLOAT m54
|
||||
)
|
||||
{
|
||||
_11 = m11;
|
||||
_12 = m12;
|
||||
_13 = m13;
|
||||
_14 = m14;
|
||||
|
||||
_21 = m21;
|
||||
_22 = m22;
|
||||
_23 = m23;
|
||||
_24 = m24;
|
||||
|
||||
_31 = m31;
|
||||
_32 = m32;
|
||||
_33 = m33;
|
||||
_34 = m34;
|
||||
|
||||
_41 = m41;
|
||||
_42 = m42;
|
||||
_43 = m43;
|
||||
_44 = m44;
|
||||
|
||||
_51 = m51;
|
||||
_52 = m52;
|
||||
_53 = m53;
|
||||
_54 = m54;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
inline
|
||||
Matrix5x4F()
|
||||
{
|
||||
_11 = 1;
|
||||
_12 = 0;
|
||||
_13 = 0;
|
||||
_14 = 0;
|
||||
|
||||
_21 = 0;
|
||||
_22 = 1;
|
||||
_23 = 0;
|
||||
_24 = 0;
|
||||
|
||||
_31 = 0;
|
||||
_32 = 0;
|
||||
_33 = 1;
|
||||
_34 = 0;
|
||||
|
||||
_41 = 0;
|
||||
_42 = 0;
|
||||
_43 = 0;
|
||||
_44 = 1;
|
||||
|
||||
_51 = 0;
|
||||
_52 = 0;
|
||||
_53 = 0;
|
||||
_54 = 0;
|
||||
}
|
||||
};
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
inline
|
||||
D2D1_COLOR_F
|
||||
ConvertColorSpace(
|
||||
D2D1_COLOR_SPACE sourceColorSpace,
|
||||
D2D1_COLOR_SPACE destinationColorSpace,
|
||||
const D2D1_COLOR_F& color
|
||||
)
|
||||
{
|
||||
return D2D1ConvertColorSpace(
|
||||
sourceColorSpace,
|
||||
destinationColorSpace,
|
||||
&color
|
||||
);
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
D2D1FORCEINLINE
|
||||
D2D1_DRAWING_STATE_DESCRIPTION1
|
||||
DrawingStateDescription1(
|
||||
D2D1_ANTIALIAS_MODE antialiasMode = D2D1_ANTIALIAS_MODE_PER_PRIMITIVE,
|
||||
D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode = D2D1_TEXT_ANTIALIAS_MODE_DEFAULT,
|
||||
D2D1_TAG tag1 = 0,
|
||||
D2D1_TAG tag2 = 0,
|
||||
_In_ const D2D1_MATRIX_3X2_F &transform = D2D1::IdentityMatrix(),
|
||||
D2D1_PRIMITIVE_BLEND primitiveBlend = D2D1_PRIMITIVE_BLEND_SOURCE_OVER,
|
||||
D2D1_UNIT_MODE unitMode = D2D1_UNIT_MODE_DIPS
|
||||
)
|
||||
{
|
||||
D2D1_DRAWING_STATE_DESCRIPTION1 drawingStateDescription1;
|
||||
|
||||
drawingStateDescription1.antialiasMode = antialiasMode;
|
||||
drawingStateDescription1.textAntialiasMode = textAntialiasMode;
|
||||
drawingStateDescription1.tag1 = tag1;
|
||||
drawingStateDescription1.tag2 = tag2;
|
||||
drawingStateDescription1.transform = transform;
|
||||
drawingStateDescription1.primitiveBlend = primitiveBlend;
|
||||
drawingStateDescription1.unitMode = unitMode;
|
||||
|
||||
return drawingStateDescription1;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
D2D1FORCEINLINE
|
||||
D2D1_DRAWING_STATE_DESCRIPTION1
|
||||
DrawingStateDescription1(
|
||||
_In_ const D2D1_DRAWING_STATE_DESCRIPTION &desc,
|
||||
D2D1_PRIMITIVE_BLEND primitiveBlend = D2D1_PRIMITIVE_BLEND_SOURCE_OVER,
|
||||
D2D1_UNIT_MODE unitMode = D2D1_UNIT_MODE_DIPS
|
||||
)
|
||||
{
|
||||
D2D1_DRAWING_STATE_DESCRIPTION1 drawingStateDescription1;
|
||||
|
||||
drawingStateDescription1.antialiasMode = desc.antialiasMode;
|
||||
drawingStateDescription1.textAntialiasMode = desc.textAntialiasMode;
|
||||
drawingStateDescription1.tag1 = desc.tag1;
|
||||
drawingStateDescription1.tag2 = desc.tag2;
|
||||
drawingStateDescription1.transform = desc.transform;
|
||||
drawingStateDescription1.primitiveBlend = primitiveBlend;
|
||||
drawingStateDescription1.unitMode = unitMode;
|
||||
|
||||
return drawingStateDescription1;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
D2D1FORCEINLINE
|
||||
D2D1_BITMAP_PROPERTIES1
|
||||
BitmapProperties1(
|
||||
D2D1_BITMAP_OPTIONS bitmapOptions = D2D1_BITMAP_OPTIONS_NONE,
|
||||
_In_ CONST D2D1_PIXEL_FORMAT pixelFormat = D2D1::PixelFormat(),
|
||||
FLOAT dpiX = 96.0f,
|
||||
FLOAT dpiY = 96.0f,
|
||||
_In_opt_ ID2D1ColorContext *colorContext = NULL
|
||||
)
|
||||
{
|
||||
D2D1_BITMAP_PROPERTIES1 bitmapProperties =
|
||||
{
|
||||
pixelFormat,
|
||||
dpiX, dpiY,
|
||||
bitmapOptions,
|
||||
colorContext
|
||||
};
|
||||
|
||||
return bitmapProperties;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
D2D1FORCEINLINE
|
||||
D2D1_LAYER_PARAMETERS1
|
||||
LayerParameters1(
|
||||
_In_ CONST D2D1_RECT_F &contentBounds = D2D1::InfiniteRect(),
|
||||
_In_opt_ ID2D1Geometry *geometricMask = NULL,
|
||||
D2D1_ANTIALIAS_MODE maskAntialiasMode = D2D1_ANTIALIAS_MODE_PER_PRIMITIVE,
|
||||
D2D1_MATRIX_3X2_F maskTransform = D2D1::IdentityMatrix(),
|
||||
FLOAT opacity = 1.0,
|
||||
_In_opt_ ID2D1Brush *opacityBrush = NULL,
|
||||
D2D1_LAYER_OPTIONS1 layerOptions = D2D1_LAYER_OPTIONS1_NONE
|
||||
)
|
||||
{
|
||||
D2D1_LAYER_PARAMETERS1 layerParameters = { 0 };
|
||||
|
||||
layerParameters.contentBounds = contentBounds;
|
||||
layerParameters.geometricMask = geometricMask;
|
||||
layerParameters.maskAntialiasMode = maskAntialiasMode;
|
||||
layerParameters.maskTransform = maskTransform;
|
||||
layerParameters.opacity = opacity;
|
||||
layerParameters.opacityBrush = opacityBrush;
|
||||
layerParameters.layerOptions = layerOptions;
|
||||
|
||||
return layerParameters;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
D2D1FORCEINLINE
|
||||
D2D1_STROKE_STYLE_PROPERTIES1
|
||||
StrokeStyleProperties1(
|
||||
D2D1_CAP_STYLE startCap = D2D1_CAP_STYLE_FLAT,
|
||||
D2D1_CAP_STYLE endCap = D2D1_CAP_STYLE_FLAT,
|
||||
D2D1_CAP_STYLE dashCap = D2D1_CAP_STYLE_FLAT,
|
||||
D2D1_LINE_JOIN lineJoin = D2D1_LINE_JOIN_MITER,
|
||||
FLOAT miterLimit = 10.0f,
|
||||
D2D1_DASH_STYLE dashStyle = D2D1_DASH_STYLE_SOLID,
|
||||
FLOAT dashOffset = 0.0f,
|
||||
D2D1_STROKE_TRANSFORM_TYPE transformType = D2D1_STROKE_TRANSFORM_TYPE_NORMAL
|
||||
)
|
||||
{
|
||||
D2D1_STROKE_STYLE_PROPERTIES1 strokeStyleProperties;
|
||||
|
||||
strokeStyleProperties.startCap = startCap;
|
||||
strokeStyleProperties.endCap = endCap;
|
||||
strokeStyleProperties.dashCap = dashCap;
|
||||
strokeStyleProperties.lineJoin = lineJoin;
|
||||
strokeStyleProperties.miterLimit = miterLimit;
|
||||
strokeStyleProperties.dashStyle = dashStyle;
|
||||
strokeStyleProperties.dashOffset = dashOffset;
|
||||
strokeStyleProperties.transformType = transformType;
|
||||
|
||||
return strokeStyleProperties;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
D2D1FORCEINLINE
|
||||
D2D1_IMAGE_BRUSH_PROPERTIES
|
||||
ImageBrushProperties(
|
||||
D2D1_RECT_F sourceRectangle,
|
||||
D2D1_EXTEND_MODE extendModeX = D2D1_EXTEND_MODE_CLAMP,
|
||||
D2D1_EXTEND_MODE extendModeY = D2D1_EXTEND_MODE_CLAMP,
|
||||
D2D1_INTERPOLATION_MODE interpolationMode = D2D1_INTERPOLATION_MODE_LINEAR
|
||||
)
|
||||
{
|
||||
D2D1_IMAGE_BRUSH_PROPERTIES imageBrushProperties;
|
||||
|
||||
imageBrushProperties.extendModeX = extendModeX;
|
||||
imageBrushProperties.extendModeY = extendModeY;
|
||||
imageBrushProperties.interpolationMode = interpolationMode;
|
||||
imageBrushProperties.sourceRectangle = sourceRectangle;
|
||||
|
||||
return imageBrushProperties;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
D2D1FORCEINLINE
|
||||
D2D1_BITMAP_BRUSH_PROPERTIES1
|
||||
BitmapBrushProperties1(
|
||||
D2D1_EXTEND_MODE extendModeX = D2D1_EXTEND_MODE_CLAMP,
|
||||
D2D1_EXTEND_MODE extendModeY = D2D1_EXTEND_MODE_CLAMP,
|
||||
D2D1_INTERPOLATION_MODE interpolationMode = D2D1_INTERPOLATION_MODE_LINEAR
|
||||
)
|
||||
{
|
||||
D2D1_BITMAP_BRUSH_PROPERTIES1 bitmapBrush1Properties;
|
||||
|
||||
bitmapBrush1Properties.extendModeX = extendModeX;
|
||||
bitmapBrush1Properties.extendModeY = extendModeY;
|
||||
bitmapBrush1Properties.interpolationMode = interpolationMode;
|
||||
|
||||
return bitmapBrush1Properties;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
D2D1FORCEINLINE
|
||||
D2D1_PRINT_CONTROL_PROPERTIES
|
||||
PrintControlProperties(
|
||||
D2D1_PRINT_FONT_SUBSET_MODE fontSubsetMode = D2D1_PRINT_FONT_SUBSET_MODE_DEFAULT,
|
||||
FLOAT rasterDpi = 150.0f,
|
||||
D2D1_COLOR_SPACE colorSpace = D2D1_COLOR_SPACE_SRGB
|
||||
)
|
||||
{
|
||||
D2D1_PRINT_CONTROL_PROPERTIES printControlProps;
|
||||
|
||||
printControlProps.fontSubset = fontSubsetMode;
|
||||
printControlProps.rasterDPI = rasterDpi;
|
||||
printControlProps.colorSpace = colorSpace;
|
||||
|
||||
return printControlProps;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
D2D1FORCEINLINE
|
||||
D2D1_RENDERING_CONTROLS
|
||||
RenderingControls(
|
||||
D2D1_BUFFER_PRECISION bufferPrecision,
|
||||
D2D1_SIZE_U tileSize
|
||||
)
|
||||
{
|
||||
D2D1_RENDERING_CONTROLS renderingControls;
|
||||
|
||||
renderingControls.bufferPrecision = bufferPrecision;
|
||||
renderingControls.tileSize = tileSize;
|
||||
|
||||
return renderingControls;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
D2D1FORCEINLINE
|
||||
D2D1_EFFECT_INPUT_DESCRIPTION
|
||||
EffectInputDescription(
|
||||
ID2D1Effect *effect,
|
||||
UINT32 inputIndex,
|
||||
D2D1_RECT_F inputRectangle
|
||||
)
|
||||
{
|
||||
D2D1_EFFECT_INPUT_DESCRIPTION description;
|
||||
|
||||
description.effect = effect;
|
||||
description.inputIndex = inputIndex;
|
||||
description.inputRectangle = inputRectangle;
|
||||
|
||||
return description;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
D2D1FORCEINLINE
|
||||
D2D1_CREATION_PROPERTIES
|
||||
CreationProperties(
|
||||
D2D1_THREADING_MODE threadingMode,
|
||||
D2D1_DEBUG_LEVEL debugLevel,
|
||||
D2D1_DEVICE_CONTEXT_OPTIONS options
|
||||
)
|
||||
{
|
||||
D2D1_CREATION_PROPERTIES creationProperties;
|
||||
|
||||
creationProperties.threadingMode = threadingMode;
|
||||
creationProperties.debugLevel = debugLevel;
|
||||
creationProperties.options = options;
|
||||
|
||||
return creationProperties;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
D2D1FORCEINLINE
|
||||
D2D1_VECTOR_2F
|
||||
Vector2F(
|
||||
FLOAT x = 0.0f,
|
||||
FLOAT y = 0.0f
|
||||
)
|
||||
{
|
||||
D2D1_VECTOR_2F vec2 = {x, y};
|
||||
return vec2;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
D2D1FORCEINLINE
|
||||
D2D1_VECTOR_3F
|
||||
Vector3F(
|
||||
FLOAT x = 0.0f,
|
||||
FLOAT y = 0.0f,
|
||||
FLOAT z = 0.0f
|
||||
)
|
||||
{
|
||||
D2D1_VECTOR_3F vec3 = {x, y, z};
|
||||
return vec3;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
D2D1FORCEINLINE
|
||||
D2D1_VECTOR_4F
|
||||
Vector4F(
|
||||
FLOAT x = 0.0f,
|
||||
FLOAT y = 0.0f,
|
||||
FLOAT z = 0.0f,
|
||||
FLOAT w = 0.0f
|
||||
)
|
||||
{
|
||||
D2D1_VECTOR_4F vec4 = {x, y, z, w};
|
||||
return vec4;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
D2D1FORCEINLINE
|
||||
D2D1_POINT_2L
|
||||
Point2L(
|
||||
INT32 x = 0,
|
||||
INT32 y = 0
|
||||
)
|
||||
{
|
||||
return Point2<INT32>(x, y);
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
D2D1FORCEINLINE
|
||||
D2D1_RECT_L
|
||||
RectL(
|
||||
INT32 left = 0.f,
|
||||
INT32 top = 0.f,
|
||||
INT32 right = 0.f,
|
||||
INT32 bottom = 0.f
|
||||
)
|
||||
{
|
||||
return Rect<INT32>(left, top, right, bottom);
|
||||
}
|
||||
|
||||
//
|
||||
// Sets a bitmap as an effect input, while inserting a DPI compensation effect
|
||||
// to preserve visual appearance as the device context's DPI changes.
|
||||
//
|
||||
COM_DECLSPEC_NOTHROW
|
||||
D2D1FORCEINLINE
|
||||
HRESULT
|
||||
SetDpiCompensatedEffectInput(
|
||||
_In_ ID2D1DeviceContext *deviceContext,
|
||||
_In_ ID2D1Effect *effect,
|
||||
UINT32 inputIndex,
|
||||
_In_opt_ ID2D1Bitmap *inputBitmap,
|
||||
D2D1_INTERPOLATION_MODE interpolationMode = D2D1_INTERPOLATION_MODE_LINEAR,
|
||||
D2D1_BORDER_MODE borderMode = D2D1_BORDER_MODE_HARD
|
||||
)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
ID2D1Effect *dpiCompensationEffect = NULL;
|
||||
|
||||
if (!inputBitmap)
|
||||
{
|
||||
effect->SetInput(inputIndex, NULL);
|
||||
return hr;
|
||||
}
|
||||
|
||||
hr = deviceContext->CreateEffect(CLSID_D2D1DpiCompensation, &dpiCompensationEffect);
|
||||
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
dpiCompensationEffect->SetInput(0, inputBitmap);
|
||||
|
||||
D2D1_POINT_2F bitmapDpi;
|
||||
inputBitmap->GetDpi(&bitmapDpi.x, &bitmapDpi.y);
|
||||
hr = dpiCompensationEffect->SetValue(D2D1_DPICOMPENSATION_PROP_INPUT_DPI, bitmapDpi);
|
||||
}
|
||||
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
hr = dpiCompensationEffect->SetValue(D2D1_DPICOMPENSATION_PROP_INTERPOLATION_MODE, interpolationMode);
|
||||
}
|
||||
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
hr = dpiCompensationEffect->SetValue(D2D1_DPICOMPENSATION_PROP_BORDER_MODE, borderMode);
|
||||
}
|
||||
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
effect->SetInputEffect(inputIndex, dpiCompensationEffect);
|
||||
}
|
||||
|
||||
if (dpiCompensationEffect)
|
||||
{
|
||||
dpiCompensationEffect->Release();
|
||||
}
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
} // namespace D2D1
|
||||
|
||||
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
|
||||
#pragma endregion
|
||||
|
||||
#endif // #ifndef D2D_USE_C_DEFINITIONS
|
||||
|
||||
#endif // #ifndef _D2D1_HELPER_H_
|
||||
|
||||
Vendored
+204
@@ -0,0 +1,204 @@
|
||||
//---------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// This file is automatically generated. Please do not edit it directly.
|
||||
//
|
||||
// File name: D2D1_2.h
|
||||
//---------------------------------------------------------------------------
|
||||
#ifdef _MSC_VER
|
||||
#pragma once
|
||||
#endif // #ifdef _MSC_VER
|
||||
|
||||
#ifndef _D2D1_2_H_
|
||||
#define _D2D1_2_H_
|
||||
|
||||
#ifndef _D2D1_1_H_
|
||||
#include <d2d1_1.h>
|
||||
#endif // #ifndef _D2D1_1_H_
|
||||
#ifndef _D2D1_EFFECTS_1_
|
||||
#include <d2d1effects_1.h>
|
||||
#endif // #ifndef _D2D1_EFFECTS_1_
|
||||
|
||||
#include <winapifamily.h>
|
||||
|
||||
#pragma region Application Family
|
||||
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
|
||||
|
||||
#ifndef D2D_USE_C_DEFINITIONS
|
||||
|
||||
interface ID2D1Device1;
|
||||
#else
|
||||
|
||||
typedef interface ID2D1Device1 ID2D1Device1;
|
||||
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the extent to which D2D will throttle work sent to the GPU.
|
||||
/// </summary>
|
||||
typedef enum D2D1_RENDERING_PRIORITY
|
||||
{
|
||||
D2D1_RENDERING_PRIORITY_NORMAL = 0,
|
||||
D2D1_RENDERING_PRIORITY_LOW = 1,
|
||||
D2D1_RENDERING_PRIORITY_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_RENDERING_PRIORITY;
|
||||
|
||||
|
||||
#ifndef D2D_USE_C_DEFINITIONS
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Encapsulates a device- and transform-dependent representation of a filled or
|
||||
/// stroked geometry.
|
||||
/// </summary>
|
||||
interface DX_DECLARE_INTERFACE("a16907d7-bc02-4801-99e8-8cf7f485f774") ID2D1GeometryRealization : public ID2D1Resource
|
||||
{
|
||||
}; // interface ID2D1GeometryRealization
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Enables creation and drawing of geometry realization objects.
|
||||
/// </summary>
|
||||
interface DX_DECLARE_INTERFACE("d37f57e4-6908-459f-a199-e72f24f79987") ID2D1DeviceContext1 : public ID2D1DeviceContext
|
||||
{
|
||||
|
||||
STDMETHOD(CreateFilledGeometryRealization)(
|
||||
_In_ ID2D1Geometry *geometry,
|
||||
FLOAT flatteningTolerance,
|
||||
_COM_Outptr_ ID2D1GeometryRealization **geometryRealization
|
||||
) PURE;
|
||||
|
||||
STDMETHOD(CreateStrokedGeometryRealization)(
|
||||
_In_ ID2D1Geometry *geometry,
|
||||
FLOAT flatteningTolerance,
|
||||
FLOAT strokeWidth,
|
||||
_In_opt_ ID2D1StrokeStyle *strokeStyle,
|
||||
_COM_Outptr_ ID2D1GeometryRealization **geometryRealization
|
||||
) PURE;
|
||||
|
||||
STDMETHOD_(void, DrawGeometryRealization)(
|
||||
_In_ ID2D1GeometryRealization *geometryRealization,
|
||||
_In_ ID2D1Brush *brush
|
||||
) PURE;
|
||||
}; // interface ID2D1DeviceContext1
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Represents a resource domain whose objects and device contexts can be used
|
||||
/// together.
|
||||
/// </summary>
|
||||
interface DX_DECLARE_INTERFACE("d21768e1-23a4-4823-a14b-7c3eba85d658") ID2D1Device1 : public ID2D1Device
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the rendering priority currently set on the device.
|
||||
/// </summary>
|
||||
STDMETHOD_(D2D1_RENDERING_PRIORITY, GetRenderingPriority)(
|
||||
) PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Sets the rendering priority of the device.
|
||||
/// </summary>
|
||||
STDMETHOD_(void, SetRenderingPriority)(
|
||||
D2D1_RENDERING_PRIORITY renderingPriority
|
||||
) PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new device context with no initially assigned target.
|
||||
/// </summary>
|
||||
STDMETHOD(CreateDeviceContext)(
|
||||
D2D1_DEVICE_CONTEXT_OPTIONS options,
|
||||
_COM_Outptr_ ID2D1DeviceContext1 **deviceContext1
|
||||
) PURE;
|
||||
|
||||
using ID2D1Device::CreateDeviceContext;
|
||||
}; // interface ID2D1Device1
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Creates Direct2D resources. This interface also enables the creation of
|
||||
/// ID2D1Device1 objects.
|
||||
/// </summary>
|
||||
interface DX_DECLARE_INTERFACE("94f81a73-9212-4376-9c58-b16a3a0d3992") ID2D1Factory2 : public ID2D1Factory1
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// This creates a new Direct2D device from the given IDXGIDevice.
|
||||
/// </summary>
|
||||
STDMETHOD(CreateDevice)(
|
||||
_In_ IDXGIDevice *dxgiDevice,
|
||||
_COM_Outptr_ ID2D1Device1 **d2dDevice1
|
||||
) PURE;
|
||||
|
||||
using ID2D1Factory1::CreateDevice;
|
||||
}; // interface ID2D1Factory2
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// This interface performs all the same functions as the existing ID2D1CommandSink
|
||||
/// interface. It also enables access to the new primitive blend modes, MIN and ADD,
|
||||
/// through its SetPrimitiveBlend1 method.
|
||||
/// </summary>
|
||||
interface DX_DECLARE_INTERFACE("9eb767fd-4269-4467-b8c2-eb30cb305743") ID2D1CommandSink1 : public ID2D1CommandSink
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// This method is called if primitiveBlend value was added after Windows 8.
|
||||
/// SetPrimitiveBlend method is used for Win8 values (_SOURCE_OVER and _COPY).
|
||||
/// </summary>
|
||||
STDMETHOD(SetPrimitiveBlend1)(
|
||||
D2D1_PRIMITIVE_BLEND primitiveBlend
|
||||
) PURE;
|
||||
}; // interface ID2D1CommandSink1
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
EXTERN_C CONST IID IID_ID2D1GeometryRealization;
|
||||
EXTERN_C CONST IID IID_ID2D1DeviceContext1;
|
||||
EXTERN_C CONST IID IID_ID2D1Device1;
|
||||
EXTERN_C CONST IID IID_ID2D1Factory2;
|
||||
EXTERN_C CONST IID IID_ID2D1CommandSink1;
|
||||
|
||||
|
||||
#ifdef D2D_USE_C_DEFINITIONS
|
||||
|
||||
|
||||
typedef interface ID2D1GeometryRealization ID2D1GeometryRealization;
|
||||
|
||||
typedef interface ID2D1DeviceContext1 ID2D1DeviceContext1;
|
||||
|
||||
typedef interface ID2D1Device1 ID2D1Device1;
|
||||
|
||||
typedef interface ID2D1Factory2 ID2D1Factory2;
|
||||
|
||||
typedef interface ID2D1CommandSink1 ID2D1CommandSink1;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#if NTDDI_VERSION >= NTDDI_WINBLUE
|
||||
FLOAT WINAPI
|
||||
D2D1ComputeMaximumScaleFactor(
|
||||
_In_ CONST D2D1_MATRIX_3X2_F *matrix
|
||||
);
|
||||
#endif // #if NTDDI_VERSION >= NTDDI_WINBLUE
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
|
||||
#pragma endregion
|
||||
#include <d2d1_2helper.h>
|
||||
#endif // #ifndef _D2D1_2_H_
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
|
||||
/*=========================================================================*\
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
File: D2D1_2Helper.h
|
||||
|
||||
Module Name: D2D
|
||||
|
||||
Description: Helper files over the D2D interfaces and APIs.
|
||||
|
||||
\*=========================================================================*/
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma once
|
||||
#endif // _MSC_VER
|
||||
|
||||
#ifndef _D2D1_2HELPER_H_
|
||||
#define _D2D1_2HELPER_H_
|
||||
|
||||
#if NTDDI_VERSION >= NTDDI_WINBLUE
|
||||
|
||||
#ifndef _D2D1_2_H_
|
||||
#include <d2d1_2.h>
|
||||
#endif // #ifndef _D2D1_2_H_
|
||||
|
||||
#ifndef D2D_USE_C_DEFINITIONS
|
||||
|
||||
#include <winapifamily.h>
|
||||
|
||||
#pragma region Application Family
|
||||
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
|
||||
|
||||
namespace D2D1
|
||||
{
|
||||
COM_DECLSPEC_NOTHROW
|
||||
D2D1FORCEINLINE
|
||||
FLOAT
|
||||
ComputeFlatteningTolerance(
|
||||
_In_ CONST D2D1_MATRIX_3X2_F &matrix,
|
||||
FLOAT dpiX = 96.0f,
|
||||
FLOAT dpiY = 96.0f,
|
||||
FLOAT maxZoomFactor = 1.0f
|
||||
)
|
||||
{
|
||||
D2D1_MATRIX_3X2_F dpiDependentTransform =
|
||||
matrix * D2D1::Matrix3x2F::Scale(dpiX / 96.0f, dpiY / 96.0f);
|
||||
|
||||
FLOAT absMaxZoomFactor = (maxZoomFactor > 0) ? maxZoomFactor : -maxZoomFactor;
|
||||
|
||||
return D2D1_DEFAULT_FLATTENING_TOLERANCE /
|
||||
(absMaxZoomFactor * D2D1ComputeMaximumScaleFactor(&dpiDependentTransform));
|
||||
}
|
||||
|
||||
} // namespace D2D1
|
||||
|
||||
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
|
||||
#pragma endregion
|
||||
|
||||
#endif // #ifndef D2D_USE_C_DEFINITIONS
|
||||
|
||||
#endif // #if NTDDI_VERSION >= NTDDI_WINBLUE
|
||||
|
||||
#endif // #ifndef _D2D1_HELPER_H_
|
||||
|
||||
Vendored
+1535
File diff suppressed because it is too large
Load Diff
+238
@@ -0,0 +1,238 @@
|
||||
|
||||
/*=========================================================================*\
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
File: D2D1_3Helper.h
|
||||
|
||||
Module Name: D2D
|
||||
|
||||
Description: Helper files over the D2D interfaces and APIs.
|
||||
|
||||
\*=========================================================================*/
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma once
|
||||
#endif // _MSC_VER
|
||||
|
||||
#ifndef _D2D1_3HELPER_H_
|
||||
#define _D2D1_3HELPER_H_
|
||||
|
||||
#if NTDDI_VERSION >= NTDDI_WINTHRESHOLD
|
||||
|
||||
#ifndef _D2D1_3_H_
|
||||
#include <d2d1_3.h>
|
||||
#endif // #ifndef _D2D1_3_H_
|
||||
|
||||
#ifndef D2D_USE_C_DEFINITIONS
|
||||
|
||||
#include <winapifamily.h>
|
||||
|
||||
#pragma region Application Family
|
||||
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
|
||||
|
||||
namespace D2D1
|
||||
{
|
||||
COM_DECLSPEC_NOTHROW
|
||||
D2D1FORCEINLINE
|
||||
D2D1_GRADIENT_MESH_PATCH
|
||||
GradientMeshPatch(
|
||||
D2D1_POINT_2F point00,
|
||||
D2D1_POINT_2F point01,
|
||||
D2D1_POINT_2F point02,
|
||||
D2D1_POINT_2F point03,
|
||||
D2D1_POINT_2F point10,
|
||||
D2D1_POINT_2F point11,
|
||||
D2D1_POINT_2F point12,
|
||||
D2D1_POINT_2F point13,
|
||||
D2D1_POINT_2F point20,
|
||||
D2D1_POINT_2F point21,
|
||||
D2D1_POINT_2F point22,
|
||||
D2D1_POINT_2F point23,
|
||||
D2D1_POINT_2F point30,
|
||||
D2D1_POINT_2F point31,
|
||||
D2D1_POINT_2F point32,
|
||||
D2D1_POINT_2F point33,
|
||||
D2D1_COLOR_F color00,
|
||||
D2D1_COLOR_F color03,
|
||||
D2D1_COLOR_F color30,
|
||||
D2D1_COLOR_F color33,
|
||||
D2D1_PATCH_EDGE_MODE topEdgeMode,
|
||||
D2D1_PATCH_EDGE_MODE leftEdgeMode,
|
||||
D2D1_PATCH_EDGE_MODE bottomEdgeMode,
|
||||
D2D1_PATCH_EDGE_MODE rightEdgeMode
|
||||
)
|
||||
{
|
||||
D2D1_GRADIENT_MESH_PATCH newPatch;
|
||||
newPatch.point00 = point00;
|
||||
newPatch.point01 = point01;
|
||||
newPatch.point02 = point02;
|
||||
newPatch.point03 = point03;
|
||||
newPatch.point10 = point10;
|
||||
newPatch.point11 = point11;
|
||||
newPatch.point12 = point12;
|
||||
newPatch.point13 = point13;
|
||||
newPatch.point20 = point20;
|
||||
newPatch.point21 = point21;
|
||||
newPatch.point22 = point22;
|
||||
newPatch.point23 = point23;
|
||||
newPatch.point30 = point30;
|
||||
newPatch.point31 = point31;
|
||||
newPatch.point32 = point32;
|
||||
newPatch.point33 = point33;
|
||||
|
||||
newPatch.color00 = color00;
|
||||
newPatch.color03 = color03;
|
||||
newPatch.color30 = color30;
|
||||
newPatch.color33 = color33;
|
||||
|
||||
newPatch.topEdgeMode = topEdgeMode;
|
||||
newPatch.leftEdgeMode = leftEdgeMode;
|
||||
newPatch.bottomEdgeMode = bottomEdgeMode;
|
||||
newPatch.rightEdgeMode = rightEdgeMode;
|
||||
|
||||
return newPatch;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
D2D1FORCEINLINE
|
||||
D2D1_GRADIENT_MESH_PATCH
|
||||
GradientMeshPatchFromCoonsPatch(
|
||||
D2D1_POINT_2F point0,
|
||||
D2D1_POINT_2F point1,
|
||||
D2D1_POINT_2F point2,
|
||||
D2D1_POINT_2F point3,
|
||||
D2D1_POINT_2F point4,
|
||||
D2D1_POINT_2F point5,
|
||||
D2D1_POINT_2F point6,
|
||||
D2D1_POINT_2F point7,
|
||||
D2D1_POINT_2F point8,
|
||||
D2D1_POINT_2F point9,
|
||||
D2D1_POINT_2F point10,
|
||||
D2D1_POINT_2F point11,
|
||||
D2D1_COLOR_F color0,
|
||||
D2D1_COLOR_F color1,
|
||||
D2D1_COLOR_F color2,
|
||||
D2D1_COLOR_F color3,
|
||||
D2D1_PATCH_EDGE_MODE topEdgeMode,
|
||||
D2D1_PATCH_EDGE_MODE leftEdgeMode,
|
||||
D2D1_PATCH_EDGE_MODE bottomEdgeMode,
|
||||
D2D1_PATCH_EDGE_MODE rightEdgeMode
|
||||
)
|
||||
{
|
||||
D2D1_GRADIENT_MESH_PATCH newPatch;
|
||||
newPatch.point00 = point0;
|
||||
newPatch.point01 = point1;
|
||||
newPatch.point02 = point2;
|
||||
newPatch.point03 = point3;
|
||||
newPatch.point13 = point4;
|
||||
newPatch.point23 = point5;
|
||||
newPatch.point33 = point6;
|
||||
newPatch.point32 = point7;
|
||||
newPatch.point31 = point8;
|
||||
newPatch.point30 = point9;
|
||||
newPatch.point20 = point10;
|
||||
newPatch.point10 = point11;
|
||||
|
||||
D2D1GetGradientMeshInteriorPointsFromCoonsPatch(
|
||||
&point0,
|
||||
&point1,
|
||||
&point2,
|
||||
&point3,
|
||||
&point4,
|
||||
&point5,
|
||||
&point6,
|
||||
&point7,
|
||||
&point8,
|
||||
&point9,
|
||||
&point10,
|
||||
&point11,
|
||||
&newPatch.point11,
|
||||
&newPatch.point12,
|
||||
&newPatch.point21,
|
||||
&newPatch.point22
|
||||
);
|
||||
|
||||
newPatch.color00 = color0;
|
||||
newPatch.color03 = color1;
|
||||
newPatch.color33 = color2;
|
||||
newPatch.color30 = color3;
|
||||
newPatch.topEdgeMode = topEdgeMode;
|
||||
newPatch.leftEdgeMode = leftEdgeMode;
|
||||
newPatch.bottomEdgeMode = bottomEdgeMode;
|
||||
newPatch.rightEdgeMode = rightEdgeMode;
|
||||
|
||||
return newPatch;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
D2D1FORCEINLINE
|
||||
D2D1_INK_POINT
|
||||
InkPoint(
|
||||
const D2D1_POINT_2F &point,
|
||||
FLOAT radius
|
||||
)
|
||||
{
|
||||
D2D1_INK_POINT inkPoint;
|
||||
|
||||
inkPoint.x = point.x;
|
||||
inkPoint.y = point.y;
|
||||
inkPoint.radius = radius;
|
||||
|
||||
return inkPoint;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
D2D1FORCEINLINE
|
||||
D2D1_INK_BEZIER_SEGMENT
|
||||
InkBezierSegment(
|
||||
const D2D1_INK_POINT &point1,
|
||||
const D2D1_INK_POINT &point2,
|
||||
const D2D1_INK_POINT &point3
|
||||
)
|
||||
{
|
||||
D2D1_INK_BEZIER_SEGMENT inkBezierSegment;
|
||||
|
||||
inkBezierSegment.point1 = point1;
|
||||
inkBezierSegment.point2 = point2;
|
||||
inkBezierSegment.point3 = point3;
|
||||
|
||||
return inkBezierSegment;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
D2D1FORCEINLINE
|
||||
D2D1_INK_STYLE_PROPERTIES
|
||||
InkStyleProperties(
|
||||
D2D1_INK_NIB_SHAPE nibShape,
|
||||
const D2D1_MATRIX_3X2_F &nibTransform
|
||||
)
|
||||
{
|
||||
D2D1_INK_STYLE_PROPERTIES inkStyleProperties;
|
||||
|
||||
inkStyleProperties.nibShape = nibShape;
|
||||
inkStyleProperties.nibTransform = nibTransform;
|
||||
|
||||
return inkStyleProperties;
|
||||
}
|
||||
|
||||
COM_DECLSPEC_NOTHROW
|
||||
D2D1FORCEINLINE
|
||||
D2D1_RECT_U
|
||||
InfiniteRectU()
|
||||
{
|
||||
D2D1_RECT_U rect = { 0u, 0u, UINT_MAX, UINT_MAX };
|
||||
|
||||
return rect;
|
||||
}
|
||||
} // namespace D2D1
|
||||
|
||||
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
|
||||
#pragma endregion
|
||||
|
||||
#endif // #ifndef D2D_USE_C_DEFINITIONS
|
||||
|
||||
#endif // #if NTDDI_VERSION >= NTDDI_WINTHRESHOLD
|
||||
|
||||
#endif // #ifndef _D2D1_HELPER_H_
|
||||
|
||||
+1906
File diff suppressed because it is too large
Load Diff
+82
@@ -0,0 +1,82 @@
|
||||
//---------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// This file is automatically generated. Please do not edit it directly.
|
||||
//
|
||||
// File name: D2D1Effects_1.h
|
||||
//---------------------------------------------------------------------------
|
||||
#ifdef _MSC_VER
|
||||
#pragma once
|
||||
#endif // #ifdef _MSC_VER
|
||||
|
||||
#ifndef _D2D1_EFFECTS_1_
|
||||
#define _D2D1_EFFECTS_1_
|
||||
|
||||
#ifndef _D2D1_EFFECTS_
|
||||
#include <d2d1effects.h>
|
||||
#endif // #ifndef _D2D1_EFFECTS_
|
||||
|
||||
|
||||
#include <winapifamily.h>
|
||||
|
||||
#pragma region Application Family
|
||||
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
|
||||
|
||||
// Built in effect CLSIDs
|
||||
DEFINE_GUID(CLSID_D2D1YCbCr, 0x99503cc1, 0x66c7, 0x45c9, 0xa8, 0x75, 0x8a, 0xd8, 0xa7, 0x91, 0x44, 0x01);
|
||||
|
||||
/// <summary>
|
||||
/// The enumeration of the YCbCr effect's top level properties.
|
||||
/// </summary>
|
||||
typedef enum D2D1_YCBCR_PROP
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "ChromaSubsampling"
|
||||
/// Property Type: D2D1_YCBCR_CHROMA_SUBSAMPLING
|
||||
/// </summary>
|
||||
D2D1_YCBCR_PROP_CHROMA_SUBSAMPLING = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "TransformMatrix"
|
||||
/// Property Type: D2D1_MATRIX_3X2_F
|
||||
/// </summary>
|
||||
D2D1_YCBCR_PROP_TRANSFORM_MATRIX = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "InterpolationMode"
|
||||
/// Property Type: D2D1_YCBCR_INTERPOLATION_MODE
|
||||
/// </summary>
|
||||
D2D1_YCBCR_PROP_INTERPOLATION_MODE = 2,
|
||||
D2D1_YCBCR_PROP_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_YCBCR_PROP;
|
||||
|
||||
typedef enum D2D1_YCBCR_CHROMA_SUBSAMPLING
|
||||
{
|
||||
D2D1_YCBCR_CHROMA_SUBSAMPLING_AUTO = 0,
|
||||
D2D1_YCBCR_CHROMA_SUBSAMPLING_420 = 1,
|
||||
D2D1_YCBCR_CHROMA_SUBSAMPLING_422 = 2,
|
||||
D2D1_YCBCR_CHROMA_SUBSAMPLING_444 = 3,
|
||||
D2D1_YCBCR_CHROMA_SUBSAMPLING_440 = 4,
|
||||
D2D1_YCBCR_CHROMA_SUBSAMPLING_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_YCBCR_CHROMA_SUBSAMPLING;
|
||||
|
||||
typedef enum D2D1_YCBCR_INTERPOLATION_MODE
|
||||
{
|
||||
D2D1_YCBCR_INTERPOLATION_MODE_NEAREST_NEIGHBOR = 0,
|
||||
D2D1_YCBCR_INTERPOLATION_MODE_LINEAR = 1,
|
||||
D2D1_YCBCR_INTERPOLATION_MODE_CUBIC = 2,
|
||||
D2D1_YCBCR_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR = 3,
|
||||
D2D1_YCBCR_INTERPOLATION_MODE_ANISOTROPIC = 4,
|
||||
D2D1_YCBCR_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC = 5,
|
||||
D2D1_YCBCR_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_YCBCR_INTERPOLATION_MODE;
|
||||
|
||||
|
||||
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
|
||||
#pragma endregion
|
||||
|
||||
#endif // #ifndef _D2D1_EFFECTS_1_
|
||||
+535
@@ -0,0 +1,535 @@
|
||||
//---------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// This file is automatically generated. Please do not edit it directly.
|
||||
//
|
||||
// File name: D2D1Effects_2.h
|
||||
//---------------------------------------------------------------------------
|
||||
#ifdef _MSC_VER
|
||||
#pragma once
|
||||
#endif // #ifdef _MSC_VER
|
||||
|
||||
#ifndef _D2D1_EFFECTS_2_
|
||||
#define _D2D1_EFFECTS_2_
|
||||
|
||||
#ifndef _D2D1_EFFECTS_1_
|
||||
#include <d2d1effects_1.h>
|
||||
#endif // #ifndef _D2D1_EFFECTS_1_
|
||||
|
||||
|
||||
#include <winapifamily.h>
|
||||
|
||||
#pragma region Application Family
|
||||
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
|
||||
|
||||
// Built in effect CLSIDs
|
||||
DEFINE_GUID(CLSID_D2D1Contrast, 0xb648a78a, 0x0ed5, 0x4f80, 0xa9, 0x4a, 0x8e, 0x82, 0x5a, 0xca, 0x6b, 0x77);
|
||||
DEFINE_GUID(CLSID_D2D1RgbToHue, 0x23f3e5ec, 0x91e8, 0x4d3d, 0xad, 0x0a, 0xaf, 0xad, 0xc1, 0x00, 0x4a, 0xa1);
|
||||
DEFINE_GUID(CLSID_D2D1HueToRgb, 0x7b78a6bd, 0x0141, 0x4def, 0x8a, 0x52, 0x63, 0x56, 0xee, 0x0c, 0xbd, 0xd5);
|
||||
DEFINE_GUID(CLSID_D2D1ChromaKey, 0x74C01F5B, 0x2A0D, 0x408C, 0x88, 0xE2, 0xC7, 0xA3, 0xC7, 0x19, 0x77, 0x42);
|
||||
DEFINE_GUID(CLSID_D2D1Emboss, 0xb1c5eb2b, 0x0348, 0x43f0, 0x81, 0x07, 0x49, 0x57, 0xca, 0xcb, 0xa2, 0xae);
|
||||
DEFINE_GUID(CLSID_D2D1Exposure, 0xb56c8cfa, 0xf634, 0x41ee, 0xbe, 0xe0, 0xff, 0xa6, 0x17, 0x10, 0x60, 0x04);
|
||||
DEFINE_GUID(CLSID_D2D1Grayscale, 0x36DDE0EB, 0x3725, 0x42E0, 0x83, 0x6D, 0x52, 0xFB, 0x20, 0xAE, 0xE6, 0x44);
|
||||
DEFINE_GUID(CLSID_D2D1Invert, 0xe0c3784d, 0xcb39, 0x4e84, 0xb6, 0xfd, 0x6b, 0x72, 0xf0, 0x81, 0x02, 0x63);
|
||||
DEFINE_GUID(CLSID_D2D1Posterize, 0x2188945e, 0x33a3, 0x4366, 0xb7, 0xbc, 0x08, 0x6b, 0xd0, 0x2d, 0x08, 0x84);
|
||||
DEFINE_GUID(CLSID_D2D1Sepia, 0x3a1af410, 0x5f1d, 0x4dbe, 0x84, 0xdf, 0x91, 0x5d, 0xa7, 0x9b, 0x71, 0x53);
|
||||
DEFINE_GUID(CLSID_D2D1Sharpen, 0xC9B887CB, 0xC5FF, 0x4DC5, 0x97, 0x79, 0x27, 0x3D, 0xCF, 0x41, 0x7C, 0x7D);
|
||||
DEFINE_GUID(CLSID_D2D1Straighten, 0x4da47b12, 0x79a3, 0x4fb0, 0x82, 0x37, 0xbb, 0xc3, 0xb2, 0xa4, 0xde, 0x08);
|
||||
DEFINE_GUID(CLSID_D2D1TemperatureTint, 0x89176087, 0x8AF9, 0x4A08, 0xAE, 0xB1, 0x89, 0x5F, 0x38, 0xDB, 0x17, 0x66);
|
||||
DEFINE_GUID(CLSID_D2D1Vignette, 0xc00c40be, 0x5e67, 0x4ca3, 0x95, 0xb4, 0xf4, 0xb0, 0x2c, 0x11, 0x51, 0x35);
|
||||
DEFINE_GUID(CLSID_D2D1EdgeDetection, 0xEFF583CA, 0xCB07, 0x4AA9, 0xAC, 0x5D, 0x2C, 0xC4, 0x4C, 0x76, 0x46, 0x0F);
|
||||
DEFINE_GUID(CLSID_D2D1HighlightsShadows, 0xCADC8384, 0x323F, 0x4C7E, 0xA3, 0x61, 0x2E, 0x2B, 0x24, 0xDF, 0x6E, 0xE4);
|
||||
DEFINE_GUID(CLSID_D2D1LookupTable3D, 0x349E0EDA, 0x0088, 0x4A79, 0x9C, 0xA3, 0xC7, 0xE3, 0x00, 0x20, 0x20, 0x20);
|
||||
|
||||
#if NTDDI_VERSION >= NTDDI_WIN10_RS1
|
||||
|
||||
DEFINE_GUID(CLSID_D2D1Opacity, 0x811d79a4, 0xde28, 0x4454, 0x80, 0x94, 0xc6, 0x46, 0x85, 0xf8, 0xbd, 0x4c);
|
||||
DEFINE_GUID(CLSID_D2D1AlphaMask, 0xc80ecff0, 0x3fd5, 0x4f05, 0x83, 0x28, 0xc5, 0xd1, 0x72, 0x4b, 0x4f, 0x0a);
|
||||
DEFINE_GUID(CLSID_D2D1CrossFade, 0x12f575e8, 0x4db1, 0x485f, 0x9a, 0x84, 0x03, 0xa0, 0x7d, 0xd3, 0x82, 0x9f);
|
||||
DEFINE_GUID(CLSID_D2D1Tint, 0x36312b17, 0xf7dd, 0x4014, 0x91, 0x5d, 0xff, 0xca, 0x76, 0x8c, 0xf2, 0x11);
|
||||
|
||||
#endif // #if NTDDI_VERSION >= NTDDI_WIN10_RS1
|
||||
|
||||
/// <summary>
|
||||
/// The enumeration of the Contrast effect's top level properties.
|
||||
/// </summary>
|
||||
typedef enum D2D1_CONTRAST_PROP
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "Contrast"
|
||||
/// Property Type: FLOAT
|
||||
/// </summary>
|
||||
D2D1_CONTRAST_PROP_CONTRAST = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "ClampInput"
|
||||
/// Property Type: BOOL
|
||||
/// </summary>
|
||||
D2D1_CONTRAST_PROP_CLAMP_INPUT = 1,
|
||||
D2D1_CONTRAST_PROP_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_CONTRAST_PROP;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The enumeration of the RgbToHue effect's top level properties.
|
||||
/// </summary>
|
||||
typedef enum D2D1_RGBTOHUE_PROP
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "OutputColorSpace"
|
||||
/// Property Type: D2D1_RGBTOHUE_OUTPUT_COLOR_SPACE
|
||||
/// </summary>
|
||||
D2D1_RGBTOHUE_PROP_OUTPUT_COLOR_SPACE = 0,
|
||||
D2D1_RGBTOHUE_PROP_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_RGBTOHUE_PROP;
|
||||
|
||||
typedef enum D2D1_RGBTOHUE_OUTPUT_COLOR_SPACE
|
||||
{
|
||||
D2D1_RGBTOHUE_OUTPUT_COLOR_SPACE_HUE_SATURATION_VALUE = 0,
|
||||
D2D1_RGBTOHUE_OUTPUT_COLOR_SPACE_HUE_SATURATION_LIGHTNESS = 1,
|
||||
D2D1_RGBTOHUE_OUTPUT_COLOR_SPACE_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_RGBTOHUE_OUTPUT_COLOR_SPACE;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The enumeration of the HueToRgb effect's top level properties.
|
||||
/// </summary>
|
||||
typedef enum D2D1_HUETORGB_PROP
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "InputColorSpace"
|
||||
/// Property Type: D2D1_HUETORGB_INPUT_COLOR_SPACE
|
||||
/// </summary>
|
||||
D2D1_HUETORGB_PROP_INPUT_COLOR_SPACE = 0,
|
||||
D2D1_HUETORGB_PROP_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_HUETORGB_PROP;
|
||||
|
||||
typedef enum D2D1_HUETORGB_INPUT_COLOR_SPACE
|
||||
{
|
||||
D2D1_HUETORGB_INPUT_COLOR_SPACE_HUE_SATURATION_VALUE = 0,
|
||||
D2D1_HUETORGB_INPUT_COLOR_SPACE_HUE_SATURATION_LIGHTNESS = 1,
|
||||
D2D1_HUETORGB_INPUT_COLOR_SPACE_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_HUETORGB_INPUT_COLOR_SPACE;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The enumeration of the Chroma Key effect's top level properties.
|
||||
/// </summary>
|
||||
typedef enum D2D1_CHROMAKEY_PROP
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "Color"
|
||||
/// Property Type: D2D1_VECTOR_3F
|
||||
/// </summary>
|
||||
D2D1_CHROMAKEY_PROP_COLOR = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "Tolerance"
|
||||
/// Property Type: FLOAT
|
||||
/// </summary>
|
||||
D2D1_CHROMAKEY_PROP_TOLERANCE = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "InvertAlpha"
|
||||
/// Property Type: BOOL
|
||||
/// </summary>
|
||||
D2D1_CHROMAKEY_PROP_INVERT_ALPHA = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "Feather"
|
||||
/// Property Type: BOOL
|
||||
/// </summary>
|
||||
D2D1_CHROMAKEY_PROP_FEATHER = 3,
|
||||
D2D1_CHROMAKEY_PROP_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_CHROMAKEY_PROP;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The enumeration of the Emboss effect's top level properties.
|
||||
/// </summary>
|
||||
typedef enum D2D1_EMBOSS_PROP
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "Height"
|
||||
/// Property Type: FLOAT
|
||||
/// </summary>
|
||||
D2D1_EMBOSS_PROP_HEIGHT = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "Direction"
|
||||
/// Property Type: FLOAT
|
||||
/// </summary>
|
||||
D2D1_EMBOSS_PROP_DIRECTION = 1,
|
||||
D2D1_EMBOSS_PROP_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_EMBOSS_PROP;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The enumeration of the Exposure effect's top level properties.
|
||||
/// </summary>
|
||||
typedef enum D2D1_EXPOSURE_PROP
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "ExposureValue"
|
||||
/// Property Type: FLOAT
|
||||
/// </summary>
|
||||
D2D1_EXPOSURE_PROP_EXPOSURE_VALUE = 0,
|
||||
D2D1_EXPOSURE_PROP_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_EXPOSURE_PROP;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The enumeration of the Posterize effect's top level properties.
|
||||
/// </summary>
|
||||
typedef enum D2D1_POSTERIZE_PROP
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "RedValueCount"
|
||||
/// Property Type: UINT32
|
||||
/// </summary>
|
||||
D2D1_POSTERIZE_PROP_RED_VALUE_COUNT = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "GreenValueCount"
|
||||
/// Property Type: UINT32
|
||||
/// </summary>
|
||||
D2D1_POSTERIZE_PROP_GREEN_VALUE_COUNT = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "BlueValueCount"
|
||||
/// Property Type: UINT32
|
||||
/// </summary>
|
||||
D2D1_POSTERIZE_PROP_BLUE_VALUE_COUNT = 2,
|
||||
D2D1_POSTERIZE_PROP_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_POSTERIZE_PROP;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The enumeration of the Sepia effect's top level properties.
|
||||
/// </summary>
|
||||
typedef enum D2D1_SEPIA_PROP
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "Intensity"
|
||||
/// Property Type: FLOAT
|
||||
/// </summary>
|
||||
D2D1_SEPIA_PROP_INTENSITY = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "AlphaMode"
|
||||
/// Property Type: D2D1_ALPHA_MODE
|
||||
/// </summary>
|
||||
D2D1_SEPIA_PROP_ALPHA_MODE = 1,
|
||||
D2D1_SEPIA_PROP_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_SEPIA_PROP;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The enumeration of the Sharpen effect's top level properties.
|
||||
/// </summary>
|
||||
typedef enum D2D1_SHARPEN_PROP
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "Sharpness"
|
||||
/// Property Type: FLOAT
|
||||
/// </summary>
|
||||
D2D1_SHARPEN_PROP_SHARPNESS = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "Threshold"
|
||||
/// Property Type: FLOAT
|
||||
/// </summary>
|
||||
D2D1_SHARPEN_PROP_THRESHOLD = 1,
|
||||
D2D1_SHARPEN_PROP_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_SHARPEN_PROP;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The enumeration of the Straighten effect's top level properties.
|
||||
/// </summary>
|
||||
typedef enum D2D1_STRAIGHTEN_PROP
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "Angle"
|
||||
/// Property Type: FLOAT
|
||||
/// </summary>
|
||||
D2D1_STRAIGHTEN_PROP_ANGLE = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "MaintainSize"
|
||||
/// Property Type: BOOL
|
||||
/// </summary>
|
||||
D2D1_STRAIGHTEN_PROP_MAINTAIN_SIZE = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "ScaleMode"
|
||||
/// Property Type: D2D1_STRAIGHTEN_SCALE_MODE
|
||||
/// </summary>
|
||||
D2D1_STRAIGHTEN_PROP_SCALE_MODE = 2,
|
||||
D2D1_STRAIGHTEN_PROP_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_STRAIGHTEN_PROP;
|
||||
|
||||
typedef enum D2D1_STRAIGHTEN_SCALE_MODE
|
||||
{
|
||||
D2D1_STRAIGHTEN_SCALE_MODE_NEAREST_NEIGHBOR = 0,
|
||||
D2D1_STRAIGHTEN_SCALE_MODE_LINEAR = 1,
|
||||
D2D1_STRAIGHTEN_SCALE_MODE_CUBIC = 2,
|
||||
D2D1_STRAIGHTEN_SCALE_MODE_MULTI_SAMPLE_LINEAR = 3,
|
||||
D2D1_STRAIGHTEN_SCALE_MODE_ANISOTROPIC = 4,
|
||||
D2D1_STRAIGHTEN_SCALE_MODE_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_STRAIGHTEN_SCALE_MODE;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The enumeration of the Temperature And Tint effect's top level properties.
|
||||
/// </summary>
|
||||
typedef enum D2D1_TEMPERATUREANDTINT_PROP
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "Temperature"
|
||||
/// Property Type: FLOAT
|
||||
/// </summary>
|
||||
D2D1_TEMPERATUREANDTINT_PROP_TEMPERATURE = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "Tint"
|
||||
/// Property Type: FLOAT
|
||||
/// </summary>
|
||||
D2D1_TEMPERATUREANDTINT_PROP_TINT = 1,
|
||||
D2D1_TEMPERATUREANDTINT_PROP_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_TEMPERATUREANDTINT_PROP;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The enumeration of the Vignette effect's top level properties.
|
||||
/// </summary>
|
||||
typedef enum D2D1_VIGNETTE_PROP
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "Color"
|
||||
/// Property Type: D2D1_VECTOR_4F
|
||||
/// </summary>
|
||||
D2D1_VIGNETTE_PROP_COLOR = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "TransitionSize"
|
||||
/// Property Type: FLOAT
|
||||
/// </summary>
|
||||
D2D1_VIGNETTE_PROP_TRANSITION_SIZE = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "Strength"
|
||||
/// Property Type: FLOAT
|
||||
/// </summary>
|
||||
D2D1_VIGNETTE_PROP_STRENGTH = 2,
|
||||
D2D1_VIGNETTE_PROP_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_VIGNETTE_PROP;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The enumeration of the Edge Detection effect's top level properties.
|
||||
/// </summary>
|
||||
typedef enum D2D1_EDGEDETECTION_PROP
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "Strength"
|
||||
/// Property Type: FLOAT
|
||||
/// </summary>
|
||||
D2D1_EDGEDETECTION_PROP_STRENGTH = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "BlurRadius"
|
||||
/// Property Type: FLOAT
|
||||
/// </summary>
|
||||
D2D1_EDGEDETECTION_PROP_BLUR_RADIUS = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "Mode"
|
||||
/// Property Type: D2D1_EDGEDETECTION_MODE
|
||||
/// </summary>
|
||||
D2D1_EDGEDETECTION_PROP_MODE = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "OverlayEdges"
|
||||
/// Property Type: BOOL
|
||||
/// </summary>
|
||||
D2D1_EDGEDETECTION_PROP_OVERLAY_EDGES = 3,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "AlphaMode"
|
||||
/// Property Type: D2D1_ALPHA_MODE
|
||||
/// </summary>
|
||||
D2D1_EDGEDETECTION_PROP_ALPHA_MODE = 4,
|
||||
D2D1_EDGEDETECTION_PROP_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_EDGEDETECTION_PROP;
|
||||
|
||||
typedef enum D2D1_EDGEDETECTION_MODE
|
||||
{
|
||||
D2D1_EDGEDETECTION_MODE_SOBEL = 0,
|
||||
D2D1_EDGEDETECTION_MODE_PREWITT = 1,
|
||||
D2D1_EDGEDETECTION_MODE_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_EDGEDETECTION_MODE;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The enumeration of the Highlights and Shadows effect's top level properties.
|
||||
/// </summary>
|
||||
typedef enum D2D1_HIGHLIGHTSANDSHADOWS_PROP
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "Highlights"
|
||||
/// Property Type: FLOAT
|
||||
/// </summary>
|
||||
D2D1_HIGHLIGHTSANDSHADOWS_PROP_HIGHLIGHTS = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "Shadows"
|
||||
/// Property Type: FLOAT
|
||||
/// </summary>
|
||||
D2D1_HIGHLIGHTSANDSHADOWS_PROP_SHADOWS = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "Clarity"
|
||||
/// Property Type: FLOAT
|
||||
/// </summary>
|
||||
D2D1_HIGHLIGHTSANDSHADOWS_PROP_CLARITY = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "InputGamma"
|
||||
/// Property Type: D2D1_HIGHLIGHTSANDSHADOWS_INPUT_GAMMA
|
||||
/// </summary>
|
||||
D2D1_HIGHLIGHTSANDSHADOWS_PROP_INPUT_GAMMA = 3,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "MaskBlurRadius"
|
||||
/// Property Type: FLOAT
|
||||
/// </summary>
|
||||
D2D1_HIGHLIGHTSANDSHADOWS_PROP_MASK_BLUR_RADIUS = 4,
|
||||
D2D1_HIGHLIGHTSANDSHADOWS_PROP_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_HIGHLIGHTSANDSHADOWS_PROP;
|
||||
|
||||
typedef enum D2D1_HIGHLIGHTSANDSHADOWS_INPUT_GAMMA
|
||||
{
|
||||
D2D1_HIGHLIGHTSANDSHADOWS_INPUT_GAMMA_LINEAR = 0,
|
||||
D2D1_HIGHLIGHTSANDSHADOWS_INPUT_GAMMA_SRGB = 1,
|
||||
D2D1_HIGHLIGHTSANDSHADOWS_INPUT_GAMMA_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_HIGHLIGHTSANDSHADOWS_INPUT_GAMMA;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The enumeration of the Lookup Table 3D effect's top level properties.
|
||||
/// </summary>
|
||||
typedef enum D2D1_LOOKUPTABLE3D_PROP
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "Lut"
|
||||
/// Property Type: IUnknown *
|
||||
/// </summary>
|
||||
D2D1_LOOKUPTABLE3D_PROP_LUT = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "AlphaMode"
|
||||
/// Property Type: D2D1_ALPHA_MODE
|
||||
/// </summary>
|
||||
D2D1_LOOKUPTABLE3D_PROP_ALPHA_MODE = 1,
|
||||
D2D1_LOOKUPTABLE3D_PROP_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_LOOKUPTABLE3D_PROP;
|
||||
|
||||
|
||||
#if NTDDI_VERSION >= NTDDI_WIN10_RS1
|
||||
|
||||
/// <summary>
|
||||
/// The enumeration of the Opacity effect's top level properties.
|
||||
/// </summary>
|
||||
typedef enum D2D1_OPACITY_PROP
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "Opacity"
|
||||
/// Property Type: FLOAT
|
||||
/// </summary>
|
||||
D2D1_OPACITY_PROP_OPACITY = 0,
|
||||
D2D1_OPACITY_PROP_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_OPACITY_PROP;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The enumeration of the Cross Fade effect's top level properties.
|
||||
/// </summary>
|
||||
typedef enum D2D1_CROSSFADE_PROP
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "Weight"
|
||||
/// Property Type: FLOAT
|
||||
/// </summary>
|
||||
D2D1_CROSSFADE_PROP_WEIGHT = 0,
|
||||
D2D1_CROSSFADE_PROP_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_CROSSFADE_PROP;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The enumeration of the Tint effect's top level properties.
|
||||
/// </summary>
|
||||
typedef enum D2D1_TINT_PROP
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "Color"
|
||||
/// Property Type: D2D1_VECTOR_4F
|
||||
/// </summary>
|
||||
D2D1_TINT_PROP_COLOR = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Property Name: "ClampOutput"
|
||||
/// Property Type: BOOL
|
||||
/// </summary>
|
||||
D2D1_TINT_PROP_CLAMP_OUTPUT = 1,
|
||||
D2D1_TINT_PROP_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_TINT_PROP;
|
||||
|
||||
|
||||
#endif // #if NTDDI_VERSION >= NTDDI_WIN10_RS1
|
||||
|
||||
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
|
||||
#pragma endregion
|
||||
|
||||
#endif // #ifndef _D2D1_EFFECTS_2_
|
||||
Vendored
+6819
File diff suppressed because it is too large
Load Diff
Vendored
+1793
File diff suppressed because it is too large
Load Diff
+306
@@ -0,0 +1,306 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// File: D3D10_1Shader.h
|
||||
// Content: D3D10.1 Shader Types and APIs
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __D3D10_1SHADER_H__
|
||||
#define __D3D10_1SHADER_H__
|
||||
|
||||
#include "d3d10shader.h"
|
||||
|
||||
#include <winapifamily.h>
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Shader debugging structures
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef enum _D3D10_SHADER_DEBUG_REGTYPE
|
||||
{
|
||||
D3D10_SHADER_DEBUG_REG_INPUT,
|
||||
D3D10_SHADER_DEBUG_REG_OUTPUT,
|
||||
D3D10_SHADER_DEBUG_REG_CBUFFER,
|
||||
D3D10_SHADER_DEBUG_REG_TBUFFER,
|
||||
D3D10_SHADER_DEBUG_REG_TEMP,
|
||||
D3D10_SHADER_DEBUG_REG_TEMPARRAY,
|
||||
D3D10_SHADER_DEBUG_REG_TEXTURE,
|
||||
D3D10_SHADER_DEBUG_REG_SAMPLER,
|
||||
D3D10_SHADER_DEBUG_REG_IMMEDIATECBUFFER,
|
||||
D3D10_SHADER_DEBUG_REG_LITERAL,
|
||||
D3D10_SHADER_DEBUG_REG_UNUSED,
|
||||
D3D11_SHADER_DEBUG_REG_INTERFACE_POINTERS,
|
||||
D3D11_SHADER_DEBUG_REG_UAV,
|
||||
D3D10_SHADER_DEBUG_REG_FORCE_DWORD = 0x7fffffff,
|
||||
} D3D10_SHADER_DEBUG_REGTYPE;
|
||||
|
||||
typedef enum _D3D10_SHADER_DEBUG_SCOPETYPE
|
||||
{
|
||||
D3D10_SHADER_DEBUG_SCOPE_GLOBAL,
|
||||
D3D10_SHADER_DEBUG_SCOPE_BLOCK,
|
||||
D3D10_SHADER_DEBUG_SCOPE_FORLOOP,
|
||||
D3D10_SHADER_DEBUG_SCOPE_STRUCT,
|
||||
D3D10_SHADER_DEBUG_SCOPE_FUNC_PARAMS,
|
||||
D3D10_SHADER_DEBUG_SCOPE_STATEBLOCK,
|
||||
D3D10_SHADER_DEBUG_SCOPE_NAMESPACE,
|
||||
D3D10_SHADER_DEBUG_SCOPE_ANNOTATION,
|
||||
D3D10_SHADER_DEBUG_SCOPE_FORCE_DWORD = 0x7fffffff,
|
||||
} D3D10_SHADER_DEBUG_SCOPETYPE;
|
||||
|
||||
typedef enum _D3D10_SHADER_DEBUG_VARTYPE
|
||||
{
|
||||
D3D10_SHADER_DEBUG_VAR_VARIABLE,
|
||||
D3D10_SHADER_DEBUG_VAR_FUNCTION,
|
||||
D3D10_SHADER_DEBUG_VAR_FORCE_DWORD = 0x7fffffff,
|
||||
} D3D10_SHADER_DEBUG_VARTYPE;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// These are the serialized structures that get written to the file
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef struct _D3D10_SHADER_DEBUG_TOKEN_INFO
|
||||
{
|
||||
UINT File; // offset into file list
|
||||
UINT Line; // line #
|
||||
UINT Column; // column #
|
||||
|
||||
UINT TokenLength;
|
||||
UINT TokenId; // offset to LPCSTR of length TokenLength in string datastore
|
||||
} D3D10_SHADER_DEBUG_TOKEN_INFO;
|
||||
|
||||
// Variable list
|
||||
typedef struct _D3D10_SHADER_DEBUG_VAR_INFO
|
||||
{
|
||||
// Index into token list for declaring identifier
|
||||
UINT TokenId;
|
||||
D3D10_SHADER_VARIABLE_TYPE Type;
|
||||
// register and component for this variable, only valid/necessary for arrays
|
||||
UINT Register;
|
||||
UINT Component;
|
||||
// gives the original variable that declared this variable
|
||||
UINT ScopeVar;
|
||||
// this variable's offset in its ScopeVar
|
||||
UINT ScopeVarOffset;
|
||||
} D3D10_SHADER_DEBUG_VAR_INFO;
|
||||
|
||||
typedef struct _D3D10_SHADER_DEBUG_INPUT_INFO
|
||||
{
|
||||
// index into array of variables of variable to initialize
|
||||
UINT Var;
|
||||
// input, cbuffer, tbuffer
|
||||
D3D10_SHADER_DEBUG_REGTYPE InitialRegisterSet;
|
||||
// set to cbuffer or tbuffer slot, geometry shader input primitive #,
|
||||
// identifying register for indexable temp, or -1
|
||||
UINT InitialBank;
|
||||
// -1 if temp, otherwise gives register in register set
|
||||
UINT InitialRegister;
|
||||
// -1 if temp, otherwise gives component
|
||||
UINT InitialComponent;
|
||||
// initial value if literal
|
||||
UINT InitialValue;
|
||||
} D3D10_SHADER_DEBUG_INPUT_INFO;
|
||||
|
||||
typedef struct _D3D10_SHADER_DEBUG_SCOPEVAR_INFO
|
||||
{
|
||||
// Index into variable token
|
||||
UINT TokenId;
|
||||
|
||||
D3D10_SHADER_DEBUG_VARTYPE VarType; // variable or function (different namespaces)
|
||||
D3D10_SHADER_VARIABLE_CLASS Class;
|
||||
UINT Rows; // number of rows (matrices)
|
||||
UINT Columns; // number of columns (vectors and matrices)
|
||||
|
||||
// In an array of structures, one struct member scope is provided, and
|
||||
// you'll have to add the array stride times the index to the variable
|
||||
// index you find, then find that variable in this structure's list of
|
||||
// variables.
|
||||
|
||||
// gives a scope to look up struct members. -1 if not a struct
|
||||
UINT StructMemberScope;
|
||||
|
||||
// number of array indices
|
||||
UINT uArrayIndices; // a[3][2][1] has 3 indices
|
||||
// maximum array index for each index
|
||||
// offset to UINT[uArrayIndices] in UINT datastore
|
||||
UINT ArrayElements; // a[3][2][1] has {3, 2, 1}
|
||||
// how many variables each array index moves
|
||||
// offset to UINT[uArrayIndices] in UINT datastore
|
||||
UINT ArrayStrides; // a[3][2][1] has {2, 1, 1}
|
||||
|
||||
UINT uVariables;
|
||||
// index of the first variable, later variables are offsets from this one
|
||||
UINT uFirstVariable;
|
||||
} D3D10_SHADER_DEBUG_SCOPEVAR_INFO;
|
||||
|
||||
// scope data, this maps variable names to debug variables (useful for the watch window)
|
||||
typedef struct _D3D10_SHADER_DEBUG_SCOPE_INFO
|
||||
{
|
||||
D3D10_SHADER_DEBUG_SCOPETYPE ScopeType;
|
||||
UINT Name; // offset to name of scope in strings list
|
||||
UINT uNameLen; // length of name string
|
||||
UINT uVariables;
|
||||
UINT VariableData; // Offset to UINT[uVariables] indexing the Scope Variable list
|
||||
} D3D10_SHADER_DEBUG_SCOPE_INFO;
|
||||
|
||||
// instruction outputs
|
||||
typedef struct _D3D10_SHADER_DEBUG_OUTPUTVAR
|
||||
{
|
||||
// index variable being written to, if -1 it's not going to a variable
|
||||
UINT Var;
|
||||
// range data that the compiler expects to be true
|
||||
UINT uValueMin, uValueMax;
|
||||
INT iValueMin, iValueMax;
|
||||
FLOAT fValueMin, fValueMax;
|
||||
|
||||
BOOL bNaNPossible, bInfPossible;
|
||||
} D3D10_SHADER_DEBUG_OUTPUTVAR;
|
||||
|
||||
typedef struct _D3D10_SHADER_DEBUG_OUTPUTREG_INFO
|
||||
{
|
||||
// Only temp, indexable temp, and output are valid here
|
||||
D3D10_SHADER_DEBUG_REGTYPE OutputRegisterSet;
|
||||
// -1 means no output
|
||||
UINT OutputReg;
|
||||
// if a temp array, identifier for which one
|
||||
UINT TempArrayReg;
|
||||
// -1 means masked out
|
||||
UINT OutputComponents[4];
|
||||
D3D10_SHADER_DEBUG_OUTPUTVAR OutputVars[4];
|
||||
// when indexing the output, get the value of this register, then add
|
||||
// that to uOutputReg. If uIndexReg is -1, then there is no index.
|
||||
// find the variable whose register is the sum (by looking in the ScopeVar)
|
||||
// and component matches, then set it. This should only happen for indexable
|
||||
// temps and outputs.
|
||||
UINT IndexReg;
|
||||
UINT IndexComp;
|
||||
} D3D10_SHADER_DEBUG_OUTPUTREG_INFO;
|
||||
|
||||
// per instruction data
|
||||
typedef struct _D3D10_SHADER_DEBUG_INST_INFO
|
||||
{
|
||||
UINT Id; // Which instruction this is in the bytecode
|
||||
UINT Opcode; // instruction type
|
||||
|
||||
// 0, 1, or 2
|
||||
UINT uOutputs;
|
||||
|
||||
// up to two outputs per instruction
|
||||
D3D10_SHADER_DEBUG_OUTPUTREG_INFO pOutputs[2];
|
||||
|
||||
// index into the list of tokens for this instruction's token
|
||||
UINT TokenId;
|
||||
|
||||
// how many function calls deep this instruction is
|
||||
UINT NestingLevel;
|
||||
|
||||
// list of scopes from outer-most to inner-most
|
||||
// Number of scopes
|
||||
UINT Scopes;
|
||||
UINT ScopeInfo; // Offset to UINT[uScopes] specifying indices of the ScopeInfo Array
|
||||
|
||||
// list of variables accessed by this instruction
|
||||
// Number of variables
|
||||
UINT AccessedVars;
|
||||
UINT AccessedVarsInfo; // Offset to UINT[AccessedVars] specifying indices of the ScopeVariableInfo Array
|
||||
} D3D10_SHADER_DEBUG_INST_INFO;
|
||||
|
||||
typedef struct _D3D10_SHADER_DEBUG_FILE_INFO
|
||||
{
|
||||
UINT FileName; // Offset to LPCSTR for file name
|
||||
UINT FileNameLen; // Length of file name
|
||||
UINT FileData; // Offset to LPCSTR of length FileLen
|
||||
UINT FileLen; // Length of file
|
||||
} D3D10_SHADER_DEBUG_FILE_INFO;
|
||||
|
||||
typedef struct _D3D10_SHADER_DEBUG_INFO
|
||||
{
|
||||
UINT Size; // sizeof(D3D10_SHADER_DEBUG_INFO)
|
||||
UINT Creator; // Offset to LPCSTR for compiler version
|
||||
UINT EntrypointName; // Offset to LPCSTR for Entry point name
|
||||
UINT ShaderTarget; // Offset to LPCSTR for shader target
|
||||
UINT CompileFlags; // flags used to compile
|
||||
UINT Files; // number of included files
|
||||
UINT FileInfo; // Offset to D3D10_SHADER_DEBUG_FILE_INFO[Files]
|
||||
UINT Instructions; // number of instructions
|
||||
UINT InstructionInfo; // Offset to D3D10_SHADER_DEBUG_INST_INFO[Instructions]
|
||||
UINT Variables; // number of variables
|
||||
UINT VariableInfo; // Offset to D3D10_SHADER_DEBUG_VAR_INFO[Variables]
|
||||
UINT InputVariables; // number of variables to initialize before running
|
||||
UINT InputVariableInfo; // Offset to D3D10_SHADER_DEBUG_INPUT_INFO[InputVariables]
|
||||
UINT Tokens; // number of tokens to initialize
|
||||
UINT TokenInfo; // Offset to D3D10_SHADER_DEBUG_TOKEN_INFO[Tokens]
|
||||
UINT Scopes; // number of scopes
|
||||
UINT ScopeInfo; // Offset to D3D10_SHADER_DEBUG_SCOPE_INFO[Scopes]
|
||||
UINT ScopeVariables; // number of variables declared
|
||||
UINT ScopeVariableInfo; // Offset to D3D10_SHADER_DEBUG_SCOPEVAR_INFO[Scopes]
|
||||
UINT UintOffset; // Offset to the UINT datastore, all UINT offsets are from this offset
|
||||
UINT StringOffset; // Offset to the string datastore, all string offsets are from this offset
|
||||
} D3D10_SHADER_DEBUG_INFO;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// ID3D10ShaderReflection1:
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
//
|
||||
// Interface definitions
|
||||
//
|
||||
|
||||
|
||||
typedef interface ID3D10ShaderReflection1 ID3D10ShaderReflection1;
|
||||
typedef interface ID3D10ShaderReflection1 *LPD3D10SHADERREFLECTION1;
|
||||
|
||||
// {C3457783-A846-47CE-9520-CEA6F66E7447}
|
||||
DEFINE_GUID(IID_ID3D10ShaderReflection1,
|
||||
0xc3457783, 0xa846, 0x47ce, 0x95, 0x20, 0xce, 0xa6, 0xf6, 0x6e, 0x74, 0x47);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D10ShaderReflection1
|
||||
|
||||
DECLARE_INTERFACE_(ID3D10ShaderReflection1, IUnknown)
|
||||
{
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
STDMETHOD(GetDesc)(THIS_ _Out_ D3D10_SHADER_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ UINT Index) PURE;
|
||||
STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ LPCSTR Name) PURE;
|
||||
|
||||
STDMETHOD(GetResourceBindingDesc)(THIS_ UINT ResourceIndex, _Out_ D3D10_SHADER_INPUT_BIND_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD(GetInputParameterDesc)(THIS_ UINT ParameterIndex, _Out_ D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
|
||||
STDMETHOD(GetOutputParameterDesc)(THIS_ UINT ParameterIndex, _Out_ D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D10ShaderReflectionVariable*, GetVariableByName)(THIS_ LPCSTR Name) PURE;
|
||||
|
||||
STDMETHOD(GetResourceBindingDescByName)(THIS_ LPCSTR Name, _Out_ D3D10_SHADER_INPUT_BIND_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD(GetMovInstructionCount)(THIS_ _Out_ UINT* pCount) PURE;
|
||||
STDMETHOD(GetMovcInstructionCount)(THIS_ _Out_ UINT* pCount) PURE;
|
||||
STDMETHOD(GetConversionInstructionCount)(THIS_ _Out_ UINT* pCount) PURE;
|
||||
STDMETHOD(GetBitwiseInstructionCount)(THIS_ _Out_ UINT* pCount) PURE;
|
||||
|
||||
STDMETHOD(GetGSInputPrimitive)(THIS_ _Out_ D3D10_PRIMITIVE* pPrim) PURE;
|
||||
STDMETHOD(IsLevel9Shader)(THIS_ _Out_ BOOL* pbLevel9Shader) PURE;
|
||||
STDMETHOD(IsSampleFrequencyShader)(THIS_ _Out_ BOOL* pbSampleFrequency) PURE;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// APIs //////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
#endif //__D3D10_1SHADER_H__
|
||||
|
||||
Vendored
+14591
File diff suppressed because it is too large
Load Diff
Vendored
+5222
File diff suppressed because it is too large
Load Diff
Vendored
+2721
File diff suppressed because it is too large
Load Diff
Vendored
+4817
File diff suppressed because it is too large
Load Diff
Vendored
+2233
File diff suppressed because it is too large
Load Diff
+283
@@ -0,0 +1,283 @@
|
||||
/*-------------------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (c) Microsoft Corporation
|
||||
*
|
||||
*-------------------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
|
||||
|
||||
|
||||
/* File created by MIDL compiler version 8.01.0618 */
|
||||
|
||||
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 500
|
||||
#endif
|
||||
|
||||
/* verify that the <rpcsal.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCSAL_H_VERSION__
|
||||
#define __REQUIRED_RPCSAL_H_VERSION__ 100
|
||||
#endif
|
||||
|
||||
#include "rpc.h"
|
||||
#include "rpcndr.h"
|
||||
|
||||
#ifndef __RPCNDR_H_VERSION__
|
||||
#error this stub requires an updated version of <rpcndr.h>
|
||||
#endif /* __RPCNDR_H_VERSION__ */
|
||||
|
||||
#ifndef COM_NO_WINDOWS_H
|
||||
#include "windows.h"
|
||||
#include "ole2.h"
|
||||
#endif /*COM_NO_WINDOWS_H*/
|
||||
|
||||
#ifndef __d3d11on12_h__
|
||||
#define __d3d11on12_h__
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
/* Forward Declarations */
|
||||
|
||||
#ifndef __ID3D11On12Device_FWD_DEFINED__
|
||||
#define __ID3D11On12Device_FWD_DEFINED__
|
||||
typedef interface ID3D11On12Device ID3D11On12Device;
|
||||
|
||||
#endif /* __ID3D11On12Device_FWD_DEFINED__ */
|
||||
|
||||
|
||||
/* header files for imported files */
|
||||
#include "oaidl.h"
|
||||
#include "ocidl.h"
|
||||
#include "d3d11.h"
|
||||
#include "d3d12.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
|
||||
|
||||
/* interface __MIDL_itf_d3d11on12_0000_0000 */
|
||||
/* [local] */
|
||||
|
||||
#include <winapifamily.h>
|
||||
#pragma region App Family
|
||||
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// D3D11On12CreateDevice
|
||||
// ------------------
|
||||
//
|
||||
// pDevice
|
||||
// Specifies a pre-existing D3D12 device to use for D3D11 interop.
|
||||
// May not be NULL.
|
||||
// Flags
|
||||
// Any of those documented for D3D11CreateDeviceAndSwapChain.
|
||||
// pFeatureLevels
|
||||
// Array of any of the following:
|
||||
// D3D_FEATURE_LEVEL_12_1
|
||||
// D3D_FEATURE_LEVEL_12_0
|
||||
// D3D_FEATURE_LEVEL_11_1
|
||||
// D3D_FEATURE_LEVEL_11_0
|
||||
// D3D_FEATURE_LEVEL_10_1
|
||||
// D3D_FEATURE_LEVEL_10_0
|
||||
// D3D_FEATURE_LEVEL_9_3
|
||||
// D3D_FEATURE_LEVEL_9_2
|
||||
// D3D_FEATURE_LEVEL_9_1
|
||||
// The first feature level which is less than or equal to the
|
||||
// D3D12 device's feature level will be used to perform D3D11 validation.
|
||||
// Creation will fail if no acceptable feature levels are provided.
|
||||
// Providing NULL will default to the D3D12 device's feature level.
|
||||
// FeatureLevels
|
||||
// Size of feature levels array.
|
||||
// ppCommandQueues
|
||||
// Array of unique queues for D3D11On12 to use. Valid queue types:
|
||||
// 3D command queue.
|
||||
// Flags must be compatible with device flags, and its NodeMask must
|
||||
// be a subset of the NodeMask provided to this API.
|
||||
// NumQueues
|
||||
// Size of command queue array.
|
||||
// NodeMask
|
||||
// Which node of the D3D12 device to use. Only 1 bit may be set.
|
||||
// ppDevice
|
||||
// Pointer to returned interface. May be NULL.
|
||||
// ppImmediateContext
|
||||
// Pointer to returned interface. May be NULL.
|
||||
// pChosenFeatureLevel
|
||||
// Pointer to returned feature level. May be NULL.
|
||||
//
|
||||
// Return Values
|
||||
// Any of those documented for
|
||||
// D3D11CreateDevice
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
typedef HRESULT (WINAPI* PFN_D3D11ON12_CREATE_DEVICE)( _In_ IUnknown*, UINT,
|
||||
_In_reads_opt_( FeatureLevels ) CONST D3D_FEATURE_LEVEL*, UINT FeatureLevels,
|
||||
_In_reads_opt_( NumQueues ) IUnknown* CONST*, UINT NumQueues,
|
||||
UINT, _COM_Outptr_opt_ ID3D11Device**, _COM_Outptr_opt_ ID3D11DeviceContext**,
|
||||
_Out_opt_ D3D_FEATURE_LEVEL* );
|
||||
|
||||
HRESULT WINAPI D3D11On12CreateDevice(
|
||||
_In_ IUnknown* pDevice,
|
||||
UINT Flags,
|
||||
_In_reads_opt_( FeatureLevels ) CONST D3D_FEATURE_LEVEL* pFeatureLevels,
|
||||
UINT FeatureLevels,
|
||||
_In_reads_opt_( NumQueues ) IUnknown* CONST* ppCommandQueues,
|
||||
UINT NumQueues,
|
||||
UINT NodeMask,
|
||||
_COM_Outptr_opt_ ID3D11Device** ppDevice,
|
||||
_COM_Outptr_opt_ ID3D11DeviceContext** ppImmediateContext,
|
||||
_Out_opt_ D3D_FEATURE_LEVEL* pChosenFeatureLevel );
|
||||
|
||||
typedef struct D3D11_RESOURCE_FLAGS
|
||||
{
|
||||
UINT BindFlags;
|
||||
UINT MiscFlags;
|
||||
UINT CPUAccessFlags;
|
||||
UINT StructureByteStride;
|
||||
} D3D11_RESOURCE_FLAGS;
|
||||
|
||||
|
||||
|
||||
extern RPC_IF_HANDLE __MIDL_itf_d3d11on12_0000_0000_v0_0_c_ifspec;
|
||||
extern RPC_IF_HANDLE __MIDL_itf_d3d11on12_0000_0000_v0_0_s_ifspec;
|
||||
|
||||
#ifndef __ID3D11On12Device_INTERFACE_DEFINED__
|
||||
#define __ID3D11On12Device_INTERFACE_DEFINED__
|
||||
|
||||
/* interface ID3D11On12Device */
|
||||
/* [unique][local][object][uuid] */
|
||||
|
||||
|
||||
EXTERN_C const IID IID_ID3D11On12Device;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
|
||||
MIDL_INTERFACE("85611e73-70a9-490e-9614-a9e302777904")
|
||||
ID3D11On12Device : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE CreateWrappedResource(
|
||||
_In_ IUnknown *pResource12,
|
||||
_In_ const D3D11_RESOURCE_FLAGS *pFlags11,
|
||||
D3D12_RESOURCE_STATES InState,
|
||||
D3D12_RESOURCE_STATES OutState,
|
||||
REFIID riid,
|
||||
_COM_Outptr_opt_ void **ppResource11) = 0;
|
||||
|
||||
virtual void STDMETHODCALLTYPE ReleaseWrappedResources(
|
||||
_In_reads_( NumResources ) ID3D11Resource *const *ppResources,
|
||||
UINT NumResources) = 0;
|
||||
|
||||
virtual void STDMETHODCALLTYPE AcquireWrappedResources(
|
||||
_In_reads_( NumResources ) ID3D11Resource *const *ppResources,
|
||||
UINT NumResources) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#else /* C style interface */
|
||||
|
||||
typedef struct ID3D11On12DeviceVtbl
|
||||
{
|
||||
BEGIN_INTERFACE
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
|
||||
ID3D11On12Device * This,
|
||||
REFIID riid,
|
||||
_COM_Outptr_ void **ppvObject);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *AddRef )(
|
||||
ID3D11On12Device * This);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *Release )(
|
||||
ID3D11On12Device * This);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *CreateWrappedResource )(
|
||||
ID3D11On12Device * This,
|
||||
_In_ IUnknown *pResource12,
|
||||
_In_ const D3D11_RESOURCE_FLAGS *pFlags11,
|
||||
D3D12_RESOURCE_STATES InState,
|
||||
D3D12_RESOURCE_STATES OutState,
|
||||
REFIID riid,
|
||||
_COM_Outptr_opt_ void **ppResource11);
|
||||
|
||||
void ( STDMETHODCALLTYPE *ReleaseWrappedResources )(
|
||||
ID3D11On12Device * This,
|
||||
_In_reads_( NumResources ) ID3D11Resource *const *ppResources,
|
||||
UINT NumResources);
|
||||
|
||||
void ( STDMETHODCALLTYPE *AcquireWrappedResources )(
|
||||
ID3D11On12Device * This,
|
||||
_In_reads_( NumResources ) ID3D11Resource *const *ppResources,
|
||||
UINT NumResources);
|
||||
|
||||
END_INTERFACE
|
||||
} ID3D11On12DeviceVtbl;
|
||||
|
||||
interface ID3D11On12Device
|
||||
{
|
||||
CONST_VTBL struct ID3D11On12DeviceVtbl *lpVtbl;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef COBJMACROS
|
||||
|
||||
|
||||
#define ID3D11On12Device_QueryInterface(This,riid,ppvObject) \
|
||||
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
|
||||
|
||||
#define ID3D11On12Device_AddRef(This) \
|
||||
( (This)->lpVtbl -> AddRef(This) )
|
||||
|
||||
#define ID3D11On12Device_Release(This) \
|
||||
( (This)->lpVtbl -> Release(This) )
|
||||
|
||||
|
||||
#define ID3D11On12Device_CreateWrappedResource(This,pResource12,pFlags11,InState,OutState,riid,ppResource11) \
|
||||
( (This)->lpVtbl -> CreateWrappedResource(This,pResource12,pFlags11,InState,OutState,riid,ppResource11) )
|
||||
|
||||
#define ID3D11On12Device_ReleaseWrappedResources(This,ppResources,NumResources) \
|
||||
( (This)->lpVtbl -> ReleaseWrappedResources(This,ppResources,NumResources) )
|
||||
|
||||
#define ID3D11On12Device_AcquireWrappedResources(This,ppResources,NumResources) \
|
||||
( (This)->lpVtbl -> AcquireWrappedResources(This,ppResources,NumResources) )
|
||||
|
||||
#endif /* COBJMACROS */
|
||||
|
||||
|
||||
#endif /* C style interface */
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* __ID3D11On12Device_INTERFACE_DEFINED__ */
|
||||
|
||||
|
||||
/* interface __MIDL_itf_d3d11on12_0000_0001 */
|
||||
/* [local] */
|
||||
|
||||
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
|
||||
#pragma endregion
|
||||
DEFINE_GUID(IID_ID3D11On12Device,0x85611e73,0x70a9,0x490e,0x96,0x14,0xa9,0xe3,0x02,0x77,0x79,0x04);
|
||||
|
||||
|
||||
extern RPC_IF_HANDLE __MIDL_itf_d3d11on12_0000_0001_v0_0_c_ifspec;
|
||||
extern RPC_IF_HANDLE __MIDL_itf_d3d11on12_0000_0001_v0_0_s_ifspec;
|
||||
|
||||
/* Additional Prototypes for ALL interfaces */
|
||||
|
||||
/* end of Additional Prototypes */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+601
@@ -0,0 +1,601 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// File: D3D11Shader.h
|
||||
// Content: D3D11 Shader Types and APIs
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __D3D11SHADER_H__
|
||||
#define __D3D11SHADER_H__
|
||||
|
||||
#include "d3dcommon.h"
|
||||
|
||||
|
||||
typedef enum D3D11_SHADER_VERSION_TYPE
|
||||
{
|
||||
D3D11_SHVER_PIXEL_SHADER = 0,
|
||||
D3D11_SHVER_VERTEX_SHADER = 1,
|
||||
D3D11_SHVER_GEOMETRY_SHADER = 2,
|
||||
|
||||
// D3D11 Shaders
|
||||
D3D11_SHVER_HULL_SHADER = 3,
|
||||
D3D11_SHVER_DOMAIN_SHADER = 4,
|
||||
D3D11_SHVER_COMPUTE_SHADER = 5,
|
||||
|
||||
D3D11_SHVER_RESERVED0 = 0xFFF0,
|
||||
} D3D11_SHADER_VERSION_TYPE;
|
||||
|
||||
#define D3D11_SHVER_GET_TYPE(_Version) \
|
||||
(((_Version) >> 16) & 0xffff)
|
||||
#define D3D11_SHVER_GET_MAJOR(_Version) \
|
||||
(((_Version) >> 4) & 0xf)
|
||||
#define D3D11_SHVER_GET_MINOR(_Version) \
|
||||
(((_Version) >> 0) & 0xf)
|
||||
|
||||
// Slot ID for library function return
|
||||
#define D3D_RETURN_PARAMETER_INDEX (-1)
|
||||
|
||||
typedef D3D_RESOURCE_RETURN_TYPE D3D11_RESOURCE_RETURN_TYPE;
|
||||
|
||||
typedef D3D_CBUFFER_TYPE D3D11_CBUFFER_TYPE;
|
||||
|
||||
|
||||
typedef struct _D3D11_SIGNATURE_PARAMETER_DESC
|
||||
{
|
||||
LPCSTR SemanticName; // Name of the semantic
|
||||
UINT SemanticIndex; // Index of the semantic
|
||||
UINT Register; // Number of member variables
|
||||
D3D_NAME SystemValueType;// A predefined system value, or D3D_NAME_UNDEFINED if not applicable
|
||||
D3D_REGISTER_COMPONENT_TYPE ComponentType; // Scalar type (e.g. uint, float, etc.)
|
||||
BYTE Mask; // Mask to indicate which components of the register
|
||||
// are used (combination of D3D10_COMPONENT_MASK values)
|
||||
BYTE ReadWriteMask; // Mask to indicate whether a given component is
|
||||
// never written (if this is an output signature) or
|
||||
// always read (if this is an input signature).
|
||||
// (combination of D3D_MASK_* values)
|
||||
UINT Stream; // Stream index
|
||||
D3D_MIN_PRECISION MinPrecision; // Minimum desired interpolation precision
|
||||
} D3D11_SIGNATURE_PARAMETER_DESC;
|
||||
|
||||
typedef struct _D3D11_SHADER_BUFFER_DESC
|
||||
{
|
||||
LPCSTR Name; // Name of the constant buffer
|
||||
D3D_CBUFFER_TYPE Type; // Indicates type of buffer content
|
||||
UINT Variables; // Number of member variables
|
||||
UINT Size; // Size of CB (in bytes)
|
||||
UINT uFlags; // Buffer description flags
|
||||
} D3D11_SHADER_BUFFER_DESC;
|
||||
|
||||
typedef struct _D3D11_SHADER_VARIABLE_DESC
|
||||
{
|
||||
LPCSTR Name; // Name of the variable
|
||||
UINT StartOffset; // Offset in constant buffer's backing store
|
||||
UINT Size; // Size of variable (in bytes)
|
||||
UINT uFlags; // Variable flags
|
||||
LPVOID DefaultValue; // Raw pointer to default value
|
||||
UINT StartTexture; // First texture index (or -1 if no textures used)
|
||||
UINT TextureSize; // Number of texture slots possibly used.
|
||||
UINT StartSampler; // First sampler index (or -1 if no textures used)
|
||||
UINT SamplerSize; // Number of sampler slots possibly used.
|
||||
} D3D11_SHADER_VARIABLE_DESC;
|
||||
|
||||
typedef struct _D3D11_SHADER_TYPE_DESC
|
||||
{
|
||||
D3D_SHADER_VARIABLE_CLASS Class; // Variable class (e.g. object, matrix, etc.)
|
||||
D3D_SHADER_VARIABLE_TYPE Type; // Variable type (e.g. float, sampler, etc.)
|
||||
UINT Rows; // Number of rows (for matrices, 1 for other numeric, 0 if not applicable)
|
||||
UINT Columns; // Number of columns (for vectors & matrices, 1 for other numeric, 0 if not applicable)
|
||||
UINT Elements; // Number of elements (0 if not an array)
|
||||
UINT Members; // Number of members (0 if not a structure)
|
||||
UINT Offset; // Offset from the start of structure (0 if not a structure member)
|
||||
LPCSTR Name; // Name of type, can be NULL
|
||||
} D3D11_SHADER_TYPE_DESC;
|
||||
|
||||
typedef D3D_TESSELLATOR_DOMAIN D3D11_TESSELLATOR_DOMAIN;
|
||||
|
||||
typedef D3D_TESSELLATOR_PARTITIONING D3D11_TESSELLATOR_PARTITIONING;
|
||||
|
||||
typedef D3D_TESSELLATOR_OUTPUT_PRIMITIVE D3D11_TESSELLATOR_OUTPUT_PRIMITIVE;
|
||||
|
||||
typedef struct _D3D11_SHADER_DESC
|
||||
{
|
||||
UINT Version; // Shader version
|
||||
LPCSTR Creator; // Creator string
|
||||
UINT Flags; // Shader compilation/parse flags
|
||||
|
||||
UINT ConstantBuffers; // Number of constant buffers
|
||||
UINT BoundResources; // Number of bound resources
|
||||
UINT InputParameters; // Number of parameters in the input signature
|
||||
UINT OutputParameters; // Number of parameters in the output signature
|
||||
|
||||
UINT InstructionCount; // Number of emitted instructions
|
||||
UINT TempRegisterCount; // Number of temporary registers used
|
||||
UINT TempArrayCount; // Number of temporary arrays used
|
||||
UINT DefCount; // Number of constant defines
|
||||
UINT DclCount; // Number of declarations (input + output)
|
||||
UINT TextureNormalInstructions; // Number of non-categorized texture instructions
|
||||
UINT TextureLoadInstructions; // Number of texture load instructions
|
||||
UINT TextureCompInstructions; // Number of texture comparison instructions
|
||||
UINT TextureBiasInstructions; // Number of texture bias instructions
|
||||
UINT TextureGradientInstructions; // Number of texture gradient instructions
|
||||
UINT FloatInstructionCount; // Number of floating point arithmetic instructions used
|
||||
UINT IntInstructionCount; // Number of signed integer arithmetic instructions used
|
||||
UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used
|
||||
UINT StaticFlowControlCount; // Number of static flow control instructions used
|
||||
UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used
|
||||
UINT MacroInstructionCount; // Number of macro instructions used
|
||||
UINT ArrayInstructionCount; // Number of array instructions used
|
||||
UINT CutInstructionCount; // Number of cut instructions used
|
||||
UINT EmitInstructionCount; // Number of emit instructions used
|
||||
D3D_PRIMITIVE_TOPOLOGY GSOutputTopology; // Geometry shader output topology
|
||||
UINT GSMaxOutputVertexCount; // Geometry shader maximum output vertex count
|
||||
D3D_PRIMITIVE InputPrimitive; // GS/HS input primitive
|
||||
UINT PatchConstantParameters; // Number of parameters in the patch constant signature
|
||||
UINT cGSInstanceCount; // Number of Geometry shader instances
|
||||
UINT cControlPoints; // Number of control points in the HS->DS stage
|
||||
D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive; // Primitive output by the tessellator
|
||||
D3D_TESSELLATOR_PARTITIONING HSPartitioning; // Partitioning mode of the tessellator
|
||||
D3D_TESSELLATOR_DOMAIN TessellatorDomain; // Domain of the tessellator (quad, tri, isoline)
|
||||
// instruction counts
|
||||
UINT cBarrierInstructions; // Number of barrier instructions in a compute shader
|
||||
UINT cInterlockedInstructions; // Number of interlocked instructions
|
||||
UINT cTextureStoreInstructions; // Number of texture writes
|
||||
} D3D11_SHADER_DESC;
|
||||
|
||||
typedef struct _D3D11_SHADER_INPUT_BIND_DESC
|
||||
{
|
||||
LPCSTR Name; // Name of the resource
|
||||
D3D_SHADER_INPUT_TYPE Type; // Type of resource (e.g. texture, cbuffer, etc.)
|
||||
UINT BindPoint; // Starting bind point
|
||||
UINT BindCount; // Number of contiguous bind points (for arrays)
|
||||
|
||||
UINT uFlags; // Input binding flags
|
||||
D3D_RESOURCE_RETURN_TYPE ReturnType; // Return type (if texture)
|
||||
D3D_SRV_DIMENSION Dimension; // Dimension (if texture)
|
||||
UINT NumSamples; // Number of samples (0 if not MS texture)
|
||||
} D3D11_SHADER_INPUT_BIND_DESC;
|
||||
|
||||
#define D3D_SHADER_REQUIRES_DOUBLES 0x00000001
|
||||
#define D3D_SHADER_REQUIRES_EARLY_DEPTH_STENCIL 0x00000002
|
||||
#define D3D_SHADER_REQUIRES_UAVS_AT_EVERY_STAGE 0x00000004
|
||||
#define D3D_SHADER_REQUIRES_64_UAVS 0x00000008
|
||||
#define D3D_SHADER_REQUIRES_MINIMUM_PRECISION 0x00000010
|
||||
#define D3D_SHADER_REQUIRES_11_1_DOUBLE_EXTENSIONS 0x00000020
|
||||
#define D3D_SHADER_REQUIRES_11_1_SHADER_EXTENSIONS 0x00000040
|
||||
#define D3D_SHADER_REQUIRES_LEVEL_9_COMPARISON_FILTERING 0x00000080
|
||||
#define D3D_SHADER_REQUIRES_TILED_RESOURCES 0x00000100
|
||||
|
||||
|
||||
typedef struct _D3D11_LIBRARY_DESC
|
||||
{
|
||||
LPCSTR Creator; // The name of the originator of the library.
|
||||
UINT Flags; // Compilation flags.
|
||||
UINT FunctionCount; // Number of functions exported from the library.
|
||||
} D3D11_LIBRARY_DESC;
|
||||
|
||||
typedef struct _D3D11_FUNCTION_DESC
|
||||
{
|
||||
UINT Version; // Shader version
|
||||
LPCSTR Creator; // Creator string
|
||||
UINT Flags; // Shader compilation/parse flags
|
||||
|
||||
UINT ConstantBuffers; // Number of constant buffers
|
||||
UINT BoundResources; // Number of bound resources
|
||||
|
||||
UINT InstructionCount; // Number of emitted instructions
|
||||
UINT TempRegisterCount; // Number of temporary registers used
|
||||
UINT TempArrayCount; // Number of temporary arrays used
|
||||
UINT DefCount; // Number of constant defines
|
||||
UINT DclCount; // Number of declarations (input + output)
|
||||
UINT TextureNormalInstructions; // Number of non-categorized texture instructions
|
||||
UINT TextureLoadInstructions; // Number of texture load instructions
|
||||
UINT TextureCompInstructions; // Number of texture comparison instructions
|
||||
UINT TextureBiasInstructions; // Number of texture bias instructions
|
||||
UINT TextureGradientInstructions; // Number of texture gradient instructions
|
||||
UINT FloatInstructionCount; // Number of floating point arithmetic instructions used
|
||||
UINT IntInstructionCount; // Number of signed integer arithmetic instructions used
|
||||
UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used
|
||||
UINT StaticFlowControlCount; // Number of static flow control instructions used
|
||||
UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used
|
||||
UINT MacroInstructionCount; // Number of macro instructions used
|
||||
UINT ArrayInstructionCount; // Number of array instructions used
|
||||
UINT MovInstructionCount; // Number of mov instructions used
|
||||
UINT MovcInstructionCount; // Number of movc instructions used
|
||||
UINT ConversionInstructionCount; // Number of type conversion instructions used
|
||||
UINT BitwiseInstructionCount; // Number of bitwise arithmetic instructions used
|
||||
D3D_FEATURE_LEVEL MinFeatureLevel; // Min target of the function byte code
|
||||
UINT64 RequiredFeatureFlags; // Required feature flags
|
||||
|
||||
LPCSTR Name; // Function name
|
||||
INT FunctionParameterCount; // Number of logical parameters in the function signature (not including return)
|
||||
BOOL HasReturn; // TRUE, if function returns a value, false - it is a subroutine
|
||||
BOOL Has10Level9VertexShader; // TRUE, if there is a 10L9 VS blob
|
||||
BOOL Has10Level9PixelShader; // TRUE, if there is a 10L9 PS blob
|
||||
} D3D11_FUNCTION_DESC;
|
||||
|
||||
typedef struct _D3D11_PARAMETER_DESC
|
||||
{
|
||||
LPCSTR Name; // Parameter name.
|
||||
LPCSTR SemanticName; // Parameter semantic name (+index).
|
||||
D3D_SHADER_VARIABLE_TYPE Type; // Element type.
|
||||
D3D_SHADER_VARIABLE_CLASS Class; // Scalar/Vector/Matrix.
|
||||
UINT Rows; // Rows are for matrix parameters.
|
||||
UINT Columns; // Components or Columns in matrix.
|
||||
D3D_INTERPOLATION_MODE InterpolationMode; // Interpolation mode.
|
||||
D3D_PARAMETER_FLAGS Flags; // Parameter modifiers.
|
||||
|
||||
UINT FirstInRegister; // The first input register for this parameter.
|
||||
UINT FirstInComponent; // The first input register component for this parameter.
|
||||
UINT FirstOutRegister; // The first output register for this parameter.
|
||||
UINT FirstOutComponent; // The first output register component for this parameter.
|
||||
} D3D11_PARAMETER_DESC;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Interfaces ////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef interface ID3D11ShaderReflectionType ID3D11ShaderReflectionType;
|
||||
typedef interface ID3D11ShaderReflectionType *LPD3D11SHADERREFLECTIONTYPE;
|
||||
|
||||
typedef interface ID3D11ShaderReflectionVariable ID3D11ShaderReflectionVariable;
|
||||
typedef interface ID3D11ShaderReflectionVariable *LPD3D11SHADERREFLECTIONVARIABLE;
|
||||
|
||||
typedef interface ID3D11ShaderReflectionConstantBuffer ID3D11ShaderReflectionConstantBuffer;
|
||||
typedef interface ID3D11ShaderReflectionConstantBuffer *LPD3D11SHADERREFLECTIONCONSTANTBUFFER;
|
||||
|
||||
typedef interface ID3D11ShaderReflection ID3D11ShaderReflection;
|
||||
typedef interface ID3D11ShaderReflection *LPD3D11SHADERREFLECTION;
|
||||
|
||||
typedef interface ID3D11LibraryReflection ID3D11LibraryReflection;
|
||||
typedef interface ID3D11LibraryReflection *LPD3D11LIBRARYREFLECTION;
|
||||
|
||||
typedef interface ID3D11FunctionReflection ID3D11FunctionReflection;
|
||||
typedef interface ID3D11FunctionReflection *LPD3D11FUNCTIONREFLECTION;
|
||||
|
||||
typedef interface ID3D11FunctionParameterReflection ID3D11FunctionParameterReflection;
|
||||
typedef interface ID3D11FunctionParameterReflection *LPD3D11FUNCTIONPARAMETERREFLECTION;
|
||||
|
||||
// {6E6FFA6A-9BAE-4613-A51E-91652D508C21}
|
||||
interface DECLSPEC_UUID("6E6FFA6A-9BAE-4613-A51E-91652D508C21") ID3D11ShaderReflectionType;
|
||||
DEFINE_GUID(IID_ID3D11ShaderReflectionType,
|
||||
0x6e6ffa6a, 0x9bae, 0x4613, 0xa5, 0x1e, 0x91, 0x65, 0x2d, 0x50, 0x8c, 0x21);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D11ShaderReflectionType
|
||||
|
||||
DECLARE_INTERFACE(ID3D11ShaderReflectionType)
|
||||
{
|
||||
STDMETHOD(GetDesc)(THIS_ _Out_ D3D11_SHADER_TYPE_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D11ShaderReflectionType*, GetMemberTypeByIndex)(THIS_ _In_ UINT Index) PURE;
|
||||
STDMETHOD_(ID3D11ShaderReflectionType*, GetMemberTypeByName)(THIS_ _In_ LPCSTR Name) PURE;
|
||||
STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ _In_ UINT Index) PURE;
|
||||
|
||||
STDMETHOD(IsEqual)(THIS_ _In_ ID3D11ShaderReflectionType* pType) PURE;
|
||||
STDMETHOD_(ID3D11ShaderReflectionType*, GetSubType)(THIS) PURE;
|
||||
STDMETHOD_(ID3D11ShaderReflectionType*, GetBaseClass)(THIS) PURE;
|
||||
STDMETHOD_(UINT, GetNumInterfaces)(THIS) PURE;
|
||||
STDMETHOD_(ID3D11ShaderReflectionType*, GetInterfaceByIndex)(THIS_ _In_ UINT uIndex) PURE;
|
||||
STDMETHOD(IsOfType)(THIS_ _In_ ID3D11ShaderReflectionType* pType) PURE;
|
||||
STDMETHOD(ImplementsInterface)(THIS_ _In_ ID3D11ShaderReflectionType* pBase) PURE;
|
||||
};
|
||||
|
||||
// {51F23923-F3E5-4BD1-91CB-606177D8DB4C}
|
||||
interface DECLSPEC_UUID("51F23923-F3E5-4BD1-91CB-606177D8DB4C") ID3D11ShaderReflectionVariable;
|
||||
DEFINE_GUID(IID_ID3D11ShaderReflectionVariable,
|
||||
0x51f23923, 0xf3e5, 0x4bd1, 0x91, 0xcb, 0x60, 0x61, 0x77, 0xd8, 0xdb, 0x4c);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D11ShaderReflectionVariable
|
||||
|
||||
DECLARE_INTERFACE(ID3D11ShaderReflectionVariable)
|
||||
{
|
||||
STDMETHOD(GetDesc)(THIS_ _Out_ D3D11_SHADER_VARIABLE_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D11ShaderReflectionType*, GetType)(THIS) PURE;
|
||||
STDMETHOD_(ID3D11ShaderReflectionConstantBuffer*, GetBuffer)(THIS) PURE;
|
||||
|
||||
STDMETHOD_(UINT, GetInterfaceSlot)(THIS_ _In_ UINT uArrayIndex) PURE;
|
||||
};
|
||||
|
||||
// {EB62D63D-93DD-4318-8AE8-C6F83AD371B8}
|
||||
interface DECLSPEC_UUID("EB62D63D-93DD-4318-8AE8-C6F83AD371B8") ID3D11ShaderReflectionConstantBuffer;
|
||||
DEFINE_GUID(IID_ID3D11ShaderReflectionConstantBuffer,
|
||||
0xeb62d63d, 0x93dd, 0x4318, 0x8a, 0xe8, 0xc6, 0xf8, 0x3a, 0xd3, 0x71, 0xb8);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D11ShaderReflectionConstantBuffer
|
||||
|
||||
DECLARE_INTERFACE(ID3D11ShaderReflectionConstantBuffer)
|
||||
{
|
||||
STDMETHOD(GetDesc)(THIS_ D3D11_SHADER_BUFFER_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D11ShaderReflectionVariable*, GetVariableByIndex)(THIS_ _In_ UINT Index) PURE;
|
||||
STDMETHOD_(ID3D11ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
|
||||
};
|
||||
|
||||
// The ID3D11ShaderReflection IID may change from SDK version to SDK version
|
||||
// if the reflection API changes. This prevents new code with the new API
|
||||
// from working with an old binary. Recompiling with the new header
|
||||
// will pick up the new IID.
|
||||
|
||||
// 8d536ca1-0cca-4956-a837-786963755584
|
||||
interface DECLSPEC_UUID("8d536ca1-0cca-4956-a837-786963755584") ID3D11ShaderReflection;
|
||||
DEFINE_GUID(IID_ID3D11ShaderReflection,
|
||||
0x8d536ca1, 0x0cca, 0x4956, 0xa8, 0x37, 0x78, 0x69, 0x63, 0x75, 0x55, 0x84);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D11ShaderReflection
|
||||
|
||||
DECLARE_INTERFACE_(ID3D11ShaderReflection, IUnknown)
|
||||
{
|
||||
STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid,
|
||||
_Out_ LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
STDMETHOD(GetDesc)(THIS_ _Out_ D3D11_SHADER_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D11ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ _In_ UINT Index) PURE;
|
||||
STDMETHOD_(ID3D11ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE;
|
||||
|
||||
STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex,
|
||||
_Out_ D3D11_SHADER_INPUT_BIND_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD(GetInputParameterDesc)(THIS_ _In_ UINT ParameterIndex,
|
||||
_Out_ D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
|
||||
STDMETHOD(GetOutputParameterDesc)(THIS_ _In_ UINT ParameterIndex,
|
||||
_Out_ D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
|
||||
STDMETHOD(GetPatchConstantParameterDesc)(THIS_ _In_ UINT ParameterIndex,
|
||||
_Out_ D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D11ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
|
||||
|
||||
STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name,
|
||||
_Out_ D3D11_SHADER_INPUT_BIND_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(UINT, GetMovInstructionCount)(THIS) PURE;
|
||||
STDMETHOD_(UINT, GetMovcInstructionCount)(THIS) PURE;
|
||||
STDMETHOD_(UINT, GetConversionInstructionCount)(THIS) PURE;
|
||||
STDMETHOD_(UINT, GetBitwiseInstructionCount)(THIS) PURE;
|
||||
|
||||
STDMETHOD_(D3D_PRIMITIVE, GetGSInputPrimitive)(THIS) PURE;
|
||||
STDMETHOD_(BOOL, IsSampleFrequencyShader)(THIS) PURE;
|
||||
|
||||
STDMETHOD_(UINT, GetNumInterfaceSlots)(THIS) PURE;
|
||||
STDMETHOD(GetMinFeatureLevel)(THIS_ _Out_ enum D3D_FEATURE_LEVEL* pLevel) PURE;
|
||||
|
||||
STDMETHOD_(UINT, GetThreadGroupSize)(THIS_
|
||||
_Out_opt_ UINT* pSizeX,
|
||||
_Out_opt_ UINT* pSizeY,
|
||||
_Out_opt_ UINT* pSizeZ) PURE;
|
||||
|
||||
STDMETHOD_(UINT64, GetRequiresFlags)(THIS) PURE;
|
||||
};
|
||||
|
||||
// {54384F1B-5B3E-4BB7-AE01-60BA3097CBB6}
|
||||
interface DECLSPEC_UUID("54384F1B-5B3E-4BB7-AE01-60BA3097CBB6") ID3D11LibraryReflection;
|
||||
DEFINE_GUID(IID_ID3D11LibraryReflection,
|
||||
0x54384f1b, 0x5b3e, 0x4bb7, 0xae, 0x1, 0x60, 0xba, 0x30, 0x97, 0xcb, 0xb6);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D11LibraryReflection
|
||||
|
||||
DECLARE_INTERFACE_(ID3D11LibraryReflection, IUnknown)
|
||||
{
|
||||
STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
STDMETHOD(GetDesc)(THIS_ _Out_ D3D11_LIBRARY_DESC * pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D11FunctionReflection *, GetFunctionByIndex)(THIS_ _In_ INT FunctionIndex) PURE;
|
||||
};
|
||||
|
||||
// {207BCECB-D683-4A06-A8A3-9B149B9F73A4}
|
||||
interface DECLSPEC_UUID("207BCECB-D683-4A06-A8A3-9B149B9F73A4") ID3D11FunctionReflection;
|
||||
DEFINE_GUID(IID_ID3D11FunctionReflection,
|
||||
0x207bcecb, 0xd683, 0x4a06, 0xa8, 0xa3, 0x9b, 0x14, 0x9b, 0x9f, 0x73, 0xa4);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D11FunctionReflection
|
||||
|
||||
DECLARE_INTERFACE(ID3D11FunctionReflection)
|
||||
{
|
||||
STDMETHOD(GetDesc)(THIS_ _Out_ D3D11_FUNCTION_DESC * pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D11ShaderReflectionConstantBuffer *, GetConstantBufferByIndex)(THIS_ _In_ UINT BufferIndex) PURE;
|
||||
STDMETHOD_(ID3D11ShaderReflectionConstantBuffer *, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE;
|
||||
|
||||
STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex,
|
||||
_Out_ D3D11_SHADER_INPUT_BIND_DESC * pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D11ShaderReflectionVariable *, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
|
||||
|
||||
STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name,
|
||||
_Out_ D3D11_SHADER_INPUT_BIND_DESC * pDesc) PURE;
|
||||
|
||||
// Use D3D_RETURN_PARAMETER_INDEX to get description of the return value.
|
||||
STDMETHOD_(ID3D11FunctionParameterReflection *, GetFunctionParameter)(THIS_ _In_ INT ParameterIndex) PURE;
|
||||
};
|
||||
|
||||
// {42757488-334F-47FE-982E-1A65D08CC462}
|
||||
interface DECLSPEC_UUID("42757488-334F-47FE-982E-1A65D08CC462") ID3D11FunctionParameterReflection;
|
||||
DEFINE_GUID(IID_ID3D11FunctionParameterReflection,
|
||||
0x42757488, 0x334f, 0x47fe, 0x98, 0x2e, 0x1a, 0x65, 0xd0, 0x8c, 0xc4, 0x62);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D11FunctionParameterReflection
|
||||
|
||||
DECLARE_INTERFACE(ID3D11FunctionParameterReflection)
|
||||
{
|
||||
STDMETHOD(GetDesc)(THIS_ _Out_ D3D11_PARAMETER_DESC * pDesc) PURE;
|
||||
};
|
||||
|
||||
// {CAC701EE-80FC-4122-8242-10B39C8CEC34}
|
||||
interface DECLSPEC_UUID("CAC701EE-80FC-4122-8242-10B39C8CEC34") ID3D11Module;
|
||||
DEFINE_GUID(IID_ID3D11Module,
|
||||
0xcac701ee, 0x80fc, 0x4122, 0x82, 0x42, 0x10, 0xb3, 0x9c, 0x8c, 0xec, 0x34);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D11Module
|
||||
|
||||
DECLARE_INTERFACE_(ID3D11Module, IUnknown)
|
||||
{
|
||||
STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
// Create an instance of a module for resource re-binding.
|
||||
STDMETHOD(CreateInstance)(THIS_ _In_opt_ LPCSTR pNamespace,
|
||||
_COM_Outptr_ interface ID3D11ModuleInstance ** ppModuleInstance) PURE;
|
||||
};
|
||||
|
||||
|
||||
// {469E07F7-045A-48D5-AA12-68A478CDF75D}
|
||||
interface DECLSPEC_UUID("469E07F7-045A-48D5-AA12-68A478CDF75D") ID3D11ModuleInstance;
|
||||
DEFINE_GUID(IID_ID3D11ModuleInstance,
|
||||
0x469e07f7, 0x45a, 0x48d5, 0xaa, 0x12, 0x68, 0xa4, 0x78, 0xcd, 0xf7, 0x5d);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D11ModuleInstance
|
||||
|
||||
DECLARE_INTERFACE_(ID3D11ModuleInstance, IUnknown)
|
||||
{
|
||||
STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
//
|
||||
// Resource binding API.
|
||||
//
|
||||
STDMETHOD(BindConstantBuffer)(THIS_ _In_ UINT uSrcSlot, _In_ UINT uDstSlot, _In_ UINT cbDstOffset) PURE;
|
||||
STDMETHOD(BindConstantBufferByName)(THIS_ _In_ LPCSTR pName, _In_ UINT uDstSlot, _In_ UINT cbDstOffset) PURE;
|
||||
|
||||
STDMETHOD(BindResource)(THIS_ _In_ UINT uSrcSlot, _In_ UINT uDstSlot, _In_ UINT uCount) PURE;
|
||||
STDMETHOD(BindResourceByName)(THIS_ _In_ LPCSTR pName, _In_ UINT uDstSlot, _In_ UINT uCount) PURE;
|
||||
|
||||
STDMETHOD(BindSampler)(THIS_ _In_ UINT uSrcSlot, _In_ UINT uDstSlot, _In_ UINT uCount) PURE;
|
||||
STDMETHOD(BindSamplerByName)(THIS_ _In_ LPCSTR pName, _In_ UINT uDstSlot, _In_ UINT uCount) PURE;
|
||||
|
||||
STDMETHOD(BindUnorderedAccessView)(THIS_ _In_ UINT uSrcSlot, _In_ UINT uDstSlot, _In_ UINT uCount) PURE;
|
||||
STDMETHOD(BindUnorderedAccessViewByName)(THIS_ _In_ LPCSTR pName, _In_ UINT uDstSlot, _In_ UINT uCount) PURE;
|
||||
|
||||
STDMETHOD(BindResourceAsUnorderedAccessView)(THIS_ _In_ UINT uSrcSrvSlot, _In_ UINT uDstUavSlot, _In_ UINT uCount) PURE;
|
||||
STDMETHOD(BindResourceAsUnorderedAccessViewByName)(THIS_ _In_ LPCSTR pSrvName, _In_ UINT uDstUavSlot, _In_ UINT uCount) PURE;
|
||||
};
|
||||
|
||||
|
||||
// {59A6CD0E-E10D-4C1F-88C0-63ABA1DAF30E}
|
||||
interface DECLSPEC_UUID("59A6CD0E-E10D-4C1F-88C0-63ABA1DAF30E") ID3D11Linker;
|
||||
DEFINE_GUID(IID_ID3D11Linker,
|
||||
0x59a6cd0e, 0xe10d, 0x4c1f, 0x88, 0xc0, 0x63, 0xab, 0xa1, 0xda, 0xf3, 0xe);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D11Linker
|
||||
|
||||
DECLARE_INTERFACE_(ID3D11Linker, IUnknown)
|
||||
{
|
||||
STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
// Link the shader and produce a shader blob suitable to D3D runtime.
|
||||
STDMETHOD(Link)(THIS_ _In_ interface ID3D11ModuleInstance * pEntry,
|
||||
_In_ LPCSTR pEntryName,
|
||||
_In_ LPCSTR pTargetName,
|
||||
_In_ UINT uFlags,
|
||||
_COM_Outptr_ ID3DBlob ** ppShaderBlob,
|
||||
_Always_(_Outptr_opt_result_maybenull_) ID3DBlob ** ppErrorBuffer) PURE;
|
||||
|
||||
// Add an instance of a library module to be used for linking.
|
||||
STDMETHOD(UseLibrary)(THIS_ _In_ interface ID3D11ModuleInstance * pLibraryMI) PURE;
|
||||
|
||||
// Add a clip plane with the plane coefficients taken from a cbuffer entry for 10L9 shaders.
|
||||
STDMETHOD(AddClipPlaneFromCBuffer)(THIS_ _In_ UINT uCBufferSlot, _In_ UINT uCBufferEntry) PURE;
|
||||
};
|
||||
|
||||
|
||||
// {D80DD70C-8D2F-4751-94A1-03C79B3556DB}
|
||||
interface DECLSPEC_UUID("D80DD70C-8D2F-4751-94A1-03C79B3556DB") ID3D11LinkingNode;
|
||||
DEFINE_GUID(IID_ID3D11LinkingNode,
|
||||
0xd80dd70c, 0x8d2f, 0x4751, 0x94, 0xa1, 0x3, 0xc7, 0x9b, 0x35, 0x56, 0xdb);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D11LinkingNode
|
||||
|
||||
DECLARE_INTERFACE_(ID3D11LinkingNode, IUnknown)
|
||||
{
|
||||
STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
};
|
||||
|
||||
|
||||
// {54133220-1CE8-43D3-8236-9855C5CEECFF}
|
||||
interface DECLSPEC_UUID("54133220-1CE8-43D3-8236-9855C5CEECFF") ID3D11FunctionLinkingGraph;
|
||||
DEFINE_GUID(IID_ID3D11FunctionLinkingGraph,
|
||||
0x54133220, 0x1ce8, 0x43d3, 0x82, 0x36, 0x98, 0x55, 0xc5, 0xce, 0xec, 0xff);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D11FunctionLinkingGraph
|
||||
|
||||
DECLARE_INTERFACE_(ID3D11FunctionLinkingGraph, IUnknown)
|
||||
{
|
||||
STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
// Create a shader module out of FLG description.
|
||||
STDMETHOD(CreateModuleInstance)(THIS_ _COM_Outptr_ interface ID3D11ModuleInstance ** ppModuleInstance,
|
||||
_Always_(_Outptr_opt_result_maybenull_) ID3DBlob ** ppErrorBuffer) PURE;
|
||||
|
||||
STDMETHOD(SetInputSignature)(THIS_ __in_ecount(cInputParameters) const D3D11_PARAMETER_DESC * pInputParameters,
|
||||
_In_ UINT cInputParameters,
|
||||
_COM_Outptr_ interface ID3D11LinkingNode ** ppInputNode) PURE;
|
||||
|
||||
STDMETHOD(SetOutputSignature)(THIS_ __in_ecount(cOutputParameters) const D3D11_PARAMETER_DESC * pOutputParameters,
|
||||
_In_ UINT cOutputParameters,
|
||||
_COM_Outptr_ interface ID3D11LinkingNode ** ppOutputNode) PURE;
|
||||
|
||||
STDMETHOD(CallFunction)(THIS_ _In_opt_ LPCSTR pModuleInstanceNamespace,
|
||||
_In_ interface ID3D11Module * pModuleWithFunctionPrototype,
|
||||
_In_ LPCSTR pFunctionName,
|
||||
_COM_Outptr_ interface ID3D11LinkingNode ** ppCallNode) PURE;
|
||||
|
||||
STDMETHOD(PassValue)(THIS_ _In_ interface ID3D11LinkingNode * pSrcNode,
|
||||
_In_ INT SrcParameterIndex,
|
||||
_In_ interface ID3D11LinkingNode * pDstNode,
|
||||
_In_ INT DstParameterIndex) PURE;
|
||||
|
||||
STDMETHOD(PassValueWithSwizzle)(THIS_ _In_ interface ID3D11LinkingNode * pSrcNode,
|
||||
_In_ INT SrcParameterIndex,
|
||||
_In_ LPCSTR pSrcSwizzle,
|
||||
_In_ interface ID3D11LinkingNode * pDstNode,
|
||||
_In_ INT DstParameterIndex,
|
||||
_In_ LPCSTR pDstSwizzle) PURE;
|
||||
|
||||
STDMETHOD(GetLastError)(THIS_ _Always_(_Outptr_opt_result_maybenull_) ID3DBlob ** ppErrorBuffer) PURE;
|
||||
|
||||
STDMETHOD(GenerateHlsl)(THIS_ _In_ UINT uFlags, // uFlags is reserved for future use.
|
||||
_COM_Outptr_ ID3DBlob ** ppBuffer) PURE;
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// APIs //////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
#endif //__D3D11SHADER_H__
|
||||
|
||||
Vendored
+7214
File diff suppressed because it is too large
Load Diff
+2388
File diff suppressed because it is too large
Load Diff
+1002
File diff suppressed because it is too large
Load Diff
Vendored
+338
@@ -0,0 +1,338 @@
|
||||
//+--------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// Abstract:
|
||||
// Public API definitions shared by DWrite, D2D, and DImage.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
#pragma once
|
||||
|
||||
#ifndef DCOMMON_H_INCLUDED
|
||||
#define DCOMMON_H_INCLUDED
|
||||
|
||||
#include <dxgiformat.h>
|
||||
|
||||
#ifndef DX_DECLARE_INTERFACE
|
||||
#define DX_DECLARE_INTERFACE(x) DECLSPEC_UUID(x) DECLSPEC_NOVTABLE
|
||||
#endif
|
||||
|
||||
#ifndef CHECKMETHOD
|
||||
#define CHECKMETHOD(method) virtual DECLSPEC_NOTHROW _Must_inspect_result_ HRESULT STDMETHODCALLTYPE method
|
||||
#endif
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4201) // anonymous unions warning
|
||||
|
||||
//
|
||||
// Forward declarations
|
||||
//
|
||||
struct IDXGISurface;
|
||||
|
||||
/// <summary>
|
||||
/// The measuring method used for text layout.
|
||||
/// </summary>
|
||||
typedef enum DWRITE_MEASURING_MODE
|
||||
{
|
||||
/// <summary>
|
||||
/// Text is measured using glyph ideal metrics whose values are independent to the current display resolution.
|
||||
/// </summary>
|
||||
DWRITE_MEASURING_MODE_NATURAL,
|
||||
|
||||
/// <summary>
|
||||
/// Text is measured using glyph display compatible metrics whose values tuned for the current display resolution.
|
||||
/// </summary>
|
||||
DWRITE_MEASURING_MODE_GDI_CLASSIC,
|
||||
|
||||
/// <summary>
|
||||
// Text is measured using the same glyph display metrics as text measured by GDI using a font
|
||||
// created with CLEARTYPE_NATURAL_QUALITY.
|
||||
/// </summary>
|
||||
DWRITE_MEASURING_MODE_GDI_NATURAL
|
||||
|
||||
} DWRITE_MEASURING_MODE;
|
||||
|
||||
/// <summary>
|
||||
/// Qualifies how alpha is to be treated in a bitmap or render target containing
|
||||
/// alpha.
|
||||
/// </summary>
|
||||
typedef enum D2D1_ALPHA_MODE
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Alpha mode should be determined implicitly. Some target surfaces do not supply
|
||||
/// or imply this information in which case alpha must be specified.
|
||||
/// </summary>
|
||||
D2D1_ALPHA_MODE_UNKNOWN = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Treat the alpha as premultipled.
|
||||
/// </summary>
|
||||
D2D1_ALPHA_MODE_PREMULTIPLIED = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Opacity is in the 'A' component only.
|
||||
/// </summary>
|
||||
D2D1_ALPHA_MODE_STRAIGHT = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Ignore any alpha channel information.
|
||||
/// </summary>
|
||||
D2D1_ALPHA_MODE_IGNORE = 3,
|
||||
|
||||
D2D1_ALPHA_MODE_FORCE_DWORD = 0xffffffff
|
||||
|
||||
} D2D1_ALPHA_MODE;
|
||||
|
||||
/// <summary>
|
||||
/// Description of a pixel format.
|
||||
/// </summary>
|
||||
typedef struct D2D1_PIXEL_FORMAT
|
||||
{
|
||||
DXGI_FORMAT format;
|
||||
D2D1_ALPHA_MODE alphaMode;
|
||||
|
||||
} D2D1_PIXEL_FORMAT;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an x-coordinate and y-coordinate pair in two-dimensional space.
|
||||
/// </summary>
|
||||
typedef struct D2D_POINT_2U
|
||||
{
|
||||
UINT32 x;
|
||||
UINT32 y;
|
||||
|
||||
} D2D_POINT_2U;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an x-coordinate and y-coordinate pair in two-dimensional space.
|
||||
/// </summary>
|
||||
typedef struct D2D_POINT_2F
|
||||
{
|
||||
FLOAT x;
|
||||
FLOAT y;
|
||||
|
||||
} D2D_POINT_2F;
|
||||
|
||||
typedef POINT D2D_POINT_2L;
|
||||
|
||||
/// <summary>
|
||||
/// A vector of 2 FLOAT values (x, y).
|
||||
/// </summary>
|
||||
typedef struct D2D_VECTOR_2F
|
||||
{
|
||||
FLOAT x;
|
||||
FLOAT y;
|
||||
|
||||
} D2D_VECTOR_2F;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A vector of 3 FLOAT values (x, y, z).
|
||||
/// </summary>
|
||||
typedef struct D2D_VECTOR_3F
|
||||
{
|
||||
FLOAT x;
|
||||
FLOAT y;
|
||||
FLOAT z;
|
||||
|
||||
} D2D_VECTOR_3F;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A vector of 4 FLOAT values (x, y, z, w).
|
||||
/// </summary>
|
||||
typedef struct D2D_VECTOR_4F
|
||||
{
|
||||
FLOAT x;
|
||||
FLOAT y;
|
||||
FLOAT z;
|
||||
FLOAT w;
|
||||
|
||||
} D2D_VECTOR_4F;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Represents a rectangle defined by the coordinates of the upper-left corner
|
||||
/// (left, top) and the coordinates of the lower-right corner (right, bottom).
|
||||
/// </summary>
|
||||
typedef struct D2D_RECT_F
|
||||
{
|
||||
FLOAT left;
|
||||
FLOAT top;
|
||||
FLOAT right;
|
||||
FLOAT bottom;
|
||||
|
||||
} D2D_RECT_F;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Represents a rectangle defined by the coordinates of the upper-left corner
|
||||
/// (left, top) and the coordinates of the lower-right corner (right, bottom).
|
||||
/// </summary>
|
||||
typedef struct D2D_RECT_U
|
||||
{
|
||||
UINT32 left;
|
||||
UINT32 top;
|
||||
UINT32 right;
|
||||
UINT32 bottom;
|
||||
|
||||
} D2D_RECT_U;
|
||||
|
||||
typedef RECT D2D_RECT_L;
|
||||
|
||||
/// <summary>
|
||||
/// Stores an ordered pair of floats, typically the width and height of a rectangle.
|
||||
/// </summary>
|
||||
typedef struct D2D_SIZE_F
|
||||
{
|
||||
FLOAT width;
|
||||
FLOAT height;
|
||||
|
||||
} D2D_SIZE_F;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Stores an ordered pair of integers, typically the width and height of a
|
||||
/// rectangle.
|
||||
/// </summary>
|
||||
typedef struct D2D_SIZE_U
|
||||
{
|
||||
UINT32 width;
|
||||
UINT32 height;
|
||||
|
||||
} D2D_SIZE_U;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Represents a 3-by-2 matrix.
|
||||
/// </summary>
|
||||
typedef struct D2D_MATRIX_3X2_F
|
||||
{
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
/// <summary>
|
||||
/// Horizontal scaling / cosine of rotation
|
||||
/// </summary>
|
||||
FLOAT m11;
|
||||
|
||||
/// <summary>
|
||||
/// Vertical shear / sine of rotation
|
||||
/// </summary>
|
||||
FLOAT m12;
|
||||
|
||||
/// <summary>
|
||||
/// Horizontal shear / negative sine of rotation
|
||||
/// </summary>
|
||||
FLOAT m21;
|
||||
|
||||
/// <summary>
|
||||
/// Vertical scaling / cosine of rotation
|
||||
/// </summary>
|
||||
FLOAT m22;
|
||||
|
||||
/// <summary>
|
||||
/// Horizontal shift (always orthogonal regardless of rotation)
|
||||
/// </summary>
|
||||
FLOAT dx;
|
||||
|
||||
/// <summary>
|
||||
/// Vertical shift (always orthogonal regardless of rotation)
|
||||
/// </summary>
|
||||
FLOAT dy;
|
||||
};
|
||||
|
||||
struct
|
||||
{
|
||||
FLOAT _11, _12;
|
||||
FLOAT _21, _22;
|
||||
FLOAT _31, _32;
|
||||
};
|
||||
|
||||
FLOAT m[3][2];
|
||||
};
|
||||
|
||||
} D2D_MATRIX_3X2_F;
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Represents a 4-by-3 matrix.
|
||||
/// </summary>
|
||||
typedef struct D2D_MATRIX_4X3_F
|
||||
{
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
FLOAT _11, _12, _13;
|
||||
FLOAT _21, _22, _23;
|
||||
FLOAT _31, _32, _33;
|
||||
FLOAT _41, _42, _43;
|
||||
};
|
||||
|
||||
FLOAT m[4][3];
|
||||
};
|
||||
|
||||
} D2D_MATRIX_4X3_F;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Represents a 4-by-4 matrix.
|
||||
/// </summary>
|
||||
typedef struct D2D_MATRIX_4X4_F
|
||||
{
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
FLOAT _11, _12, _13, _14;
|
||||
FLOAT _21, _22, _23, _24;
|
||||
FLOAT _31, _32, _33, _34;
|
||||
FLOAT _41, _42, _43, _44;
|
||||
};
|
||||
|
||||
FLOAT m[4][4];
|
||||
};
|
||||
|
||||
} D2D_MATRIX_4X4_F;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Represents a 5-by-4 matrix.
|
||||
/// </summary>
|
||||
typedef struct D2D_MATRIX_5X4_F
|
||||
{
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
FLOAT _11, _12, _13, _14;
|
||||
FLOAT _21, _22, _23, _24;
|
||||
FLOAT _31, _32, _33, _34;
|
||||
FLOAT _41, _42, _43, _44;
|
||||
FLOAT _51, _52, _53, _54;
|
||||
};
|
||||
|
||||
FLOAT m[5][4];
|
||||
};
|
||||
|
||||
} D2D_MATRIX_5X4_F;
|
||||
|
||||
|
||||
typedef D2D_POINT_2F D2D1_POINT_2F;
|
||||
typedef D2D_POINT_2U D2D1_POINT_2U;
|
||||
typedef D2D_POINT_2L D2D1_POINT_2L;
|
||||
typedef D2D_RECT_F D2D1_RECT_F;
|
||||
typedef D2D_RECT_U D2D1_RECT_U;
|
||||
typedef D2D_RECT_L D2D1_RECT_L;
|
||||
typedef D2D_SIZE_F D2D1_SIZE_F;
|
||||
typedef D2D_SIZE_U D2D1_SIZE_U;
|
||||
typedef D2D_MATRIX_3X2_F D2D1_MATRIX_3X2_F;
|
||||
|
||||
|
||||
#pragma warning(pop)
|
||||
|
||||
#endif /* DCOMMON_H_INCLUDED */
|
||||
Vendored
+5094
File diff suppressed because it is too large
Load Diff
Vendored
+1926
File diff suppressed because it is too large
Load Diff
Vendored
+969
@@ -0,0 +1,969 @@
|
||||
//+--------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// Abstract:
|
||||
// DirectX Typography Services public API definitions.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#ifndef DWRITE_2_H_INCLUDED
|
||||
#define DWRITE_2_H_INCLUDED
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <DWrite_1.h>
|
||||
|
||||
|
||||
interface IDWriteFontFallback;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// How to align glyphs to the margin.
|
||||
/// </summary>
|
||||
enum DWRITE_OPTICAL_ALIGNMENT
|
||||
{
|
||||
/// <summary>
|
||||
/// Align to the default metrics of the glyph.
|
||||
/// </summary>
|
||||
DWRITE_OPTICAL_ALIGNMENT_NONE,
|
||||
|
||||
/// <summary>
|
||||
/// Align glyphs to the margins. Without this, some small whitespace
|
||||
/// may be present between the text and the margin from the glyph's side
|
||||
/// bearing values. Note that glyphs may still overhang outside the
|
||||
/// margin, such as flourishes or italic slants.
|
||||
/// </summary>
|
||||
DWRITE_OPTICAL_ALIGNMENT_NO_SIDE_BEARINGS,
|
||||
};
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Whether to enable grid-fitting of glyph outlines (a.k.a. hinting).
|
||||
/// </summary>
|
||||
enum DWRITE_GRID_FIT_MODE
|
||||
{
|
||||
/// <summary>
|
||||
/// Choose grid fitting base on the font's gasp table information.
|
||||
/// </summary>
|
||||
DWRITE_GRID_FIT_MODE_DEFAULT,
|
||||
|
||||
/// <summary>
|
||||
/// Always disable grid fitting, using the ideal glyph outlines.
|
||||
/// </summary>
|
||||
DWRITE_GRID_FIT_MODE_DISABLED,
|
||||
|
||||
/// <summary>
|
||||
/// Enable grid fitting, adjusting glyph outlines for device pixel display.
|
||||
/// </summary>
|
||||
DWRITE_GRID_FIT_MODE_ENABLED
|
||||
};
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Overall metrics associated with text after layout.
|
||||
/// All coordinates are in device independent pixels (DIPs).
|
||||
/// </summary>
|
||||
struct DWRITE_TEXT_METRICS1 : DWRITE_TEXT_METRICS
|
||||
{
|
||||
/// <summary>
|
||||
/// The height of the formatted text taking into account the
|
||||
/// trailing whitespace at the end of each line, which will
|
||||
/// matter for vertical reading directions.
|
||||
/// </summary>
|
||||
FLOAT heightIncludingTrailingWhitespace;
|
||||
};
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The text renderer interface represents a set of application-defined
|
||||
/// callbacks that perform rendering of text, inline objects, and decorations
|
||||
/// such as underlines.
|
||||
/// </summary>
|
||||
interface DWRITE_DECLARE_INTERFACE("D3E0E934-22A0-427E-AAE4-7D9574B59DB1") IDWriteTextRenderer1 : public IDWriteTextRenderer
|
||||
{
|
||||
/// <summary>
|
||||
/// IDWriteTextLayout::Draw calls this function to instruct the client to
|
||||
/// render a run of glyphs.
|
||||
/// </summary>
|
||||
/// <param name="clientDrawingContext">The context passed to
|
||||
/// IDWriteTextLayout::Draw.</param>
|
||||
/// <param name="baselineOriginX">X-coordinate of the baseline.</param>
|
||||
/// <param name="baselineOriginY">Y-coordinate of the baseline.</param>
|
||||
/// <param name="orientationAngle">Orientation of the glyph run.</param>
|
||||
/// <param name="measuringMode">Specifies measuring method for glyphs in
|
||||
/// the run. Renderer implementations may choose different rendering
|
||||
/// modes for given measuring methods, but best results are seen when
|
||||
/// the rendering mode matches the corresponding measuring mode:
|
||||
/// DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL for DWRITE_MEASURING_MODE_NATURAL
|
||||
/// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC for DWRITE_MEASURING_MODE_GDI_CLASSIC
|
||||
/// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL for DWRITE_MEASURING_MODE_GDI_NATURAL
|
||||
/// </param>
|
||||
/// <param name="glyphRun">The glyph run to draw.</param>
|
||||
/// <param name="glyphRunDescription">Properties of the characters
|
||||
/// associated with this run.</param>
|
||||
/// <param name="clientDrawingEffect">The drawing effect set in
|
||||
/// IDWriteTextLayout::SetDrawingEffect.</param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
/// <remarks>
|
||||
/// If a non-identity orientation is passed, the glyph run should be
|
||||
/// rotated around the given baseline x and y coordinates. The function
|
||||
/// IDWriteAnalyzer2::GetGlyphOrientationTransform will return the
|
||||
/// necessary transform for you, which can be combined with any existing
|
||||
/// world transform on the drawing context.
|
||||
/// </remarks>
|
||||
STDMETHOD(DrawGlyphRun)(
|
||||
_In_opt_ void* clientDrawingContext,
|
||||
FLOAT baselineOriginX,
|
||||
FLOAT baselineOriginY,
|
||||
DWRITE_GLYPH_ORIENTATION_ANGLE orientationAngle,
|
||||
DWRITE_MEASURING_MODE measuringMode,
|
||||
_In_ DWRITE_GLYPH_RUN const* glyphRun,
|
||||
_In_ DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription,
|
||||
_In_opt_ IUnknown* clientDrawingEffect
|
||||
) PURE;
|
||||
|
||||
/// <summary>
|
||||
/// IDWriteTextLayout::Draw calls this function to instruct the client to draw
|
||||
/// an underline.
|
||||
/// </summary>
|
||||
/// <param name="clientDrawingContext">The context passed to
|
||||
/// IDWriteTextLayout::Draw.</param>
|
||||
/// <param name="baselineOriginX">X-coordinate of the baseline.</param>
|
||||
/// <param name="baselineOriginY">Y-coordinate of the baseline.</param>
|
||||
/// <param name="orientationAngle">Orientation of the underline.</param>
|
||||
/// <param name="underline">Underline logical information.</param>
|
||||
/// <param name="clientDrawingEffect">The drawing effect set in
|
||||
/// IDWriteTextLayout::SetDrawingEffect.</param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
/// <remarks>
|
||||
/// A single underline can be broken into multiple calls, depending on
|
||||
/// how the formatting changes attributes. If font sizes/styles change
|
||||
/// within an underline, the thickness and offset will be averaged
|
||||
/// weighted according to characters.
|
||||
///
|
||||
/// To get the correct top coordinate of the underline rect, add
|
||||
/// underline::offset to the baseline's Y. Otherwise the underline will
|
||||
/// be immediately under the text. The x coordinate will always be passed
|
||||
/// as the left side, regardless of text directionality. This simplifies
|
||||
/// drawing and reduces the problem of round-off that could potentially
|
||||
/// cause gaps or a double stamped alpha blend. To avoid alpha overlap,
|
||||
/// round the end points to the nearest device pixel.
|
||||
/// </remarks>
|
||||
STDMETHOD(DrawUnderline)(
|
||||
_In_opt_ void* clientDrawingContext,
|
||||
FLOAT baselineOriginX,
|
||||
FLOAT baselineOriginY,
|
||||
DWRITE_GLYPH_ORIENTATION_ANGLE orientationAngle,
|
||||
_In_ DWRITE_UNDERLINE const* underline,
|
||||
_In_opt_ IUnknown* clientDrawingEffect
|
||||
) PURE;
|
||||
|
||||
/// <summary>
|
||||
/// IDWriteTextLayout::Draw calls this function to instruct the client to draw
|
||||
/// a strikethrough.
|
||||
/// </summary>
|
||||
/// <param name="clientDrawingContext">The context passed to
|
||||
/// IDWriteTextLayout::Draw.</param>
|
||||
/// <param name="baselineOriginX">X-coordinate of the baseline.</param>
|
||||
/// <param name="baselineOriginY">Y-coordinate of the baseline.</param>
|
||||
/// <param name="orientationAngle">Orientation of the strikethrough.</param>
|
||||
/// <param name="strikethrough">Strikethrough logical information.</param>
|
||||
/// <param name="clientDrawingEffect">The drawing effect set in
|
||||
/// IDWriteTextLayout::SetDrawingEffect.</param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
/// <remarks>
|
||||
/// A single strikethrough can be broken into multiple calls, depending on
|
||||
/// how the formatting changes attributes. Strikethrough is not averaged
|
||||
/// across font sizes/styles changes.
|
||||
/// To get the correct top coordinate of the strikethrough rect,
|
||||
/// add strikethrough::offset to the baseline's Y.
|
||||
/// Like underlines, the x coordinate will always be passed as the left side,
|
||||
/// regardless of text directionality.
|
||||
/// </remarks>
|
||||
STDMETHOD(DrawStrikethrough)(
|
||||
_In_opt_ void* clientDrawingContext,
|
||||
FLOAT baselineOriginX,
|
||||
FLOAT baselineOriginY,
|
||||
DWRITE_GLYPH_ORIENTATION_ANGLE orientationAngle,
|
||||
_In_ DWRITE_STRIKETHROUGH const* strikethrough,
|
||||
_In_opt_ IUnknown* clientDrawingEffect
|
||||
) PURE;
|
||||
|
||||
/// <summary>
|
||||
/// IDWriteTextLayout::Draw calls this application callback when it needs to
|
||||
/// draw an inline object.
|
||||
/// </summary>
|
||||
/// <param name="clientDrawingContext">The context passed to
|
||||
/// IDWriteTextLayout::Draw.</param>
|
||||
/// <param name="originX">X-coordinate at the top-left corner of the
|
||||
/// inline object.</param>
|
||||
/// <param name="originY">Y-coordinate at the top-left corner of the
|
||||
/// inline object.</param>
|
||||
/// <param name="orientationAngle">Orientation of the inline object.</param>
|
||||
/// <param name="inlineObject">The object set using IDWriteTextLayout::SetInlineObject.</param>
|
||||
/// <param name="isSideways">The object should be drawn on its side.</param>
|
||||
/// <param name="isRightToLeft">The object is in an right-to-left context
|
||||
/// and should be drawn flipped.</param>
|
||||
/// <param name="clientDrawingEffect">The drawing effect set in
|
||||
/// IDWriteTextLayout::SetDrawingEffect.</param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
/// <remarks>
|
||||
/// The right-to-left flag is a hint to draw the appropriate visual for
|
||||
/// that reading direction. For example, it would look strange to draw an
|
||||
/// arrow pointing to the right to indicate a submenu. The sideways flag
|
||||
/// similarly hints that the object is drawn in a different orientation.
|
||||
/// If a non-identity orientation is passed, the top left of the inline
|
||||
/// object should be rotated around the given x and y coordinates.
|
||||
/// IDWriteAnalyzer2::GetGlyphOrientationTransform returns the necessary
|
||||
/// transform for this.
|
||||
/// </remarks>
|
||||
STDMETHOD(DrawInlineObject)(
|
||||
_In_opt_ void* clientDrawingContext,
|
||||
FLOAT originX,
|
||||
FLOAT originY,
|
||||
DWRITE_GLYPH_ORIENTATION_ANGLE orientationAngle,
|
||||
_In_ IDWriteInlineObject* inlineObject,
|
||||
BOOL isSideways,
|
||||
BOOL isRightToLeft,
|
||||
_In_opt_ IUnknown* clientDrawingEffect
|
||||
) PURE;
|
||||
};
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The format of text used for text layout.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This object may not be thread-safe and it may carry the state of text format change.
|
||||
/// </remarks>
|
||||
interface DWRITE_DECLARE_INTERFACE("5F174B49-0D8B-4CFB-8BCA-F1CCE9D06C67") IDWriteTextFormat1 : public IDWriteTextFormat
|
||||
{
|
||||
/// <summary>
|
||||
/// Set the preferred orientation of glyphs when using a vertical reading direction.
|
||||
/// </summary>
|
||||
/// <param name="glyphOrientation">Preferred glyph orientation.</param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
STDMETHOD(SetVerticalGlyphOrientation)(
|
||||
DWRITE_VERTICAL_GLYPH_ORIENTATION glyphOrientation
|
||||
) PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Get the preferred orientation of glyphs when using a vertical reading
|
||||
/// direction.
|
||||
/// </summary>
|
||||
STDMETHOD_(DWRITE_VERTICAL_GLYPH_ORIENTATION, GetVerticalGlyphOrientation)() PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Set whether or not the last word on the last line is wrapped.
|
||||
/// </summary>
|
||||
/// <param name="isLastLineWrappingEnabled">Line wrapping option.</param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
STDMETHOD(SetLastLineWrapping)(
|
||||
BOOL isLastLineWrappingEnabled
|
||||
) PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Get whether or not the last word on the last line is wrapped.
|
||||
/// </summary>
|
||||
STDMETHOD_(BOOL, GetLastLineWrapping)() PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Set how the glyphs align to the edges the margin. Default behavior is
|
||||
/// to align glyphs using their default glyphs metrics which include side
|
||||
/// bearings.
|
||||
/// </summary>
|
||||
/// <param name="opticalAlignment">Optical alignment option.</param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
STDMETHOD(SetOpticalAlignment)(
|
||||
DWRITE_OPTICAL_ALIGNMENT opticalAlignment
|
||||
) PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Get how the glyphs align to the edges the margin.
|
||||
/// </summary>
|
||||
STDMETHOD_(DWRITE_OPTICAL_ALIGNMENT, GetOpticalAlignment)() PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Apply a custom font fallback onto layout. If none is specified,
|
||||
/// layout uses the system fallback list.
|
||||
/// </summary>
|
||||
/// <param name="fontFallback">Custom font fallback created from
|
||||
/// IDWriteFontFallbackBuilder::CreateFontFallback or from
|
||||
/// IDWriteFactory2::GetSystemFontFallback.</param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
STDMETHOD(SetFontFallback)(
|
||||
IDWriteFontFallback* fontFallback
|
||||
) PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Get the current font fallback object.
|
||||
/// </summary>
|
||||
STDMETHOD(GetFontFallback)(
|
||||
__out IDWriteFontFallback** fontFallback
|
||||
) PURE;
|
||||
};
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The text layout interface represents a block of text after it has
|
||||
/// been fully analyzed and formatted.
|
||||
///
|
||||
/// All coordinates are in device independent pixels (DIPs).
|
||||
/// </summary>
|
||||
interface DWRITE_DECLARE_INTERFACE("1093C18F-8D5E-43F0-B064-0917311B525E") IDWriteTextLayout2 : public IDWriteTextLayout1
|
||||
{
|
||||
/// <summary>
|
||||
/// GetMetrics retrieves overall metrics for the formatted string.
|
||||
/// </summary>
|
||||
/// <param name="textMetrics">The returned metrics.</param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
/// <remarks>
|
||||
/// Drawing effects like underline and strikethrough do not contribute
|
||||
/// to the text size, which is essentially the sum of advance widths and
|
||||
/// line heights. Additionally, visible swashes and other graphic
|
||||
/// adornments may extend outside the returned width and height.
|
||||
/// </remarks>
|
||||
STDMETHOD(GetMetrics)(
|
||||
_Out_ DWRITE_TEXT_METRICS1* textMetrics
|
||||
) PURE;
|
||||
|
||||
using IDWriteTextLayout::GetMetrics;
|
||||
|
||||
/// <summary>
|
||||
/// Set the preferred orientation of glyphs when using a vertical reading direction.
|
||||
/// </summary>
|
||||
/// <param name="glyphOrientation">Preferred glyph orientation.</param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
STDMETHOD(SetVerticalGlyphOrientation)(
|
||||
DWRITE_VERTICAL_GLYPH_ORIENTATION glyphOrientation
|
||||
) PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Get the preferred orientation of glyphs when using a vertical reading
|
||||
/// direction.
|
||||
/// </summary>
|
||||
STDMETHOD_(DWRITE_VERTICAL_GLYPH_ORIENTATION, GetVerticalGlyphOrientation)() PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Set whether or not the last word on the last line is wrapped.
|
||||
/// </summary>
|
||||
/// <param name="isLastLineWrappingEnabled">Line wrapping option.</param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
STDMETHOD(SetLastLineWrapping)(
|
||||
BOOL isLastLineWrappingEnabled
|
||||
) PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Get whether or not the last word on the last line is wrapped.
|
||||
/// </summary>
|
||||
STDMETHOD_(BOOL, GetLastLineWrapping)() PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Set how the glyphs align to the edges the margin. Default behavior is
|
||||
/// to align glyphs using their default glyphs metrics which include side
|
||||
/// bearings.
|
||||
/// </summary>
|
||||
/// <param name="opticalAlignment">Optical alignment option.</param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
STDMETHOD(SetOpticalAlignment)(
|
||||
DWRITE_OPTICAL_ALIGNMENT opticalAlignment
|
||||
) PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Get how the glyphs align to the edges the margin.
|
||||
/// </summary>
|
||||
STDMETHOD_(DWRITE_OPTICAL_ALIGNMENT, GetOpticalAlignment)() PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Apply a custom font fallback onto layout. If none is specified,
|
||||
/// layout uses the system fallback list.
|
||||
/// </summary>
|
||||
/// <param name="fontFallback">Custom font fallback created from
|
||||
/// IDWriteFontFallbackBuilder::CreateFontFallback or
|
||||
/// IDWriteFactory2::GetSystemFontFallback.</param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
STDMETHOD(SetFontFallback)(
|
||||
IDWriteFontFallback* fontFallback
|
||||
) PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Get the current font fallback object.
|
||||
/// </summary>
|
||||
STDMETHOD(GetFontFallback)(
|
||||
__out IDWriteFontFallback** fontFallback
|
||||
) PURE;
|
||||
};
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The text analyzer interface represents a set of application-defined
|
||||
/// callbacks that perform rendering of text, inline objects, and decorations
|
||||
/// such as underlines.
|
||||
/// </summary>
|
||||
interface DWRITE_DECLARE_INTERFACE("553A9FF3-5693-4DF7-B52B-74806F7F2EB9") IDWriteTextAnalyzer2 : public IDWriteTextAnalyzer1
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns 2x3 transform matrix for the respective angle to draw the
|
||||
/// glyph run or other object.
|
||||
/// </summary>
|
||||
/// <param name="glyphOrientationAngle">The angle reported to one of the application callbacks,
|
||||
/// including IDWriteTextAnalysisSink1::SetGlyphOrientation and IDWriteTextRenderer1::Draw*.</param>
|
||||
/// <param name="isSideways">Whether the run's glyphs are sideways or not.</param>
|
||||
/// <param name="originX">X origin of the element, be it a glyph run or underline or other.</param>
|
||||
/// <param name="originY">Y origin of the element, be it a glyph run or underline or other.</param>
|
||||
/// <param name="transform">Returned transform.</param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
/// <remarks>
|
||||
/// This rotates around the given origin x and y, returning a translation component
|
||||
/// such that the glyph run, text decoration, or inline object is drawn with the
|
||||
/// right orientation at the expected coordinate.
|
||||
/// </remarks>
|
||||
STDMETHOD(GetGlyphOrientationTransform)(
|
||||
DWRITE_GLYPH_ORIENTATION_ANGLE glyphOrientationAngle,
|
||||
BOOL isSideways,
|
||||
FLOAT originX,
|
||||
FLOAT originY,
|
||||
_Out_ DWRITE_MATRIX* transform
|
||||
) PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of typographic feature tags for the given script and language.
|
||||
/// </summary>
|
||||
/// <param name="fontFace">The font face to get features from.</param>
|
||||
/// <param name="scriptAnalysis">Script analysis result from AnalyzeScript.</param>
|
||||
/// <param name="localeName">The locale to use when selecting the feature,
|
||||
/// such en-us or ja-jp.</param>
|
||||
/// <param name="maxTagCount">Maximum tag count.</param>
|
||||
/// <param name="actualTagCount">Actual tag count. If greater than
|
||||
/// maxTagCount, E_NOT_SUFFICIENT_BUFFER is returned, and the call
|
||||
/// should be retried with a larger buffer.</param>
|
||||
/// <param name="tags">Feature tag list.</param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
STDMETHOD(GetTypographicFeatures)(
|
||||
IDWriteFontFace* fontFace,
|
||||
DWRITE_SCRIPT_ANALYSIS scriptAnalysis,
|
||||
_In_opt_z_ WCHAR const* localeName,
|
||||
UINT32 maxTagCount,
|
||||
_Out_ UINT32* actualTagCount,
|
||||
_Out_writes_(maxTagCount) DWRITE_FONT_FEATURE_TAG* tags
|
||||
) PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Returns an array of which glyphs are affected by a given feature.
|
||||
/// </summary>
|
||||
/// <param name="fontFace">The font face to read glyph information from.</param>
|
||||
/// <param name="scriptAnalysis">Script analysis result from AnalyzeScript.</param>
|
||||
/// <param name="localeName">The locale to use when selecting the feature,
|
||||
/// such en-us or ja-jp.</param>
|
||||
/// <param name="featureTag">OpenType feature name to use, which may be one
|
||||
/// of the DWRITE_FONT_FEATURE_TAG values or a custom feature using
|
||||
/// DWRITE_MAKE_OPENTYPE_TAG.</param>
|
||||
/// <param name="glyphCount">Number of glyph indices to check.</param>
|
||||
/// <param name="glyphIndices">Glyph indices to check for feature application.</param>
|
||||
/// <param name="featureApplies">Output of which glyphs are affected by the
|
||||
/// feature, where for each glyph affected, the respective array index
|
||||
/// will be 1. The result is returned per-glyph without regard to
|
||||
/// neighboring context of adjacent glyphs.</param>
|
||||
/// </remarks>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
STDMETHOD(CheckTypographicFeature)(
|
||||
IDWriteFontFace* fontFace,
|
||||
DWRITE_SCRIPT_ANALYSIS scriptAnalysis,
|
||||
_In_opt_z_ WCHAR const* localeName,
|
||||
DWRITE_FONT_FEATURE_TAG featureTag,
|
||||
UINT32 glyphCount,
|
||||
_In_reads_(glyphCount) UINT16 const* glyphIndices,
|
||||
_Out_writes_(glyphCount) UINT8* featureApplies
|
||||
) PURE;
|
||||
};
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A font fallback definition used for mapping characters to fonts capable of
|
||||
/// supporting them.
|
||||
/// </summary>
|
||||
interface DWRITE_DECLARE_INTERFACE("EFA008F9-F7A1-48BF-B05C-F224713CC0FF") IDWriteFontFallback : public IUnknown
|
||||
{
|
||||
/// <summary>
|
||||
/// Determines an appropriate font to use to render the range of text.
|
||||
/// </summary>
|
||||
/// <param name="source">The text source implementation holds the text and
|
||||
/// locale.</param>
|
||||
/// <param name="textLength">Length of the text to analyze.</param>
|
||||
/// <param name="baseFontCollection">Default font collection to use.</param>
|
||||
/// <param name="baseFont">Base font to check (optional).</param>
|
||||
/// <param name="baseFamilyName">Family name of the base font. If you pass
|
||||
/// null, no matching will be done against the family.</param>
|
||||
/// <param name="baseWeight">Desired weight.</param>
|
||||
/// <param name="baseStyle">Desired style.</param>
|
||||
/// <param name="baseStretch">Desired stretch.</param>
|
||||
/// <param name="mappedLength">Length of text mapped to the mapped font.
|
||||
/// This will always be less or equal to the input text length and
|
||||
/// greater than zero (if the text length is non-zero) so that the
|
||||
/// caller advances at least one character each call.</param>
|
||||
/// <param name="mappedFont">The font that should be used to render the
|
||||
/// first mappedLength characters of the text. If it returns NULL,
|
||||
/// then no known font can render the text, and mappedLength is the
|
||||
/// number of unsupported characters to skip.</param>
|
||||
/// <param name="scale">Scale factor to multiply the em size of the
|
||||
/// returned font by.</param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
STDMETHOD(MapCharacters)(
|
||||
IDWriteTextAnalysisSource* analysisSource,
|
||||
UINT32 textPosition,
|
||||
UINT32 textLength,
|
||||
_In_opt_ IDWriteFontCollection* baseFontCollection,
|
||||
_In_opt_z_ wchar_t const* baseFamilyName,
|
||||
DWRITE_FONT_WEIGHT baseWeight,
|
||||
DWRITE_FONT_STYLE baseStyle,
|
||||
DWRITE_FONT_STRETCH baseStretch,
|
||||
_Out_range_(0, textLength) UINT32* mappedLength,
|
||||
_COM_Outptr_result_maybenull_ IDWriteFont** mappedFont,
|
||||
_Out_ FLOAT* scale
|
||||
) PURE;
|
||||
};
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Builder used to create a font fallback definition by appending a series of
|
||||
/// fallback mappings, followed by a creation call.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This object may not be thread-safe.
|
||||
/// </remarks>
|
||||
interface DWRITE_DECLARE_INTERFACE("FD882D06-8ABA-4FB8-B849-8BE8B73E14DE") IDWriteFontFallbackBuilder : public IUnknown
|
||||
{
|
||||
/// <summary>
|
||||
/// Appends a single mapping to the list. Call this once for each additional mapping.
|
||||
/// </summary>
|
||||
/// <param name="ranges">Unicode ranges that apply to this mapping.</param>
|
||||
/// <param name="rangesCount">Number of Unicode ranges.</param>
|
||||
/// <param name="localeName">Locale of the context (e.g. document locale).</param>
|
||||
/// <param name="baseFamilyName">Base family name to match against, if applicable.</param>
|
||||
/// <param name="fontCollection">Explicit font collection for this mapping (optional).</param>
|
||||
/// <param name="targetFamilyNames">List of target family name strings.</param>
|
||||
/// <param name="targetFamilyNamesCount">Number of target family names.</param>
|
||||
/// <param name="scale">Scale factor to multiply the result target font by.</param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
STDMETHOD(AddMapping)(
|
||||
_In_reads_(rangesCount) DWRITE_UNICODE_RANGE const* ranges,
|
||||
UINT32 rangesCount,
|
||||
_In_reads_(targetFamilyNamesCount) WCHAR const** targetFamilyNames,
|
||||
UINT32 targetFamilyNamesCount,
|
||||
_In_opt_ IDWriteFontCollection* fontCollection = NULL,
|
||||
_In_opt_z_ WCHAR const* localeName = NULL,
|
||||
_In_opt_z_ WCHAR const* baseFamilyName = NULL,
|
||||
FLOAT scale = 1.0f
|
||||
) PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Appends all the mappings from an existing font fallback object.
|
||||
/// </summary>
|
||||
/// <param name="fontFallback">Font fallback to read mappings from.</param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
STDMETHOD(AddMappings)(
|
||||
IDWriteFontFallback* fontFallback
|
||||
) PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Creates the finalized fallback object from the mappings added.
|
||||
/// </summary>
|
||||
/// <param name="fontFallback">Created fallback list.</param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
STDMETHOD(CreateFontFallback)(
|
||||
_COM_Outptr_ IDWriteFontFallback** fontFallback
|
||||
) PURE;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// DWRITE_COLOR_F
|
||||
/// </summary>
|
||||
#ifndef D3DCOLORVALUE_DEFINED
|
||||
|
||||
typedef struct _D3DCOLORVALUE {
|
||||
union {
|
||||
FLOAT r;
|
||||
FLOAT dvR;
|
||||
};
|
||||
union {
|
||||
FLOAT g;
|
||||
FLOAT dvG;
|
||||
};
|
||||
union {
|
||||
FLOAT b;
|
||||
FLOAT dvB;
|
||||
};
|
||||
union {
|
||||
FLOAT a;
|
||||
FLOAT dvA;
|
||||
};
|
||||
} D3DCOLORVALUE;
|
||||
|
||||
#define D3DCOLORVALUE_DEFINED
|
||||
#endif D3DCOLORVALUE_DEFINED
|
||||
|
||||
typedef D3DCOLORVALUE DWRITE_COLOR_F;
|
||||
|
||||
/// <summary>
|
||||
/// The IDWriteFont interface represents a physical font in a font collection.
|
||||
/// </summary>
|
||||
interface DWRITE_DECLARE_INTERFACE("29748ed6-8c9c-4a6a-be0b-d912e8538944") IDWriteFont2 : public IDWriteFont1
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns TRUE if the font contains tables that can provide color information
|
||||
/// (including COLR, CPAL, SVG, CBDT, sbix tables), or FALSE if not. Note that
|
||||
/// TRUE is returned even in the case when the font tables contain only grayscale
|
||||
/// images.
|
||||
/// </summary>
|
||||
STDMETHOD_(BOOL, IsColorFont)() PURE;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// The interface that represents an absolute reference to a font face.
|
||||
/// It contains font face type, appropriate file references and face identification data.
|
||||
/// Various font data such as metrics, names and glyph outlines is obtained from IDWriteFontFace.
|
||||
/// </summary>
|
||||
interface DWRITE_DECLARE_INTERFACE("d8b768ff-64bc-4e66-982b-ec8e87f693f7") IDWriteFontFace2 : public IDWriteFontFace1
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns TRUE if the font contains tables that can provide color information
|
||||
/// (including COLR, CPAL, SVG, CBDT, sbix tables), or FALSE if not. Note that
|
||||
/// TRUE is returned even in the case when the font tables contain only grayscale
|
||||
/// images.
|
||||
/// </summary>
|
||||
STDMETHOD_(BOOL, IsColorFont)() PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the number of color palettes defined by the font. The return
|
||||
/// value is zero if the font has no color information. Color fonts must
|
||||
/// have at least one palette, with palette index zero being the default.
|
||||
/// </summary>
|
||||
STDMETHOD_(UINT32, GetColorPaletteCount)() PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the number of entries in each color palette. All color palettes
|
||||
/// in a font have the same number of palette entries. The return value is
|
||||
/// zero if the font has no color information.
|
||||
/// </summary>
|
||||
STDMETHOD_(UINT32, GetPaletteEntryCount)() PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Reads color values from the font's color palette.
|
||||
/// </summary>
|
||||
/// <param name="colorPaletteIndex">Zero-based index of the color palette. If the
|
||||
/// font does not have a palette with the specified index, the method returns
|
||||
/// DWRITE_E_NOCOLOR.<param>
|
||||
/// <param name="firstEntryIndex">Zero-based index of the first palette entry
|
||||
/// to read.</param>
|
||||
/// <param name="entryCount">Number of palette entries to read.</param>
|
||||
/// <param name="paletteEntries">Array that receives the color values.<param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// The return value is E_INVALIDARG if firstEntryIndex + entryCount is greater
|
||||
/// than the actual number of palette entries as returned by GetPaletteEntryCount.
|
||||
/// The return value is DWRITE_E_NOCOLOR if the font does not have a palette
|
||||
/// with the specified palette index.
|
||||
/// </returns>
|
||||
STDMETHOD(GetPaletteEntries)(
|
||||
UINT32 colorPaletteIndex,
|
||||
UINT32 firstEntryIndex,
|
||||
UINT32 entryCount,
|
||||
_Out_writes_(entryCount) DWRITE_COLOR_F* paletteEntries
|
||||
) PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Determines the recommended text rendering and grid-fit mode to be used based on the
|
||||
/// font, size, world transform, and measuring mode.
|
||||
/// </summary>
|
||||
/// <param name="fontEmSize">Logical font size in DIPs.</param>
|
||||
/// <param name="dpiX">Number of pixels per logical inch in the horizontal direction.</param>
|
||||
/// <param name="dpiY">Number of pixels per logical inch in the vertical direction.</param>
|
||||
/// <param name="transform">Specifies the world transform.</param>
|
||||
/// <param name="outlineThreshold">Specifies the quality of the graphics system's outline rendering,
|
||||
/// affects the size threshold above which outline rendering is used.</param>
|
||||
/// <param name="measuringMode">Specifies the method used to measure during text layout. For proper
|
||||
/// glyph spacing, the function returns a rendering mode that is compatible with the specified
|
||||
/// measuring mode.</param>
|
||||
/// <param name="renderingParams">Rendering parameters object. This parameter is necessary in case the rendering parameters
|
||||
/// object overrides the rendering mode.</param>
|
||||
/// <param name="renderingMode">Receives the recommended rendering mode.</param>
|
||||
/// <param name="gridFitMode">Receives the recommended grid-fit mode.</param>
|
||||
/// <remarks>
|
||||
/// This method should be used to determine the actual rendering mode in cases where the rendering
|
||||
/// mode of the rendering params object is DWRITE_RENDERING_MODE_DEFAULT, and the actual grid-fit
|
||||
/// mode when the rendering params object is DWRITE_GRID_FIT_MODE_DEFAULT.
|
||||
/// </remarks>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
STDMETHOD(GetRecommendedRenderingMode)(
|
||||
FLOAT fontEmSize,
|
||||
FLOAT dpiX,
|
||||
FLOAT dpiY,
|
||||
_In_opt_ DWRITE_MATRIX const* transform,
|
||||
BOOL isSideways,
|
||||
DWRITE_OUTLINE_THRESHOLD outlineThreshold,
|
||||
DWRITE_MEASURING_MODE measuringMode,
|
||||
_In_opt_ IDWriteRenderingParams* renderingParams,
|
||||
_Out_ DWRITE_RENDERING_MODE* renderingMode,
|
||||
_Out_ DWRITE_GRID_FIT_MODE* gridFitMode
|
||||
) PURE;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Represents a color glyph run. The IDWriteFactory2::TranslateColorGlyphRun
|
||||
/// method returns an ordered collection of color glyph runs, which can be
|
||||
/// layered on top of each other to produce a color representation of the
|
||||
/// given base glyph run.
|
||||
/// </summary>
|
||||
struct DWRITE_COLOR_GLYPH_RUN
|
||||
{
|
||||
/// <summary>
|
||||
/// Glyph run to render.
|
||||
/// </summary>
|
||||
DWRITE_GLYPH_RUN glyphRun;
|
||||
|
||||
/// <summary>
|
||||
/// Optional glyph run description.
|
||||
/// </summary>
|
||||
_Maybenull_ DWRITE_GLYPH_RUN_DESCRIPTION* glyphRunDescription;
|
||||
|
||||
/// <summary>
|
||||
/// Location at which to draw this glyph run.
|
||||
/// </summary>
|
||||
FLOAT baselineOriginX;
|
||||
FLOAT baselineOriginY;
|
||||
|
||||
/// <summary>
|
||||
/// Color to use for this layer, if any. This is the same color that
|
||||
/// IDWriteFontFace2::GetPaletteEntries would return for the current
|
||||
/// palette index if the paletteIndex member is less than 0xFFFF. If
|
||||
/// the paletteIndex member is 0xFFFF then there is no associated
|
||||
/// palette entry, this member is set to { 0, 0, 0, 0 }, and the client
|
||||
/// should use the current foreground brush.
|
||||
/// </summary>
|
||||
DWRITE_COLOR_F runColor;
|
||||
|
||||
/// <summary>
|
||||
/// Zero-based index of this layer's color entry in the current color
|
||||
/// palette, or 0xFFFF if this layer is to be rendered using
|
||||
/// the current foreground brush.
|
||||
/// </summary>
|
||||
UINT16 paletteIndex;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Enumerator for an ordered collection of color glyph runs.
|
||||
/// </summary>
|
||||
interface DWRITE_DECLARE_INTERFACE("d31fbe17-f157-41a2-8d24-cb779e0560e8") IDWriteColorGlyphRunEnumerator : public IUnknown
|
||||
{
|
||||
/// <summary>
|
||||
/// Advances to the first or next color run. The runs are enumerated
|
||||
/// in order from back to front.
|
||||
/// </summary>
|
||||
/// <param name="hasRun">Receives TRUE if there is a current run or
|
||||
/// FALSE if the end of the sequence has been reached.</param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
STDMETHOD(MoveNext)(
|
||||
_Out_ BOOL* hasRun
|
||||
) PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current color glyph run.
|
||||
/// </summary>
|
||||
/// <param name="colorGlyphRun">Receives a pointer to the color
|
||||
/// glyph run. The pointer remains valid until the next call to
|
||||
/// MoveNext or until the interface is released.</param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code. An error is returned if there is
|
||||
/// no current glyph run, i.e., if MoveNext has not yet been called
|
||||
/// or if the end of the sequence has been reached.
|
||||
/// </returns>
|
||||
STDMETHOD(GetCurrentRun)(
|
||||
_Outptr_ DWRITE_COLOR_GLYPH_RUN const** colorGlyphRun
|
||||
) PURE;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// The interface that represents text rendering settings for glyph rasterization and filtering.
|
||||
/// </summary>
|
||||
interface DWRITE_DECLARE_INTERFACE("F9D711C3-9777-40AE-87E8-3E5AF9BF0948") IDWriteRenderingParams2 : public IDWriteRenderingParams1
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the grid fitting mode.
|
||||
/// </summary>
|
||||
STDMETHOD_(DWRITE_GRID_FIT_MODE, GetGridFitMode)() PURE;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// The root factory interface for all DWrite objects.
|
||||
/// </summary>
|
||||
interface DWRITE_DECLARE_INTERFACE("0439fc60-ca44-4994-8dee-3a9af7b732ec") IDWriteFactory2 : public IDWriteFactory1
|
||||
{
|
||||
/// <summary>
|
||||
/// Get the system-appropriate font fallback mapping list.
|
||||
/// </summary>
|
||||
/// <param name="fontFallback">The system fallback list.</param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
STDMETHOD(GetSystemFontFallback)(
|
||||
_COM_Outptr_ IDWriteFontFallback** fontFallback
|
||||
) PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Create a custom font fallback builder.
|
||||
/// </summary>
|
||||
/// <param name="fontFallbackBuilder">Empty font fallback builder.</param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
STDMETHOD(CreateFontFallbackBuilder)(
|
||||
_COM_Outptr_ IDWriteFontFallbackBuilder** fontFallbackBuilder
|
||||
) PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Translates a glyph run to a sequence of color glyph runs, which can be
|
||||
/// rendered to produce a color representation of the original "base" run.
|
||||
/// </summary>
|
||||
/// <param name="baselineOriginX">Horizontal origin of the base glyph run in
|
||||
/// pre-transform coordinates.</param>
|
||||
/// <param name="baselineOriginY">Vertical origin of the base glyph run in
|
||||
/// pre-transform coordinates.</param>
|
||||
/// <param name="glyphRun">Pointer to the original "base" glyph run.</param>
|
||||
/// <param name="glyphRunDescription">Optional glyph run description.</param>
|
||||
/// <param name="measuringMode">Measuring mode, needed to compute the origins
|
||||
/// of each glyph.</param>
|
||||
/// <param name="worldToDeviceTransform">Matrix converting from the client's
|
||||
/// coordinate space to device coordinates (pixels), i.e., the world transform
|
||||
/// multiplied by any DPI scaling.</param>
|
||||
/// <param name="colorPaletteIndex">Zero-based index of the color palette to use.
|
||||
/// Valid indices are less than the number of palettes in the font, as returned
|
||||
/// by IDWriteFontFace2::GetColorPaletteCount.</param>
|
||||
/// <param name="colorLayers">If the function succeeds, receives a pointer
|
||||
/// to an enumerator object that can be used to obtain the color glyph runs.
|
||||
/// If the base run has no color glyphs, then the output pointer is NULL
|
||||
/// and the method returns DWRITE_E_NOCOLOR.</param>
|
||||
/// <returns>
|
||||
/// Returns DWRITE_E_NOCOLOR if the font has no color information, the base
|
||||
/// glyph run does not contain any color glyphs, or the specified color palette
|
||||
/// index is out of range. In this case, the client should render the base glyph
|
||||
/// run. Otherwise, returns a standard HRESULT error code.
|
||||
/// </returns>
|
||||
STDMETHOD(TranslateColorGlyphRun)(
|
||||
FLOAT baselineOriginX,
|
||||
FLOAT baselineOriginY,
|
||||
_In_ DWRITE_GLYPH_RUN const* glyphRun,
|
||||
_In_opt_ DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription,
|
||||
DWRITE_MEASURING_MODE measuringMode,
|
||||
_In_opt_ DWRITE_MATRIX const* worldToDeviceTransform,
|
||||
UINT32 colorPaletteIndex,
|
||||
_COM_Outptr_ IDWriteColorGlyphRunEnumerator** colorLayers
|
||||
) PURE;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a rendering parameters object with the specified properties.
|
||||
/// </summary>
|
||||
/// <param name="gamma">The gamma value used for gamma correction, which must be greater than zero and cannot exceed 256.</param>
|
||||
/// <param name="enhancedContrast">The amount of contrast enhancement, zero or greater.</param>
|
||||
/// <param name="clearTypeLevel">The degree of ClearType level, from 0.0f (no ClearType) to 1.0f (full ClearType).</param>
|
||||
/// <param name="pixelGeometry">The geometry of a device pixel.</param>
|
||||
/// <param name="renderingMode">Method of rendering glyphs. In most cases, this should be DWRITE_RENDERING_MODE_DEFAULT to automatically use an appropriate mode.</param>
|
||||
/// <param name="gridFitMode">How to grid fit glyph outlines. In most cases, this should be DWRITE_GRID_FIT_DEFAULT to automatically choose an appropriate mode.</param>
|
||||
/// <param name="renderingParams">Holds the newly created rendering parameters object, or NULL in case of failure.</param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
STDMETHOD(CreateCustomRenderingParams)(
|
||||
FLOAT gamma,
|
||||
FLOAT enhancedContrast,
|
||||
FLOAT grayscaleEnhancedContrast,
|
||||
FLOAT clearTypeLevel,
|
||||
DWRITE_PIXEL_GEOMETRY pixelGeometry,
|
||||
DWRITE_RENDERING_MODE renderingMode,
|
||||
DWRITE_GRID_FIT_MODE gridFitMode,
|
||||
_COM_Outptr_ IDWriteRenderingParams2** renderingParams
|
||||
) PURE;
|
||||
|
||||
using IDWriteFactory::CreateCustomRenderingParams;
|
||||
using IDWriteFactory1::CreateCustomRenderingParams;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a glyph run analysis object, which encapsulates information
|
||||
/// used to render a glyph run.
|
||||
/// </summary>
|
||||
/// <param name="glyphRun">Structure specifying the properties of the glyph run.</param>
|
||||
/// <param name="transform">Optional transform applied to the glyphs and their positions. This transform is applied after the
|
||||
/// scaling specified by the emSize and pixelsPerDip.</param>
|
||||
/// <param name="renderingMode">Specifies the rendering mode, which must be one of the raster rendering modes (i.e., not default
|
||||
/// and not outline).</param>
|
||||
/// <param name="measuringMode">Specifies the method to measure glyphs.</param>
|
||||
/// <param name="gridFitMode">How to grid-fit glyph outlines. This must be non-default.</param>
|
||||
/// <param name="baselineOriginX">Horizontal position of the baseline origin, in DIPs.</param>
|
||||
/// <param name="baselineOriginY">Vertical position of the baseline origin, in DIPs.</param>
|
||||
/// <param name="glyphRunAnalysis">Receives a pointer to the newly created object.</param>
|
||||
/// <returns>
|
||||
/// Standard HRESULT error code.
|
||||
/// </returns>
|
||||
STDMETHOD(CreateGlyphRunAnalysis)(
|
||||
_In_ DWRITE_GLYPH_RUN const* glyphRun,
|
||||
_In_opt_ DWRITE_MATRIX const* transform,
|
||||
DWRITE_RENDERING_MODE renderingMode,
|
||||
DWRITE_MEASURING_MODE measuringMode,
|
||||
DWRITE_GRID_FIT_MODE gridFitMode,
|
||||
DWRITE_TEXT_ANTIALIAS_MODE antialiasMode,
|
||||
FLOAT baselineOriginX,
|
||||
FLOAT baselineOriginY,
|
||||
_COM_Outptr_ IDWriteGlyphRunAnalysis** glyphRunAnalysis
|
||||
) PURE;
|
||||
|
||||
using IDWriteFactory::CreateGlyphRunAnalysis;
|
||||
};
|
||||
|
||||
|
||||
#endif /* DWRITE_2_H_INCLUDED */
|
||||
Vendored
+2059
File diff suppressed because it is too large
Load Diff
Vendored
+2953
File diff suppressed because it is too large
Load Diff
Vendored
+2474
File diff suppressed because it is too large
Load Diff
Vendored
+2121
File diff suppressed because it is too large
Load Diff
Vendored
+1494
File diff suppressed because it is too large
Load Diff
Vendored
+1533
File diff suppressed because it is too large
Load Diff
+137
@@ -0,0 +1,137 @@
|
||||
//
|
||||
// Copyright (C) Microsoft. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef __dxgiformat_h__
|
||||
#define __dxgiformat_h__
|
||||
|
||||
#define DXGI_FORMAT_DEFINED 1
|
||||
|
||||
typedef enum DXGI_FORMAT
|
||||
{
|
||||
DXGI_FORMAT_UNKNOWN = 0,
|
||||
DXGI_FORMAT_R32G32B32A32_TYPELESS = 1,
|
||||
DXGI_FORMAT_R32G32B32A32_FLOAT = 2,
|
||||
DXGI_FORMAT_R32G32B32A32_UINT = 3,
|
||||
DXGI_FORMAT_R32G32B32A32_SINT = 4,
|
||||
DXGI_FORMAT_R32G32B32_TYPELESS = 5,
|
||||
DXGI_FORMAT_R32G32B32_FLOAT = 6,
|
||||
DXGI_FORMAT_R32G32B32_UINT = 7,
|
||||
DXGI_FORMAT_R32G32B32_SINT = 8,
|
||||
DXGI_FORMAT_R16G16B16A16_TYPELESS = 9,
|
||||
DXGI_FORMAT_R16G16B16A16_FLOAT = 10,
|
||||
DXGI_FORMAT_R16G16B16A16_UNORM = 11,
|
||||
DXGI_FORMAT_R16G16B16A16_UINT = 12,
|
||||
DXGI_FORMAT_R16G16B16A16_SNORM = 13,
|
||||
DXGI_FORMAT_R16G16B16A16_SINT = 14,
|
||||
DXGI_FORMAT_R32G32_TYPELESS = 15,
|
||||
DXGI_FORMAT_R32G32_FLOAT = 16,
|
||||
DXGI_FORMAT_R32G32_UINT = 17,
|
||||
DXGI_FORMAT_R32G32_SINT = 18,
|
||||
DXGI_FORMAT_R32G8X24_TYPELESS = 19,
|
||||
DXGI_FORMAT_D32_FLOAT_S8X24_UINT = 20,
|
||||
DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS = 21,
|
||||
DXGI_FORMAT_X32_TYPELESS_G8X24_UINT = 22,
|
||||
DXGI_FORMAT_R10G10B10A2_TYPELESS = 23,
|
||||
DXGI_FORMAT_R10G10B10A2_UNORM = 24,
|
||||
DXGI_FORMAT_R10G10B10A2_UINT = 25,
|
||||
DXGI_FORMAT_R11G11B10_FLOAT = 26,
|
||||
DXGI_FORMAT_R8G8B8A8_TYPELESS = 27,
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM = 28,
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29,
|
||||
DXGI_FORMAT_R8G8B8A8_UINT = 30,
|
||||
DXGI_FORMAT_R8G8B8A8_SNORM = 31,
|
||||
DXGI_FORMAT_R8G8B8A8_SINT = 32,
|
||||
DXGI_FORMAT_R16G16_TYPELESS = 33,
|
||||
DXGI_FORMAT_R16G16_FLOAT = 34,
|
||||
DXGI_FORMAT_R16G16_UNORM = 35,
|
||||
DXGI_FORMAT_R16G16_UINT = 36,
|
||||
DXGI_FORMAT_R16G16_SNORM = 37,
|
||||
DXGI_FORMAT_R16G16_SINT = 38,
|
||||
DXGI_FORMAT_R32_TYPELESS = 39,
|
||||
DXGI_FORMAT_D32_FLOAT = 40,
|
||||
DXGI_FORMAT_R32_FLOAT = 41,
|
||||
DXGI_FORMAT_R32_UINT = 42,
|
||||
DXGI_FORMAT_R32_SINT = 43,
|
||||
DXGI_FORMAT_R24G8_TYPELESS = 44,
|
||||
DXGI_FORMAT_D24_UNORM_S8_UINT = 45,
|
||||
DXGI_FORMAT_R24_UNORM_X8_TYPELESS = 46,
|
||||
DXGI_FORMAT_X24_TYPELESS_G8_UINT = 47,
|
||||
DXGI_FORMAT_R8G8_TYPELESS = 48,
|
||||
DXGI_FORMAT_R8G8_UNORM = 49,
|
||||
DXGI_FORMAT_R8G8_UINT = 50,
|
||||
DXGI_FORMAT_R8G8_SNORM = 51,
|
||||
DXGI_FORMAT_R8G8_SINT = 52,
|
||||
DXGI_FORMAT_R16_TYPELESS = 53,
|
||||
DXGI_FORMAT_R16_FLOAT = 54,
|
||||
DXGI_FORMAT_D16_UNORM = 55,
|
||||
DXGI_FORMAT_R16_UNORM = 56,
|
||||
DXGI_FORMAT_R16_UINT = 57,
|
||||
DXGI_FORMAT_R16_SNORM = 58,
|
||||
DXGI_FORMAT_R16_SINT = 59,
|
||||
DXGI_FORMAT_R8_TYPELESS = 60,
|
||||
DXGI_FORMAT_R8_UNORM = 61,
|
||||
DXGI_FORMAT_R8_UINT = 62,
|
||||
DXGI_FORMAT_R8_SNORM = 63,
|
||||
DXGI_FORMAT_R8_SINT = 64,
|
||||
DXGI_FORMAT_A8_UNORM = 65,
|
||||
DXGI_FORMAT_R1_UNORM = 66,
|
||||
DXGI_FORMAT_R9G9B9E5_SHAREDEXP = 67,
|
||||
DXGI_FORMAT_R8G8_B8G8_UNORM = 68,
|
||||
DXGI_FORMAT_G8R8_G8B8_UNORM = 69,
|
||||
DXGI_FORMAT_BC1_TYPELESS = 70,
|
||||
DXGI_FORMAT_BC1_UNORM = 71,
|
||||
DXGI_FORMAT_BC1_UNORM_SRGB = 72,
|
||||
DXGI_FORMAT_BC2_TYPELESS = 73,
|
||||
DXGI_FORMAT_BC2_UNORM = 74,
|
||||
DXGI_FORMAT_BC2_UNORM_SRGB = 75,
|
||||
DXGI_FORMAT_BC3_TYPELESS = 76,
|
||||
DXGI_FORMAT_BC3_UNORM = 77,
|
||||
DXGI_FORMAT_BC3_UNORM_SRGB = 78,
|
||||
DXGI_FORMAT_BC4_TYPELESS = 79,
|
||||
DXGI_FORMAT_BC4_UNORM = 80,
|
||||
DXGI_FORMAT_BC4_SNORM = 81,
|
||||
DXGI_FORMAT_BC5_TYPELESS = 82,
|
||||
DXGI_FORMAT_BC5_UNORM = 83,
|
||||
DXGI_FORMAT_BC5_SNORM = 84,
|
||||
DXGI_FORMAT_B5G6R5_UNORM = 85,
|
||||
DXGI_FORMAT_B5G5R5A1_UNORM = 86,
|
||||
DXGI_FORMAT_B8G8R8A8_UNORM = 87,
|
||||
DXGI_FORMAT_B8G8R8X8_UNORM = 88,
|
||||
DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM = 89,
|
||||
DXGI_FORMAT_B8G8R8A8_TYPELESS = 90,
|
||||
DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 91,
|
||||
DXGI_FORMAT_B8G8R8X8_TYPELESS = 92,
|
||||
DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 93,
|
||||
DXGI_FORMAT_BC6H_TYPELESS = 94,
|
||||
DXGI_FORMAT_BC6H_UF16 = 95,
|
||||
DXGI_FORMAT_BC6H_SF16 = 96,
|
||||
DXGI_FORMAT_BC7_TYPELESS = 97,
|
||||
DXGI_FORMAT_BC7_UNORM = 98,
|
||||
DXGI_FORMAT_BC7_UNORM_SRGB = 99,
|
||||
DXGI_FORMAT_AYUV = 100,
|
||||
DXGI_FORMAT_Y410 = 101,
|
||||
DXGI_FORMAT_Y416 = 102,
|
||||
DXGI_FORMAT_NV12 = 103,
|
||||
DXGI_FORMAT_P010 = 104,
|
||||
DXGI_FORMAT_P016 = 105,
|
||||
DXGI_FORMAT_420_OPAQUE = 106,
|
||||
DXGI_FORMAT_YUY2 = 107,
|
||||
DXGI_FORMAT_Y210 = 108,
|
||||
DXGI_FORMAT_Y216 = 109,
|
||||
DXGI_FORMAT_NV11 = 110,
|
||||
DXGI_FORMAT_AI44 = 111,
|
||||
DXGI_FORMAT_IA44 = 112,
|
||||
DXGI_FORMAT_P8 = 113,
|
||||
DXGI_FORMAT_A8P8 = 114,
|
||||
DXGI_FORMAT_B4G4R4A4_UNORM = 115,
|
||||
|
||||
DXGI_FORMAT_P208 = 130,
|
||||
DXGI_FORMAT_V208 = 131,
|
||||
DXGI_FORMAT_V408 = 132,
|
||||
|
||||
|
||||
DXGI_FORMAT_FORCE_UINT = 0xffffffff
|
||||
} DXGI_FORMAT;
|
||||
|
||||
#endif // __dxgiformat_h__
|
||||
Vendored
+149
@@ -0,0 +1,149 @@
|
||||
//
|
||||
// Copyright (C) Microsoft. All rights reserved.
|
||||
//
|
||||
#ifndef __dxgitype_h__
|
||||
#define __dxgitype_h__
|
||||
|
||||
#include "dxgiformat.h"
|
||||
|
||||
#define _FACDXGI 0x87a
|
||||
#define MAKE_DXGI_HRESULT(code) MAKE_HRESULT(1, _FACDXGI, code)
|
||||
#define MAKE_DXGI_STATUS(code) MAKE_HRESULT(0, _FACDXGI, code)
|
||||
|
||||
// DXGI error messages have moved to winerror.h
|
||||
|
||||
#define DXGI_CPU_ACCESS_NONE ( 0 )
|
||||
#define DXGI_CPU_ACCESS_DYNAMIC ( 1 )
|
||||
#define DXGI_CPU_ACCESS_READ_WRITE ( 2 )
|
||||
#define DXGI_CPU_ACCESS_SCRATCH ( 3 )
|
||||
#define DXGI_CPU_ACCESS_FIELD 15
|
||||
|
||||
|
||||
typedef struct DXGI_RGB
|
||||
{
|
||||
float Red;
|
||||
float Green;
|
||||
float Blue;
|
||||
} DXGI_RGB;
|
||||
|
||||
#ifndef D3DCOLORVALUE_DEFINED
|
||||
typedef struct _D3DCOLORVALUE {
|
||||
float r;
|
||||
float g;
|
||||
float b;
|
||||
float a;
|
||||
} D3DCOLORVALUE;
|
||||
|
||||
#define D3DCOLORVALUE_DEFINED
|
||||
#endif
|
||||
|
||||
typedef D3DCOLORVALUE DXGI_RGBA;
|
||||
|
||||
typedef struct DXGI_GAMMA_CONTROL
|
||||
{
|
||||
DXGI_RGB Scale;
|
||||
DXGI_RGB Offset;
|
||||
DXGI_RGB GammaCurve[ 1025 ];
|
||||
} DXGI_GAMMA_CONTROL;
|
||||
|
||||
typedef struct DXGI_GAMMA_CONTROL_CAPABILITIES
|
||||
{
|
||||
BOOL ScaleAndOffsetSupported;
|
||||
float MaxConvertedValue;
|
||||
float MinConvertedValue;
|
||||
UINT NumGammaControlPoints;
|
||||
float ControlPointPositions[1025];
|
||||
} DXGI_GAMMA_CONTROL_CAPABILITIES;
|
||||
|
||||
typedef struct DXGI_RATIONAL
|
||||
{
|
||||
UINT Numerator;
|
||||
UINT Denominator;
|
||||
} DXGI_RATIONAL;
|
||||
|
||||
typedef enum DXGI_MODE_SCANLINE_ORDER
|
||||
{
|
||||
DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED = 0,
|
||||
DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE = 1,
|
||||
DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST = 2,
|
||||
DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST = 3
|
||||
} DXGI_MODE_SCANLINE_ORDER;
|
||||
|
||||
typedef enum DXGI_MODE_SCALING
|
||||
{
|
||||
DXGI_MODE_SCALING_UNSPECIFIED = 0,
|
||||
DXGI_MODE_SCALING_CENTERED = 1,
|
||||
DXGI_MODE_SCALING_STRETCHED = 2
|
||||
} DXGI_MODE_SCALING;
|
||||
|
||||
typedef enum DXGI_MODE_ROTATION
|
||||
{
|
||||
DXGI_MODE_ROTATION_UNSPECIFIED = 0,
|
||||
DXGI_MODE_ROTATION_IDENTITY = 1,
|
||||
DXGI_MODE_ROTATION_ROTATE90 = 2,
|
||||
DXGI_MODE_ROTATION_ROTATE180 = 3,
|
||||
DXGI_MODE_ROTATION_ROTATE270 = 4
|
||||
} DXGI_MODE_ROTATION;
|
||||
|
||||
typedef struct DXGI_MODE_DESC
|
||||
{
|
||||
UINT Width;
|
||||
UINT Height;
|
||||
DXGI_RATIONAL RefreshRate;
|
||||
DXGI_FORMAT Format;
|
||||
DXGI_MODE_SCANLINE_ORDER ScanlineOrdering;
|
||||
DXGI_MODE_SCALING Scaling;
|
||||
} DXGI_MODE_DESC;
|
||||
|
||||
// The following values are used with DXGI_SAMPLE_DESC::Quality:
|
||||
#define DXGI_STANDARD_MULTISAMPLE_QUALITY_PATTERN 0xffffffff
|
||||
#define DXGI_CENTER_MULTISAMPLE_QUALITY_PATTERN 0xfffffffe
|
||||
|
||||
typedef struct DXGI_SAMPLE_DESC
|
||||
{
|
||||
UINT Count;
|
||||
UINT Quality;
|
||||
} DXGI_SAMPLE_DESC;
|
||||
|
||||
typedef enum DXGI_COLOR_SPACE_TYPE
|
||||
{
|
||||
DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 = 0,
|
||||
DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 = 1,
|
||||
DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P709 = 2,
|
||||
DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P2020 = 3,
|
||||
DXGI_COLOR_SPACE_RESERVED = 4,
|
||||
DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 = 5,
|
||||
DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 = 6,
|
||||
DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P601 = 7,
|
||||
DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 = 8,
|
||||
DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P709 = 9,
|
||||
DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 = 10,
|
||||
DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 = 11,
|
||||
DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 = 12,
|
||||
DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_LEFT_P2020 = 13,
|
||||
DXGI_COLOR_SPACE_RGB_STUDIO_G2084_NONE_P2020 = 14,
|
||||
DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_TOPLEFT_P2020 = 15,
|
||||
DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_TOPLEFT_P2020 = 16,
|
||||
DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P2020 = 17,
|
||||
DXGI_COLOR_SPACE_CUSTOM = 0xFFFFFFFF
|
||||
} DXGI_COLOR_SPACE_TYPE;
|
||||
|
||||
typedef struct DXGI_JPEG_DC_HUFFMAN_TABLE
|
||||
{
|
||||
BYTE CodeCounts[12];
|
||||
BYTE CodeValues[12];
|
||||
} DXGI_JPEG_DC_HUFFMAN_TABLE;
|
||||
|
||||
typedef struct DXGI_JPEG_AC_HUFFMAN_TABLE
|
||||
{
|
||||
BYTE CodeCounts[16];
|
||||
BYTE CodeValues[162];
|
||||
} DXGI_JPEG_AC_HUFFMAN_TABLE;
|
||||
|
||||
typedef struct DXGI_JPEG_QUANTIZATION_TABLE
|
||||
{
|
||||
BYTE Elements[64];
|
||||
} DXGI_JPEG_QUANTIZATION_TABLE;
|
||||
|
||||
#endif // __dxgitype_h__
|
||||
|
||||
+295
@@ -0,0 +1,295 @@
|
||||
/*
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
Module Name:
|
||||
|
||||
sdkddkver.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Master include file for versioning windows SDK/DDK.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef _INC_SDKDDKVER
|
||||
#define _INC_SDKDDKVER
|
||||
|
||||
#if (_MSC_VER >= 800)
|
||||
#if (_MSC_VER >= 1200)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4668) /* #if not_defined treated as #if 0 */
|
||||
#endif
|
||||
#pragma warning(disable:4001) /* nonstandard extension : single line comment */
|
||||
#endif
|
||||
|
||||
#pragma once
|
||||
|
||||
//
|
||||
// _WIN32_WINNT version constants
|
||||
//
|
||||
#define _WIN32_WINNT_NT4 0x0400
|
||||
#define _WIN32_WINNT_WIN2K 0x0500
|
||||
#define _WIN32_WINNT_WINXP 0x0501
|
||||
#define _WIN32_WINNT_WS03 0x0502
|
||||
#define _WIN32_WINNT_WIN6 0x0600
|
||||
#define _WIN32_WINNT_VISTA 0x0600
|
||||
#define _WIN32_WINNT_WS08 0x0600
|
||||
#define _WIN32_WINNT_LONGHORN 0x0600
|
||||
#define _WIN32_WINNT_WIN7 0x0601
|
||||
#define _WIN32_WINNT_WIN8 0x0602
|
||||
#define _WIN32_WINNT_WINBLUE 0x0603
|
||||
#define _WIN32_WINNT_WINTHRESHOLD 0x0A00 /* ABRACADABRA_THRESHOLD*/
|
||||
#define _WIN32_WINNT_WIN10 0x0A00 /* ABRACADABRA_THRESHOLD*/
|
||||
|
||||
//
|
||||
// _WIN32_IE_ version constants
|
||||
//
|
||||
#define _WIN32_IE_IE20 0x0200
|
||||
#define _WIN32_IE_IE30 0x0300
|
||||
#define _WIN32_IE_IE302 0x0302
|
||||
#define _WIN32_IE_IE40 0x0400
|
||||
#define _WIN32_IE_IE401 0x0401
|
||||
#define _WIN32_IE_IE50 0x0500
|
||||
#define _WIN32_IE_IE501 0x0501
|
||||
#define _WIN32_IE_IE55 0x0550
|
||||
#define _WIN32_IE_IE60 0x0600
|
||||
#define _WIN32_IE_IE60SP1 0x0601
|
||||
#define _WIN32_IE_IE60SP2 0x0603
|
||||
#define _WIN32_IE_IE70 0x0700
|
||||
#define _WIN32_IE_IE80 0x0800
|
||||
#define _WIN32_IE_IE90 0x0900
|
||||
#define _WIN32_IE_IE100 0x0A00
|
||||
#define _WIN32_IE_IE110 0x0A00 /* ABRACADABRA_THRESHOLD */
|
||||
|
||||
//
|
||||
// IE <-> OS version mapping
|
||||
//
|
||||
// NT4 supports IE versions 2.0 -> 6.0 SP1
|
||||
#define _WIN32_IE_NT4 _WIN32_IE_IE20
|
||||
#define _WIN32_IE_NT4SP1 _WIN32_IE_IE20
|
||||
#define _WIN32_IE_NT4SP2 _WIN32_IE_IE20
|
||||
#define _WIN32_IE_NT4SP3 _WIN32_IE_IE302
|
||||
#define _WIN32_IE_NT4SP4 _WIN32_IE_IE401
|
||||
#define _WIN32_IE_NT4SP5 _WIN32_IE_IE401
|
||||
#define _WIN32_IE_NT4SP6 _WIN32_IE_IE50
|
||||
// Win98 supports IE versions 4.01 -> 6.0 SP1
|
||||
#define _WIN32_IE_WIN98 _WIN32_IE_IE401
|
||||
// Win98SE supports IE versions 5.0 -> 6.0 SP1
|
||||
#define _WIN32_IE_WIN98SE _WIN32_IE_IE50
|
||||
// WinME supports IE versions 5.5 -> 6.0 SP1
|
||||
#define _WIN32_IE_WINME _WIN32_IE_IE55
|
||||
// Win2k supports IE versions 5.01 -> 6.0 SP1
|
||||
#define _WIN32_IE_WIN2K _WIN32_IE_IE501
|
||||
#define _WIN32_IE_WIN2KSP1 _WIN32_IE_IE501
|
||||
#define _WIN32_IE_WIN2KSP2 _WIN32_IE_IE501
|
||||
#define _WIN32_IE_WIN2KSP3 _WIN32_IE_IE501
|
||||
#define _WIN32_IE_WIN2KSP4 _WIN32_IE_IE501
|
||||
#define _WIN32_IE_XP _WIN32_IE_IE60
|
||||
#define _WIN32_IE_XPSP1 _WIN32_IE_IE60SP1
|
||||
#define _WIN32_IE_XPSP2 _WIN32_IE_IE60SP2
|
||||
#define _WIN32_IE_WS03 0x0602
|
||||
#define _WIN32_IE_WS03SP1 _WIN32_IE_IE60SP2
|
||||
#define _WIN32_IE_WIN6 _WIN32_IE_IE70
|
||||
#define _WIN32_IE_LONGHORN _WIN32_IE_IE70
|
||||
#define _WIN32_IE_WIN7 _WIN32_IE_IE80
|
||||
#define _WIN32_IE_WIN8 _WIN32_IE_IE100
|
||||
#define _WIN32_IE_WINBLUE _WIN32_IE_IE100
|
||||
#define _WIN32_IE_WINTHRESHOLD _WIN32_IE_IE110 /* ABRACADABRA_THRESHOLD */
|
||||
#define _WIN32_IE_WIN10 _WIN32_IE_IE110 /* ABRACADABRA_THRESHOLD */
|
||||
|
||||
|
||||
//
|
||||
// NTDDI version constants
|
||||
//
|
||||
#define NTDDI_WIN2K 0x05000000
|
||||
#define NTDDI_WIN2KSP1 0x05000100
|
||||
#define NTDDI_WIN2KSP2 0x05000200
|
||||
#define NTDDI_WIN2KSP3 0x05000300
|
||||
#define NTDDI_WIN2KSP4 0x05000400
|
||||
|
||||
#define NTDDI_WINXP 0x05010000
|
||||
#define NTDDI_WINXPSP1 0x05010100
|
||||
#define NTDDI_WINXPSP2 0x05010200
|
||||
#define NTDDI_WINXPSP3 0x05010300
|
||||
#define NTDDI_WINXPSP4 0x05010400
|
||||
|
||||
#define NTDDI_WS03 0x05020000
|
||||
#define NTDDI_WS03SP1 0x05020100
|
||||
#define NTDDI_WS03SP2 0x05020200
|
||||
#define NTDDI_WS03SP3 0x05020300
|
||||
#define NTDDI_WS03SP4 0x05020400
|
||||
|
||||
#define NTDDI_WIN6 0x06000000
|
||||
#define NTDDI_WIN6SP1 0x06000100
|
||||
#define NTDDI_WIN6SP2 0x06000200
|
||||
#define NTDDI_WIN6SP3 0x06000300
|
||||
#define NTDDI_WIN6SP4 0x06000400
|
||||
|
||||
#define NTDDI_VISTA NTDDI_WIN6
|
||||
#define NTDDI_VISTASP1 NTDDI_WIN6SP1
|
||||
#define NTDDI_VISTASP2 NTDDI_WIN6SP2
|
||||
#define NTDDI_VISTASP3 NTDDI_WIN6SP3
|
||||
#define NTDDI_VISTASP4 NTDDI_WIN6SP4
|
||||
|
||||
#define NTDDI_LONGHORN NTDDI_VISTA
|
||||
|
||||
#define NTDDI_WS08 NTDDI_WIN6SP1
|
||||
#define NTDDI_WS08SP2 NTDDI_WIN6SP2
|
||||
#define NTDDI_WS08SP3 NTDDI_WIN6SP3
|
||||
#define NTDDI_WS08SP4 NTDDI_WIN6SP4
|
||||
|
||||
#define NTDDI_WIN7 0x06010000
|
||||
#define NTDDI_WIN8 0x06020000
|
||||
#define NTDDI_WINBLUE 0x06030000
|
||||
#define NTDDI_WINTHRESHOLD 0x0A000000 /* ABRACADABRA_THRESHOLD */
|
||||
#define NTDDI_WIN10 0x0A000000 /* ABRACADABRA_THRESHOLD */
|
||||
#define NTDDI_WIN10_TH2 0x0A000001 /* ABRACADABRA_WIN10_TH2 */
|
||||
#define NTDDI_WIN10_RS1 0x0A000002 /* ABRACADABRA_WIN10_RS1 */
|
||||
|
||||
//
|
||||
// masks for version macros
|
||||
//
|
||||
#define OSVERSION_MASK 0xFFFF0000
|
||||
#define SPVERSION_MASK 0x0000FF00
|
||||
#define SUBVERSION_MASK 0x000000FF
|
||||
|
||||
|
||||
//
|
||||
// macros to extract various version fields from the NTDDI version
|
||||
//
|
||||
#define OSVER(Version) ((Version) & OSVERSION_MASK)
|
||||
#define SPVER(Version) (((Version) & SPVERSION_MASK) >> 8)
|
||||
#define SUBVER(Version) (((Version) & SUBVERSION_MASK) )
|
||||
|
||||
|
||||
#if defined(DECLSPEC_DEPRECATED_DDK)
|
||||
|
||||
// deprecate in 2k or later
|
||||
#if (NTDDI_VERSION >= NTDDI_WIN2K)
|
||||
#define DECLSPEC_DEPRECATED_DDK_WIN2K DECLSPEC_DEPRECATED_DDK
|
||||
#else
|
||||
#define DECLSPEC_DEPRECATED_DDK_WIN2K
|
||||
#endif
|
||||
|
||||
// deprecate in XP or later
|
||||
#if (NTDDI_VERSION >= NTDDI_WINXP)
|
||||
#define DECLSPEC_DEPRECATED_DDK_WINXP DECLSPEC_DEPRECATED_DDK
|
||||
#else
|
||||
#define DECLSPEC_DEPRECATED_DDK_WINXP
|
||||
#endif
|
||||
|
||||
// deprecate in WS03 or later
|
||||
#if (NTDDI_VERSION >= NTDDI_WS03)
|
||||
#define DECLSPEC_DEPRECATED_DDK_WIN2003 DECLSPEC_DEPRECATED_DDK
|
||||
#else
|
||||
#define DECLSPEC_DEPRECATED_DDK_WIN2003
|
||||
#endif
|
||||
|
||||
// deprecate in WIN6 or later
|
||||
#if (NTDDI_VERSION >= NTDDI_WIN6)
|
||||
#define DECLSPEC_DEPRECATED_DDK_WIN6 DECLSPEC_DEPRECATED_DDK
|
||||
#else
|
||||
#define DECLSPEC_DEPRECATED_DDK_WIN6
|
||||
#endif
|
||||
|
||||
#define DECLSPEC_DEPRECATED_DDK_LONGHORN DECLSPEC_DEPRECATED_DDK_WIN6
|
||||
|
||||
#endif // defined(DECLSPEC_DEPRECATED_DDK)
|
||||
|
||||
|
||||
//
|
||||
// if versions aren't already defined, default to most current
|
||||
//
|
||||
|
||||
#define NTDDI_VERSION_FROM_WIN32_WINNT2(ver) ver##0000
|
||||
#define NTDDI_VERSION_FROM_WIN32_WINNT(ver) NTDDI_VERSION_FROM_WIN32_WINNT2(ver)
|
||||
|
||||
#if !defined(_WIN32_WINNT) && !defined(_CHICAGO_)
|
||||
#define _WIN32_WINNT 0x0A00
|
||||
#endif
|
||||
|
||||
#ifndef NTDDI_VERSION
|
||||
#ifdef _WIN32_WINNT
|
||||
// set NTDDI_VERSION based on _WIN32_WINNT
|
||||
#define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
|
||||
#else
|
||||
#define NTDDI_VERSION 0x0A000002
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef WINVER
|
||||
#ifdef _WIN32_WINNT
|
||||
// set WINVER based on _WIN32_WINNT
|
||||
#define WINVER _WIN32_WINNT
|
||||
#else
|
||||
#define WINVER 0x0A00
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32_IE
|
||||
#ifdef _WIN32_WINNT
|
||||
// set _WIN32_IE based on _WIN32_WINNT
|
||||
#if (_WIN32_WINNT <= _WIN32_WINNT_NT4)
|
||||
#define _WIN32_IE _WIN32_IE_IE50
|
||||
#elif (_WIN32_WINNT <= _WIN32_WINNT_WIN2K)
|
||||
#define _WIN32_IE _WIN32_IE_IE501
|
||||
#elif (_WIN32_WINNT <= _WIN32_WINNT_WINXP)
|
||||
#define _WIN32_IE _WIN32_IE_IE60
|
||||
#elif (_WIN32_WINNT <= _WIN32_WINNT_WS03)
|
||||
#define _WIN32_IE _WIN32_IE_WS03
|
||||
#elif (_WIN32_WINNT <= _WIN32_WINNT_VISTA)
|
||||
#define _WIN32_IE _WIN32_IE_LONGHORN
|
||||
#elif (_WIN32_WINNT <= _WIN32_WINNT_WIN7)
|
||||
#define _WIN32_IE _WIN32_IE_WIN7
|
||||
#elif (_WIN32_WINNT <= _WIN32_WINNT_WIN8)
|
||||
#define _WIN32_IE _WIN32_IE_WIN8
|
||||
#else
|
||||
#define _WIN32_IE 0x0A00
|
||||
#endif
|
||||
#else
|
||||
#define _WIN32_IE 0x0A00
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// Sanity check for compatible versions
|
||||
//
|
||||
#if defined(_WIN32_WINNT) && !defined(MIDL_PASS) && !defined(RC_INVOKED)
|
||||
|
||||
#if (defined(WINVER) && (WINVER < 0x0400) && (_WIN32_WINNT > 0x0400))
|
||||
#error WINVER setting conflicts with _WIN32_WINNT setting
|
||||
#endif
|
||||
|
||||
#if (((OSVERSION_MASK & NTDDI_VERSION) == NTDDI_WIN2K) && (_WIN32_WINNT != _WIN32_WINNT_WIN2K))
|
||||
#error NTDDI_VERSION setting conflicts with _WIN32_WINNT setting
|
||||
#endif
|
||||
|
||||
#if (((OSVERSION_MASK & NTDDI_VERSION) == NTDDI_WINXP) && (_WIN32_WINNT != _WIN32_WINNT_WINXP))
|
||||
#error NTDDI_VERSION setting conflicts with _WIN32_WINNT setting
|
||||
#endif
|
||||
|
||||
#if (((OSVERSION_MASK & NTDDI_VERSION) == NTDDI_WS03) && (_WIN32_WINNT != _WIN32_WINNT_WS03))
|
||||
#error NTDDI_VERSION setting conflicts with _WIN32_WINNT setting
|
||||
#endif
|
||||
|
||||
#if (((OSVERSION_MASK & NTDDI_VERSION) == NTDDI_VISTA) && (_WIN32_WINNT != _WIN32_WINNT_VISTA))
|
||||
#error NTDDI_VERSION setting conflicts with _WIN32_WINNT setting
|
||||
#endif
|
||||
|
||||
#if ((_WIN32_WINNT < _WIN32_WINNT_WIN2K) && (_WIN32_IE > _WIN32_IE_IE60SP1))
|
||||
#error _WIN32_WINNT settings conflicts with _WIN32_IE setting
|
||||
#endif
|
||||
|
||||
#endif // defined(_WIN32_WINNT) && !defined(MIDL_PASS) && !defined(_WINRESRC_)
|
||||
|
||||
#if (_MSC_VER >= 800)
|
||||
#if (_MSC_VER >= 1200)
|
||||
#pragma warning(pop)
|
||||
#else
|
||||
#pragma warning(default:4001) /* nonstandard extension : single line comment */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* !_INC_SDKDDKVER */
|
||||
|
||||
Vendored
+1158
File diff suppressed because it is too large
Load Diff
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
+1
Submodule 3rdparty/pugixml added at f205aaf6e1
Vendored
+6698
File diff suppressed because it is too large
Load Diff
Vendored
+3301
File diff suppressed because it is too large
Load Diff
+42
-2
@@ -1,6 +1,46 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
|
||||
set(ASMJIT_STATIC TRUE)
|
||||
|
||||
add_subdirectory( asmjit )
|
||||
if (NOT CMAKE_BUILD_TYPE)
|
||||
message(STATUS "No build type selected, default to Release")
|
||||
set(CMAKE_BUILD_TYPE "Release")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
message( FATAL_ERROR "RPCS3 can only be compiled on 64-bit platforms." )
|
||||
endif()
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1)
|
||||
message( FATAL_ERROR "RPCS3 requires at least gcc-5.1." )
|
||||
endif()
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 6.1)
|
||||
message( FATAL_ERROR "RPCS3 can't be compiled with gcc-6.1, see #1691." )
|
||||
endif()
|
||||
|
||||
find_program(CCACHE_FOUND ccache)
|
||||
if (CCACHE_FOUND)
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
||||
endif()
|
||||
|
||||
add_definitions(-DCMAKE_BUILD)
|
||||
|
||||
# We use libpng's static library and don't need to build the shared library and run the tests
|
||||
set(PNG_SHARED OFF CACHE BOOL "Build shared lib." FORCE)
|
||||
set(PNG_TESTS OFF CACHE BOOL "Build tests." FORCE)
|
||||
|
||||
# Select the version of libpng to use, default is builtin
|
||||
if (NOT USE_SYSTEM_LIBPNG)
|
||||
add_subdirectory( 3rdparty/libpng )
|
||||
endif()
|
||||
|
||||
option(VULKAN_PREBUILT "" OFF)
|
||||
|
||||
# TODO: do real installation, including copying directory structure
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${PROJECT_BINARY_DIR}/bin")
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${PROJECT_BINARY_DIR}/bin")
|
||||
add_subdirectory( Vulkan )
|
||||
add_subdirectory( rpcs3 )
|
||||
add_subdirectory( rsx_program_decompiler )
|
||||
|
||||
Binary file not shown.
@@ -1,36 +1,69 @@
|
||||
RPCS3
|
||||
=====
|
||||
|
||||
[](https://travis-ci.org/DHrpcs3/rpcs3)
|
||||
[](https://travis-ci.org/RPCS3/rpcs3)
|
||||
[](https://ci.appveyor.com/project/rpcs3/rpcs3/branch/master)
|
||||
[](https://scan.coverity.com/projects/3960)
|
||||
|
||||
An open-source PlayStation 3 emulator/debugger written in C++.
|
||||
|
||||
You can find some basic information in the [FAQ](https://github.com/DHrpcs3/rpcs3/wiki/FAQ). For discussion about this emulator and PS3 emulation please visit the [official forums](http://www.emunewz.net/forum/forumdisplay.php?fid=162).
|
||||
You can find some basic information in the [FAQ](https://github.com/RPCS3/rpcs3/wiki/FAQ). For discussion about this emulator and PS3 emulation please visit the [official forums](http://www.emunewz.net/forum/forumdisplay.php?fid=172).
|
||||
|
||||
Official Discord server: https://discord.me/RPCS3
|
||||
|
||||
Support Nekotekina on Patreon: https://www.patreon.com/Nekotekina
|
||||
|
||||
### Development
|
||||
|
||||
If you want to contribute please take a took at the [Coding Style](https://github.com/DHrpcs3/rpcs3/wiki/Coding-Style), [Roadmap](https://github.com/DHrpcs3/rpcs3/wiki/Roadmap) and [Developer Information](https://github.com/DHrpcs3/rpcs3/wiki/Developer-Information) pages. You should as well contact any of the developers in the forum in order to know about the current situation of the emulator.
|
||||
If you want to contribute please take a look at the [Coding Style](https://github.com/RPCS3/rpcs3/wiki/Coding-Style), [Roadmap](https://github.com/RPCS3/rpcs3/wiki/Roadmap) and [Developer Information](https://github.com/RPCS3/rpcs3/wiki/Developer-Information) pages. You should as well contact any of the developers in the forum in order to know about the current situation of the emulator.
|
||||
|
||||
|
||||
### Dependencies
|
||||
|
||||
__Windows__
|
||||
* [Visual C++ Redistributable Packages for Visual Studio 2013](http://www.microsoft.com/en-us/download/details.aspx?id=40784)
|
||||
* [OpenAL binaries](http://kcat.strangesoft.net/openal.html): download and copy `Win64\soft_oal.dll` to `rpcs3\bin\`
|
||||
* [Visual Studio 2017](https://www.visualstudio.com/downloads/)
|
||||
* [Visual C++ Redistributable Packages for Visual Studio 2017](https://go.microsoft.com/fwlink/?LinkId=746572)
|
||||
* [Cmake 3.1.0+](http://www.cmake.org/download/) (required; add to PATH)
|
||||
* [Python 3.3+](https://www.python.org/downloads/) (required; add to PATH)
|
||||
|
||||
__Linux__
|
||||
* Debian & Ubuntu: `sudo apt-get install libopenal-dev libwxgtk3.0-dev build-essential`
|
||||
* GCC 5.1+ or Clang 3.5.0+ ([not GCC 6.1](https://github.com/RPCS3/rpcs3/issues/1691))
|
||||
* Debian & Ubuntu: `sudo apt-get install cmake build-essential libopenal-dev libwxgtk3.0-dev libglew-dev zlib1g-dev libedit-dev libvulkan-dev git`
|
||||
* Arch: `sudo pacman -S glew openal wxgtk cmake llvm`
|
||||
|
||||
__Mac OSX__
|
||||
Mac OSX is not supported at this moment because it doesn't meet system requirements (OpenGL 4.3)
|
||||
* Xcode 6+ (tested with Xcode 6.4)
|
||||
* Install with Homebrew: `brew install glew wxwidgets`
|
||||
* Remove '-framework QuickTime' from '_ldflags' in /usr/local/bin/wx-config
|
||||
|
||||
|
||||
### Building
|
||||
|
||||
To initialize the repository don't forget to execute `git submodule update --init` to pull the wxWidgets source.
|
||||
* __Windows__: Install *Visual Studio 2013*. Then open the *.SLN* file, and press *Build* > *Rebuild Solution*.
|
||||
* __Linux & Mac OSX__:
|
||||
`cd rpcs3 && cmake CMakeLists.txt && make && cd ../` Then run with `cd bin && ./rpcs3`
|
||||
- __Windows__: </br>
|
||||
1) To initialize the repository don't forget to execute `git submodule update --init` to pull the submodules. </br>
|
||||
2) Open the *.SLN* file. </br>
|
||||
3) Build the projects in *__BUILD_BEFORE* folder: right-click on every project > *Build*. </br>
|
||||
4) Press *BUILD* > *Build Solution* or *Rebuild Solution*. </br>
|
||||
|
||||
- __Linux & Mac OSX__: </br>
|
||||
1) `git clone https://github.com/RPCS3/rpcs3.git` </br>
|
||||
2) `cd rpcs3/` </br>
|
||||
3) `git submodule update --init` </br>
|
||||
4) `cmake CMakeLists.txt && make GitVersion && make` </br>
|
||||
5) Run RPCS3 with `./bin/rpcs3` </br>
|
||||
|
||||
If you are on OSX and want to build with llvm don't forget to add `-DLLVM_DIR=...` (or wherever llvm brew was installed) to cmake invocation.
|
||||
|
||||
When using GDB, configure it to ignore SIGSEGV signal (`handle SIGSEGV nostop noprint`).
|
||||
|
||||
##### CMake Build Options (Linux & Mac OSX)
|
||||
|
||||
- ```-DUSE_SYSTEM_LIBPNG=ON/OFF``` (default = *OFF*) </br>
|
||||
Build against the shared libpng instead of using the builtin one. libpng 1.6+ highly recommended. Try this option if you get version conflict errors or only see black game icons.
|
||||
|
||||
- ```-DUSE_SYSTEM_FFMPEG=ON/OFF``` (default = *OFF*) </br>
|
||||
Build against the shared ffmpeg libraries instead of using the builtin patched version. Try this if the builtin version breaks the OpenGL renderer for you.
|
||||
|
||||
### License
|
||||
|
||||
Most files are licensed under the terms of GNU GPLv2 License, see LICENSE file for details. Some files may be licensed differently, check appropriate file headers for details.
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
template<typename T, size_t size> class SizedStack
|
||||
{
|
||||
T m_ptr[size];
|
||||
uint m_count;
|
||||
|
||||
public:
|
||||
SizedStack()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
~SizedStack()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
m_count = 0;
|
||||
}
|
||||
|
||||
bool Pop(T& dst)
|
||||
{
|
||||
if(!m_count)
|
||||
return false;
|
||||
|
||||
dst = m_ptr[--m_count];
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Push(const T& src)
|
||||
{
|
||||
if(m_count + 1 > size)
|
||||
return false;
|
||||
|
||||
m_ptr[m_count++] = src;
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t GetFreeCount() const
|
||||
{
|
||||
return size - m_count;
|
||||
}
|
||||
|
||||
size_t GetCount() const
|
||||
{
|
||||
return m_count;
|
||||
}
|
||||
|
||||
size_t GetMaxCount() const
|
||||
{
|
||||
return size;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T> struct ScopedPtr
|
||||
{
|
||||
private:
|
||||
T* m_ptr;
|
||||
|
||||
public:
|
||||
ScopedPtr() : m_ptr(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
ScopedPtr(T* ptr) : m_ptr(ptr)
|
||||
{
|
||||
}
|
||||
|
||||
~ScopedPtr()
|
||||
{
|
||||
Swap(nullptr);
|
||||
}
|
||||
|
||||
operator T*() { return m_ptr; }
|
||||
operator const T*() const { return m_ptr; }
|
||||
|
||||
T* operator ->() { return m_ptr; }
|
||||
const T* operator ->() const { return m_ptr; }
|
||||
|
||||
void Swap(T* ptr)
|
||||
{
|
||||
delete m_ptr;
|
||||
m_ptr = ptr;
|
||||
}
|
||||
};
|
||||
+1054
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,150 @@
|
||||
#pragma once
|
||||
|
||||
#include "Atomic.h"
|
||||
#include <memory>
|
||||
|
||||
// Unfinished. Only std::default_delete will work as expected.
|
||||
template<typename T, typename D>
|
||||
class atomic_ptr_base : D
|
||||
{
|
||||
protected:
|
||||
atomic_t<T*> m_ptr;
|
||||
|
||||
constexpr atomic_ptr_base(T* ptr)
|
||||
: m_ptr(ptr)
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
~atomic_ptr_base()
|
||||
{
|
||||
if (m_ptr)
|
||||
{
|
||||
(*this)(m_ptr.load());
|
||||
}
|
||||
}
|
||||
|
||||
D& get_deleter()
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
const D& get_deleter() const
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
// Simple atomic pointer with unique ownership. Draft, unfinished.
|
||||
template<typename T, typename D = std::default_delete<T>>
|
||||
class atomic_ptr final : atomic_ptr_base<T, D>
|
||||
{
|
||||
using base = atomic_ptr_base<T, D>;
|
||||
|
||||
static_assert(sizeof(T*) == sizeof(base), "atomic_ptr<> error: invalid deleter (empty class expected)");
|
||||
|
||||
public:
|
||||
constexpr atomic_ptr()
|
||||
: base(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
constexpr atomic_ptr(std::nullptr_t)
|
||||
: base(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
explicit atomic_ptr(T* ptr)
|
||||
: base(ptr)
|
||||
{
|
||||
}
|
||||
|
||||
template<typename T2, typename = std::enable_if_t<std::is_convertible<T2, T>::value>>
|
||||
atomic_ptr(std::unique_ptr<T2, D>&& ptr)
|
||||
: base(ptr.release())
|
||||
{
|
||||
}
|
||||
|
||||
atomic_ptr& operator =(std::nullptr_t)
|
||||
{
|
||||
if (T* old = base::m_ptr.exchange(nullptr))
|
||||
{
|
||||
this->get_deleter()(old);
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename T2, typename = std::enable_if_t<std::is_convertible<T2, T>::value>>
|
||||
atomic_ptr& operator =(std::unique_ptr<T2, D>&& ptr)
|
||||
{
|
||||
if (T* old = base::m_ptr.exchange(ptr.release()))
|
||||
{
|
||||
this->get_deleter()(old);
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
void swap(std::unique_ptr<T, D>& ptr)
|
||||
{
|
||||
ptr.reset(base::m_ptr.exchange(ptr.release()));
|
||||
}
|
||||
|
||||
std::add_lvalue_reference_t<T> operator *() const
|
||||
{
|
||||
return *base::m_ptr;
|
||||
}
|
||||
|
||||
T* operator ->() const
|
||||
{
|
||||
return base::m_ptr;
|
||||
}
|
||||
|
||||
T* get() const
|
||||
{
|
||||
return base::m_ptr;
|
||||
}
|
||||
|
||||
explicit operator bool() const
|
||||
{
|
||||
return base::m_ptr != nullptr;
|
||||
}
|
||||
|
||||
T* release() const
|
||||
{
|
||||
return base::m_ptr.exchange(0);
|
||||
}
|
||||
|
||||
void reset(T* ptr = nullptr)
|
||||
{
|
||||
if (T* old = base::m_ptr.exchange(ptr))
|
||||
{
|
||||
this->get_deleter()(old);
|
||||
}
|
||||
}
|
||||
|
||||
// Steal the pointer from `ptr`, convert old value to unique_ptr
|
||||
std::unique_ptr<T, D> exchange(std::unique_ptr<T, D>&& ptr)
|
||||
{
|
||||
return std::unique_ptr<T, D>(base::m_ptr.exchange(ptr.release()));
|
||||
}
|
||||
|
||||
// If pointer is null, steal it from `ptr`
|
||||
bool test_and_swap(std::unique_ptr<T, D>&& ptr)
|
||||
{
|
||||
if (base::m_ptr.compare_and_swap_test(nullptr, ptr.get()))
|
||||
{
|
||||
ptr.release();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T, typename D>
|
||||
class atomic_ptr<T[], D> final : atomic_ptr_base<T[], D>
|
||||
{
|
||||
// TODO
|
||||
};
|
||||
@@ -0,0 +1,73 @@
|
||||
#include "stdafx.h"
|
||||
#include "Config.h"
|
||||
#include "Emu/System.h"
|
||||
#include "AutoPause.h"
|
||||
|
||||
cfg::bool_entry g_cfg_debug_autopause_syscall(cfg::root.misc, "Automatically pause at system call");
|
||||
cfg::bool_entry g_cfg_debug_autopause_func_call(cfg::root.misc, "Automatically pause at function call");
|
||||
|
||||
debug::autopause& debug::autopause::get_instance()
|
||||
{
|
||||
// Use magic static
|
||||
static autopause instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
// Load Auto Pause Configuration from file "pause.bin"
|
||||
void debug::autopause::reload(void)
|
||||
{
|
||||
auto& instance = get_instance();
|
||||
|
||||
instance.m_pause_function.clear();
|
||||
instance.m_pause_syscall.clear();
|
||||
|
||||
// TODO: better format, possibly a config entry
|
||||
if (fs::file list{ fs::get_config_dir() + "pause.bin" })
|
||||
{
|
||||
u32 num;
|
||||
size_t fmax = list.size();
|
||||
size_t fcur = 0;
|
||||
list.seek(0);
|
||||
while (fcur <= fmax - sizeof(u32))
|
||||
{
|
||||
list.read(&num, sizeof(u32));
|
||||
fcur += sizeof(u32);
|
||||
if (num == 0xFFFFFFFF) break;
|
||||
|
||||
if (num < 1024)
|
||||
{
|
||||
instance.m_pause_syscall.emplace(num);
|
||||
LOG_WARNING(HLE, "Set autopause at syscall %lld", num);
|
||||
}
|
||||
else
|
||||
{
|
||||
instance.m_pause_function.emplace(num);
|
||||
LOG_WARNING(HLE, "Set autopause at function 0x%08x", num);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool debug::autopause::pause_syscall(u64 code)
|
||||
{
|
||||
if (g_cfg_debug_autopause_syscall && get_instance().m_pause_syscall.count(code) != 0)
|
||||
{
|
||||
Emu.Pause();
|
||||
LOG_SUCCESS(HLE, "Autopause triggered at syscall %lld", code);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool debug::autopause::pause_function(u32 code)
|
||||
{
|
||||
if (g_cfg_debug_autopause_func_call && get_instance().m_pause_function.count(code) != 0)
|
||||
{
|
||||
Emu.Pause();
|
||||
LOG_SUCCESS(HLE, "Autopause triggered at function 0x%08x", code);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include <unordered_set>
|
||||
|
||||
// Regarded as a Debugger Enchantment
|
||||
namespace debug
|
||||
{
|
||||
// To store the pause function/call id, and let those pause there.
|
||||
// Would be with a GUI to configure those.
|
||||
class autopause
|
||||
{
|
||||
std::unordered_set<u64> m_pause_syscall;
|
||||
std::unordered_set<u32> m_pause_function;
|
||||
|
||||
static autopause& get_instance();
|
||||
public:
|
||||
|
||||
static void reload();
|
||||
static bool pause_syscall(u64 code);
|
||||
static bool pause_function(u32 code);
|
||||
};
|
||||
}
|
||||
+750
-145
@@ -1,194 +1,799 @@
|
||||
#pragma once
|
||||
|
||||
#include "Utilities/GNU.h"
|
||||
#include "types.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
using std::min;
|
||||
using std::max;
|
||||
|
||||
//#define re(val) MemoryBase::Reverse(val)
|
||||
#define re64(val) MemoryBase::Reverse64(val)
|
||||
#define re32(val) MemoryBase::Reverse32(val)
|
||||
#define re16(val) MemoryBase::Reverse16(val)
|
||||
|
||||
template<typename T, int size = sizeof(T)> struct se_t;
|
||||
template<typename T> struct se_t<T, 1> { static __forceinline void func(T& dst, const T src) { (u8&)dst = (u8&)src; } };
|
||||
template<typename T> struct se_t<T, 2> { static __forceinline void func(T& dst, const T src) { (u16&)dst = _byteswap_ushort((u16&)src); } };
|
||||
template<typename T> struct se_t<T, 4> { static __forceinline void func(T& dst, const T src) { (u32&)dst = _byteswap_ulong((u32&)src); } };
|
||||
template<typename T> struct se_t<T, 8> { static __forceinline void func(T& dst, const T src) { (u64&)dst = _byteswap_uint64((u64&)src); } };
|
||||
|
||||
template<typename T> T re(const T val) { T res; se_t<T>::func(res, val); return res; }
|
||||
template<typename T1, typename T2> void re(T1& dst, const T2 val) { se_t<T1>::func(dst, val); }
|
||||
|
||||
template<typename T, s64 _value, int size = sizeof(T)> struct const_se_t;
|
||||
template<typename T, s64 _value> struct const_se_t<T, _value, 1>
|
||||
// 128-bit vector type and also se_storage<> storage type
|
||||
union alignas(16) v128
|
||||
{
|
||||
static const T value = (T)_value;
|
||||
};
|
||||
char _bytes[16];
|
||||
|
||||
template<typename T, s64 _value> struct const_se_t<T, _value, 2>
|
||||
{
|
||||
static const T value = ((_value >> 8) & 0xff) | ((_value << 8) & 0xff00);
|
||||
};
|
||||
template <typename T, std::size_t N, std::size_t M>
|
||||
struct masked_array_t // array type accessed as (index ^ M)
|
||||
{
|
||||
T m_data[N];
|
||||
|
||||
template<typename T, s64 _value> struct const_se_t<T, _value, 4>
|
||||
{
|
||||
static const T value =
|
||||
((_value >> 24) & 0x000000ff) |
|
||||
((_value >> 8) & 0x0000ff00) |
|
||||
((_value << 8) & 0x00ff0000) |
|
||||
((_value << 24) & 0xff000000);
|
||||
};
|
||||
public:
|
||||
T& operator[](std::size_t index)
|
||||
{
|
||||
return m_data[index ^ M];
|
||||
}
|
||||
|
||||
template<typename T, s64 _value> struct const_se_t<T, _value, 8>
|
||||
{
|
||||
static const T value =
|
||||
((_value >> 56) & 0x00000000000000ff) |
|
||||
((_value >> 40) & 0x000000000000ff00) |
|
||||
((_value >> 24) & 0x0000000000ff0000) |
|
||||
((_value >> 8) & 0x00000000ff000000) |
|
||||
((_value << 8) & 0x000000ff00000000) |
|
||||
((_value << 24) & 0x0000ff0000000000) |
|
||||
((_value << 40) & 0x00ff000000000000) |
|
||||
((_value << 56) & 0xff00000000000000);
|
||||
};
|
||||
const T& operator[](std::size_t index) const
|
||||
{
|
||||
return m_data[index ^ M];
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T, int size=sizeof(T)>
|
||||
class be_t
|
||||
{
|
||||
static_assert(size == 1 || size == 2 || size == 4 || size == 8, "Bad be_t type");
|
||||
T m_data;
|
||||
|
||||
public:
|
||||
typedef T type;
|
||||
|
||||
#ifdef _WIN32
|
||||
be_t(){}
|
||||
#else
|
||||
be_t() noexcept = default;
|
||||
#if IS_LE_MACHINE == 1
|
||||
template <typename T, std::size_t N = 16 / sizeof(T)>
|
||||
using normal_array_t = masked_array_t<T, N, 0>;
|
||||
template <typename T, std::size_t N = 16 / sizeof(T)>
|
||||
using reversed_array_t = masked_array_t<T, N, N - 1>;
|
||||
#endif
|
||||
|
||||
be_t(const be_t<T,size>& value) = default;
|
||||
be_t(const T& value)
|
||||
normal_array_t<u64> _u64;
|
||||
normal_array_t<s64> _s64;
|
||||
reversed_array_t<u64> u64r;
|
||||
reversed_array_t<s64> s64r;
|
||||
|
||||
normal_array_t<u32> _u32;
|
||||
normal_array_t<s32> _s32;
|
||||
reversed_array_t<u32> u32r;
|
||||
reversed_array_t<s32> s32r;
|
||||
|
||||
normal_array_t<u16> _u16;
|
||||
normal_array_t<s16> _s16;
|
||||
reversed_array_t<u16> u16r;
|
||||
reversed_array_t<s16> s16r;
|
||||
|
||||
normal_array_t<u8> _u8;
|
||||
normal_array_t<s8> _s8;
|
||||
reversed_array_t<u8> u8r;
|
||||
reversed_array_t<s8> s8r;
|
||||
|
||||
normal_array_t<f32> _f;
|
||||
normal_array_t<f64> _d;
|
||||
reversed_array_t<f32> fr;
|
||||
reversed_array_t<f64> dr;
|
||||
|
||||
__m128 vf;
|
||||
__m128i vi;
|
||||
__m128d vd;
|
||||
|
||||
struct bit_array_128
|
||||
{
|
||||
FromLE(value);
|
||||
u64 m_data[2];
|
||||
|
||||
public:
|
||||
class bit_element
|
||||
{
|
||||
u64& data;
|
||||
const u64 mask;
|
||||
|
||||
public:
|
||||
bit_element(u64& data, const u64 mask)
|
||||
: data(data)
|
||||
, mask(mask)
|
||||
{
|
||||
}
|
||||
|
||||
operator bool() const
|
||||
{
|
||||
return (data & mask) != 0;
|
||||
}
|
||||
|
||||
bit_element& operator=(const bool right)
|
||||
{
|
||||
if (right)
|
||||
{
|
||||
data |= mask;
|
||||
}
|
||||
else
|
||||
{
|
||||
data &= ~mask;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
bit_element& operator=(const bit_element& right)
|
||||
{
|
||||
if (right)
|
||||
{
|
||||
data |= mask;
|
||||
}
|
||||
else
|
||||
{
|
||||
data &= ~mask;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
// Index 0 returns the MSB and index 127 returns the LSB
|
||||
bit_element operator[](u32 index)
|
||||
{
|
||||
#if IS_LE_MACHINE == 1
|
||||
return bit_element(m_data[1 - (index >> 6)], 0x8000000000000000ull >> (index & 0x3F));
|
||||
#endif
|
||||
}
|
||||
|
||||
// Index 0 returns the MSB and index 127 returns the LSB
|
||||
bool operator[](u32 index) const
|
||||
{
|
||||
#if IS_LE_MACHINE == 1
|
||||
return (m_data[1 - (index >> 6)] & (0x8000000000000000ull >> (index & 0x3F))) != 0;
|
||||
#endif
|
||||
}
|
||||
} _bit;
|
||||
|
||||
static v128 from64(u64 _0, u64 _1 = 0)
|
||||
{
|
||||
v128 ret;
|
||||
ret._u64[0] = _0;
|
||||
ret._u64[1] = _1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<typename T1>
|
||||
explicit be_t(const be_t<T1>& value)
|
||||
static v128 from64r(u64 _1, u64 _0 = 0)
|
||||
{
|
||||
FromBE(value.ToBE());
|
||||
}
|
||||
|
||||
const T& ToBE() const
|
||||
{
|
||||
return m_data;
|
||||
return from64(_0, _1);
|
||||
}
|
||||
|
||||
T ToLE() const
|
||||
static v128 from32(u32 _0, u32 _1 = 0, u32 _2 = 0, u32 _3 = 0)
|
||||
{
|
||||
T res;
|
||||
|
||||
se_t<T>::func(res, m_data);
|
||||
|
||||
return res;
|
||||
v128 ret;
|
||||
ret._u32[0] = _0;
|
||||
ret._u32[1] = _1;
|
||||
ret._u32[2] = _2;
|
||||
ret._u32[3] = _3;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void FromBE(const T& value)
|
||||
static v128 from32r(u32 _3, u32 _2 = 0, u32 _1 = 0, u32 _0 = 0)
|
||||
{
|
||||
m_data = value;
|
||||
return from32(_0, _1, _2, _3);
|
||||
}
|
||||
|
||||
void FromLE(const T& value)
|
||||
static v128 from32p(u32 value)
|
||||
{
|
||||
se_t<T>::func(m_data, value);
|
||||
v128 ret;
|
||||
ret.vi = _mm_set1_epi32(static_cast<s32>(value));
|
||||
return ret;
|
||||
}
|
||||
|
||||
static be_t MakeFromLE(const T value)
|
||||
static v128 from16p(u16 value)
|
||||
{
|
||||
be_t res;
|
||||
res.FromLE(value);
|
||||
return res;
|
||||
v128 ret;
|
||||
ret.vi = _mm_set1_epi16(static_cast<s16>(value));
|
||||
return ret;
|
||||
}
|
||||
|
||||
static be_t MakeFromBE(const T value)
|
||||
static v128 from8p(u8 value)
|
||||
{
|
||||
be_t res;
|
||||
res.FromBE(value);
|
||||
return res;
|
||||
v128 ret;
|
||||
ret.vi = _mm_set1_epi8(static_cast<s8>(value));
|
||||
return ret;
|
||||
}
|
||||
|
||||
//template<typename T1>
|
||||
operator const T() const
|
||||
static v128 fromBit(u32 bit)
|
||||
{
|
||||
return ToLE();
|
||||
v128 ret = {};
|
||||
ret._bit[bit] = true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<typename T1>
|
||||
operator const be_t<T1>() const
|
||||
static v128 fromV(__m128i value)
|
||||
{
|
||||
be_t<T1> res;
|
||||
res.FromBE(ToBE());
|
||||
return res;
|
||||
v128 ret;
|
||||
ret.vi = value;
|
||||
return ret;
|
||||
}
|
||||
|
||||
be_t& operator = (const T& right)
|
||||
static v128 fromF(__m128 value)
|
||||
{
|
||||
FromLE(right);
|
||||
return *this;
|
||||
v128 ret;
|
||||
ret.vf = value;
|
||||
return ret;
|
||||
}
|
||||
|
||||
be_t<T,size>& operator = (const be_t<T,size>& right) = default;
|
||||
static v128 fromD(__m128d value)
|
||||
{
|
||||
v128 ret;
|
||||
ret.vd = value;
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<typename T1> be_t& operator += (T1 right) { return *this = T(*this) + right; }
|
||||
template<typename T1> be_t& operator -= (T1 right) { return *this = T(*this) - right; }
|
||||
template<typename T1> be_t& operator *= (T1 right) { return *this = T(*this) * right; }
|
||||
template<typename T1> be_t& operator /= (T1 right) { return *this = T(*this) / right; }
|
||||
template<typename T1> be_t& operator %= (T1 right) { return *this = T(*this) % right; }
|
||||
template<typename T1> be_t& operator &= (T1 right) { return *this = T(*this) & right; }
|
||||
template<typename T1> be_t& operator |= (T1 right) { return *this = T(*this) | right; }
|
||||
template<typename T1> be_t& operator ^= (T1 right) { return *this = T(*this) ^ right; }
|
||||
template<typename T1> be_t& operator <<= (T1 right) { return *this = T(*this) << right; }
|
||||
template<typename T1> be_t& operator >>= (T1 right) { return *this = T(*this) >> right; }
|
||||
static inline v128 add8(const v128& left, const v128& right)
|
||||
{
|
||||
return fromV(_mm_add_epi8(left.vi, right.vi));
|
||||
}
|
||||
|
||||
template<typename T1> be_t& operator += (const be_t<T1>& right) { return *this = ToLE() + right.ToLE(); }
|
||||
template<typename T1> be_t& operator -= (const be_t<T1>& right) { return *this = ToLE() - right.ToLE(); }
|
||||
template<typename T1> be_t& operator *= (const be_t<T1>& right) { return *this = ToLE() * right.ToLE(); }
|
||||
template<typename T1> be_t& operator /= (const be_t<T1>& right) { return *this = ToLE() / right.ToLE(); }
|
||||
template<typename T1> be_t& operator %= (const be_t<T1>& right) { return *this = ToLE() % right.ToLE(); }
|
||||
template<typename T1> be_t& operator &= (const be_t<T1>& right) { return *this = ToBE() & right.ToBE(); }
|
||||
template<typename T1> be_t& operator |= (const be_t<T1>& right) { return *this = ToBE() | right.ToBE(); }
|
||||
template<typename T1> be_t& operator ^= (const be_t<T1>& right) { return *this = ToBE() ^ right.ToBE(); }
|
||||
static inline v128 add16(const v128& left, const v128& right)
|
||||
{
|
||||
return fromV(_mm_add_epi16(left.vi, right.vi));
|
||||
}
|
||||
|
||||
template<typename T1> be_t operator & (const be_t<T1>& right) const { be_t<T> res; res.FromBE(ToBE() & right.ToBE()); return res; }
|
||||
template<typename T1> be_t operator | (const be_t<T1>& right) const { be_t<T> res; res.FromBE(ToBE() | right.ToBE()); return res; }
|
||||
template<typename T1> be_t operator ^ (const be_t<T1>& right) const { be_t<T> res; res.FromBE(ToBE() ^ right.ToBE()); return res; }
|
||||
static inline v128 add32(const v128& left, const v128& right)
|
||||
{
|
||||
return fromV(_mm_add_epi32(left.vi, right.vi));
|
||||
}
|
||||
|
||||
template<typename T1> bool operator == (T1 right) const { return (T1)ToLE() == right; }
|
||||
template<typename T1> bool operator != (T1 right) const { return !(*this == right); }
|
||||
template<typename T1> bool operator > (T1 right) const { return (T1)ToLE() > right; }
|
||||
template<typename T1> bool operator < (T1 right) const { return (T1)ToLE() < right; }
|
||||
template<typename T1> bool operator >= (T1 right) const { return (T1)ToLE() >= right; }
|
||||
template<typename T1> bool operator <= (T1 right) const { return (T1)ToLE() <= right; }
|
||||
static inline v128 addfs(const v128& left, const v128& right)
|
||||
{
|
||||
return fromF(_mm_add_ps(left.vf, right.vf));
|
||||
}
|
||||
|
||||
template<typename T1> bool operator == (const be_t<T1>& right) const { return ToBE() == right.ToBE(); }
|
||||
template<typename T1> bool operator != (const be_t<T1>& right) const { return !(*this == right); }
|
||||
template<typename T1> bool operator > (const be_t<T1>& right) const { return (T1)ToLE() > right.ToLE(); }
|
||||
template<typename T1> bool operator < (const be_t<T1>& right) const { return (T1)ToLE() < right.ToLE(); }
|
||||
template<typename T1> bool operator >= (const be_t<T1>& right) const { return (T1)ToLE() >= right.ToLE(); }
|
||||
template<typename T1> bool operator <= (const be_t<T1>& right) const { return (T1)ToLE() <= right.ToLE(); }
|
||||
static inline v128 addfd(const v128& left, const v128& right)
|
||||
{
|
||||
return fromD(_mm_add_pd(left.vd, right.vd));
|
||||
}
|
||||
|
||||
be_t operator++ (int) { be_t res = *this; *this += 1; return res; }
|
||||
be_t operator-- (int) { be_t res = *this; *this -= 1; return res; }
|
||||
be_t& operator++ () { *this += 1; return *this; }
|
||||
be_t& operator-- () { *this -= 1; return *this; }
|
||||
static inline v128 sub8(const v128& left, const v128& right)
|
||||
{
|
||||
return fromV(_mm_sub_epi8(left.vi, right.vi));
|
||||
}
|
||||
|
||||
static inline v128 sub16(const v128& left, const v128& right)
|
||||
{
|
||||
return fromV(_mm_sub_epi16(left.vi, right.vi));
|
||||
}
|
||||
|
||||
static inline v128 sub32(const v128& left, const v128& right)
|
||||
{
|
||||
return fromV(_mm_sub_epi32(left.vi, right.vi));
|
||||
}
|
||||
|
||||
static inline v128 subfs(const v128& left, const v128& right)
|
||||
{
|
||||
return fromF(_mm_sub_ps(left.vf, right.vf));
|
||||
}
|
||||
|
||||
static inline v128 subfd(const v128& left, const v128& right)
|
||||
{
|
||||
return fromD(_mm_sub_pd(left.vd, right.vd));
|
||||
}
|
||||
|
||||
static inline v128 maxu8(const v128& left, const v128& right)
|
||||
{
|
||||
return fromV(_mm_max_epu8(left.vi, right.vi));
|
||||
}
|
||||
|
||||
static inline v128 minu8(const v128& left, const v128& right)
|
||||
{
|
||||
return fromV(_mm_min_epu8(left.vi, right.vi));
|
||||
}
|
||||
|
||||
static inline v128 eq8(const v128& left, const v128& right)
|
||||
{
|
||||
return fromV(_mm_cmpeq_epi8(left.vi, right.vi));
|
||||
}
|
||||
|
||||
static inline v128 eq16(const v128& left, const v128& right)
|
||||
{
|
||||
return fromV(_mm_cmpeq_epi16(left.vi, right.vi));
|
||||
}
|
||||
|
||||
static inline v128 eq32(const v128& left, const v128& right)
|
||||
{
|
||||
return fromV(_mm_cmpeq_epi32(left.vi, right.vi));
|
||||
}
|
||||
|
||||
bool operator==(const v128& right) const
|
||||
{
|
||||
return _u64[0] == right._u64[0] && _u64[1] == right._u64[1];
|
||||
}
|
||||
|
||||
bool operator!=(const v128& right) const
|
||||
{
|
||||
return _u64[0] != right._u64[0] || _u64[1] != right._u64[1];
|
||||
}
|
||||
|
||||
// result = (~left) & (right)
|
||||
static inline v128 andnot(const v128& left, const v128& right)
|
||||
{
|
||||
return fromV(_mm_andnot_si128(left.vi, right.vi));
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
_u64[0] = 0;
|
||||
_u64[1] = 0;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T, typename T1, T1 value> struct _se : public const_se_t<T, value> {};
|
||||
template<typename T, typename T1, T1 value> struct _se<be_t<T>, T1, value> : public const_se_t<T, value> {};
|
||||
inline v128 operator|(const v128& left, const v128& right)
|
||||
{
|
||||
return v128::fromV(_mm_or_si128(left.vi, right.vi));
|
||||
}
|
||||
|
||||
#define se(t, x) _se<decltype(t), decltype(x), x>::value
|
||||
#define se16(x) _se<u16, decltype(x), x>::value
|
||||
#define se32(x) _se<u32, decltype(x), x>::value
|
||||
#define se64(x) _se<u64, decltype(x), x>::value
|
||||
inline v128 operator&(const v128& left, const v128& right)
|
||||
{
|
||||
return v128::fromV(_mm_and_si128(left.vi, right.vi));
|
||||
}
|
||||
|
||||
inline v128 operator^(const v128& left, const v128& right)
|
||||
{
|
||||
return v128::fromV(_mm_xor_si128(left.vi, right.vi));
|
||||
}
|
||||
|
||||
inline v128 operator~(const v128& other)
|
||||
{
|
||||
return v128::from64(~other._u64[0], ~other._u64[1]);
|
||||
}
|
||||
|
||||
template <typename T, std::size_t Align, std::size_t Size>
|
||||
struct se_storage
|
||||
{
|
||||
using type = std::aligned_storage_t<Size, Align>;
|
||||
|
||||
// Unoptimized generic byteswap for unaligned data
|
||||
static void reverse(u8* dst, const u8* src)
|
||||
{
|
||||
for (std::size_t i = 0; i < Size; i++)
|
||||
{
|
||||
dst[i] = src[Size - 1 - i];
|
||||
}
|
||||
}
|
||||
|
||||
static type to(const T& src)
|
||||
{
|
||||
type result;
|
||||
reverse(reinterpret_cast<u8*>(&result), reinterpret_cast<const u8*>(&src));
|
||||
return result;
|
||||
}
|
||||
|
||||
static T from(const type& src)
|
||||
{
|
||||
T result;
|
||||
reverse(reinterpret_cast<u8*>(&result), reinterpret_cast<const u8*>(&src));
|
||||
return result;
|
||||
}
|
||||
|
||||
static type copy(const type& src)
|
||||
{
|
||||
type result;
|
||||
for (std::size_t i = 0; i < Size; i++)
|
||||
{
|
||||
reinterpret_cast<u8*>(&result)[i] = reinterpret_cast<const u8*>(&src)[i];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct se_storage<T, 2, 2>
|
||||
{
|
||||
using type = u16;
|
||||
|
||||
static constexpr u16 swap(u16 src)
|
||||
{
|
||||
#if defined(__GNUG__)
|
||||
return __builtin_bswap16(src);
|
||||
#else
|
||||
return _byteswap_ushort(src);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline u16 to(const T& src)
|
||||
{
|
||||
return swap(reinterpret_cast<const u16&>(src));
|
||||
}
|
||||
|
||||
static inline T from(u16 src)
|
||||
{
|
||||
const u16 result = swap(src);
|
||||
return reinterpret_cast<const T&>(result);
|
||||
}
|
||||
|
||||
static inline T copy(const T& src)
|
||||
{
|
||||
return src;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct se_storage<T, 4, 4>
|
||||
{
|
||||
using type = u32;
|
||||
|
||||
static constexpr u32 swap(u32 src)
|
||||
{
|
||||
#if defined(__GNUG__)
|
||||
return __builtin_bswap32(src);
|
||||
#else
|
||||
return _byteswap_ulong(src);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline u32 to(const T& src)
|
||||
{
|
||||
return swap(reinterpret_cast<const u32&>(src));
|
||||
}
|
||||
|
||||
static inline T from(u32 src)
|
||||
{
|
||||
const u32 result = swap(src);
|
||||
return reinterpret_cast<const T&>(result);
|
||||
}
|
||||
|
||||
static inline T copy(const T& src)
|
||||
{
|
||||
return src;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct se_storage<T, 8, 8>
|
||||
{
|
||||
using type = u64;
|
||||
|
||||
static constexpr u64 swap(u64 src)
|
||||
{
|
||||
#if defined(__GNUG__)
|
||||
return __builtin_bswap64(src);
|
||||
#else
|
||||
return _byteswap_uint64(src);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline u64 to(const T& src)
|
||||
{
|
||||
return swap(reinterpret_cast<const u64&>(src));
|
||||
}
|
||||
|
||||
static inline T from(u64 src)
|
||||
{
|
||||
const u64 result = swap(src);
|
||||
return reinterpret_cast<const T&>(result);
|
||||
}
|
||||
|
||||
static inline T copy(const T& src)
|
||||
{
|
||||
return src;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct se_storage<T, 16, 16>
|
||||
{
|
||||
using type = v128;
|
||||
|
||||
static inline v128 swap(const v128& src)
|
||||
{
|
||||
return v128::fromV(_mm_shuffle_epi8(src.vi, _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)));
|
||||
}
|
||||
|
||||
static inline v128 to(const T& src)
|
||||
{
|
||||
return swap(reinterpret_cast<const v128&>(src));
|
||||
}
|
||||
|
||||
static inline T from(const v128& src)
|
||||
{
|
||||
const v128 result = swap(src);
|
||||
return reinterpret_cast<const T&>(result);
|
||||
}
|
||||
|
||||
static inline T copy(const T& src)
|
||||
{
|
||||
return src;
|
||||
}
|
||||
};
|
||||
|
||||
// Switched endianness
|
||||
template <typename T, std::size_t Align>
|
||||
class se_t<T, true, Align>
|
||||
{
|
||||
using type = typename std::remove_cv<T>::type;
|
||||
using stype = typename se_storage<type, Align>::type;
|
||||
using storage = se_storage<type, Align>;
|
||||
|
||||
stype m_data;
|
||||
|
||||
static_assert(!std::is_pointer<type>::value, "se_t<> error: invalid type (pointer)");
|
||||
static_assert(!std::is_reference<type>::value, "se_t<> error: invalid type (reference)");
|
||||
static_assert(!std::is_array<type>::value, "se_t<> error: invalid type (array)");
|
||||
static_assert(sizeof(type) == alignof(type), "se_t<> error: unexpected alignment");
|
||||
|
||||
public:
|
||||
se_t() = default;
|
||||
|
||||
se_t(const se_t& right) = default;
|
||||
|
||||
se_t(type value)
|
||||
: m_data(storage::to(value))
|
||||
{
|
||||
}
|
||||
|
||||
type value() const
|
||||
{
|
||||
return storage::from(m_data);
|
||||
}
|
||||
|
||||
se_t& operator=(const se_t&) = default;
|
||||
|
||||
se_t& operator=(type value)
|
||||
{
|
||||
return m_data = storage::to(value), *this;
|
||||
}
|
||||
|
||||
using simple_type = simple_t<T>;
|
||||
|
||||
operator type() const
|
||||
{
|
||||
return storage::from(m_data);
|
||||
}
|
||||
};
|
||||
|
||||
// Native endianness
|
||||
template <typename T, std::size_t Align>
|
||||
class se_t<T, false, Align>
|
||||
{
|
||||
using type = typename std::remove_cv<T>::type;
|
||||
using stype = typename se_storage<type, Align>::type;
|
||||
using storage = se_storage<type, Align>;
|
||||
|
||||
static_assert(!std::is_pointer<type>::value, "se_t<> error: invalid type (pointer)");
|
||||
static_assert(!std::is_reference<type>::value, "se_t<> error: invalid type (reference)");
|
||||
static_assert(!std::is_array<type>::value, "se_t<> error: invalid type (array)");
|
||||
static_assert(sizeof(type) == alignof(type), "se_t<> error: unexpected alignment");
|
||||
|
||||
stype m_data;
|
||||
|
||||
public:
|
||||
se_t() = default;
|
||||
|
||||
se_t(type value)
|
||||
: m_data(reinterpret_cast<const stype&>(value))
|
||||
{
|
||||
}
|
||||
|
||||
type value() const
|
||||
{
|
||||
return storage::copy(reinterpret_cast<const type&>(m_data));
|
||||
}
|
||||
|
||||
se_t& operator=(const se_t& value) = default;
|
||||
|
||||
se_t& operator=(type value)
|
||||
{
|
||||
return m_data = reinterpret_cast<const stype&>(value), *this;
|
||||
}
|
||||
|
||||
using simple_type = simple_t<T>;
|
||||
|
||||
operator type() const
|
||||
{
|
||||
return storage::copy(reinterpret_cast<const type&>(m_data));
|
||||
}
|
||||
};
|
||||
|
||||
// se_t<> with native endianness
|
||||
template <typename T, std::size_t Align = alignof(T)>
|
||||
using nse_t = se_t<T, false, Align>;
|
||||
|
||||
template <typename T, bool Se, std::size_t Align, typename T1>
|
||||
inline se_t<T, Se, Align>& operator+=(se_t<T, Se, Align>& left, const T1& right)
|
||||
{
|
||||
auto value = left.value();
|
||||
return left = (value += right);
|
||||
}
|
||||
|
||||
template <typename T, bool Se, std::size_t Align, typename T1>
|
||||
inline se_t<T, Se, Align>& operator-=(se_t<T, Se, Align>& left, const T1& right)
|
||||
{
|
||||
auto value = left.value();
|
||||
return left = (value -= right);
|
||||
}
|
||||
|
||||
template <typename T, bool Se, std::size_t Align, typename T1>
|
||||
inline se_t<T, Se, Align>& operator*=(se_t<T, Se, Align>& left, const T1& right)
|
||||
{
|
||||
auto value = left.value();
|
||||
return left = (value *= right);
|
||||
}
|
||||
|
||||
template <typename T, bool Se, std::size_t Align, typename T1>
|
||||
inline se_t<T, Se, Align>& operator/=(se_t<T, Se, Align>& left, const T1& right)
|
||||
{
|
||||
auto value = left.value();
|
||||
return left = (value /= right);
|
||||
}
|
||||
|
||||
template <typename T, bool Se, std::size_t Align, typename T1>
|
||||
inline se_t<T, Se, Align>& operator%=(se_t<T, Se, Align>& left, const T1& right)
|
||||
{
|
||||
auto value = left.value();
|
||||
return left = (value %= right);
|
||||
}
|
||||
|
||||
template <typename T, bool Se, std::size_t Align, typename T1>
|
||||
inline se_t<T, Se, Align>& operator&=(se_t<T, Se, Align>& left, const T1& right)
|
||||
{
|
||||
auto value = left.value();
|
||||
return left = (value &= right);
|
||||
}
|
||||
|
||||
template <typename T, bool Se, std::size_t Align, typename T1>
|
||||
inline se_t<T, Se, Align>& operator|=(se_t<T, Se, Align>& left, const T1& right)
|
||||
{
|
||||
auto value = left.value();
|
||||
return left = (value |= right);
|
||||
}
|
||||
|
||||
template <typename T, bool Se, std::size_t Align, typename T1>
|
||||
inline se_t<T, Se, Align>& operator^=(se_t<T, Se, Align>& left, const T1& right)
|
||||
{
|
||||
auto value = left.value();
|
||||
return left = (value ^= right);
|
||||
}
|
||||
|
||||
template <typename T, bool Se, std::size_t Align, typename T1>
|
||||
inline se_t<T, Se, Align>& operator<<=(se_t<T, Se, Align>& left, const T1& right)
|
||||
{
|
||||
auto value = left.value();
|
||||
return left = (value <<= right);
|
||||
}
|
||||
|
||||
template <typename T, bool Se, std::size_t Align, typename T1>
|
||||
inline se_t<T, Se, Align>& operator>>=(se_t<T, Se, Align>& left, const T1& right)
|
||||
{
|
||||
auto value = left.value();
|
||||
return left = (value >>= right);
|
||||
}
|
||||
|
||||
template <typename T, bool Se, std::size_t Align>
|
||||
inline se_t<T, Se, Align> operator++(se_t<T, Se, Align>& left, int)
|
||||
{
|
||||
auto value = left.value();
|
||||
auto result = value++;
|
||||
left = value;
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T, bool Se, std::size_t Align>
|
||||
inline se_t<T, Se, Align> operator--(se_t<T, Se, Align>& left, int)
|
||||
{
|
||||
auto value = left.value();
|
||||
auto result = value--;
|
||||
left = value;
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T, bool Se, std::size_t Align>
|
||||
inline se_t<T, Se, Align>& operator++(se_t<T, Se, Align>& right)
|
||||
{
|
||||
auto value = right.value();
|
||||
return right = ++value;
|
||||
}
|
||||
|
||||
template <typename T, bool Se, std::size_t Align>
|
||||
inline se_t<T, Se, Align>& operator--(se_t<T, Se, Align>& right)
|
||||
{
|
||||
auto value = right.value();
|
||||
return right = --value;
|
||||
}
|
||||
|
||||
#if IS_LE_MACHINE == 1
|
||||
template <typename T, std::size_t Align = alignof(T)>
|
||||
using be_t = se_t<T, true, Align>;
|
||||
template <typename T, std::size_t Align = alignof(T)>
|
||||
using le_t = se_t<T, false, Align>;
|
||||
#endif
|
||||
|
||||
// Type converter: converts native endianness arithmetic/enum types to appropriate se_t<> type
|
||||
template <typename T, bool Se, typename = void>
|
||||
struct to_se
|
||||
{
|
||||
template <typename T2, typename = void>
|
||||
struct to_se_
|
||||
{
|
||||
using type = T2;
|
||||
};
|
||||
|
||||
template <typename T2>
|
||||
struct to_se_<T2, std::enable_if_t<std::is_arithmetic<T2>::value || std::is_enum<T2>::value>>
|
||||
{
|
||||
using type = se_t<T2, Se>;
|
||||
};
|
||||
|
||||
// Convert arithmetic and enum types
|
||||
using type = typename to_se_<T>::type;
|
||||
};
|
||||
|
||||
template <bool Se>
|
||||
struct to_se<v128, Se>
|
||||
{
|
||||
using type = se_t<v128, Se>;
|
||||
};
|
||||
|
||||
template <bool Se>
|
||||
struct to_se<u128, Se>
|
||||
{
|
||||
using type = se_t<u128, Se>;
|
||||
};
|
||||
|
||||
template <bool Se>
|
||||
struct to_se<s128, Se>
|
||||
{
|
||||
using type = se_t<s128, Se>;
|
||||
};
|
||||
|
||||
template <bool Se>
|
||||
struct to_se<bool, Se>
|
||||
{
|
||||
using type = bool;
|
||||
};
|
||||
|
||||
template <bool Se>
|
||||
struct to_se<char, Se>
|
||||
{
|
||||
using type = char;
|
||||
};
|
||||
|
||||
template <bool Se>
|
||||
struct to_se<u8, Se>
|
||||
{
|
||||
using type = u8;
|
||||
};
|
||||
|
||||
template <bool Se>
|
||||
struct to_se<s8, Se>
|
||||
{
|
||||
using type = s8;
|
||||
};
|
||||
|
||||
template <typename T, bool Se>
|
||||
struct to_se<const T, Se, std::enable_if_t<!std::is_array<T>::value>>
|
||||
{
|
||||
// Move const qualifier
|
||||
using type = const typename to_se<T, Se>::type;
|
||||
};
|
||||
|
||||
template <typename T, bool Se>
|
||||
struct to_se<volatile T, Se, std::enable_if_t<!std::is_array<T>::value && !std::is_const<T>::value>>
|
||||
{
|
||||
// Move volatile qualifier
|
||||
using type = volatile typename to_se<T, Se>::type;
|
||||
};
|
||||
|
||||
template <typename T, bool Se>
|
||||
struct to_se<T[], Se>
|
||||
{
|
||||
// Move array qualifier
|
||||
using type = typename to_se<T, Se>::type[];
|
||||
};
|
||||
|
||||
template <typename T, bool Se, std::size_t N>
|
||||
struct to_se<T[N], Se>
|
||||
{
|
||||
// Move array qualifier
|
||||
using type = typename to_se<T, Se>::type[N];
|
||||
};
|
||||
|
||||
// BE/LE aliases for to_se<>
|
||||
#if IS_LE_MACHINE == 1
|
||||
template <typename T>
|
||||
using to_be_t = typename to_se<T, true>::type;
|
||||
template <typename T>
|
||||
using to_le_t = typename to_se<T, false>::type;
|
||||
#endif
|
||||
|
||||
// BE/LE aliases for atomic_t
|
||||
#if IS_LE_MACHINE == 1
|
||||
template <typename T>
|
||||
using atomic_be_t = atomic_t<be_t<T>>;
|
||||
template <typename T>
|
||||
using atomic_le_t = atomic_t<le_t<T>>;
|
||||
#endif
|
||||
|
||||
template <typename T, bool Se, std::size_t Align>
|
||||
struct fmt_unveil<se_t<T, Se, Align>, void>
|
||||
{
|
||||
using type = typename fmt_unveil<T>::type;
|
||||
|
||||
static inline auto get(const se_t<T, Se, Align>& arg)
|
||||
{
|
||||
return fmt_unveil<T>::get(arg);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -0,0 +1,280 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
|
||||
template<typename T, uint N>
|
||||
struct bf_base
|
||||
{
|
||||
using type = T;
|
||||
using vtype = simple_t<type>;
|
||||
using utype = typename std::make_unsigned<vtype>::type;
|
||||
|
||||
// Datatype bitsize
|
||||
static constexpr uint bitmax = sizeof(T) * 8; static_assert(N - 1 < bitmax, "bf_base<> error: N out of bounds");
|
||||
|
||||
// Field bitsize
|
||||
static constexpr uint bitsize = N;
|
||||
|
||||
// Value mask
|
||||
static constexpr utype vmask = static_cast<utype>(~utype{} >> (bitmax - bitsize));
|
||||
|
||||
protected:
|
||||
type m_data;
|
||||
};
|
||||
|
||||
// Bitfield accessor (N bits from I position, 0 is LSB)
|
||||
template<typename T, uint I, uint N>
|
||||
struct bf_t : bf_base<T, N>
|
||||
{
|
||||
using type = typename bf_t::type;
|
||||
using vtype = typename bf_t::vtype;
|
||||
using utype = typename bf_t::utype;
|
||||
|
||||
// Field offset
|
||||
static constexpr uint bitpos = I; static_assert(bitpos + N <= bf_t::bitmax, "bf_t<> error: I out of bounds");
|
||||
|
||||
// Get bitmask of size N, at I pos
|
||||
static constexpr utype data_mask()
|
||||
{
|
||||
return static_cast<utype>(static_cast<utype>(~utype{} >> (bf_t::bitmax - bf_t::bitsize)) << bitpos);
|
||||
}
|
||||
|
||||
// Bitfield extraction helper
|
||||
template<typename T2, typename = void>
|
||||
struct extract_impl
|
||||
{
|
||||
static_assert(!sizeof(T2), "bf_t<> error: Invalid type");
|
||||
};
|
||||
|
||||
template<typename T2>
|
||||
struct extract_impl<T2, std::enable_if_t<std::is_unsigned<T2>::value>>
|
||||
{
|
||||
// Load unsigned value
|
||||
static constexpr T2 extract(const T& data)
|
||||
{
|
||||
return static_cast<T2>((static_cast<utype>(data) >> bitpos) & bf_t::vmask);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T2>
|
||||
struct extract_impl<T2, std::enable_if_t<std::is_signed<T2>::value>>
|
||||
{
|
||||
// Load signed value (sign-extended)
|
||||
static constexpr T2 extract(const T& data)
|
||||
{
|
||||
return static_cast<T2>(static_cast<vtype>(static_cast<utype>(data) << (bf_t::bitmax - bitpos - N)) >> (bf_t::bitmax - N));
|
||||
}
|
||||
};
|
||||
|
||||
// Bitfield extraction
|
||||
static constexpr vtype extract(const T& data)
|
||||
{
|
||||
return extract_impl<vtype>::extract(data);
|
||||
}
|
||||
|
||||
// Bitfield insertion
|
||||
static constexpr vtype insert(vtype value)
|
||||
{
|
||||
return static_cast<vtype>((value & bf_t::vmask) << bitpos);
|
||||
}
|
||||
|
||||
// Load bitfield value
|
||||
constexpr operator vtype() const
|
||||
{
|
||||
return extract(this->m_data);
|
||||
}
|
||||
|
||||
// Load raw data with mask applied
|
||||
constexpr T unshifted() const
|
||||
{
|
||||
return static_cast<T>(this->m_data & data_mask());
|
||||
}
|
||||
|
||||
// Optimized bool conversion (must be removed if inappropriate)
|
||||
explicit constexpr operator bool() const
|
||||
{
|
||||
return unshifted() != 0;
|
||||
}
|
||||
|
||||
// Store bitfield value
|
||||
bf_t& operator =(vtype value)
|
||||
{
|
||||
this->m_data = static_cast<vtype>((this->m_data & ~data_mask()) | insert(value));
|
||||
return *this;
|
||||
}
|
||||
|
||||
vtype operator ++(int)
|
||||
{
|
||||
utype result = *this;
|
||||
*this = static_cast<vtype>(result + 1);
|
||||
return result;
|
||||
}
|
||||
|
||||
bf_t& operator ++()
|
||||
{
|
||||
return *this = *this + 1;
|
||||
}
|
||||
|
||||
vtype operator --(int)
|
||||
{
|
||||
utype result = *this;
|
||||
*this = static_cast<vtype>(result - 1);
|
||||
return result;
|
||||
}
|
||||
|
||||
bf_t& operator --()
|
||||
{
|
||||
return *this = *this - 1;
|
||||
}
|
||||
|
||||
bf_t& operator +=(vtype right)
|
||||
{
|
||||
return *this = *this + right;
|
||||
}
|
||||
|
||||
bf_t& operator -=(vtype right)
|
||||
{
|
||||
return *this = *this - right;
|
||||
}
|
||||
|
||||
bf_t& operator *=(vtype right)
|
||||
{
|
||||
return *this = *this * right;
|
||||
}
|
||||
|
||||
bf_t& operator &=(vtype right)
|
||||
{
|
||||
this->m_data &= static_cast<vtype>((static_cast<utype>(right) & bf_t::vmask) << bitpos);
|
||||
return *this;
|
||||
}
|
||||
|
||||
bf_t& operator |=(vtype right)
|
||||
{
|
||||
this->m_data |= static_cast<vtype>((static_cast<utype>(right) & bf_t::vmask) << bitpos);
|
||||
return *this;
|
||||
}
|
||||
|
||||
bf_t& operator ^=(vtype right)
|
||||
{
|
||||
this->m_data ^= static_cast<vtype>((static_cast<utype>(right) & bf_t::vmask) << bitpos);
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
// Field pack (concatenated from left to right)
|
||||
template<typename F = void, typename... Fields>
|
||||
struct cf_t : bf_base<typename F::type, F::bitsize + cf_t<Fields...>::bitsize>
|
||||
{
|
||||
using type = typename cf_t::type;
|
||||
using vtype = typename cf_t::vtype;
|
||||
using utype = typename cf_t::utype;
|
||||
|
||||
// Get disjunction of all "data" masks of concatenated values
|
||||
static constexpr vtype data_mask()
|
||||
{
|
||||
return static_cast<vtype>(F::data_mask() | cf_t<Fields...>::data_mask());
|
||||
}
|
||||
|
||||
// Extract all bitfields and concatenate
|
||||
static constexpr vtype extract(const type& data)
|
||||
{
|
||||
return static_cast<vtype>(static_cast<utype>(F::extract(data)) << cf_t<Fields...>::bitsize | cf_t<Fields...>::extract(data));
|
||||
}
|
||||
|
||||
// Split bitfields and insert them
|
||||
static constexpr vtype insert(vtype value)
|
||||
{
|
||||
return static_cast<vtype>(F::insert(value >> cf_t<Fields...>::bitsize) | cf_t<Fields...>::insert(value));
|
||||
}
|
||||
|
||||
// Load value
|
||||
constexpr operator vtype() const
|
||||
{
|
||||
return extract(this->m_data);
|
||||
}
|
||||
|
||||
// Store value
|
||||
cf_t& operator =(vtype value)
|
||||
{
|
||||
this->m_data = (this->m_data & ~data_mask()) | insert(value);
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
// Empty field pack (recursion terminator)
|
||||
template<>
|
||||
struct cf_t<void>
|
||||
{
|
||||
static constexpr uint bitsize = 0;
|
||||
|
||||
static constexpr uint data_mask()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static constexpr auto extract(const T& data) -> decltype(+T())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static constexpr T insert(T value)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
// Fixed field (provides constant values in field pack)
|
||||
template<typename T, T V, uint N>
|
||||
struct ff_t : bf_base<T, N>
|
||||
{
|
||||
using type = typename ff_t::type;
|
||||
using vtype = typename ff_t::vtype;
|
||||
|
||||
// Return constant value
|
||||
static constexpr vtype extract(const type& data)
|
||||
{
|
||||
static_assert((V & ff_t::vmask) == V, "ff_t<> error: V out of bounds");
|
||||
return V;
|
||||
}
|
||||
|
||||
// Get value
|
||||
operator vtype() const
|
||||
{
|
||||
return V;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T, uint I, uint N>
|
||||
struct fmt_unveil<bf_t<T, I, N>, void>
|
||||
{
|
||||
using type = typename fmt_unveil<simple_t<T>>::type;
|
||||
|
||||
static inline auto get(const bf_t<T, I, N>& bf)
|
||||
{
|
||||
return fmt_unveil<type>::get(bf);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename F, typename... Fields>
|
||||
struct fmt_unveil<cf_t<F, Fields...>, void>
|
||||
{
|
||||
using type = typename fmt_unveil<simple_t<typename F::type>>::type;
|
||||
|
||||
static inline auto get(const cf_t<F, Fields...>& cf)
|
||||
{
|
||||
return fmt_unveil<type>::get(cf);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T, T V, uint N>
|
||||
struct fmt_unveil<ff_t<T, V, N>, void>
|
||||
{
|
||||
using type = typename fmt_unveil<simple_t<T>>::type;
|
||||
|
||||
static inline auto get(const ff_t<T, V, N>& ff)
|
||||
{
|
||||
return fmt_unveil<type>::get(ff);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,285 @@
|
||||
#include "stdafx.h"
|
||||
#include "Config.h"
|
||||
|
||||
#include "yaml-cpp/yaml.h"
|
||||
|
||||
namespace cfg
|
||||
{
|
||||
logs::channel cfg("CFG", logs::level::notice);
|
||||
|
||||
entry_base::entry_base(type _type)
|
||||
: m_type(_type)
|
||||
{
|
||||
if (_type != type::node)
|
||||
{
|
||||
fmt::throw_exception<std::logic_error>("Invalid root node" HERE);
|
||||
}
|
||||
}
|
||||
|
||||
entry_base::entry_base(type _type, node& owner, const std::string& name)
|
||||
: m_type(_type)
|
||||
{
|
||||
if (!owner.m_nodes.emplace(name, this).second)
|
||||
{
|
||||
fmt::throw_exception<std::logic_error>("Node already exists: %s" HERE, name);
|
||||
}
|
||||
}
|
||||
|
||||
entry_base& entry_base::operator[](const std::string& name) const
|
||||
{
|
||||
if (m_type == type::node)
|
||||
{
|
||||
return *static_cast<const node&>(*this).m_nodes.at(name);
|
||||
}
|
||||
|
||||
fmt::throw_exception<std::logic_error>("Invalid node type" HERE);
|
||||
}
|
||||
|
||||
entry_base& entry_base::operator[](const char* name) const
|
||||
{
|
||||
if (m_type == type::node)
|
||||
{
|
||||
return *static_cast<const node&>(*this).m_nodes.at(name);
|
||||
}
|
||||
|
||||
fmt::throw_exception<std::logic_error>("Invalid node type" HERE);
|
||||
}
|
||||
|
||||
bool entry_base::from_string(const std::string&)
|
||||
{
|
||||
fmt::throw_exception<std::logic_error>("from_string() purecall" HERE);
|
||||
}
|
||||
|
||||
bool entry_base::from_list(std::vector<std::string>&&)
|
||||
{
|
||||
fmt::throw_exception<std::logic_error>("from_list() purecall" HERE);
|
||||
}
|
||||
|
||||
// Emit YAML
|
||||
static void encode(YAML::Emitter& out, const class entry_base& rhs);
|
||||
|
||||
// Incrementally load config entries from YAML::Node.
|
||||
// The config value is preserved if the corresponding YAML node doesn't exist.
|
||||
static void decode(const YAML::Node& data, class entry_base& rhs);
|
||||
}
|
||||
|
||||
bool cfg::try_to_int64(s64* out, const std::string& value, s64 min, s64 max)
|
||||
{
|
||||
// TODO: this could be rewritten without exceptions (but it should be as safe as possible and provide logs)
|
||||
s64 result;
|
||||
std::size_t pos;
|
||||
|
||||
try
|
||||
{
|
||||
result = std::stoll(value, &pos, 0 /* Auto-detect numeric base */);
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
if (out) cfg.error("cfg::try_to_int('%s'): exception: %s", value, e.what());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pos != value.size())
|
||||
{
|
||||
if (out) cfg.error("cfg::try_to_int('%s'): unexpected characters (pos=%zu)", value, pos);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (result < min || result > max)
|
||||
{
|
||||
if (out) cfg.error("cfg::try_to_int('%s'): out of bounds (%lld..%lld)", value, min, max);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (out) *out = result;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cfg::try_to_enum_value(u64* out, decltype(&fmt_class_string<int>::format) func, const std::string& value)
|
||||
{
|
||||
for (u64 i = 0;; i++)
|
||||
{
|
||||
std::string var;
|
||||
func(var, i);
|
||||
|
||||
if (var == value)
|
||||
{
|
||||
if (out) *out = i;
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string hex;
|
||||
fmt_class_string<u64>::format(hex, i);
|
||||
if (var == hex)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
const auto val = std::stoull(value, nullptr, 0);
|
||||
|
||||
if (out) *out = val;
|
||||
return true;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<std::string> cfg::try_to_enum_list(decltype(&fmt_class_string<int>::format) func)
|
||||
{
|
||||
std::vector<std::string> result;
|
||||
|
||||
for (u64 i = 0;; i++)
|
||||
{
|
||||
std::string var;
|
||||
func(var, i);
|
||||
|
||||
std::string hex;
|
||||
fmt_class_string<u64>::format(hex, i);
|
||||
if (var == hex)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
result.emplace_back(std::move(var));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void cfg::encode(YAML::Emitter& out, const cfg::entry_base& rhs)
|
||||
{
|
||||
switch (rhs.get_type())
|
||||
{
|
||||
case type::node:
|
||||
{
|
||||
out << YAML::BeginMap;
|
||||
for (const auto& np : static_cast<const node&>(rhs).get_nodes())
|
||||
{
|
||||
out << YAML::Key << np.first;
|
||||
out << YAML::Value; encode(out, *np.second);
|
||||
}
|
||||
|
||||
out << YAML::EndMap;
|
||||
return;
|
||||
}
|
||||
case type::set:
|
||||
{
|
||||
out << YAML::BeginSeq;
|
||||
for (const auto& str : static_cast<const set_entry&>(rhs).get_set())
|
||||
{
|
||||
out << str;
|
||||
}
|
||||
|
||||
out << YAML::EndSeq;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
out << rhs.to_string();
|
||||
}
|
||||
|
||||
void cfg::decode(const YAML::Node& data, cfg::entry_base& rhs)
|
||||
{
|
||||
switch (rhs.get_type())
|
||||
{
|
||||
case type::node:
|
||||
{
|
||||
if (data.IsScalar() || data.IsSequence())
|
||||
{
|
||||
return; // ???
|
||||
}
|
||||
|
||||
for (const auto& pair : data)
|
||||
{
|
||||
if (!pair.first.IsScalar()) continue;
|
||||
|
||||
// Find the key among existing nodes
|
||||
const auto name = pair.first.Scalar();
|
||||
const auto found = static_cast<node&>(rhs).get_nodes().find(name);
|
||||
|
||||
if (found != static_cast<node&>(rhs).get_nodes().cend())
|
||||
{
|
||||
decode(pair.second, *found->second);
|
||||
}
|
||||
else
|
||||
{
|
||||
// ???
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case type::set:
|
||||
{
|
||||
std::vector<std::string> values;
|
||||
|
||||
if (YAML::convert<decltype(values)>::decode(data, values))
|
||||
{
|
||||
rhs.from_list(std::move(values));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
std::string value;
|
||||
|
||||
if (YAML::convert<std::string>::decode(data, value))
|
||||
{
|
||||
rhs.from_string(value);
|
||||
}
|
||||
|
||||
break; // ???
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string cfg::node::to_string() const
|
||||
{
|
||||
YAML::Emitter out;
|
||||
cfg::encode(out, *this);
|
||||
|
||||
return{ out.c_str(), out.size() };
|
||||
}
|
||||
|
||||
bool cfg::node::from_string(const std::string& value)
|
||||
{
|
||||
cfg::decode(YAML::Load(value), *this);
|
||||
return true;
|
||||
}
|
||||
|
||||
void cfg::node::from_default()
|
||||
{
|
||||
for (auto& node : m_nodes)
|
||||
{
|
||||
node.second->from_default();
|
||||
}
|
||||
}
|
||||
|
||||
void cfg::bool_entry::from_default()
|
||||
{
|
||||
value = def;
|
||||
}
|
||||
|
||||
void cfg::string_entry::from_default()
|
||||
{
|
||||
*this = def;
|
||||
}
|
||||
|
||||
void cfg::set_entry::from_default()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
m_set = {};
|
||||
}
|
||||
|
||||
cfg::root_node& cfg::get_root()
|
||||
{
|
||||
// Magic static
|
||||
static root_node root;
|
||||
return root;
|
||||
}
|
||||
@@ -0,0 +1,510 @@
|
||||
#pragma once
|
||||
|
||||
#include "Utilities/types.h"
|
||||
#include "Utilities/Atomic.h"
|
||||
#include "Utilities/StrFmt.h"
|
||||
|
||||
#include <initializer_list>
|
||||
#include <exception>
|
||||
#include <utility>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include <unordered_map>
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
|
||||
namespace cfg
|
||||
{
|
||||
// Convert string to signed integer
|
||||
bool try_to_int64(s64* out, const std::string& value, s64 min, s64 max);
|
||||
|
||||
// Internal hack
|
||||
bool try_to_enum_value(u64* out, decltype(&fmt_class_string<int>::format) func, const std::string&);
|
||||
|
||||
// Internal hack
|
||||
std::vector<std::string> try_to_enum_list(decltype(&fmt_class_string<int>::format) func);
|
||||
|
||||
// Config tree entry type.
|
||||
enum class type : uint
|
||||
{
|
||||
node = 0, // cfg::node type
|
||||
boolean, // cfg::bool_entry type
|
||||
fixed_map, // cfg::map_entry type
|
||||
enumeration, // cfg::enum_entry type
|
||||
integer, // cfg::int_entry type
|
||||
string, // cfg::string_entry type
|
||||
set, // cfg::set_entry type
|
||||
};
|
||||
|
||||
// Config tree entry abstract base class
|
||||
class entry_base
|
||||
{
|
||||
const type m_type;
|
||||
|
||||
protected:
|
||||
// Ownerless entry constructor
|
||||
entry_base(type _type);
|
||||
|
||||
// Owned entry constructor
|
||||
entry_base(type _type, class node& owner, const std::string& name);
|
||||
|
||||
public:
|
||||
// Disallow copy/move constructors and assignments
|
||||
entry_base(const entry_base&) = delete;
|
||||
|
||||
// Get type
|
||||
type get_type() const { return m_type; }
|
||||
|
||||
// Access child node (must exist)
|
||||
entry_base& operator [](const std::string& name) const; entry_base& operator [](const char* name) const;
|
||||
|
||||
// Reset defaults
|
||||
virtual void from_default() = 0;
|
||||
|
||||
// Convert to string (optional)
|
||||
virtual std::string to_string() const
|
||||
{
|
||||
return{};
|
||||
}
|
||||
|
||||
// Try to convert from string (optional)
|
||||
virtual bool from_string(const std::string&);
|
||||
|
||||
// Get string list (optional)
|
||||
virtual std::vector<std::string> to_list() const
|
||||
{
|
||||
return{};
|
||||
}
|
||||
|
||||
// Set multiple values. Implementation-specific, optional.
|
||||
virtual bool from_list(std::vector<std::string>&&);
|
||||
};
|
||||
|
||||
// Config tree node which contains another nodes
|
||||
class node : public entry_base
|
||||
{
|
||||
std::map<std::string, entry_base*> m_nodes;
|
||||
|
||||
friend class entry_base;
|
||||
|
||||
public:
|
||||
// Root node constructor
|
||||
node()
|
||||
: entry_base(type::node)
|
||||
{
|
||||
}
|
||||
|
||||
// Registered node constructor
|
||||
node(node& owner, const std::string& name)
|
||||
: entry_base(type::node, owner, name)
|
||||
{
|
||||
}
|
||||
|
||||
// Get child nodes
|
||||
const std::map<std::string, entry_base*>& get_nodes() const
|
||||
{
|
||||
return m_nodes;
|
||||
}
|
||||
|
||||
// Serialize node
|
||||
std::string to_string() const override;
|
||||
|
||||
// Deserialize node
|
||||
bool from_string(const std::string& value) override;
|
||||
|
||||
// Set default values
|
||||
void from_default() override;
|
||||
};
|
||||
|
||||
struct bool_entry final : public entry_base
|
||||
{
|
||||
atomic_t<bool> value;
|
||||
|
||||
const bool def;
|
||||
|
||||
bool_entry(node& owner, const std::string& name, bool def = false)
|
||||
: entry_base(type::boolean, owner, name)
|
||||
, value(def)
|
||||
, def(def)
|
||||
{
|
||||
}
|
||||
|
||||
explicit operator bool() const
|
||||
{
|
||||
return value.load();
|
||||
}
|
||||
|
||||
bool_entry& operator =(bool value)
|
||||
{
|
||||
value = value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void from_default() override;
|
||||
|
||||
std::string to_string() const override
|
||||
{
|
||||
return value.load() ? "true" : "false";
|
||||
}
|
||||
|
||||
bool from_string(const std::string& value) override
|
||||
{
|
||||
if (value == "false")
|
||||
this->value = false;
|
||||
else if (value == "true")
|
||||
this->value = true;
|
||||
else
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
// Value node with fixed set of possible values, each maps to a value of type T.
|
||||
template<typename T>
|
||||
struct map_entry final : public entry_base
|
||||
{
|
||||
using init_type = std::initializer_list<std::pair<std::string, T>>;
|
||||
using map_type = std::unordered_map<std::string, T>;
|
||||
using list_type = std::vector<std::string>;
|
||||
using value_type = typename map_type::value_type;
|
||||
|
||||
static map_type make_map(init_type init)
|
||||
{
|
||||
map_type map(init.size());
|
||||
|
||||
for (const auto& v : init)
|
||||
{
|
||||
// Ensure elements are unique
|
||||
verify(HERE), map.emplace(v.first, v.second).second;
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
static list_type make_list(init_type init)
|
||||
{
|
||||
list_type list; list.reserve(init.size());
|
||||
|
||||
for (const auto& v : init)
|
||||
{
|
||||
list.emplace_back(v.first);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public:
|
||||
const map_type map;
|
||||
const list_type list; // Element list sorted in original order
|
||||
const value_type& def; // Pointer to the default value
|
||||
|
||||
private:
|
||||
atomic_t<const value_type*> m_value;
|
||||
|
||||
public:
|
||||
map_entry(node& owner, const std::string& name, const std::string& def, init_type init)
|
||||
: entry_base(type::fixed_map, owner, name)
|
||||
, map(make_map(init))
|
||||
, list(make_list(init))
|
||||
, def(*map.find(def))
|
||||
, m_value(&this->def)
|
||||
{
|
||||
}
|
||||
|
||||
map_entry(node& owner, const std::string& name, std::size_t def_index, init_type init)
|
||||
: map_entry(owner, name, (init.begin() + (def_index < init.size() ? def_index : 0))->first, init)
|
||||
{
|
||||
}
|
||||
|
||||
map_entry(node& owner, const std::string& name, init_type init)
|
||||
: map_entry(owner, name, 0, init)
|
||||
{
|
||||
}
|
||||
|
||||
const T& get() const
|
||||
{
|
||||
return m_value.load()->second;
|
||||
}
|
||||
|
||||
void from_default() override
|
||||
{
|
||||
m_value = &def;
|
||||
}
|
||||
|
||||
std::string to_string() const override
|
||||
{
|
||||
return m_value.load()->first;
|
||||
}
|
||||
|
||||
bool from_string(const std::string& value) override
|
||||
{
|
||||
const auto found = map.find(value);
|
||||
|
||||
if (found == map.end())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_value = &*found;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<std::string> to_list() const override
|
||||
{
|
||||
return list;
|
||||
}
|
||||
};
|
||||
|
||||
// Value node with fixed set of possible values, each maps to an enum value of type T.
|
||||
template<typename T, bool External = false>
|
||||
class enum_entry final : public entry_base
|
||||
{
|
||||
// Value or reference
|
||||
std::conditional_t<External, atomic_t<T>&, atomic_t<T>> m_value;
|
||||
|
||||
public:
|
||||
const T def;
|
||||
|
||||
enum_entry(node& owner, const std::string& name, std::conditional_t<External, atomic_t<T>&, T> value)
|
||||
: entry_base(type::enumeration, owner, name)
|
||||
, m_value(value)
|
||||
, def(value)
|
||||
{
|
||||
}
|
||||
|
||||
operator T() const
|
||||
{
|
||||
return m_value.load();
|
||||
}
|
||||
|
||||
enum_entry& operator =(T value)
|
||||
{
|
||||
m_value = value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void from_default() override
|
||||
{
|
||||
m_value = def;
|
||||
}
|
||||
|
||||
std::string to_string() const override
|
||||
{
|
||||
std::string result;
|
||||
fmt_class_string<T>::format(result, fmt_unveil<T>::get(m_value));
|
||||
return result; // TODO: ???
|
||||
}
|
||||
|
||||
bool from_string(const std::string& value) override
|
||||
{
|
||||
u64 result;
|
||||
|
||||
if (try_to_enum_value(&result, &fmt_class_string<T>::format, value))
|
||||
{
|
||||
// No narrowing check, it's hard to do right there
|
||||
m_value = static_cast<T>(static_cast<std::underlying_type_t<T>>(result));
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<std::string> to_list() const override
|
||||
{
|
||||
return try_to_enum_list(&fmt_class_string<T>::format);
|
||||
}
|
||||
};
|
||||
|
||||
// Signed 32/64-bit integer entry with custom Min/Max range.
|
||||
template<s64 Min, s64 Max>
|
||||
class int_entry final : public entry_base
|
||||
{
|
||||
static_assert(Min < Max, "Invalid cfg::int_entry range");
|
||||
|
||||
// Prefer 32 bit type if possible
|
||||
using int_type = std::conditional_t<Min >= INT32_MIN && Max <= INT32_MAX, s32, s64>;
|
||||
|
||||
atomic_t<int_type> m_value;
|
||||
|
||||
public:
|
||||
const int_type def;
|
||||
|
||||
int_entry(node& owner, const std::string& name, int_type def = std::min<int_type>(Max, std::max<int_type>(Min, 0)))
|
||||
: entry_base(type::integer, owner, name)
|
||||
, m_value(def)
|
||||
, def(def)
|
||||
{
|
||||
}
|
||||
|
||||
operator int_type() const
|
||||
{
|
||||
return m_value.load();
|
||||
}
|
||||
|
||||
int_entry& operator =(int_type value)
|
||||
{
|
||||
if (value < Min || value > Max)
|
||||
{
|
||||
fmt::throw_exception("Value out of the valid range: %lld" HERE, s64{ value });
|
||||
}
|
||||
|
||||
m_value = value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void from_default() override
|
||||
{
|
||||
m_value = def;
|
||||
}
|
||||
|
||||
std::string to_string() const override
|
||||
{
|
||||
return std::to_string(m_value.load());
|
||||
}
|
||||
|
||||
bool from_string(const std::string& value) override
|
||||
{
|
||||
s64 result;
|
||||
if (try_to_int64(&result, value, Min, Max))
|
||||
{
|
||||
m_value = static_cast<int_type>(result);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// Alias for 32 bit int
|
||||
using int32_entry = int_entry<INT32_MIN, INT32_MAX>;
|
||||
|
||||
// Alias for 64 bit int
|
||||
using int64_entry = int_entry<INT64_MIN, INT64_MAX>;
|
||||
|
||||
// Simple string entry with mutex
|
||||
class string_entry final : public entry_base
|
||||
{
|
||||
mutable std::mutex m_mutex;
|
||||
std::string m_value;
|
||||
|
||||
public:
|
||||
const std::string def;
|
||||
|
||||
string_entry(node& owner, const std::string& name, const std::string& def = {})
|
||||
: entry_base(type::string, owner, name)
|
||||
, m_value(def)
|
||||
, def(def)
|
||||
{
|
||||
}
|
||||
|
||||
operator std::string() const
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
return m_value;
|
||||
}
|
||||
|
||||
std::string get() const
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
string_entry& operator =(const std::string& value)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
m_value = value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
std::size_t size() const
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
return m_value.size();
|
||||
}
|
||||
|
||||
void from_default() override;
|
||||
|
||||
std::string to_string() const override
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
return m_value;
|
||||
}
|
||||
|
||||
bool from_string(const std::string& value) override
|
||||
{
|
||||
*this = value;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
// Simple set entry with mutex (TODO: template for various types)
|
||||
class set_entry final : public entry_base
|
||||
{
|
||||
mutable std::mutex m_mutex;
|
||||
|
||||
std::set<std::string> m_set;
|
||||
|
||||
public:
|
||||
// Default value is empty list in current implementation
|
||||
set_entry(node& owner, const std::string& name)
|
||||
: entry_base(type::set, owner, name)
|
||||
{
|
||||
}
|
||||
|
||||
std::set<std::string> get_set() const
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
|
||||
return m_set;
|
||||
}
|
||||
|
||||
void set_set(std::set<std::string>&& set)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
m_set = std::move(set);
|
||||
}
|
||||
|
||||
void from_default() override;
|
||||
|
||||
std::vector<std::string> to_list() const override
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
|
||||
return{ m_set.begin(), m_set.end() };
|
||||
}
|
||||
|
||||
bool from_list(std::vector<std::string>&& list) override
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
m_set = { std::make_move_iterator(list.begin()), std::make_move_iterator(list.end()) };
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
// Root type with some predefined nodes. Don't change it, this is not mandatory for adding nodes.
|
||||
struct root_node : node
|
||||
{
|
||||
node core { *this, "Core" };
|
||||
node vfs { *this, "VFS" };
|
||||
node log { *this, "Log" };
|
||||
node video { *this, "Video" };
|
||||
node audio { *this, "Audio" };
|
||||
node io { *this, "Input/Output" };
|
||||
node sys { *this, "System" };
|
||||
node net { *this, "Net" };
|
||||
node misc { *this, "Miscellaneous" };
|
||||
};
|
||||
|
||||
// Get global configuration root instance
|
||||
extern root_node& get_root();
|
||||
|
||||
// Global configuration root instance (cached reference)
|
||||
static root_node& root = get_root();
|
||||
}
|
||||
|
||||
// Registered log channel
|
||||
#define LOG_CHANNEL(name) extern logs::channel name; namespace logs { static cfg::enum_entry<logs::level, true> name(cfg::root.log, #name, ::name.enabled); }
|
||||
+1320
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,570 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include "bit_set.h"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
namespace fs
|
||||
{
|
||||
// File open mode flags
|
||||
enum class open_mode : u32
|
||||
{
|
||||
read,
|
||||
write,
|
||||
append,
|
||||
create,
|
||||
trunc,
|
||||
excl,
|
||||
|
||||
__bitset_enum_max
|
||||
};
|
||||
|
||||
constexpr auto read = +open_mode::read; // Enable reading
|
||||
constexpr auto write = +open_mode::write; // Enable writing
|
||||
constexpr auto append = +open_mode::append; // Always append to the end of the file
|
||||
constexpr auto create = +open_mode::create; // Create file if it doesn't exist
|
||||
constexpr auto trunc = +open_mode::trunc; // Clear opened file if it's not empty
|
||||
constexpr auto excl = +open_mode::excl; // Failure if the file already exists (used with `create`)
|
||||
|
||||
constexpr auto rewrite = open_mode::write + open_mode::create + open_mode::trunc;
|
||||
|
||||
// File seek mode
|
||||
enum class seek_mode : u32
|
||||
{
|
||||
seek_set,
|
||||
seek_cur,
|
||||
seek_end,
|
||||
};
|
||||
|
||||
constexpr auto seek_set = seek_mode::seek_set; // From beginning
|
||||
constexpr auto seek_cur = seek_mode::seek_cur; // From current position
|
||||
constexpr auto seek_end = seek_mode::seek_end; // From end
|
||||
|
||||
// File attributes (TODO)
|
||||
struct stat_t
|
||||
{
|
||||
bool is_directory;
|
||||
bool is_writable;
|
||||
u64 size;
|
||||
s64 atime;
|
||||
s64 mtime;
|
||||
s64 ctime;
|
||||
};
|
||||
|
||||
// File handle base
|
||||
struct file_base
|
||||
{
|
||||
virtual ~file_base();
|
||||
|
||||
virtual stat_t stat() = 0;
|
||||
virtual bool trunc(u64 length) = 0;
|
||||
virtual u64 read(void* buffer, u64 size) = 0;
|
||||
virtual u64 write(const void* buffer, u64 size) = 0;
|
||||
virtual u64 seek(s64 offset, seek_mode whence) = 0;
|
||||
virtual u64 size() = 0;
|
||||
};
|
||||
|
||||
// Directory entry (TODO)
|
||||
struct dir_entry : stat_t
|
||||
{
|
||||
std::string name;
|
||||
};
|
||||
|
||||
// Directory handle base
|
||||
struct dir_base
|
||||
{
|
||||
virtual ~dir_base();
|
||||
|
||||
virtual bool read(dir_entry&) = 0;
|
||||
virtual void rewind() = 0;
|
||||
};
|
||||
|
||||
// Virtual device
|
||||
struct device_base
|
||||
{
|
||||
virtual ~device_base();
|
||||
|
||||
virtual bool stat(const std::string& path, stat_t& info) = 0;
|
||||
virtual bool remove_dir(const std::string& path) = 0;
|
||||
virtual bool create_dir(const std::string& path) = 0;
|
||||
virtual bool rename(const std::string& from, const std::string& to) = 0;
|
||||
virtual bool remove(const std::string& path) = 0;
|
||||
virtual bool trunc(const std::string& path, u64 length) = 0;
|
||||
virtual bool utime(const std::string& path, s64 atime, s64 mtime) = 0;
|
||||
|
||||
virtual std::unique_ptr<file_base> open(const std::string& path, bs_t<open_mode> mode) = 0;
|
||||
virtual std::unique_ptr<dir_base> open_dir(const std::string& path) = 0;
|
||||
};
|
||||
|
||||
// Get virtual device for specified path (nullptr for real path)
|
||||
std::shared_ptr<device_base> get_virtual_device(const std::string& path);
|
||||
|
||||
// Set virtual device with specified name (nullptr for deletion)
|
||||
std::shared_ptr<device_base> set_virtual_device(const std::string& root_name, const std::shared_ptr<device_base>&);
|
||||
|
||||
// Try to get parent directory (returns empty string on failure)
|
||||
std::string get_parent_dir(const std::string& path);
|
||||
|
||||
// Get file information
|
||||
bool stat(const std::string& path, stat_t& info);
|
||||
|
||||
// Check whether a file or a directory exists (not recommended, use is_file() or is_dir() instead)
|
||||
bool exists(const std::string& path);
|
||||
|
||||
// Check whether the file exists and is NOT a directory
|
||||
bool is_file(const std::string& path);
|
||||
|
||||
// Check whether the directory exists and is NOT a file
|
||||
bool is_dir(const std::string& path);
|
||||
|
||||
// Delete empty directory
|
||||
bool remove_dir(const std::string& path);
|
||||
|
||||
// Create directory
|
||||
bool create_dir(const std::string& path);
|
||||
|
||||
// Create directories
|
||||
bool create_path(const std::string& path);
|
||||
|
||||
// Rename (move) file or directory
|
||||
bool rename(const std::string& from, const std::string& to);
|
||||
|
||||
// Copy file contents
|
||||
bool copy_file(const std::string& from, const std::string& to, bool overwrite);
|
||||
|
||||
// Delete file
|
||||
bool remove_file(const std::string& path);
|
||||
|
||||
// Change file size (possibly appending zeros)
|
||||
bool truncate_file(const std::string& path, u64 length);
|
||||
|
||||
// Set file access/modification time
|
||||
bool utime(const std::string& path, s64 atime, s64 mtime);
|
||||
|
||||
class file final
|
||||
{
|
||||
std::unique_ptr<file_base> m_file;
|
||||
|
||||
[[noreturn]] void xnull() const;
|
||||
[[noreturn]] void xfail() const;
|
||||
|
||||
public:
|
||||
// Default constructor
|
||||
file() = default;
|
||||
|
||||
// Open file with specified mode
|
||||
explicit file(const std::string& path, bs_t<open_mode> mode = ::fs::read);
|
||||
|
||||
// Open memory for read
|
||||
explicit file(const void* ptr, std::size_t size);
|
||||
|
||||
// Open file with specified args (forward to constructor)
|
||||
template <typename... Args>
|
||||
bool open(Args&&... args)
|
||||
{
|
||||
*this = fs::file(std::forward<Args>(args)...);
|
||||
return m_file.operator bool();
|
||||
}
|
||||
|
||||
// Check whether the handle is valid (opened file)
|
||||
explicit operator bool() const
|
||||
{
|
||||
return m_file.operator bool();
|
||||
}
|
||||
|
||||
// Close the file explicitly
|
||||
void close()
|
||||
{
|
||||
m_file.reset();
|
||||
}
|
||||
|
||||
void reset(std::unique_ptr<file_base>&& ptr)
|
||||
{
|
||||
m_file = std::move(ptr);
|
||||
}
|
||||
|
||||
std::unique_ptr<file_base> release()
|
||||
{
|
||||
return std::move(m_file);
|
||||
}
|
||||
|
||||
// Change file size (possibly appending zero bytes)
|
||||
bool trunc(u64 length) const
|
||||
{
|
||||
if (!m_file) xnull();
|
||||
return m_file->trunc(length);
|
||||
}
|
||||
|
||||
// Get file information
|
||||
stat_t stat() const
|
||||
{
|
||||
if (!m_file) xnull();
|
||||
return m_file->stat();
|
||||
}
|
||||
|
||||
// Read the data from the file and return the amount of data written in buffer
|
||||
u64 read(void* buffer, u64 count) const
|
||||
{
|
||||
if (!m_file) xnull();
|
||||
return m_file->read(buffer, count);
|
||||
}
|
||||
|
||||
// Write the data to the file and return the amount of data actually written
|
||||
u64 write(const void* buffer, u64 count) const
|
||||
{
|
||||
if (!m_file) xnull();
|
||||
return m_file->write(buffer, count);
|
||||
}
|
||||
|
||||
// Change current position, returns resulting position
|
||||
u64 seek(s64 offset, seek_mode whence = seek_set) const
|
||||
{
|
||||
if (!m_file) xnull();
|
||||
return m_file->seek(offset, whence);
|
||||
}
|
||||
|
||||
// Get file size
|
||||
u64 size() const
|
||||
{
|
||||
if (!m_file) xnull();
|
||||
return m_file->size();
|
||||
}
|
||||
|
||||
// Get current position
|
||||
u64 pos() const
|
||||
{
|
||||
if (!m_file) xnull();
|
||||
return m_file->seek(0, seek_cur);
|
||||
}
|
||||
|
||||
// Write std::string unconditionally
|
||||
const file& write(const std::string& str) const
|
||||
{
|
||||
if (write(str.data(), str.size()) != str.size()) xfail();
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Write POD unconditionally
|
||||
template<typename T>
|
||||
std::enable_if_t<std::is_pod<T>::value && !std::is_pointer<T>::value, const file&> write(const T& data) const
|
||||
{
|
||||
if (write(std::addressof(data), sizeof(T)) != sizeof(T)) xfail();
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Write POD std::vector unconditionally
|
||||
template<typename T>
|
||||
std::enable_if_t<std::is_pod<T>::value && !std::is_pointer<T>::value, const file&> write(const std::vector<T>& vec) const
|
||||
{
|
||||
if (write(vec.data(), vec.size() * sizeof(T)) != vec.size() * sizeof(T)) xfail();
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Read std::string, size must be set by resize() method
|
||||
bool read(std::string& str) const
|
||||
{
|
||||
return read(&str[0], str.size()) == str.size();
|
||||
}
|
||||
|
||||
// Read std::string
|
||||
bool read(std::string& str, std::size_t size) const
|
||||
{
|
||||
str.resize(size);
|
||||
return read(&str[0], size) == size;
|
||||
}
|
||||
|
||||
// Read POD, sizeof(T) is used
|
||||
template<typename T>
|
||||
std::enable_if_t<std::is_pod<T>::value && !std::is_pointer<T>::value, bool> read(T& data) const
|
||||
{
|
||||
return read(&data, sizeof(T)) == sizeof(T);
|
||||
}
|
||||
|
||||
// Read POD std::vector, size must be set by resize() method
|
||||
template<typename T>
|
||||
std::enable_if_t<std::is_pod<T>::value && !std::is_pointer<T>::value, bool> read(std::vector<T>& vec) const
|
||||
{
|
||||
return read(vec.data(), sizeof(T) * vec.size()) == sizeof(T) * vec.size();
|
||||
}
|
||||
|
||||
// Read POD std::vector
|
||||
template<typename T>
|
||||
std::enable_if_t<std::is_pod<T>::value && !std::is_pointer<T>::value, bool> read(std::vector<T>& vec, std::size_t size) const
|
||||
{
|
||||
vec.resize(size);
|
||||
return read(vec.data(), sizeof(T) * size) == sizeof(T) * size;
|
||||
}
|
||||
|
||||
// Read POD (experimental)
|
||||
template<typename T>
|
||||
std::enable_if_t<std::is_pod<T>::value && !std::is_pointer<T>::value, T> read() const
|
||||
{
|
||||
T result;
|
||||
if (!read(result)) xfail();
|
||||
return result;
|
||||
}
|
||||
|
||||
// Read full file to std::string
|
||||
std::string to_string() const
|
||||
{
|
||||
std::string result;
|
||||
result.resize(size());
|
||||
if (seek(0), !read(result)) xfail();
|
||||
return result;
|
||||
}
|
||||
|
||||
// Read full file to std::vector
|
||||
template<typename T>
|
||||
std::enable_if_t<std::is_pod<T>::value && !std::is_pointer<T>::value, std::vector<T>> to_vector() const
|
||||
{
|
||||
std::vector<T> result;
|
||||
result.resize(size() / sizeof(T));
|
||||
if (seek(0), !read(result)) xfail();
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
class dir final
|
||||
{
|
||||
std::unique_ptr<dir_base> m_dir;
|
||||
|
||||
[[noreturn]] void xnull() const;
|
||||
|
||||
public:
|
||||
dir() = default;
|
||||
|
||||
// Open dir handle
|
||||
explicit dir(const std::string& path)
|
||||
{
|
||||
open(path);
|
||||
}
|
||||
|
||||
// Open specified directory
|
||||
bool open(const std::string& path);
|
||||
|
||||
// Check whether the handle is valid (opened directory)
|
||||
explicit operator bool() const
|
||||
{
|
||||
return m_dir.operator bool();
|
||||
}
|
||||
|
||||
// Close the directory explicitly
|
||||
void close()
|
||||
{
|
||||
m_dir.reset();
|
||||
}
|
||||
|
||||
void reset(std::unique_ptr<dir_base>&& ptr)
|
||||
{
|
||||
m_dir = std::move(ptr);
|
||||
}
|
||||
|
||||
std::unique_ptr<dir_base> release()
|
||||
{
|
||||
return std::move(m_dir);
|
||||
}
|
||||
|
||||
// Get next directory entry
|
||||
bool read(dir_entry& out) const
|
||||
{
|
||||
if (!m_dir) xnull();
|
||||
return m_dir->read(out);
|
||||
}
|
||||
|
||||
// Reset to the beginning
|
||||
void rewind() const
|
||||
{
|
||||
if (!m_dir) xnull();
|
||||
return m_dir->rewind();
|
||||
}
|
||||
|
||||
class iterator
|
||||
{
|
||||
dir* m_parent;
|
||||
dir_entry m_entry;
|
||||
|
||||
public:
|
||||
enum class mode
|
||||
{
|
||||
from_first,
|
||||
from_current
|
||||
};
|
||||
|
||||
iterator(dir* parent, mode mode_ = mode::from_first)
|
||||
: m_parent(parent)
|
||||
{
|
||||
if (!m_parent)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (mode_ == mode::from_first)
|
||||
{
|
||||
m_parent->rewind();
|
||||
}
|
||||
|
||||
if (!m_parent->read(m_entry))
|
||||
{
|
||||
m_parent = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
dir_entry& operator *()
|
||||
{
|
||||
return m_entry;
|
||||
}
|
||||
|
||||
iterator& operator++()
|
||||
{
|
||||
*this = { m_parent, mode::from_current };
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool operator !=(const iterator& rhs) const
|
||||
{
|
||||
return m_parent != rhs.m_parent;
|
||||
}
|
||||
};
|
||||
|
||||
iterator begin()
|
||||
{
|
||||
return{ m_dir ? this : nullptr };
|
||||
}
|
||||
|
||||
iterator end()
|
||||
{
|
||||
return{ nullptr };
|
||||
}
|
||||
};
|
||||
|
||||
// Get configuration directory
|
||||
const std::string& get_config_dir();
|
||||
|
||||
// Get data/cache directory for specified prefix and suffix
|
||||
std::string get_data_dir(const std::string& prefix, const std::string& location, const std::string& suffix);
|
||||
|
||||
// Get data/cache directory for specified prefix and path (suffix will be filename)
|
||||
std::string get_data_dir(const std::string& prefix, const std::string& path);
|
||||
|
||||
// Delete directory and all its contents recursively
|
||||
void remove_all(const std::string& path, bool remove_root = true);
|
||||
|
||||
// Get size of all files recursively
|
||||
u64 get_dir_size(const std::string& path);
|
||||
|
||||
enum class error : uint
|
||||
{
|
||||
ok = 0,
|
||||
|
||||
inval,
|
||||
noent,
|
||||
exist,
|
||||
acces,
|
||||
};
|
||||
|
||||
// Error code returned
|
||||
extern thread_local error g_tls_error;
|
||||
|
||||
template <typename T>
|
||||
struct container_stream final : file_base
|
||||
{
|
||||
// T can be a reference, but this is not recommended
|
||||
using value_type = typename std::remove_reference_t<T>::value_type;
|
||||
|
||||
T obj;
|
||||
u64 pos;
|
||||
|
||||
container_stream(T&& obj)
|
||||
: obj(std::forward<T>(obj))
|
||||
, pos(0)
|
||||
{
|
||||
}
|
||||
|
||||
~container_stream() override
|
||||
{
|
||||
}
|
||||
|
||||
stat_t stat() override
|
||||
{
|
||||
fmt::raw_error("fs::container_stream<>::stat(): not supported");
|
||||
}
|
||||
|
||||
bool trunc(u64 length) override
|
||||
{
|
||||
obj.resize(length);
|
||||
return true;
|
||||
}
|
||||
|
||||
u64 read(void* buffer, u64 size) override
|
||||
{
|
||||
const u64 end = obj.size();
|
||||
|
||||
if (pos < end)
|
||||
{
|
||||
// Get readable size
|
||||
if (const u64 max = std::min<u64>(size, end - pos))
|
||||
{
|
||||
std::copy(obj.cbegin() + pos, obj.cbegin() + pos + max, static_cast<value_type*>(buffer));
|
||||
pos = pos + max;
|
||||
return max;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
u64 write(const void* buffer, u64 size) override
|
||||
{
|
||||
const u64 old_size = obj.size();
|
||||
|
||||
if (old_size + size < old_size)
|
||||
{
|
||||
fmt::raw_error("fs::container_stream<>::write(): overflow");
|
||||
}
|
||||
|
||||
if (pos > old_size)
|
||||
{
|
||||
// Fill gap if necessary (default-initialized)
|
||||
obj.resize(pos);
|
||||
}
|
||||
|
||||
const auto src = static_cast<const value_type*>(buffer);
|
||||
|
||||
// Overwrite existing part
|
||||
const u64 overlap = std::min<u64>(obj.size() - pos, size);
|
||||
std::copy(src, src + overlap, obj.begin() + pos);
|
||||
|
||||
// Append new data
|
||||
obj.insert(obj.end(), src + overlap, src + size);
|
||||
pos += size;
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
u64 seek(s64 offset, seek_mode whence) override
|
||||
{
|
||||
return
|
||||
whence == fs::seek_set ? pos = offset :
|
||||
whence == fs::seek_cur ? pos = offset + pos :
|
||||
whence == fs::seek_end ? pos = offset + size() :
|
||||
(fmt::raw_error("fs::container_stream<>::seek(): invalid whence"), 0);
|
||||
}
|
||||
|
||||
u64 size() override
|
||||
{
|
||||
return obj.size();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
file make_stream(T&& container = T{})
|
||||
{
|
||||
file result;
|
||||
result.reset(std::make_unique<container_stream<T>>(std::forward<T>(container)));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
#include "GNU.h"
|
||||
|
||||
#ifdef __APPLE__
|
||||
void * _aligned_malloc(size_t size, size_t alignment) {
|
||||
void *buffer;
|
||||
posix_memalign(&buffer, alignment, size);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
int clock_gettime(int foo, struct timespec *ts) {
|
||||
struct timeval tv;
|
||||
|
||||
gettimeofday(&tv, NULL);
|
||||
ts->tv_sec = tv.tv_sec;
|
||||
ts->tv_nsec = tv.tv_usec * 1000;
|
||||
return(0);
|
||||
}
|
||||
#endif /* !__APPLE__ */
|
||||
@@ -1,72 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef _WIN32
|
||||
#define thread_local __declspec(thread)
|
||||
#elif __APPLE__
|
||||
#define thread_local __thread
|
||||
#endif
|
||||
|
||||
#if defined(__GNUG__)
|
||||
#include <cmath>
|
||||
#include <stdlib.h>
|
||||
#include <cstdint>
|
||||
|
||||
#ifndef __APPLE__
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#define _fpclass(x) std::fpclassify(x)
|
||||
#define __forceinline __attribute__((always_inline))
|
||||
#define _byteswap_ushort(x) __builtin_bswap16(x)
|
||||
#define _byteswap_ulong(x) __builtin_bswap32(x)
|
||||
#define _byteswap_uint64(x) __builtin_bswap64(x)
|
||||
#define Sleep(x) usleep(x * 1000)
|
||||
#define mkdir(x) mkdir(x, 0777)
|
||||
#define INFINITE 0xFFFFFFFF
|
||||
#define _CRT_ALIGN(x) __attribute__((aligned(x)))
|
||||
#define InterlockedCompareExchange(ptr,new_val,old_val) __sync_val_compare_and_swap(ptr,old_val,new_val)
|
||||
#define InterlockedCompareExchange64(ptr,new_val,old_val) __sync_val_compare_and_swap(ptr,old_val,new_val)
|
||||
|
||||
inline int64_t InterlockedOr64(volatile int64_t *dest, int64_t val)
|
||||
{
|
||||
int64_t olderval;
|
||||
int64_t oldval = *dest;
|
||||
do
|
||||
{
|
||||
olderval = oldval;
|
||||
oldval = InterlockedCompareExchange64(dest, olderval | val, olderval);
|
||||
} while (olderval != oldval);
|
||||
return oldval;
|
||||
}
|
||||
|
||||
inline uint64_t __umulh(uint64_t a, uint64_t b)
|
||||
{
|
||||
uint64_t result;
|
||||
__asm__("mulq %[b]" : "=d" (result) : [a] "a" (a), [b] "rm" (b));
|
||||
return result;
|
||||
}
|
||||
|
||||
inline int64_t __mulh(int64_t a, int64_t b)
|
||||
{
|
||||
int64_t result;
|
||||
__asm__("imulq %[b]" : "=d" (result) : [a] "a" (a), [b] "rm" (b));
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifndef __APPLE__
|
||||
#define _aligned_malloc(size,alignment) memalign(alignment,size)
|
||||
#else
|
||||
void * _aligned_malloc(size_t size, size_t alignment);
|
||||
int clock_gettime(int foo, struct timespec *ts);
|
||||
#define wxIsNaN(x) ((x) != (x))
|
||||
|
||||
#ifndef CLOCK_MONOTONIC
|
||||
#define CLOCK_MONOTONIC 0
|
||||
#endif /* !CLOCK_MONOTONIC */
|
||||
|
||||
#endif /* !__APPLE__ */
|
||||
|
||||
#define _aligned_free free
|
||||
|
||||
#define DWORD int32_t
|
||||
#endif
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#define GSL_THROW_ON_CONTRACT_VIOLATION
|
||||
|
||||
#pragma push_macro("new")
|
||||
#undef new
|
||||
#include <gsl>
|
||||
#pragma pop_macro("new")
|
||||
#undef Expects
|
||||
#undef Ensures
|
||||
@@ -1,179 +0,0 @@
|
||||
#pragma once
|
||||
#include <unordered_map>
|
||||
|
||||
#define rID_ANY -1 // was wxID_ANY
|
||||
|
||||
typedef u32 ID_TYPE;
|
||||
|
||||
class IDData
|
||||
{
|
||||
protected:
|
||||
void* m_ptr;
|
||||
std::function<void(void*)> m_destr;
|
||||
|
||||
public:
|
||||
IDData(void* ptr, std::function<void(void*)> destr)
|
||||
: m_ptr(ptr)
|
||||
, m_destr(destr)
|
||||
{
|
||||
}
|
||||
|
||||
~IDData()
|
||||
{
|
||||
m_destr(m_ptr);
|
||||
}
|
||||
|
||||
template<typename T> T* get()
|
||||
{
|
||||
return (T*)m_ptr;
|
||||
}
|
||||
|
||||
template<typename T> const T* get() const
|
||||
{
|
||||
return (const T*)m_ptr;
|
||||
}
|
||||
};
|
||||
|
||||
struct ID
|
||||
{
|
||||
std::string m_name;
|
||||
u32 m_attr;
|
||||
IDData* m_data;
|
||||
|
||||
template<typename T>
|
||||
ID(const std::string& name, T* data, const u32 attr)
|
||||
: m_name(name)
|
||||
, m_attr(attr)
|
||||
{
|
||||
m_data = new IDData(data, [](void *ptr) -> void { delete (T*)ptr; });
|
||||
}
|
||||
|
||||
ID() : m_data(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
ID(ID&& other)
|
||||
{
|
||||
m_name = other.m_name;
|
||||
m_attr = other.m_attr;
|
||||
m_data = other.m_data;
|
||||
other.m_data = nullptr;
|
||||
}
|
||||
ID& operator=(ID&& other)
|
||||
{
|
||||
std::swap(m_name,other.m_name);
|
||||
std::swap(m_attr,other.m_attr);
|
||||
std::swap(m_data,other.m_data);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void Kill()
|
||||
{
|
||||
delete m_data;
|
||||
}
|
||||
};
|
||||
|
||||
class IdManager
|
||||
{
|
||||
static const ID_TYPE s_first_id = 1;
|
||||
static const ID_TYPE s_max_id = -1;
|
||||
|
||||
std::unordered_map<ID_TYPE, ID> m_id_map;
|
||||
std::mutex m_mtx_main;
|
||||
|
||||
ID_TYPE m_cur_id;
|
||||
|
||||
public:
|
||||
IdManager() : m_cur_id(s_first_id)
|
||||
{
|
||||
}
|
||||
|
||||
~IdManager()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
bool CheckID(const ID_TYPE id)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mtx_main);
|
||||
|
||||
return m_id_map.find(id) != m_id_map.end();
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mtx_main);
|
||||
|
||||
for(auto& i : m_id_map)
|
||||
{
|
||||
i.second.Kill();
|
||||
}
|
||||
|
||||
m_id_map.clear();
|
||||
m_cur_id = s_first_id;
|
||||
}
|
||||
|
||||
template<typename T
|
||||
#ifdef __GNUG__
|
||||
= char
|
||||
#endif
|
||||
>
|
||||
ID_TYPE GetNewID(const std::string& name = "", T* data = nullptr, const u32 attr = 0)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mtx_main);
|
||||
|
||||
m_id_map[m_cur_id] = ID(name, data, attr);
|
||||
|
||||
return m_cur_id++;
|
||||
}
|
||||
|
||||
ID& GetID(const ID_TYPE id)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mtx_main);
|
||||
|
||||
return m_id_map[id];
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
bool GetIDData(const ID_TYPE id, T*& result)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mtx_main);
|
||||
|
||||
auto f = m_id_map.find(id);
|
||||
|
||||
if(f == m_id_map.end())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
result = f->second.m_data->get<T>();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool HasID(const s64 id)
|
||||
{
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mtx_main);
|
||||
|
||||
if(id == rID_ANY)
|
||||
return m_id_map.begin() != m_id_map.end();
|
||||
}
|
||||
|
||||
return CheckID(id);
|
||||
}
|
||||
|
||||
bool RemoveID(const ID_TYPE id)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mtx_main);
|
||||
|
||||
auto item = m_id_map.find(id);
|
||||
|
||||
if(item == m_id_map.end()) return false;
|
||||
|
||||
item->second.Kill();
|
||||
m_id_map.erase(item);
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
+24
-34
@@ -1,42 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
template<typename T>
|
||||
struct BaseInterval
|
||||
template<typename T1, typename T2> struct range_t
|
||||
{
|
||||
static const uint64_t zero = 0ull;
|
||||
static const uint64_t notz = 0xffffffffffffffffull;
|
||||
T1 _min; // first value
|
||||
T2 _max; // second value
|
||||
};
|
||||
|
||||
T m_min, m_max;
|
||||
template<typename T1, typename T2> constexpr range_t<std::decay_t<T1>, std::decay_t<T2>> make_range(T1&& _min, T2&& _max)
|
||||
{
|
||||
return{ std::forward<T1>(_min), std::forward<T2>(_max) };
|
||||
}
|
||||
|
||||
static BaseInterval<T> make(T min_value, T max_value)
|
||||
{
|
||||
BaseInterval<T> res = { min_value, max_value };
|
||||
return res;
|
||||
}
|
||||
template<typename T1, typename T2, typename T> constexpr bool operator <(const range_t<T1, T2>& range, const T& value)
|
||||
{
|
||||
return range._min < value && range._max < value;
|
||||
}
|
||||
|
||||
static BaseInterval<T> make()
|
||||
{
|
||||
return make((T&)zero, (T&)notz);
|
||||
}
|
||||
template<typename T1, typename T2, typename T> constexpr bool operator <(const T& value, const range_t<T1, T2>& range)
|
||||
{
|
||||
return value < range._min && value < range._max;
|
||||
}
|
||||
|
||||
bool getconst(T& result)
|
||||
{
|
||||
if (m_min == m_max)
|
||||
{
|
||||
result = m_min;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
template<typename T1, typename T2, typename T> constexpr bool operator ==(const range_t<T1, T2>& range, const T& value)
|
||||
{
|
||||
return !(value < range._min) && !(range._max < value);
|
||||
}
|
||||
|
||||
bool isindef()
|
||||
{
|
||||
if (T == float)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
template<typename T1, typename T2, typename T> constexpr bool operator ==(const T& value, const range_t<T1, T2>& range)
|
||||
{
|
||||
return !(value < range._min) && !(range._max < value);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,380 @@
|
||||
#ifdef LLVM_AVAILABLE
|
||||
|
||||
#include <unordered_map>
|
||||
#include <map>
|
||||
#include <unordered_set>
|
||||
#include <set>
|
||||
#include <array>
|
||||
|
||||
#include "types.h"
|
||||
#include "StrFmt.h"
|
||||
#include "File.h"
|
||||
#include "Log.h"
|
||||
#include "VirtualMemory.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push, 0)
|
||||
#endif
|
||||
#include "llvm/Support/TargetSelect.h"
|
||||
#include "llvm/Support/FormattedStream.h"
|
||||
#include "llvm/ExecutionEngine/ExecutionEngine.h"
|
||||
#include "llvm/ExecutionEngine/RTDyldMemoryManager.h"
|
||||
#include "llvm/ExecutionEngine/JITEventListener.h"
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
#include "JIT.h"
|
||||
|
||||
// Global LLVM context (thread-unsafe)
|
||||
llvm::LLVMContext g_llvm_ctx;
|
||||
|
||||
// Size of virtual memory area reserved: 512 MB
|
||||
static const u64 s_memory_size = 0x20000000;
|
||||
|
||||
// Try to reserve a portion of virtual memory in the first 2 GB address space beforehand, if possible.
|
||||
static void* const s_memory = []() -> void*
|
||||
{
|
||||
for (u64 addr = 0x10000000; addr <= 0x80000000 - s_memory_size; addr += 0x1000000)
|
||||
{
|
||||
if (auto ptr = utils::memory_reserve(s_memory_size, (void*)addr))
|
||||
{
|
||||
return ptr;
|
||||
}
|
||||
}
|
||||
|
||||
return utils::memory_reserve(s_memory_size);
|
||||
}();
|
||||
|
||||
// Code section
|
||||
static u8* s_code_addr;
|
||||
static u64 s_code_size;
|
||||
|
||||
#ifdef _WIN32
|
||||
static std::vector<std::vector<RUNTIME_FUNCTION>> s_unwind; // .pdata
|
||||
#endif
|
||||
|
||||
// Helper class
|
||||
struct MemoryManager final : llvm::RTDyldMemoryManager
|
||||
{
|
||||
std::unordered_map<std::string, std::uintptr_t>& m_link;
|
||||
|
||||
std::array<u8, 16>* m_tramps;
|
||||
|
||||
MemoryManager(std::unordered_map<std::string, std::uintptr_t>& table)
|
||||
: m_link(table)
|
||||
, m_next(s_memory)
|
||||
, m_tramps(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
[[noreturn]] static void null()
|
||||
{
|
||||
fmt::throw_exception("Null function" HERE);
|
||||
}
|
||||
|
||||
virtual u64 getSymbolAddress(const std::string& name) override
|
||||
{
|
||||
auto& addr = m_link[name];
|
||||
|
||||
// Find function address
|
||||
if (!addr)
|
||||
{
|
||||
addr = RTDyldMemoryManager::getSymbolAddress(name);
|
||||
|
||||
if (addr)
|
||||
{
|
||||
LOG_WARNING(GENERAL, "LLVM: Symbol requested: %s -> 0x%016llx", name, addr);
|
||||
}
|
||||
else
|
||||
{
|
||||
// It's fine if some function is never called, for example.
|
||||
LOG_ERROR(GENERAL, "LLVM: Linkage failed: %s", name);
|
||||
addr = (u64)null;
|
||||
}
|
||||
}
|
||||
|
||||
// Verify address for small code model
|
||||
if ((u64)s_memory > 0x80000000 - s_memory_size ? (u64)addr - (u64)s_memory >= s_memory_size : addr >= 0x80000000)
|
||||
{
|
||||
// Allocate memory for trampolines
|
||||
if (!m_tramps)
|
||||
{
|
||||
m_tramps = reinterpret_cast<decltype(m_tramps)>(m_next);
|
||||
utils::memory_commit(m_next, 4096, utils::protection::wx);
|
||||
m_next = (u8*)((u64)m_next + 4096);
|
||||
}
|
||||
|
||||
// Create a trampoline
|
||||
auto& data = *m_tramps++;
|
||||
data[0x0] = 0xff; // JMP [rip+2]
|
||||
data[0x1] = 0x25;
|
||||
data[0x2] = 0x02;
|
||||
data[0x3] = 0x00;
|
||||
data[0x4] = 0x00;
|
||||
data[0x5] = 0x00;
|
||||
data[0x6] = 0x48; // MOV rax, imm64 (not executed)
|
||||
data[0x7] = 0xb8;
|
||||
std::memcpy(data.data() + 8, &addr, 8);
|
||||
addr = (u64)&data;
|
||||
|
||||
// Reset pointer (memory page exhausted)
|
||||
if (((u64)m_tramps % 4096) == 0)
|
||||
{
|
||||
m_tramps = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
return addr;
|
||||
}
|
||||
|
||||
virtual u8* allocateCodeSection(std::uintptr_t size, uint align, uint sec_id, llvm::StringRef sec_name) override
|
||||
{
|
||||
// Simple allocation
|
||||
const u64 next = ::align((u64)m_next + size, 4096);
|
||||
|
||||
if (next > (u64)s_memory + s_memory_size)
|
||||
{
|
||||
LOG_FATAL(GENERAL, "LLVM: Out of memory (size=0x%llx, aligned 0x%x)", size, align);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
utils::memory_commit(m_next, size, utils::protection::wx);
|
||||
s_code_addr = (u8*)m_next;
|
||||
s_code_size = size;
|
||||
|
||||
LOG_NOTICE(GENERAL, "LLVM: Code section %u '%s' allocated -> %p (size=0x%llx, aligned 0x%x)", sec_id, sec_name.data(), m_next, size, align);
|
||||
return (u8*)std::exchange(m_next, (void*)next);
|
||||
}
|
||||
|
||||
virtual u8* allocateDataSection(std::uintptr_t size, uint align, uint sec_id, llvm::StringRef sec_name, bool is_ro) override
|
||||
{
|
||||
// Simple allocation
|
||||
const u64 next = ::align((u64)m_next + size, 4096);
|
||||
|
||||
if (next > (u64)s_memory + s_memory_size)
|
||||
{
|
||||
LOG_FATAL(GENERAL, "LLVM: Out of memory (size=0x%llx, aligned 0x%x)", size, align);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!is_ro)
|
||||
{
|
||||
LOG_ERROR(GENERAL, "LLVM: Writeable data section not supported!");
|
||||
}
|
||||
|
||||
utils::memory_commit(m_next, size);
|
||||
|
||||
LOG_NOTICE(GENERAL, "LLVM: Data section %u '%s' allocated -> %p (size=0x%llx, aligned 0x%x, %s)", sec_id, sec_name.data(), m_next, size, align, is_ro ? "ro" : "rw");
|
||||
return (u8*)std::exchange(m_next, (void*)next);
|
||||
}
|
||||
|
||||
virtual bool finalizeMemory(std::string* = nullptr) override
|
||||
{
|
||||
// TODO: make only read-only sections read-only
|
||||
//#ifdef _WIN32
|
||||
// DWORD op;
|
||||
// VirtualProtect(s_memory, (u64)m_next - (u64)s_memory, PAGE_READONLY, &op);
|
||||
// VirtualProtect(s_code_addr, s_code_size, PAGE_EXECUTE_READ, &op);
|
||||
//#else
|
||||
// ::mprotect(s_memory, (u64)m_next - (u64)s_memory, PROT_READ);
|
||||
// ::mprotect(s_code_addr, s_code_size, PROT_READ | PROT_EXEC);
|
||||
//#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual void registerEHFrames(u8* addr, u64 load_addr, std::size_t size) override
|
||||
{
|
||||
#ifdef _WIN32
|
||||
// Use s_memory as a BASE, compute the difference
|
||||
const u64 code_diff = (u64)s_code_addr - (u64)s_memory;
|
||||
const u64 unwind_diff = (u64)addr - (u64)s_memory;
|
||||
|
||||
// Fix RUNTIME_FUNCTION records (.pdata section)
|
||||
auto& pdata = s_unwind.back();
|
||||
|
||||
for (auto& rf : pdata)
|
||||
{
|
||||
rf.BeginAddress += static_cast<DWORD>(code_diff);
|
||||
rf.EndAddress += static_cast<DWORD>(code_diff);
|
||||
rf.UnwindData += static_cast<DWORD>(unwind_diff);
|
||||
}
|
||||
|
||||
// Register .xdata UNWIND_INFO structs
|
||||
if (!RtlAddFunctionTable(pdata.data(), (DWORD)pdata.size(), (u64)s_memory))
|
||||
{
|
||||
LOG_ERROR(GENERAL, "RtlAddFunctionTable() failed! Error %u", GetLastError());
|
||||
}
|
||||
#endif
|
||||
|
||||
return RTDyldMemoryManager::registerEHFrames(addr, load_addr, size);
|
||||
}
|
||||
|
||||
virtual void deregisterEHFrames(u8* addr, u64 load_addr, std::size_t size) override
|
||||
{
|
||||
LOG_ERROR(GENERAL, "deregisterEHFrames() called"); // Not expected
|
||||
|
||||
return RTDyldMemoryManager::deregisterEHFrames(addr, load_addr, size);
|
||||
}
|
||||
|
||||
~MemoryManager()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
for (auto&& unwind : s_unwind)
|
||||
{
|
||||
if (!RtlDeleteFunctionTable(unwind.data()))
|
||||
{
|
||||
LOG_FATAL(GENERAL, "RtlDeleteFunctionTable() failed! Error %u", GetLastError());
|
||||
}
|
||||
}
|
||||
|
||||
s_unwind.clear();
|
||||
#else
|
||||
// TODO: unregister EH frames if necessary
|
||||
#endif
|
||||
|
||||
utils::memory_decommit(s_memory, s_memory_size);
|
||||
}
|
||||
|
||||
private:
|
||||
void* m_next;
|
||||
};
|
||||
|
||||
// Helper class
|
||||
struct EventListener final : llvm::JITEventListener
|
||||
{
|
||||
std::string path;
|
||||
|
||||
virtual void NotifyObjectEmitted(const llvm::object::ObjectFile& obj, const llvm::RuntimeDyld::LoadedObjectInfo& inf) override
|
||||
{
|
||||
if (!path.empty())
|
||||
{
|
||||
const llvm::StringRef elf = obj.getData();
|
||||
fs::file(path, fs::rewrite).write(elf.data(), elf.size());
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
for (auto it = obj.section_begin(), end = obj.section_end(); it != end; ++it)
|
||||
{
|
||||
llvm::StringRef name;
|
||||
it->getName(name);
|
||||
|
||||
if (name == ".pdata")
|
||||
{
|
||||
llvm::StringRef data;
|
||||
it->getContents(data);
|
||||
|
||||
std::vector<RUNTIME_FUNCTION> rfs(data.size() / sizeof(RUNTIME_FUNCTION));
|
||||
|
||||
auto offsets = reinterpret_cast<DWORD*>(rfs.data());
|
||||
|
||||
// Initialize .pdata section using relocation info
|
||||
for (auto ri = it->relocation_begin(), end = it->relocation_end(); ri != end; ++ri)
|
||||
{
|
||||
if (ri->getType() == 3 /*R_X86_64_GOT32*/)
|
||||
{
|
||||
const u64 value = *reinterpret_cast<const DWORD*>(data.data() + ri->getOffset());
|
||||
offsets[ri->getOffset() / sizeof(DWORD)] = static_cast<DWORD>(value + ri->getSymbol()->getAddress().get());
|
||||
}
|
||||
}
|
||||
|
||||
s_unwind.emplace_back(std::move(rfs));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
static EventListener s_listener;
|
||||
|
||||
jit_compiler::jit_compiler(std::unordered_map<std::string, std::uintptr_t> init_linkage_info, std::string _cpu)
|
||||
: m_link(std::move(init_linkage_info))
|
||||
, m_cpu(std::move(_cpu))
|
||||
{
|
||||
// Initialization
|
||||
llvm::InitializeNativeTarget();
|
||||
llvm::InitializeNativeTargetAsmPrinter();
|
||||
LLVMLinkInMCJIT();
|
||||
|
||||
if (m_cpu.empty())
|
||||
{
|
||||
m_cpu = llvm::sys::getHostCPUName();
|
||||
}
|
||||
|
||||
std::string result;
|
||||
|
||||
m_engine.reset(llvm::EngineBuilder(std::make_unique<llvm::Module>("", g_llvm_ctx))
|
||||
.setErrorStr(&result)
|
||||
.setMCJITMemoryManager(std::make_unique<MemoryManager>(m_link))
|
||||
.setOptLevel(llvm::CodeGenOpt::Aggressive)
|
||||
.setCodeModel(llvm::CodeModel::Small)
|
||||
.setMCPU(m_cpu)
|
||||
.create());
|
||||
|
||||
if (!m_engine)
|
||||
{
|
||||
fmt::throw_exception("LLVM: Failed to create ExecutionEngine: %s", result);
|
||||
}
|
||||
|
||||
m_engine->RegisterJITEventListener(&s_listener);
|
||||
}
|
||||
|
||||
void jit_compiler::load(std::unique_ptr<llvm::Module> module, std::unique_ptr<llvm::object::ObjectFile> object)
|
||||
{
|
||||
s_listener.path.clear();
|
||||
|
||||
auto* module_ptr = module.get();
|
||||
|
||||
m_engine->addModule(std::move(module));
|
||||
m_engine->addObjectFile(std::move(object));
|
||||
m_engine->finalizeObject();
|
||||
|
||||
m_map.clear();
|
||||
|
||||
for (auto& func : module_ptr->functions())
|
||||
{
|
||||
const std::string& name = func.getName();
|
||||
|
||||
if (!m_link.count(name))
|
||||
{
|
||||
// Register compiled function
|
||||
m_map[name] = m_engine->getFunctionAddress(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void jit_compiler::make(std::unique_ptr<llvm::Module> module, std::string path)
|
||||
{
|
||||
s_listener.path = std::move(path);
|
||||
|
||||
auto* module_ptr = module.get();
|
||||
|
||||
m_engine->addModule(std::move(module));
|
||||
m_engine->finalizeObject();
|
||||
|
||||
m_map.clear();
|
||||
|
||||
for (auto& func : module_ptr->functions())
|
||||
{
|
||||
if (!func.empty())
|
||||
{
|
||||
const std::string& name = func.getName();
|
||||
|
||||
// Register compiled function
|
||||
m_map[name] = m_engine->getFunctionAddress(name);
|
||||
}
|
||||
|
||||
// Delete IR to lower memory consumption
|
||||
func.deleteBody();
|
||||
}
|
||||
}
|
||||
|
||||
jit_compiler::~jit_compiler()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,70 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef LLVM_AVAILABLE
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "restore_new.h"
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push, 0)
|
||||
#endif
|
||||
#include "llvm/IR/LLVMContext.h"
|
||||
#include "llvm/IR/Module.h"
|
||||
#include "llvm/ExecutionEngine/ExecutionEngine.h"
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
#include "define_new_memleakdetect.h"
|
||||
|
||||
extern llvm::LLVMContext g_llvm_ctx;
|
||||
|
||||
// Temporary compiler interface
|
||||
class jit_compiler final
|
||||
{
|
||||
// Execution instance
|
||||
std::unique_ptr<llvm::ExecutionEngine> m_engine;
|
||||
|
||||
// Compiled functions
|
||||
std::unordered_map<std::string, std::uintptr_t> m_map;
|
||||
|
||||
// Linkage cache
|
||||
std::unordered_map<std::string, std::uintptr_t> m_link;
|
||||
|
||||
// Arch
|
||||
std::string m_cpu;
|
||||
|
||||
public:
|
||||
jit_compiler(std::unordered_map<std::string, std::uintptr_t>, std::string _cpu);
|
||||
~jit_compiler();
|
||||
|
||||
// Compile module
|
||||
void make(std::unique_ptr<llvm::Module>, std::string);
|
||||
|
||||
// Load object
|
||||
void load(std::unique_ptr<llvm::Module>, std::unique_ptr<llvm::object::ObjectFile>);
|
||||
|
||||
// Get compiled function address
|
||||
std::uintptr_t get(const std::string& name) const
|
||||
{
|
||||
const auto found = m_map.find(name);
|
||||
|
||||
if (found != m_map.end())
|
||||
{
|
||||
return found->second;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Get CPU info
|
||||
const std::string& cpu() const
|
||||
{
|
||||
return m_cpu;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,23 @@
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
execute, and transmit the Software, and to prepare derivative works of the
|
||||
Software, and to permit third-parties to whom the Software is furnished to
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
the above license grant, this restriction and the following disclaimer,
|
||||
must be included in all copies of the Software, in whole or in part, and
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
+202
-221
@@ -1,239 +1,220 @@
|
||||
#include "stdafx.h"
|
||||
#include "Log.h"
|
||||
#include <iostream>
|
||||
#include "Log.h"
|
||||
#include "File.h"
|
||||
#include "StrFmt.h"
|
||||
|
||||
#include "rpcs3_version.h"
|
||||
#include <string>
|
||||
#include <cinttypes>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <mutex>
|
||||
#include <condition_variable>
|
||||
#include <thread>
|
||||
#include <set>
|
||||
#include <array>
|
||||
|
||||
using namespace Log;
|
||||
|
||||
LogManager *gLogManager = nullptr;
|
||||
|
||||
u32 LogMessage::size()
|
||||
{
|
||||
//1 byte for NULL terminator
|
||||
return sizeof(LogMessage::size_type) + sizeof(LogType) + sizeof(LogSeverity) + sizeof(std::string::value_type)*mText.size() + 1;
|
||||
}
|
||||
|
||||
void LogMessage::serialize(char *output)
|
||||
{
|
||||
LogMessage::size_type size = this->size();
|
||||
memcpy(output, &size, sizeof(LogMessage::size_type));
|
||||
output += sizeof(LogMessage::size_type);
|
||||
memcpy(output, &mType, sizeof(LogType));
|
||||
output += sizeof(LogType);
|
||||
memcpy(output, &mServerity, sizeof(LogSeverity));
|
||||
output += sizeof(LogSeverity);
|
||||
memcpy(output, mText.c_str(), mText.size() );
|
||||
output += sizeof(std::string::value_type)*mText.size();
|
||||
*output = '\0';
|
||||
|
||||
}
|
||||
LogMessage LogMessage::deserialize(char *input, u32* size_out)
|
||||
{
|
||||
LogMessage msg;
|
||||
LogMessage::size_type msgSize = *(reinterpret_cast<LogMessage::size_type*>(input));
|
||||
input += sizeof(LogMessage::size_type);
|
||||
msg.mType = *(reinterpret_cast<LogType*>(input));
|
||||
input += sizeof(LogType);
|
||||
msg.mServerity = *(reinterpret_cast<LogSeverity*>(input));
|
||||
input += sizeof(LogSeverity);
|
||||
if (msgSize > 9000)
|
||||
{
|
||||
int wtf = 6;
|
||||
}
|
||||
msg.mText.append(input, msgSize - 1 - sizeof(LogSeverity) - sizeof(LogType));
|
||||
if (size_out){(*size_out) = msgSize;}
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
|
||||
LogChannel::LogChannel() : LogChannel("unknown")
|
||||
{}
|
||||
|
||||
LogChannel::LogChannel(const std::string& name) :
|
||||
name(name)
|
||||
, mEnabled(true)
|
||||
, mLogLevel(Warning)
|
||||
{}
|
||||
|
||||
void LogChannel::log(LogMessage msg)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mListenerLock);
|
||||
for (auto &listener : mListeners)
|
||||
{
|
||||
listener->log(msg);
|
||||
}
|
||||
}
|
||||
|
||||
void LogChannel::addListener(std::shared_ptr<LogListener> listener)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mListenerLock);
|
||||
mListeners.insert(listener);
|
||||
}
|
||||
void LogChannel::removeListener(std::shared_ptr<LogListener> listener)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mListenerLock);
|
||||
mListeners.erase(listener);
|
||||
}
|
||||
|
||||
struct CoutListener : LogListener
|
||||
{
|
||||
void log(LogMessage msg)
|
||||
{
|
||||
std::cerr << msg.mText << std::endl;
|
||||
}
|
||||
};
|
||||
|
||||
struct FileListener : LogListener
|
||||
{
|
||||
rFile mFile;
|
||||
bool mPrependChannelName;
|
||||
|
||||
FileListener(const std::string& name = _PRGNAME_, bool prependChannel = true)
|
||||
: mFile(name + ".log", rFile::write),
|
||||
mPrependChannelName(prependChannel)
|
||||
{
|
||||
if (!mFile.IsOpened())
|
||||
{
|
||||
rMessageBox("Can't create log file! (" + name + ".log)", rMessageBoxCaptionStr, rICON_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
void log(LogMessage msg)
|
||||
{
|
||||
if (mPrependChannelName)
|
||||
{
|
||||
msg.mText.insert(0, gTypeNameTable[static_cast<u32>(msg.mType)].mName);
|
||||
}
|
||||
mFile.Write(msg.mText);
|
||||
}
|
||||
};
|
||||
|
||||
LogManager::LogManager()
|
||||
#ifdef BUFFERED_LOGGING
|
||||
: mExiting(false), mLogConsumer()
|
||||
#endif
|
||||
{
|
||||
auto it = mChannels.begin();
|
||||
std::shared_ptr<LogListener> listener(new FileListener());
|
||||
for (const LogTypeName& name : gTypeNameTable)
|
||||
{
|
||||
it->name = name.mName;
|
||||
it->addListener(listener);
|
||||
it++;
|
||||
}
|
||||
std::shared_ptr<LogListener> TTYListener(new FileListener("TTY",false));
|
||||
getChannel(TTY).addListener(TTYListener);
|
||||
#ifdef BUFFERED_LOGGING
|
||||
mLogConsumer = std::thread(&LogManager::consumeLog, this);
|
||||
#endif
|
||||
}
|
||||
|
||||
LogManager::~LogManager()
|
||||
{
|
||||
#ifdef BUFFERED_LOGGING
|
||||
mExiting = true;
|
||||
mBufferReady.notify_all();
|
||||
mLogConsumer.join();
|
||||
}
|
||||
|
||||
void LogManager::consumeLog()
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(mStatusMut);
|
||||
while (!mExiting)
|
||||
{
|
||||
mBufferReady.wait(lock);
|
||||
mBuffer.lockGet();
|
||||
size_t size = mBuffer.size();
|
||||
std::vector<char> local_messages(size);
|
||||
mBuffer.popN(&local_messages.front(), size);
|
||||
mBuffer.unlockGet();
|
||||
|
||||
u32 cursor = 0;
|
||||
u32 removed = 0;
|
||||
while (cursor < size)
|
||||
{
|
||||
Log::LogMessage msg = Log::LogMessage::deserialize(local_messages.data() + cursor, &removed);
|
||||
cursor += removed;
|
||||
getChannel(msg.mType).log(msg);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void LogManager::log(LogMessage msg)
|
||||
{
|
||||
//don't do any formatting changes or filtering to the TTY output since we
|
||||
//use the raw output to do diffs with the output of a real PS3 and some
|
||||
//programs write text in single bytes to the console
|
||||
if (msg.mType != TTY)
|
||||
{
|
||||
std::string prefix;
|
||||
switch (msg.mServerity)
|
||||
{
|
||||
case Success:
|
||||
prefix = "S ";
|
||||
break;
|
||||
case Notice:
|
||||
prefix = "! ";
|
||||
break;
|
||||
case Warning:
|
||||
prefix = "W ";
|
||||
break;
|
||||
case Error:
|
||||
prefix = "E ";
|
||||
break;
|
||||
}
|
||||
if (NamedThreadBase* thr = GetCurrentNamedThread())
|
||||
{
|
||||
prefix += thr->GetThreadName();
|
||||
}
|
||||
msg.mText.insert(0, prefix);
|
||||
msg.mText.append(1,'\n');
|
||||
}
|
||||
#ifdef BUFFERED_LOGGING
|
||||
size_t size = msg.size();
|
||||
std::vector<char> temp_buffer(size);
|
||||
msg.serialize(temp_buffer.data());
|
||||
mBuffer.pushRange(temp_buffer.begin(), temp_buffer.end());
|
||||
mBufferReady.notify_one();
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#else
|
||||
mChannels[static_cast<u32>(msg.mType)].log(msg);
|
||||
#include <chrono>
|
||||
#endif
|
||||
|
||||
// Thread-specific log prefix provider
|
||||
thread_local std::string(*g_tls_log_prefix)() = nullptr;
|
||||
|
||||
template<>
|
||||
void fmt_class_string<logs::level>::format(std::string& out, u64 arg)
|
||||
{
|
||||
format_enum(out, arg, [](auto lev)
|
||||
{
|
||||
switch (lev)
|
||||
{
|
||||
case logs::level::always: return "Nothing";
|
||||
case logs::level::fatal: return "Fatal";
|
||||
case logs::level::error: return "Error";
|
||||
case logs::level::todo: return "TODO";
|
||||
case logs::level::success: return "Success";
|
||||
case logs::level::warning: return "Warning";
|
||||
case logs::level::notice: return "Notice";
|
||||
case logs::level::trace: return "Trace";
|
||||
}
|
||||
|
||||
return unknown;
|
||||
});
|
||||
}
|
||||
|
||||
void LogManager::addListener(std::shared_ptr<LogListener> listener)
|
||||
namespace logs
|
||||
{
|
||||
for (auto& channel : mChannels)
|
||||
class file_writer
|
||||
{
|
||||
channel.addListener(listener);
|
||||
// Could be memory-mapped file
|
||||
fs::file m_file;
|
||||
|
||||
public:
|
||||
file_writer(const std::string& name);
|
||||
|
||||
virtual ~file_writer() = default;
|
||||
|
||||
// Append raw data
|
||||
void log(const char* text, std::size_t size);
|
||||
};
|
||||
|
||||
struct file_listener : public file_writer, public listener
|
||||
{
|
||||
file_listener(const std::string& name)
|
||||
: file_writer(name)
|
||||
, listener()
|
||||
{
|
||||
const std::string& start = fmt::format("\xEF\xBB\xBF" "RPCS3 v%s\n", rpcs3::version.to_string());
|
||||
file_writer::log(start.data(), start.size());
|
||||
}
|
||||
|
||||
// Encode level, current thread name, channel name and write log message
|
||||
virtual void log(u64 stamp, const message& msg, const std::string& prefix, const std::string& text) override;
|
||||
};
|
||||
|
||||
static file_listener* get_logger()
|
||||
{
|
||||
// Use magic static
|
||||
static file_listener logger("RPCS3.log");
|
||||
return &logger;
|
||||
}
|
||||
}
|
||||
void LogManager::removeListener(std::shared_ptr<LogListener> listener)
|
||||
{
|
||||
for (auto& channel : mChannels)
|
||||
|
||||
static u64 get_stamp()
|
||||
{
|
||||
channel.removeListener(listener);
|
||||
static struct time_initializer
|
||||
{
|
||||
#ifdef _WIN32
|
||||
LARGE_INTEGER freq;
|
||||
LARGE_INTEGER start;
|
||||
|
||||
time_initializer()
|
||||
{
|
||||
QueryPerformanceFrequency(&freq);
|
||||
QueryPerformanceCounter(&start);
|
||||
}
|
||||
#else
|
||||
std::chrono::steady_clock::time_point start = std::chrono::steady_clock::now();
|
||||
#endif
|
||||
|
||||
u64 get() const
|
||||
{
|
||||
#ifdef _WIN32
|
||||
LARGE_INTEGER now;
|
||||
QueryPerformanceCounter(&now);
|
||||
const LONGLONG diff = now.QuadPart - start.QuadPart;
|
||||
return diff / freq.QuadPart * 1'000'000 + diff % freq.QuadPart * 1'000'000 / freq.QuadPart;
|
||||
#else
|
||||
return std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::steady_clock::now() - start).count();
|
||||
#endif
|
||||
}
|
||||
} timebase{};
|
||||
|
||||
return timebase.get();
|
||||
}
|
||||
|
||||
channel GENERAL(nullptr, level::notice);
|
||||
channel LOADER("LDR", level::notice);
|
||||
channel MEMORY("MEM", level::notice);
|
||||
channel RSX("RSX", level::notice);
|
||||
channel HLE("HLE", level::notice);
|
||||
channel PPU("PPU", level::notice);
|
||||
channel SPU("SPU", level::notice);
|
||||
channel ARMv7("ARMv7");
|
||||
}
|
||||
|
||||
logs::listener::~listener()
|
||||
{
|
||||
}
|
||||
|
||||
void logs::listener::add(logs::listener* _new)
|
||||
{
|
||||
// Get first (main) listener
|
||||
listener* lis = get_logger();
|
||||
|
||||
// Install new listener at the end of linked list
|
||||
while (lis->m_next || !lis->m_next.compare_and_swap_test(nullptr, _new))
|
||||
{
|
||||
lis = lis->m_next;
|
||||
}
|
||||
}
|
||||
|
||||
LogManager& LogManager::getInstance()
|
||||
void logs::message::broadcast(const char* fmt, const fmt_type_info* sup, const u64* args)
|
||||
{
|
||||
if (!gLogManager)
|
||||
// Get timestamp
|
||||
const u64 stamp = get_stamp();
|
||||
|
||||
std::string text; fmt::raw_append(text, fmt, sup, args);
|
||||
std::string prefix(g_tls_log_prefix ? g_tls_log_prefix() : "");
|
||||
|
||||
// Get first (main) listener
|
||||
listener* lis = get_logger();
|
||||
|
||||
// Send message to all listeners
|
||||
while (lis)
|
||||
{
|
||||
gLogManager = new LogManager();
|
||||
lis->log(stamp, *this, prefix, text);
|
||||
lis = lis->m_next;
|
||||
}
|
||||
return *gLogManager;
|
||||
}
|
||||
LogChannel &LogManager::getChannel(LogType type)
|
||||
|
||||
[[noreturn]] extern void catch_all_exceptions();
|
||||
|
||||
logs::file_writer::file_writer(const std::string& name)
|
||||
{
|
||||
return mChannels[static_cast<u32>(type)];
|
||||
}
|
||||
try
|
||||
{
|
||||
if (!m_file.open(fs::get_config_dir() + name, fs::rewrite + fs::append))
|
||||
{
|
||||
fmt::throw_exception("Can't create log file %s (error %s)", name, fs::g_tls_error);
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
catch_all_exceptions();
|
||||
}
|
||||
}
|
||||
|
||||
void logs::file_writer::log(const char* text, std::size_t size)
|
||||
{
|
||||
m_file.write(text, size);
|
||||
}
|
||||
|
||||
void logs::file_listener::log(u64 stamp, const logs::message& msg, const std::string& prefix, const std::string& _text)
|
||||
{
|
||||
std::string text; text.reserve(prefix.size() + _text.size() + 200);
|
||||
|
||||
// Used character: U+00B7 (Middle Dot)
|
||||
switch (msg.sev)
|
||||
{
|
||||
case level::always: text = u8"·A "; break;
|
||||
case level::fatal: text = u8"·F "; break;
|
||||
case level::error: text = u8"·E "; break;
|
||||
case level::todo: text = u8"·U "; break;
|
||||
case level::success: text = u8"·S "; break;
|
||||
case level::warning: text = u8"·W "; break;
|
||||
case level::notice: text = u8"·! "; break;
|
||||
case level::trace: text = u8"·T "; break;
|
||||
}
|
||||
|
||||
// Print miscosecond timestamp
|
||||
const u64 hours = stamp / 3600'000'000;
|
||||
const u64 mins = (stamp % 3600'000'000) / 60'000'000;
|
||||
const u64 secs = (stamp % 60'000'000) / 1'000'000;
|
||||
const u64 frac = (stamp % 1'000'000);
|
||||
fmt::append(text, "%u:%02u:%02u.%06u ", hours, mins, secs, frac);
|
||||
|
||||
if (prefix.size() > 0)
|
||||
{
|
||||
text += "{";
|
||||
text += prefix;
|
||||
text += "} ";
|
||||
}
|
||||
|
||||
if (msg.ch->name)
|
||||
{
|
||||
text += msg.ch->name;
|
||||
text += msg.sev == level::todo ? " TODO: " : ": ";
|
||||
}
|
||||
else if (msg.sev == level::todo)
|
||||
{
|
||||
text += "TODO: ";
|
||||
}
|
||||
|
||||
text += _text;
|
||||
text += '\n';
|
||||
|
||||
file_writer::log(text.data(), text.size());
|
||||
}
|
||||
|
||||
+93
-126
@@ -1,148 +1,115 @@
|
||||
#pragma once
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <cinttypes>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <mutex>
|
||||
#include <set>
|
||||
#include <array>
|
||||
#include "Utilities/MTRingbuffer.h"
|
||||
|
||||
//#define BUFFERED_LOGGING 1
|
||||
#include "types.h"
|
||||
#include "Atomic.h"
|
||||
#include "StrFmt.h"
|
||||
|
||||
//first parameter is of type Log::LogType and text is of type std::string
|
||||
|
||||
#define LOG_SUCCESS(logType, text, ...) log_message(logType, Log::Success, text, ##__VA_ARGS__)
|
||||
#define LOG_NOTICE(logType, text, ...) log_message(logType, Log::Notice, text, ##__VA_ARGS__)
|
||||
#define LOG_WARNING(logType, text, ...) log_message(logType, Log::Warning, text, ##__VA_ARGS__)
|
||||
#define LOG_ERROR(logType, text, ...) log_message(logType, Log::Error, text, ##__VA_ARGS__)
|
||||
|
||||
namespace Log
|
||||
namespace logs
|
||||
{
|
||||
const unsigned int MAX_LOG_BUFFER_LENGTH = 1024*1024;
|
||||
const unsigned int gBuffSize = 1000;
|
||||
|
||||
enum LogType : u32
|
||||
enum class level : uint
|
||||
{
|
||||
GENERAL = 0,
|
||||
LOADER,
|
||||
MEMORY,
|
||||
RSX,
|
||||
HLE,
|
||||
PPU,
|
||||
SPU,
|
||||
TTY,
|
||||
always, // highest level (unused, cannot be disabled)
|
||||
fatal,
|
||||
error,
|
||||
todo,
|
||||
success,
|
||||
warning,
|
||||
notice,
|
||||
trace, // lowest level (usually disabled)
|
||||
};
|
||||
|
||||
struct channel;
|
||||
|
||||
struct LogTypeName
|
||||
// Message information (temporary data)
|
||||
struct message
|
||||
{
|
||||
LogType mType;
|
||||
std::string mName;
|
||||
const channel* ch;
|
||||
level sev;
|
||||
|
||||
// Send log message to global logger instance
|
||||
void broadcast(const char*, const fmt_type_info*, const u64*);
|
||||
};
|
||||
|
||||
//well I'd love make_array() but alas manually counting is not the end of the world
|
||||
static const std::array<LogTypeName, 8> gTypeNameTable = { {
|
||||
{ GENERAL, "G: " },
|
||||
{ LOADER, "LDR: " },
|
||||
{ MEMORY, "MEM: " },
|
||||
{ RSX, "RSX: " },
|
||||
{ HLE, "HLE: " },
|
||||
{ PPU, "PPU: " },
|
||||
{ SPU, "SPU: " },
|
||||
{ TTY, "TTY: " }
|
||||
} };
|
||||
|
||||
enum LogSeverity : u32
|
||||
class listener
|
||||
{
|
||||
Success = 0,
|
||||
Notice,
|
||||
Warning,
|
||||
Error,
|
||||
// Next listener (linked list)
|
||||
atomic_t<listener*> m_next{};
|
||||
|
||||
friend struct message;
|
||||
|
||||
public:
|
||||
constexpr listener() = default;
|
||||
|
||||
virtual ~listener();
|
||||
|
||||
// Process log message
|
||||
virtual void log(u64 stamp, const message& msg, const std::string& prefix, const std::string& text) = 0;
|
||||
|
||||
// Add new listener
|
||||
static void add(listener*);
|
||||
};
|
||||
|
||||
struct LogMessage
|
||||
struct channel
|
||||
{
|
||||
using size_type = u32;
|
||||
LogType mType;
|
||||
LogSeverity mServerity;
|
||||
std::string mText;
|
||||
// Channel prefix (added to every log message)
|
||||
const char* const name;
|
||||
|
||||
u32 size();
|
||||
void serialize(char *output);
|
||||
static LogMessage deserialize(char *input, u32* size_out=nullptr);
|
||||
// The lowest logging level enabled for this channel (used for early filtering)
|
||||
atomic_t<level> enabled;
|
||||
|
||||
// Constant initialization: name and initial log level
|
||||
constexpr channel(const char* name, level enabled = level::trace)
|
||||
: name(name)
|
||||
, enabled(enabled)
|
||||
{
|
||||
}
|
||||
|
||||
// Formatting function
|
||||
template<typename... Args>
|
||||
SAFE_BUFFERS FORCE_INLINE void format(level sev, const char* fmt, const Args&... args) const
|
||||
{
|
||||
if (UNLIKELY(sev <= enabled))
|
||||
{
|
||||
message{this, sev}.broadcast(fmt, fmt::get_type_info<fmt_unveil_t<Args>...>(), fmt_args_t<Args...>{fmt_unveil<Args>::get(args)...});
|
||||
}
|
||||
}
|
||||
|
||||
#define GEN_LOG_METHOD(_sev)\
|
||||
template<typename... Args>\
|
||||
SAFE_BUFFERS void _sev(const char* fmt, const Args&... args) const\
|
||||
{\
|
||||
return format<Args...>(level::_sev, fmt, args...);\
|
||||
}
|
||||
|
||||
GEN_LOG_METHOD(fatal)
|
||||
GEN_LOG_METHOD(error)
|
||||
GEN_LOG_METHOD(todo)
|
||||
GEN_LOG_METHOD(success)
|
||||
GEN_LOG_METHOD(warning)
|
||||
GEN_LOG_METHOD(notice)
|
||||
GEN_LOG_METHOD(trace)
|
||||
|
||||
#undef GEN_LOG_METHOD
|
||||
};
|
||||
|
||||
struct LogListener
|
||||
{
|
||||
virtual ~LogListener() {};
|
||||
virtual void log(LogMessage msg) = 0;
|
||||
};
|
||||
/* Small set of predefined channels */
|
||||
|
||||
struct LogChannel
|
||||
{
|
||||
LogChannel();
|
||||
LogChannel(const std::string& name);
|
||||
LogChannel(LogChannel& other) = delete;
|
||||
LogChannel& operator = (LogChannel& other) = delete;
|
||||
void log(LogMessage msg);
|
||||
void addListener(std::shared_ptr<LogListener> listener);
|
||||
void removeListener(std::shared_ptr<LogListener> listener);
|
||||
std::string name;
|
||||
private:
|
||||
bool mEnabled;
|
||||
LogSeverity mLogLevel;
|
||||
std::mutex mListenerLock;
|
||||
std::set<std::shared_ptr<LogListener>> mListeners;
|
||||
};
|
||||
|
||||
struct LogManager
|
||||
{
|
||||
LogManager();
|
||||
~LogManager();
|
||||
static LogManager& getInstance();
|
||||
LogChannel& getChannel(LogType type);
|
||||
void log(LogMessage msg);
|
||||
void addListener(std::shared_ptr<LogListener> listener);
|
||||
void removeListener(std::shared_ptr<LogListener> listener);
|
||||
#ifdef BUFFERED_LOGGING
|
||||
void consumeLog();
|
||||
#endif
|
||||
private:
|
||||
#ifdef BUFFERED_LOGGING
|
||||
MTRingbuffer<char, MAX_LOG_BUFFER_LENGTH> mBuffer;
|
||||
std::condition_variable mBufferReady;
|
||||
std::mutex mStatusMut;
|
||||
std::atomic<bool> mExiting;
|
||||
std::thread mLogConsumer;
|
||||
#endif
|
||||
std::array<LogChannel, std::tuple_size<decltype(gTypeNameTable)>::value> mChannels;
|
||||
//std::array<LogChannel,gTypeNameTable.size()> mChannels; //TODO: use this once Microsoft sorts their shit out
|
||||
};
|
||||
extern channel GENERAL;
|
||||
extern channel LOADER;
|
||||
extern channel MEMORY;
|
||||
extern channel RSX;
|
||||
extern channel HLE;
|
||||
extern channel PPU;
|
||||
extern channel SPU;
|
||||
extern channel ARMv7;
|
||||
}
|
||||
|
||||
static struct { inline operator Log::LogType() { return Log::LogType::GENERAL; } } GENERAL;
|
||||
static struct { inline operator Log::LogType() { return Log::LogType::LOADER; } } LOADER;
|
||||
static struct { inline operator Log::LogType() { return Log::LogType::MEMORY; } } MEMORY;
|
||||
static struct { inline operator Log::LogType() { return Log::LogType::RSX; } } RSX;
|
||||
static struct { inline operator Log::LogType() { return Log::LogType::HLE; } } HLE;
|
||||
static struct { inline operator Log::LogType() { return Log::LogType::PPU; } } PPU;
|
||||
static struct { inline operator Log::LogType() { return Log::LogType::SPU; } } SPU;
|
||||
static struct { inline operator Log::LogType() { return Log::LogType::TTY; } } TTY;
|
||||
// Legacy:
|
||||
|
||||
inline void log_message(Log::LogType type, Log::LogSeverity sev, std::string text)
|
||||
{
|
||||
//another msvc bug makes this not work, uncomment this and delete everything else in this function when it's fixed
|
||||
//Log::LogManager::getInstance().log({logType, severity, text})
|
||||
|
||||
Log::LogMessage msg{type, sev, text};
|
||||
Log::LogManager::getInstance().log(msg);
|
||||
}
|
||||
|
||||
template<typename T, typename ...Ts>
|
||||
inline void log_message(Log::LogType type, Log::LogSeverity sev, std::string text, T arg, Ts... args)
|
||||
{
|
||||
Log::LogMessage msg{type, sev, fmt::Format(text,arg,args...)};
|
||||
Log::LogManager::getInstance().log(msg);
|
||||
}
|
||||
#define LOG_SUCCESS(ch, fmt, ...) logs::ch.success("" fmt, ##__VA_ARGS__)
|
||||
#define LOG_NOTICE(ch, fmt, ...) logs::ch.notice ("" fmt, ##__VA_ARGS__)
|
||||
#define LOG_WARNING(ch, fmt, ...) logs::ch.warning("" fmt, ##__VA_ARGS__)
|
||||
#define LOG_ERROR(ch, fmt, ...) logs::ch.error ("" fmt, ##__VA_ARGS__)
|
||||
#define LOG_TODO(ch, fmt, ...) logs::ch.todo ("" fmt, ##__VA_ARGS__)
|
||||
#define LOG_TRACE(ch, fmt, ...) logs::ch.trace ("" fmt, ##__VA_ARGS__)
|
||||
#define LOG_FATAL(ch, fmt, ...) logs::ch.fatal ("" fmt, ##__VA_ARGS__)
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
Show();
|
||||
}
|
||||
|
||||
__forceinline void Update(const u8 thread_id, const u64 value, const wxString& msg)
|
||||
void Update(const u8 thread_id, const u64 value, const wxString& msg)
|
||||
{
|
||||
if(thread_id > m_cores) return;
|
||||
|
||||
|
||||
@@ -1,159 +0,0 @@
|
||||
#pragma once
|
||||
#include <thread>
|
||||
#include <array>
|
||||
#include <mutex>
|
||||
#include <algorithm>
|
||||
|
||||
//Simple non-resizable FIFO Ringbuffer that can be simultaneously be read from and written to
|
||||
//if we ever get to use boost please replace this with boost::circular_buffer, there's no reason
|
||||
//why we would have to keep this amateur attempt at such a fundamental data-structure around
|
||||
template< typename T, unsigned int MAX_MTRINGBUFFER_BUFFER_SIZE>
|
||||
class MTRingbuffer{
|
||||
std::array<T, MAX_MTRINGBUFFER_BUFFER_SIZE> mBuffer;
|
||||
//this is a recursive mutex because the get methods lock it but the only
|
||||
//way to be sure that they do not block is to check the size and the only
|
||||
//way to check the size and use get atomically is to lock this mutex,
|
||||
//so it goes:
|
||||
//lock get mutex-->check size-->call get-->lock get mutex-->unlock get mutex-->return from get-->unlock get mutex
|
||||
std::recursive_mutex mMutGet;
|
||||
std::mutex mMutPut;
|
||||
|
||||
size_t mGet;
|
||||
size_t mPut;
|
||||
size_t moveGet(size_t by = 1){ return (mGet + by) % MAX_MTRINGBUFFER_BUFFER_SIZE; }
|
||||
size_t movePut(size_t by = 1){ return (mPut + by) % MAX_MTRINGBUFFER_BUFFER_SIZE; }
|
||||
public:
|
||||
MTRingbuffer() : mGet(0), mPut(0){}
|
||||
|
||||
//blocks until there's something to get, so check "spaceLeft()" if you want to avoid blocking
|
||||
//also lock the get mutex around the spaceLeft() check and the pop if you want to avoid racing
|
||||
T pop()
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(mMutGet);
|
||||
while (mGet == mPut)
|
||||
{
|
||||
//wait until there's actually something to get
|
||||
//throwing an exception might be better, blocking here is a little awkward
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
}
|
||||
size_t ret = mGet;
|
||||
mGet = moveGet();
|
||||
return mBuffer[ret];
|
||||
}
|
||||
|
||||
//blocks if the buffer is full until there's enough room
|
||||
void push(T &putEle)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mMutPut);
|
||||
while (movePut() == mGet)
|
||||
{
|
||||
//if this is reached a lot it's time to increase the buffer size
|
||||
//or implement dynamic re-sizing
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
}
|
||||
mBuffer[mPut] = std::forward(putEle);
|
||||
mPut = movePut();
|
||||
}
|
||||
|
||||
bool empty()
|
||||
{
|
||||
return mGet == mPut;
|
||||
}
|
||||
|
||||
//returns the amount of free places, this is the amount of actual free spaces-1
|
||||
//since mGet==mPut signals an empty buffer we can't actually use the last free
|
||||
//space, so we shouldn't report it as free.
|
||||
size_t spaceLeft() //apparently free() is a macro definition in msvc in some conditions
|
||||
{
|
||||
if (mGet < mPut)
|
||||
{
|
||||
return mBuffer.size() - (mPut - mGet) - 1;
|
||||
}
|
||||
else if (mGet > mPut)
|
||||
{
|
||||
return mGet - mPut - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return mBuffer.size() - 1;
|
||||
}
|
||||
}
|
||||
|
||||
size_t size()
|
||||
{
|
||||
//the magic -1 is the same magic 1 that is explained in the spaceLeft() function
|
||||
return mBuffer.size() - spaceLeft() - 1;
|
||||
}
|
||||
|
||||
//takes random access iterator to T
|
||||
template<typename IteratorType>
|
||||
void pushRange(IteratorType from, IteratorType until)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mMutPut);
|
||||
size_t length = until - from;
|
||||
|
||||
//if whatever we're trying to store is greater than the entire buffer the following loop will be infinite
|
||||
assert(mBuffer.size() > length);
|
||||
while (spaceLeft() < length)
|
||||
{
|
||||
//if this is reached a lot it's time to increase the buffer size
|
||||
//or implement dynamic re-sizing
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
}
|
||||
if (mPut + length <= mBuffer.size())
|
||||
{
|
||||
std::copy(from, until, mBuffer.begin() + mPut);
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t tillEnd = mBuffer.size() - mPut;
|
||||
std::copy(from, from + tillEnd, mBuffer.begin() + mPut);
|
||||
std::copy(from + tillEnd, until, mBuffer.begin());
|
||||
}
|
||||
mPut = movePut(length);
|
||||
|
||||
}
|
||||
|
||||
//takes output iterator to T
|
||||
template<typename IteratorType>
|
||||
void popN(IteratorType output, size_t n)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(mMutGet);
|
||||
//make sure we're not trying to retrieve more than is in
|
||||
assert(n <= size());
|
||||
peekN<IteratorType>(output, n);
|
||||
mGet = moveGet(n);
|
||||
}
|
||||
|
||||
//takes output iterator to T
|
||||
template<typename IteratorType>
|
||||
void peekN(IteratorType output, size_t n)
|
||||
{
|
||||
size_t lGet = mGet;
|
||||
if (lGet + n <= mBuffer.size())
|
||||
{
|
||||
std::copy_n(mBuffer.begin() + lGet, n, output);
|
||||
}
|
||||
else
|
||||
{
|
||||
auto next = std::copy(mBuffer.begin() + lGet, mBuffer.end(), output);
|
||||
std::copy_n(mBuffer.begin(), n - (mBuffer.size() - lGet), next);
|
||||
}
|
||||
}
|
||||
|
||||
//well this is just asking for trouble
|
||||
//but the comment above the declaration of mMutGet explains why it's there
|
||||
//if there's a better way please remove this
|
||||
void lockGet()
|
||||
{
|
||||
mMutGet.lock();
|
||||
}
|
||||
|
||||
//well this is just asking for trouble
|
||||
//but the comment above the declaration of mMutGet explains why it's there
|
||||
//if there's a better way please remove this
|
||||
void unlockGet()
|
||||
{
|
||||
mMutGet.unlock();
|
||||
}
|
||||
};
|
||||
@@ -1,40 +0,0 @@
|
||||
#include <stdafx.h>
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/CPU/CPUThread.h"
|
||||
|
||||
#include "Utilities/SMutex.h"
|
||||
|
||||
__forceinline void SM_Sleep()
|
||||
{
|
||||
if (NamedThreadBase* t = GetCurrentNamedThread())
|
||||
{
|
||||
t->WaitForAnySignal();
|
||||
}
|
||||
else
|
||||
{
|
||||
Sleep(1);
|
||||
}
|
||||
}
|
||||
|
||||
thread_local size_t g_this_thread_id = 0;
|
||||
|
||||
__forceinline size_t SM_GetCurrentThreadId()
|
||||
{
|
||||
return g_this_thread_id ? g_this_thread_id : g_this_thread_id = std::hash<std::thread::id>()(std::this_thread::get_id());
|
||||
}
|
||||
|
||||
__forceinline u32 SM_GetCurrentCPUThreadId()
|
||||
{
|
||||
if (CPUThread* t = GetCurrentCPUThread())
|
||||
{
|
||||
return t->GetId();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
__forceinline be_t<u32> SM_GetCurrentCPUThreadIdBE()
|
||||
{
|
||||
return SM_GetCurrentCPUThreadId();
|
||||
}
|
||||
@@ -1,177 +0,0 @@
|
||||
#pragma once
|
||||
#include "BEType.h"
|
||||
|
||||
extern void SM_Sleep();
|
||||
extern size_t SM_GetCurrentThreadId();
|
||||
extern u32 SM_GetCurrentCPUThreadId();
|
||||
extern be_t<u32> SM_GetCurrentCPUThreadIdBE();
|
||||
|
||||
enum SMutexResult
|
||||
{
|
||||
SMR_OK = 0, // succeeded (lock, trylock, unlock)
|
||||
SMR_FAILED, // failed (trylock, unlock)
|
||||
SMR_DEADLOCK, // mutex reached deadlock (lock, trylock)
|
||||
SMR_SIGNAL = SMR_DEADLOCK, // unlock can be used for signaling specific thread
|
||||
SMR_PERMITTED, // not owner of the mutex (unlock)
|
||||
SMR_ABORT, // emulator has been stopped (lock, trylock, unlock)
|
||||
SMR_DESTROYED, // mutex has been destroyed (lock, trylock, unlock)
|
||||
SMR_TIMEOUT, // timed out (lock)
|
||||
};
|
||||
|
||||
template
|
||||
<
|
||||
typename T,
|
||||
u64 free_value = 0,
|
||||
u64 dead_value = 0xffffffff,
|
||||
void (*wait)() = SM_Sleep
|
||||
>
|
||||
class SMutexBase
|
||||
{
|
||||
static_assert(sizeof(T) == sizeof(std::atomic<T>), "Invalid SMutexBase type");
|
||||
std::atomic<T> owner;
|
||||
|
||||
public:
|
||||
SMutexBase()
|
||||
: owner((T)free_value)
|
||||
{
|
||||
}
|
||||
|
||||
void initialize()
|
||||
{
|
||||
(T&)owner = free_value;
|
||||
}
|
||||
|
||||
~SMutexBase()
|
||||
{
|
||||
lock((T)dead_value);
|
||||
owner = (T)dead_value;
|
||||
}
|
||||
|
||||
__forceinline T GetOwner() const
|
||||
{
|
||||
return (T&)owner;
|
||||
}
|
||||
|
||||
__forceinline T GetFreeValue() const
|
||||
{
|
||||
return (T)free_value;
|
||||
}
|
||||
|
||||
__forceinline T GetDeadValue() const
|
||||
{
|
||||
return (T)dead_value;
|
||||
}
|
||||
|
||||
SMutexResult trylock(T tid)
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
return SMR_ABORT;
|
||||
}
|
||||
T old = (T)free_value;
|
||||
|
||||
if (!owner.compare_exchange_strong(old, tid))
|
||||
{
|
||||
if (old == tid)
|
||||
{
|
||||
return SMR_DEADLOCK;
|
||||
}
|
||||
if (old == (T)dead_value)
|
||||
{
|
||||
return SMR_DESTROYED;
|
||||
}
|
||||
return SMR_FAILED;
|
||||
}
|
||||
|
||||
return SMR_OK;
|
||||
}
|
||||
|
||||
SMutexResult unlock(T tid, T to = (T)free_value)
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
return SMR_ABORT;
|
||||
}
|
||||
T old = tid;
|
||||
|
||||
if (!owner.compare_exchange_strong(old, to))
|
||||
{
|
||||
if (old == (T)free_value)
|
||||
{
|
||||
return SMR_FAILED;
|
||||
}
|
||||
if (old == (T)dead_value)
|
||||
{
|
||||
return SMR_DESTROYED;
|
||||
}
|
||||
|
||||
return SMR_PERMITTED;
|
||||
}
|
||||
|
||||
return SMR_OK;
|
||||
}
|
||||
|
||||
SMutexResult lock(T tid, u64 timeout = 0)
|
||||
{
|
||||
u64 counter = 0;
|
||||
|
||||
while (true)
|
||||
{
|
||||
switch (SMutexResult res = trylock(tid))
|
||||
{
|
||||
case SMR_FAILED: break;
|
||||
default: return res;
|
||||
}
|
||||
|
||||
if (wait) wait();
|
||||
|
||||
if (timeout && counter++ > timeout)
|
||||
{
|
||||
return SMR_TIMEOUT;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T, typename Tid, Tid (get_tid)()>
|
||||
class SMutexLockerBase
|
||||
{
|
||||
T& sm;
|
||||
public:
|
||||
const Tid tid;
|
||||
|
||||
__forceinline SMutexLockerBase(T& _sm)
|
||||
: sm(_sm)
|
||||
, tid(get_tid())
|
||||
{
|
||||
if (!tid)
|
||||
{
|
||||
if (!Emu.IsStopped())
|
||||
{
|
||||
LOG_ERROR(HLE, "SMutexLockerBase: thread id == 0");
|
||||
Emu.Pause();
|
||||
}
|
||||
return;
|
||||
}
|
||||
sm.lock(tid);
|
||||
}
|
||||
|
||||
__forceinline ~SMutexLockerBase()
|
||||
{
|
||||
if (tid) sm.unlock(tid);
|
||||
}
|
||||
};
|
||||
|
||||
typedef SMutexBase<size_t>
|
||||
SMutexGeneral;
|
||||
typedef SMutexBase<u32>
|
||||
SMutex;
|
||||
typedef SMutexBase<be_t<u32>>
|
||||
SMutexBE;
|
||||
|
||||
typedef SMutexLockerBase<SMutexGeneral, size_t, SM_GetCurrentThreadId>
|
||||
SMutexGeneralLocker;
|
||||
typedef SMutexLockerBase<SMutex, u32, SM_GetCurrentCPUThreadId>
|
||||
SMutexLocker;
|
||||
typedef SMutexLockerBase<SMutexBE, be_t<u32>, SM_GetCurrentCPUThreadIdBE>
|
||||
SMutexBELocker;
|
||||
@@ -1,139 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
template<typename T, u32 SQSize = 666>
|
||||
class SQueue
|
||||
{
|
||||
std::mutex m_mutex;
|
||||
NamedThreadBase* push_waiter;
|
||||
NamedThreadBase* pop_waiter;
|
||||
u32 m_pos;
|
||||
u32 m_count;
|
||||
T m_data[SQSize];
|
||||
|
||||
public:
|
||||
SQueue()
|
||||
: m_pos(0)
|
||||
, m_count(0)
|
||||
, push_waiter(nullptr)
|
||||
, pop_waiter(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
const u32 GetSize() const
|
||||
{
|
||||
return SQSize;
|
||||
}
|
||||
|
||||
bool Push(const T& data)
|
||||
{
|
||||
NamedThreadBase* t = GetCurrentNamedThread();
|
||||
push_waiter = t;
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (m_count >= SQSize)
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
SM_Sleep();
|
||||
continue;
|
||||
}
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
|
||||
if (m_count >= SQSize) continue;
|
||||
if (pop_waiter && !m_count) pop_waiter->Notify();
|
||||
|
||||
m_data[(m_pos + m_count++) % SQSize] = data;
|
||||
|
||||
push_waiter = nullptr;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool Pop(T& data)
|
||||
{
|
||||
NamedThreadBase* t = GetCurrentNamedThread();
|
||||
pop_waiter = t;
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (!m_count)
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
SM_Sleep();
|
||||
continue;
|
||||
}
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
|
||||
if (!m_count) continue;
|
||||
if (push_waiter && m_count >= SQSize) push_waiter->Notify();
|
||||
|
||||
data = m_data[m_pos];
|
||||
m_pos = (m_pos + 1) % SQSize;
|
||||
m_count--;
|
||||
|
||||
pop_waiter = nullptr;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
volatile u32 GetCount() // may be thread unsafe
|
||||
{
|
||||
return m_count;
|
||||
}
|
||||
|
||||
volatile bool IsEmpty() // may be thread unsafe
|
||||
{
|
||||
return !m_count;
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
if (push_waiter && m_count >= SQSize) push_waiter->Notify();
|
||||
m_count = 0;
|
||||
}
|
||||
|
||||
T& Peek(u32 pos = 0)
|
||||
{
|
||||
NamedThreadBase* t = GetCurrentNamedThread();
|
||||
pop_waiter = t;
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (!m_count)
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
SM_Sleep();
|
||||
continue;
|
||||
}
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
if (m_count)
|
||||
{
|
||||
pop_waiter = nullptr;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return m_data[(m_pos + pos) % SQSize];
|
||||
}
|
||||
};
|
||||
@@ -1,87 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "Utilities/SSemaphore.h"
|
||||
|
||||
void SSemaphore::wait()
|
||||
{
|
||||
u32 order;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
if (m_count && m_out_order == m_in_order)
|
||||
{
|
||||
m_count--;
|
||||
return;
|
||||
}
|
||||
order = m_in_order++;
|
||||
}
|
||||
|
||||
std::unique_lock<std::mutex> cv_lock(m_cv_mutex);
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_cond.wait_for(cv_lock, std::chrono::milliseconds(1));
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
if (m_count)
|
||||
{
|
||||
if (m_out_order == order)
|
||||
{
|
||||
m_count--;
|
||||
m_out_order++;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_cond.notify_one();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool SSemaphore::try_wait()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
|
||||
if (m_count && m_in_order == m_out_order)
|
||||
{
|
||||
m_count--;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void SSemaphore::post()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
|
||||
if (m_count < m_max)
|
||||
{
|
||||
m_count++;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_cond.notify_one();
|
||||
}
|
||||
|
||||
bool SSemaphore::post_and_wait()
|
||||
{
|
||||
// TODO: merge these functions? Probably has a race condition.
|
||||
if (try_wait()) return false;
|
||||
|
||||
post();
|
||||
wait();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
class SSemaphore
|
||||
{
|
||||
const u32 m_max;
|
||||
u32 m_count;
|
||||
u32 m_in_order;
|
||||
u32 m_out_order;
|
||||
std::mutex m_cv_mutex;
|
||||
std::mutex m_mutex;
|
||||
std::condition_variable m_cond;
|
||||
|
||||
public:
|
||||
SSemaphore(u32 value, u32 max = 1)
|
||||
: m_max(max > 0 ? max : 0xffffffff)
|
||||
, m_count(value > m_max ? m_max : value)
|
||||
, m_in_order(0)
|
||||
, m_out_order(0)
|
||||
{
|
||||
}
|
||||
|
||||
SSemaphore()
|
||||
: m_max(0xffffffff)
|
||||
, m_count(0)
|
||||
, m_in_order(0)
|
||||
, m_out_order(0)
|
||||
{
|
||||
}
|
||||
|
||||
~SSemaphore()
|
||||
{
|
||||
}
|
||||
|
||||
void wait();
|
||||
|
||||
bool try_wait();
|
||||
|
||||
void post();
|
||||
|
||||
bool post_and_wait();
|
||||
};
|
||||
+365
-91
@@ -1,37 +1,299 @@
|
||||
#include "stdafx.h"
|
||||
#include "StrFmt.h"
|
||||
#include "BEType.h"
|
||||
#include "StrUtil.h"
|
||||
#include "cfmt.h"
|
||||
|
||||
extern const std::string fmt::placeholder = "???";
|
||||
#include <algorithm>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#else
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
//wrapper to deal with advance sprintf formating options with automatic length finding
|
||||
//can't take strings by reference because of "va_start", so overload it with char *
|
||||
std::string fmt::FormatV(const char *fmt, va_list args)
|
||||
template <>
|
||||
void fmt_class_string<std::pair<const fmt_type_info*, u64>>::format(std::string& out, u64 arg)
|
||||
{
|
||||
size_t length = 256;
|
||||
std::string str;
|
||||
// Dynamic format arg
|
||||
const auto& pair = get_object(arg);
|
||||
|
||||
for (;;)
|
||||
if (pair.first)
|
||||
{
|
||||
std::vector<char> buffptr(length);
|
||||
size_t printlen = vsnprintf(buffptr.data(), length, fmt, args);
|
||||
if (printlen < length)
|
||||
{
|
||||
str = std::string(buffptr.data(), printlen);
|
||||
break;
|
||||
}
|
||||
length *= 2;
|
||||
pair.first->fmt_string(out, pair.second);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
std::string fmt::FormatV(std::string fmt, va_list args)
|
||||
void fmt_class_string<const void*>::format(std::string& out, u64 arg)
|
||||
{
|
||||
std::string str = FormatV(fmt.c_str(), args);
|
||||
return str;
|
||||
if (arg)
|
||||
{
|
||||
fmt::append(out, "%p", reinterpret_cast<const void*>(static_cast<std::uintptr_t>(arg)));
|
||||
}
|
||||
else
|
||||
{
|
||||
out += "(NULL)";
|
||||
}
|
||||
}
|
||||
|
||||
std::string replace_first(const std::string& src, const std::string& from, const std::string& to)
|
||||
void fmt_class_string<const char*>::format(std::string& out, u64 arg)
|
||||
{
|
||||
if (arg)
|
||||
{
|
||||
out += reinterpret_cast<const char*>(static_cast<std::uintptr_t>(arg));
|
||||
}
|
||||
else
|
||||
{
|
||||
out += "(NULL)";
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
void fmt_class_string<std::string>::format(std::string& out, u64 arg)
|
||||
{
|
||||
out += get_object(arg).c_str(); // TODO?
|
||||
}
|
||||
|
||||
template <>
|
||||
void fmt_class_string<std::vector<char>>::format(std::string& out, u64 arg)
|
||||
{
|
||||
const std::vector<char>& obj = get_object(arg);
|
||||
out.append(obj.cbegin(), obj.cend());
|
||||
}
|
||||
|
||||
template <>
|
||||
void fmt_class_string<char>::format(std::string& out, u64 arg)
|
||||
{
|
||||
fmt::append(out, "%#hhx", static_cast<char>(arg));
|
||||
}
|
||||
|
||||
template <>
|
||||
void fmt_class_string<uchar>::format(std::string& out, u64 arg)
|
||||
{
|
||||
fmt::append(out, "%#hhx", static_cast<uchar>(arg));
|
||||
}
|
||||
|
||||
template <>
|
||||
void fmt_class_string<schar>::format(std::string& out, u64 arg)
|
||||
{
|
||||
fmt::append(out, "%#hhx", static_cast<schar>(arg));
|
||||
}
|
||||
|
||||
template <>
|
||||
void fmt_class_string<short>::format(std::string& out, u64 arg)
|
||||
{
|
||||
fmt::append(out, "%#hx", static_cast<short>(arg));
|
||||
}
|
||||
|
||||
template <>
|
||||
void fmt_class_string<ushort>::format(std::string& out, u64 arg)
|
||||
{
|
||||
fmt::append(out, "%#hx", static_cast<ushort>(arg));
|
||||
}
|
||||
|
||||
template <>
|
||||
void fmt_class_string<int>::format(std::string& out, u64 arg)
|
||||
{
|
||||
fmt::append(out, "%#x", static_cast<int>(arg));
|
||||
}
|
||||
|
||||
template <>
|
||||
void fmt_class_string<uint>::format(std::string& out, u64 arg)
|
||||
{
|
||||
fmt::append(out, "%#x", static_cast<uint>(arg));
|
||||
}
|
||||
|
||||
template <>
|
||||
void fmt_class_string<long>::format(std::string& out, u64 arg)
|
||||
{
|
||||
fmt::append(out, "%#lx", static_cast<long>(arg));
|
||||
}
|
||||
|
||||
template <>
|
||||
void fmt_class_string<ulong>::format(std::string& out, u64 arg)
|
||||
{
|
||||
fmt::append(out, "%#lx", static_cast<ulong>(arg));
|
||||
}
|
||||
|
||||
template <>
|
||||
void fmt_class_string<llong>::format(std::string& out, u64 arg)
|
||||
{
|
||||
fmt::append(out, "%#llx", static_cast<llong>(arg));
|
||||
}
|
||||
|
||||
template <>
|
||||
void fmt_class_string<ullong>::format(std::string& out, u64 arg)
|
||||
{
|
||||
fmt::append(out, "%#llx", static_cast<ullong>(arg));
|
||||
}
|
||||
|
||||
template <>
|
||||
void fmt_class_string<float>::format(std::string& out, u64 arg)
|
||||
{
|
||||
fmt::append(out, "%gf", static_cast<float>(reinterpret_cast<f64&>(arg)));
|
||||
}
|
||||
|
||||
template <>
|
||||
void fmt_class_string<double>::format(std::string& out, u64 arg)
|
||||
{
|
||||
fmt::append(out, "%g", reinterpret_cast<f64&>(arg));
|
||||
}
|
||||
|
||||
template <>
|
||||
void fmt_class_string<bool>::format(std::string& out, u64 arg)
|
||||
{
|
||||
out += arg ? "true" : "false";
|
||||
}
|
||||
|
||||
template <>
|
||||
void fmt_class_string<v128>::format(std::string& out, u64 arg)
|
||||
{
|
||||
const v128& vec = get_object(arg);
|
||||
fmt::append(out, "0x%016llx%016llx", vec._u64[1], vec._u64[0]);
|
||||
}
|
||||
|
||||
namespace fmt
|
||||
{
|
||||
void raw_error(const char* msg)
|
||||
{
|
||||
throw std::runtime_error{msg};
|
||||
}
|
||||
|
||||
void raw_verify_error(const char* msg, const fmt_type_info* sup, u64 arg)
|
||||
{
|
||||
std::string out{"Verification failed"};
|
||||
|
||||
// Print error code (may be irrelevant)
|
||||
#ifdef _WIN32
|
||||
if (DWORD error = GetLastError())
|
||||
{
|
||||
fmt::append(out, " (e=%#x)", error);
|
||||
}
|
||||
#else
|
||||
if (int error = errno)
|
||||
{
|
||||
fmt::append(out, " (e=%d)", error);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (sup)
|
||||
{
|
||||
out += " (";
|
||||
sup->fmt_string(out, arg); // Print value
|
||||
out += ")";
|
||||
}
|
||||
|
||||
if (msg)
|
||||
{
|
||||
out += ": ";
|
||||
out += msg;
|
||||
}
|
||||
|
||||
throw std::runtime_error{out};
|
||||
}
|
||||
|
||||
void raw_narrow_error(const char* msg, const fmt_type_info* sup, u64 arg)
|
||||
{
|
||||
std::string out{"Narrow error"};
|
||||
|
||||
if (sup)
|
||||
{
|
||||
out += " (";
|
||||
sup->fmt_string(out, arg); // Print value
|
||||
out += ")";
|
||||
}
|
||||
|
||||
if (msg)
|
||||
{
|
||||
out += ": ";
|
||||
out += msg;
|
||||
}
|
||||
|
||||
throw std::range_error{out};
|
||||
}
|
||||
|
||||
// Hidden template
|
||||
template <typename T>
|
||||
void raw_throw_exception(const char* fmt, const fmt_type_info* sup, const u64* args)
|
||||
{
|
||||
std::string out;
|
||||
raw_append(out, fmt, sup, args);
|
||||
throw T{out};
|
||||
}
|
||||
|
||||
// Explicit instantiations (not exhaustive)
|
||||
template void raw_throw_exception<std::runtime_error>(const char*, const fmt_type_info*, const u64*);
|
||||
template void raw_throw_exception<std::logic_error>(const char*, const fmt_type_info*, const u64*);
|
||||
template void raw_throw_exception<std::domain_error>(const char*, const fmt_type_info*, const u64*);
|
||||
template void raw_throw_exception<std::invalid_argument>(const char*, const fmt_type_info*, const u64*);
|
||||
template void raw_throw_exception<std::out_of_range>(const char*, const fmt_type_info*, const u64*);
|
||||
template void raw_throw_exception<std::range_error>(const char*, const fmt_type_info*, const u64*);
|
||||
template void raw_throw_exception<std::overflow_error>(const char*, const fmt_type_info*, const u64*);
|
||||
template void raw_throw_exception<std::underflow_error>(const char*, const fmt_type_info*, const u64*);
|
||||
|
||||
struct cfmt_src;
|
||||
}
|
||||
|
||||
// Temporary implementation
|
||||
struct fmt::cfmt_src
|
||||
{
|
||||
const fmt_type_info* sup;
|
||||
const u64* args;
|
||||
|
||||
bool test(std::size_t index) const
|
||||
{
|
||||
if (!sup[index].fmt_string)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T get(std::size_t index) const
|
||||
{
|
||||
return *reinterpret_cast<const T*>(reinterpret_cast<const u8*>(args + index));
|
||||
}
|
||||
|
||||
void skip(std::size_t extra)
|
||||
{
|
||||
++sup += extra;
|
||||
++args += extra;
|
||||
}
|
||||
|
||||
std::size_t fmt_string(std::string& out, std::size_t extra) const
|
||||
{
|
||||
const std::size_t start = out.size();
|
||||
sup[extra].fmt_string(out, args[extra]);
|
||||
return out.size() - start;
|
||||
}
|
||||
|
||||
// Returns type size (0 if unknown, pointer, unsigned, assumed max)
|
||||
std::size_t type(std::size_t extra) const
|
||||
{
|
||||
// Hack: use known function pointers to determine type
|
||||
#define TYPE(type) \
|
||||
if (sup[extra].fmt_string == &fmt_class_string<type>::format) return sizeof(type);
|
||||
|
||||
TYPE(int);
|
||||
TYPE(llong);
|
||||
TYPE(schar);
|
||||
TYPE(short);
|
||||
if (std::is_signed<char>::value) TYPE(char);
|
||||
TYPE(long);
|
||||
|
||||
#undef TYPE
|
||||
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
void fmt::raw_append(std::string& out, const char* fmt, const fmt_type_info* sup, const u64* args) noexcept
|
||||
{
|
||||
cfmt_append(out, fmt, cfmt_src{sup, args});
|
||||
}
|
||||
|
||||
std::string fmt::replace_first(const std::string& src, const std::string& from, const std::string& to)
|
||||
{
|
||||
auto pos = src.find(from);
|
||||
|
||||
@@ -43,90 +305,102 @@ std::string replace_first(const std::string& src, const std::string& from, const
|
||||
return (pos ? src.substr(0, pos) + to : to) + std::string(src.c_str() + pos + from.length());
|
||||
}
|
||||
|
||||
std::string replace_all(std::string src, const std::string& from, const std::string& to)
|
||||
std::string fmt::replace_all(const std::string& src, const std::string& from, const std::string& to)
|
||||
{
|
||||
for (auto pos = src.find(from); pos != std::string::npos; src.find(from, pos + 1))
|
||||
std::string target = src;
|
||||
for (auto pos = target.find(from); pos != std::string::npos; pos = target.find(from, pos + 1))
|
||||
{
|
||||
src = (pos ? src.substr(0, pos) + to : to) + std::string(src.c_str() + pos + from.length());
|
||||
target = (pos ? target.substr(0, pos) + to : to) + std::string(target.c_str() + pos + from.length());
|
||||
pos += to.length();
|
||||
}
|
||||
|
||||
return src;
|
||||
return target;
|
||||
}
|
||||
|
||||
//TODO: move this wx Stuff somewhere else
|
||||
//convert a wxString to a std::string encoded in utf8
|
||||
//CAUTION, only use this to interface with wxWidgets classes
|
||||
std::string fmt::ToUTF8(const wxString& right)
|
||||
std::vector<std::string> fmt::split(const std::string& source, std::initializer_list<std::string> separators, bool is_skip_empty)
|
||||
{
|
||||
auto ret = std::string(((const char *)right.utf8_str()));
|
||||
return ret;
|
||||
}
|
||||
std::vector<std::string> result;
|
||||
|
||||
//convert a std::string encoded in utf8 to a wxString
|
||||
//CAUTION, only use this to interface with wxWidgets classes
|
||||
wxString fmt::FromUTF8(const std::string& right)
|
||||
{
|
||||
auto ret = wxString::FromUTF8(right.c_str());
|
||||
return ret;
|
||||
}
|
||||
size_t cursor_begin = 0;
|
||||
|
||||
//TODO: remove this after every snippet that uses it is gone
|
||||
//WARNING: not fully compatible with CmpNoCase from wxString
|
||||
int fmt::CmpNoCase(const std::string& a, const std::string& b)
|
||||
{
|
||||
if (a.length() != b.length())
|
||||
for (size_t cursor_end = 0; cursor_end < source.length(); ++cursor_end)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return std::equal(a.begin(),
|
||||
a.end(),
|
||||
b.begin(),
|
||||
[](const char& a, const char& b){return tolower(a) == tolower(b); })
|
||||
? 0 : -1;
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: remove this after every snippet that uses it is gone
|
||||
//WARNING: not fully compatible with CmpNoCase from wxString
|
||||
void fmt::Replace(std::string &str, const std::string &searchterm, const std::string& replaceterm)
|
||||
{
|
||||
size_t cursor = 0;
|
||||
do
|
||||
{
|
||||
cursor = str.find(searchterm, cursor);
|
||||
if (cursor != std::string::npos)
|
||||
for (auto& separator : separators)
|
||||
{
|
||||
str.replace(cursor, searchterm.size(), replaceterm);
|
||||
cursor += replaceterm.size();
|
||||
if (strncmp(source.c_str() + cursor_end, separator.c_str(), separator.length()) == 0)
|
||||
{
|
||||
std::string candidate = source.substr(cursor_begin, cursor_end - cursor_begin);
|
||||
if (!is_skip_empty || !candidate.empty())
|
||||
result.push_back(candidate);
|
||||
|
||||
cursor_begin = cursor_end + separator.length();
|
||||
cursor_end = cursor_begin - 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
|
||||
if (cursor_begin != source.length())
|
||||
{
|
||||
result.push_back(source.substr(cursor_begin));
|
||||
}
|
||||
|
||||
return std::move(result);
|
||||
}
|
||||
|
||||
std::string fmt::trim(const std::string& source, const std::string& values)
|
||||
{
|
||||
std::size_t begin = source.find_first_not_of(values);
|
||||
|
||||
if (begin == source.npos)
|
||||
return {};
|
||||
|
||||
return source.substr(begin, source.find_last_not_of(values) + 1);
|
||||
}
|
||||
|
||||
std::string fmt::to_upper(const std::string& string)
|
||||
{
|
||||
std::string result;
|
||||
result.resize(string.size());
|
||||
std::transform(string.begin(), string.end(), result.begin(), ::toupper);
|
||||
return result;
|
||||
}
|
||||
|
||||
bool fmt::match(const std::string& source, const std::string& mask)
|
||||
{
|
||||
std::size_t source_position = 0, mask_position = 0;
|
||||
|
||||
for (; source_position < source.size() && mask_position < mask.size(); ++mask_position, ++source_position)
|
||||
{
|
||||
switch (mask[mask_position])
|
||||
{
|
||||
case '?': break;
|
||||
|
||||
case '*':
|
||||
for (std::size_t test_source_position = source_position; test_source_position < source.size(); ++test_source_position)
|
||||
{
|
||||
if (match(source.substr(test_source_position), mask.substr(mask_position + 1)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
default:
|
||||
if (source[source_position] != mask[mask_position])
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
} while (true);
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<std::string> fmt::rSplit(const std::string& source, const std::string& delim)
|
||||
{
|
||||
std::vector<std::string> ret;
|
||||
size_t cursor = 0;
|
||||
do
|
||||
{
|
||||
size_t prevcurs = cursor;
|
||||
cursor = source.find(delim, cursor);
|
||||
if (cursor != std::string::npos)
|
||||
{
|
||||
ret.push_back(source.substr(prevcurs,cursor-prevcurs));
|
||||
cursor += delim.size();
|
||||
}
|
||||
else
|
||||
{
|
||||
ret.push_back(source.substr(prevcurs));
|
||||
break;
|
||||
}
|
||||
} while (true);
|
||||
return ret;
|
||||
}
|
||||
if (source_position != source.size())
|
||||
return false;
|
||||
|
||||
if (mask_position != mask.size())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+231
-168
@@ -1,202 +1,265 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include <exception>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <cstdio>
|
||||
#include <functional>
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
namespace fmt
|
||||
{
|
||||
template <typename... Args>
|
||||
static std::string format(const char*, const Args&...);
|
||||
}
|
||||
|
||||
namespace fmt{
|
||||
using std::string;
|
||||
using std::ostream;
|
||||
using std::ostringstream;
|
||||
template <typename T, typename>
|
||||
struct fmt_unveil
|
||||
{
|
||||
static_assert(sizeof(T) > 0, "fmt_unveil<>: cannot pass forward-declared object");
|
||||
|
||||
struct empty_t{};
|
||||
using type = T;
|
||||
|
||||
extern const string placeholder;
|
||||
|
||||
template <typename T>
|
||||
std::string AfterLast(const std::string& source, T searchstr)
|
||||
static inline u64 get(const T& arg)
|
||||
{
|
||||
size_t search_pos = source.rfind(searchstr);
|
||||
search_pos = search_pos == std::string::npos ? 0 : search_pos;
|
||||
return source.substr(search_pos);
|
||||
return reinterpret_cast<std::uintptr_t>(&arg);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
std::string BeforeLast(const std::string& source, T searchstr)
|
||||
// Temporary value container (can possibly be created by other fmt_unveil<> specializations)
|
||||
struct u64_wrapper
|
||||
{
|
||||
size_t search_pos = source.rfind(searchstr);
|
||||
search_pos = search_pos == std::string::npos ? 0 : search_pos;
|
||||
return source.substr(0, search_pos);
|
||||
}
|
||||
T arg;
|
||||
|
||||
template <typename T>
|
||||
std::string AfterFirst(const std::string& source, T searchstr)
|
||||
{
|
||||
size_t search_pos = source.find(searchstr);
|
||||
search_pos = search_pos == std::string::npos ? 0 : search_pos;
|
||||
return source.substr(search_pos);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
std::string BeforeFirst(const std::string& source, T searchstr)
|
||||
{
|
||||
size_t search_pos = source.find(searchstr);
|
||||
search_pos = search_pos == std::string::npos ? 0 : search_pos;
|
||||
return source.substr(0, search_pos);
|
||||
}
|
||||
|
||||
// write `fmt` from `pos` to the first occurence of `fmt::placeholder` to
|
||||
// the stream `os`. Then write `arg` to to the stream. If there's no
|
||||
// `fmt::placeholder` after `pos` everything in `fmt` after pos is written
|
||||
// to `os`. Then `arg` is written to `os` after appending a space character
|
||||
template<typename T>
|
||||
empty_t write(const string &fmt, ostream &os, string::size_type &pos, T &&arg)
|
||||
{
|
||||
string::size_type ins = fmt.find(placeholder, pos);
|
||||
|
||||
if (ins == string::npos)
|
||||
// Allow implicit conversion
|
||||
operator u64() const
|
||||
{
|
||||
os.write(fmt.data() + pos, fmt.size() - pos);
|
||||
os << ' ' << arg;
|
||||
|
||||
pos = fmt.size();
|
||||
return reinterpret_cast<std::uintptr_t>(&arg);
|
||||
}
|
||||
else
|
||||
{
|
||||
os.write(fmt.data() + pos, ins - pos);
|
||||
os << arg;
|
||||
};
|
||||
|
||||
pos = ins + placeholder.size();
|
||||
}
|
||||
return{};
|
||||
// This overload resolution takes the precedence
|
||||
static inline u64_wrapper get(T&& arg)
|
||||
{
|
||||
return u64_wrapper{std::move(arg)};
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct fmt_unveil<T, std::enable_if_t<std::is_integral<T>::value && sizeof(T) <= 8 && alignof(T) <= 8>>
|
||||
{
|
||||
using type = T;
|
||||
|
||||
static inline u64 get(T arg)
|
||||
{
|
||||
return static_cast<T>(arg);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct fmt_unveil<T, std::enable_if_t<std::is_floating_point<T>::value && sizeof(T) <= 8 && alignof(T) <= 8>>
|
||||
{
|
||||
using type = T;
|
||||
|
||||
// Convert FP to f64 and reinterpret (TODO?)
|
||||
static inline u64 get(const f64 arg)
|
||||
{
|
||||
return *reinterpret_cast<const u64*>(reinterpret_cast<const u8*>(&arg));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct fmt_unveil<T, std::enable_if_t<std::is_enum<T>::value>>
|
||||
{
|
||||
using type = T;
|
||||
|
||||
static inline u64 get(T arg)
|
||||
{
|
||||
return static_cast<std::underlying_type_t<T>>(arg);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct fmt_unveil<T*, void>
|
||||
{
|
||||
using type = const T*;
|
||||
|
||||
static inline u64 get(const T* arg)
|
||||
{
|
||||
return reinterpret_cast<std::uintptr_t>(arg);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, std::size_t N>
|
||||
struct fmt_unveil<T[N], void>
|
||||
{
|
||||
using type = const T*;
|
||||
|
||||
static inline u64 get(const T* arg)
|
||||
{
|
||||
return reinterpret_cast<std::uintptr_t>(arg);
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct fmt_unveil<b8, void>
|
||||
{
|
||||
using type = bool;
|
||||
|
||||
static inline u64 get(const b8& value)
|
||||
{
|
||||
return fmt_unveil<bool>::get(value);
|
||||
}
|
||||
};
|
||||
|
||||
// String type format provider, also type classifier (format() called if an argument is formatted as "%s")
|
||||
template <typename T, typename = void>
|
||||
struct fmt_class_string
|
||||
{
|
||||
// Formatting function (must be explicitly specialized)
|
||||
static void format(std::string& out, u64 arg);
|
||||
|
||||
// Helper typedef (visible in format())
|
||||
using type = T;
|
||||
|
||||
// Helper function (converts arg to object reference)
|
||||
static SAFE_BUFFERS FORCE_INLINE const T& get_object(u64 arg)
|
||||
{
|
||||
return *reinterpret_cast<const T*>(static_cast<std::uintptr_t>(arg));
|
||||
}
|
||||
|
||||
// typesafe version of a sprintf-like function. Returns the printed to
|
||||
// string. To mark positions where the arguments are supposed to be
|
||||
// inserted use `fmt::placeholder`. If there's not enough placeholders
|
||||
// the rest of the arguments are appended at the end, seperated by spaces
|
||||
template<typename ... Args>
|
||||
string SFormat(const string &fmt, Args&& ... parameters)
|
||||
// Helper function (safely converts arg to enum value)
|
||||
static SAFE_BUFFERS FORCE_INLINE void format_enum(std::string& out, u64 arg, const char* (*get)(T value))
|
||||
{
|
||||
ostringstream os;
|
||||
string::size_type pos = 0;
|
||||
std::initializer_list<empty_t> { write(fmt, os, pos, parameters)... };
|
||||
const auto value = static_cast<std::underlying_type_t<T>>(arg);
|
||||
|
||||
if (!fmt.empty())
|
||||
// Check narrowing
|
||||
if (static_cast<u64>(value) == arg)
|
||||
{
|
||||
os.write(fmt.data() + pos, fmt.size() - pos);
|
||||
if (const char* str = get(static_cast<T>(value)))
|
||||
{
|
||||
out += str;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
string result = os.str();
|
||||
// Fallback to underlying type formatting
|
||||
fmt_class_string<std::underlying_type_t<T>>::format(out, static_cast<u64>(value));
|
||||
}
|
||||
|
||||
// Helper function (bitset formatting)
|
||||
static SAFE_BUFFERS FORCE_INLINE void format_bitset(std::string& out, u64 arg, const char* prefix, const char* delim, const char* suffix, void (*fmt)(std::string&, u64))
|
||||
{
|
||||
// Start from raw value
|
||||
fmt_class_string<u64>::format(out, arg);
|
||||
|
||||
out += prefix;
|
||||
|
||||
for (u64 i = 0; i < 63; i++)
|
||||
{
|
||||
const u64 mask = 1ull << i;
|
||||
|
||||
if (arg & mask)
|
||||
{
|
||||
fmt(out, i);
|
||||
|
||||
if (arg >> (i + 1))
|
||||
{
|
||||
out += delim;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (arg & (1ull << 63))
|
||||
{
|
||||
fmt(out, 63);
|
||||
}
|
||||
|
||||
out += suffix;
|
||||
}
|
||||
|
||||
// Helper constant (may be used in format_enum as lambda return value)
|
||||
static constexpr const char* unknown = nullptr;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct fmt_class_string<const void*, void>
|
||||
{
|
||||
static void format(std::string& out, u64 arg);
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct fmt_class_string<T*, void> : fmt_class_string<const void*, void>
|
||||
{
|
||||
// Classify all pointers as const void*
|
||||
};
|
||||
|
||||
template <>
|
||||
struct fmt_class_string<const char*, void>
|
||||
{
|
||||
static void format(std::string& out, u64 arg);
|
||||
};
|
||||
|
||||
template <>
|
||||
struct fmt_class_string<char*, void> : fmt_class_string<const char*>
|
||||
{
|
||||
// Classify char* as const char*
|
||||
};
|
||||
|
||||
struct fmt_type_info
|
||||
{
|
||||
decltype(&fmt_class_string<int>::format) fmt_string;
|
||||
|
||||
template <typename T>
|
||||
static constexpr fmt_type_info make()
|
||||
{
|
||||
return fmt_type_info
|
||||
{
|
||||
&fmt_class_string<T>::format,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
// Argument array type (each element generated via fmt_unveil<>)
|
||||
template <typename... Args>
|
||||
using fmt_args_t = const u64(&&)[sizeof...(Args) + 1];
|
||||
|
||||
namespace fmt
|
||||
{
|
||||
template <typename... Args>
|
||||
SAFE_BUFFERS FORCE_INLINE const fmt_type_info* get_type_info()
|
||||
{
|
||||
// Constantly initialized null-terminated list of type-specific information
|
||||
static constexpr fmt_type_info result[sizeof...(Args) + 1]{fmt_type_info::make<Args>()...};
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//small wrapper used to deal with bitfields
|
||||
template<typename T>
|
||||
T by_value(T x) { return x; }
|
||||
// Internal formatting function
|
||||
void raw_append(std::string& out, const char*, const fmt_type_info*, const u64*) noexcept;
|
||||
|
||||
//wrapper to deal with advance sprintf formating options with automatic length finding
|
||||
//can't take strings by reference because of "va_start", so overload it with char *
|
||||
string FormatV(const char *fmt, va_list args);
|
||||
|
||||
string FormatV(string fmt, va_list args);
|
||||
|
||||
//wrapper to deal with advance sprintf formating options with automatic length finding
|
||||
template<typename ... Args>
|
||||
string Format(const string &fmt, Args ... parameters)
|
||||
// Formatting function
|
||||
template <typename... Args>
|
||||
SAFE_BUFFERS FORCE_INLINE void append(std::string& out, const char* fmt, const Args&... args)
|
||||
{
|
||||
size_t length = 256;
|
||||
string str;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
std::vector<char> buffptr(length);
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wformat-security"
|
||||
size_t printlen = snprintf(buffptr.data(), length, fmt.c_str(), std::forward<Args>(parameters)...);
|
||||
#pragma clang diagnostic pop
|
||||
if (printlen < length)
|
||||
{
|
||||
str = string(buffptr.data(), printlen);
|
||||
break;
|
||||
}
|
||||
length *= 2;
|
||||
}
|
||||
return str;
|
||||
raw_append(out, fmt, fmt::get_type_info<fmt_unveil_t<Args>...>(), fmt_args_t<Args...>{fmt_unveil<Args>::get(args)...});
|
||||
}
|
||||
|
||||
std::string replace_first(const std::string& src, const std::string& from, const std::string& to);
|
||||
std::string replace_all(std::string src, const std::string& from, const std::string& to);
|
||||
|
||||
template<size_t list_size>
|
||||
std::string replace_all(std::string src, const std::pair<std::string, std::string>(&list)[list_size])
|
||||
// Formatting function
|
||||
template <typename... Args>
|
||||
SAFE_BUFFERS FORCE_INLINE std::string format(const char* fmt, const Args&... args)
|
||||
{
|
||||
for (size_t pos = 0; pos < src.length(); ++pos)
|
||||
{
|
||||
for (size_t i = 0; i < list_size; ++i)
|
||||
{
|
||||
const size_t comp_length = list[i].first.length();
|
||||
|
||||
if (src.length() - pos < comp_length)
|
||||
continue;
|
||||
|
||||
if (src.substr(pos, comp_length) == list[i].first)
|
||||
{
|
||||
src = (pos ? src.substr(0, pos) + list[i].second : list[i].second) + std::string(src.c_str() + pos + comp_length);
|
||||
pos += list[i].second.length() - 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return src;
|
||||
std::string result;
|
||||
append<Args...>(result, fmt, args...);
|
||||
return result;
|
||||
}
|
||||
|
||||
template<size_t list_size>
|
||||
std::string replace_all(std::string src, const std::pair<std::string, std::function<std::string()>>(&list)[list_size])
|
||||
// Internal exception message formatting template, must be explicitly specialized or instantiated in cpp to minimize code bloat
|
||||
template <typename T>
|
||||
[[noreturn]] void raw_throw_exception(const char*, const fmt_type_info*, const u64*);
|
||||
|
||||
// Throw exception with formatting
|
||||
template <typename T = std::runtime_error, typename... Args>
|
||||
[[noreturn]] SAFE_BUFFERS FORCE_INLINE void throw_exception(const char* fmt, const Args&... args)
|
||||
{
|
||||
for (size_t pos = 0; pos < src.length(); ++pos)
|
||||
{
|
||||
for (size_t i = 0; i < list_size; ++i)
|
||||
{
|
||||
const size_t comp_length = list[i].first.length();
|
||||
|
||||
if (src.length() - pos < comp_length)
|
||||
continue;
|
||||
|
||||
if (src.substr(pos, comp_length) == list[i].first)
|
||||
{
|
||||
src = (pos ? src.substr(0, pos) + list[i].second() : list[i].second()) + std::string(src.c_str() + pos + comp_length);
|
||||
pos += list[i].second().length() - 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return src;
|
||||
raw_throw_exception<T>(fmt, fmt::get_type_info<fmt_unveil_t<Args>...>(), fmt_args_t<Args...>{fmt_unveil<Args>::get(args)...});
|
||||
}
|
||||
|
||||
//convert a wxString to a std::string encoded in utf8
|
||||
//CAUTION, only use this to interface with wxWidgets classes
|
||||
std::string ToUTF8(const wxString& right);
|
||||
|
||||
//convert a std::string encoded in utf8 to a wxString
|
||||
//CAUTION, only use this to interface with wxWidgets classes
|
||||
wxString FromUTF8(const string& right);
|
||||
|
||||
//TODO: remove this after every snippet that uses it is gone
|
||||
//WARNING: not fully compatible with CmpNoCase from wxString
|
||||
int CmpNoCase(const std::string& a, const std::string& b);
|
||||
|
||||
//TODO: remove this after every snippet that uses it is gone
|
||||
//WARNING: not fully compatible with Replace from wxString
|
||||
void Replace(std::string &str, const std::string &searchterm, const std::string& replaceterm);
|
||||
|
||||
std::vector<std::string> rSplit(const std::string& source, const std::string& delim);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user