From b691c43c44ff180d10e7d4a9afc83b98551ff586 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Sun, 1 Mar 2026 12:16:08 +0800 Subject: Initial commit --- .../Durango/4JLibs/Media/4J_strings.resx | 171 + Minecraft.Client/Durango/4JLibs/inc/4J_Input.h | 165 + Minecraft.Client/Durango/4JLibs/inc/4J_Profile.h | 162 + Minecraft.Client/Durango/4JLibs/inc/4J_Render.h | 302 + Minecraft.Client/Durango/4JLibs/inc/4J_Storage.h | 492 ++ Minecraft.Client/Durango/4JLibs/libs/4J_Input.lib | Bin 0 -> 1469298 bytes .../Durango/4JLibs/libs/4J_Input_d.lib | Bin 0 -> 1765658 bytes .../Durango/4JLibs/libs/4J_Input_r.lib | Bin 0 -> 1615310 bytes .../Durango/4JLibs/libs/4J_Profile.lib | Bin 0 -> 10828466 bytes .../Durango/4JLibs/libs/4J_Profile_d.lib | Bin 0 -> 15201884 bytes .../Durango/4JLibs/libs/4J_Profile_r.lib | Bin 0 -> 12989246 bytes Minecraft.Client/Durango/4JLibs/libs/4J_Render.lib | Bin 0 -> 6567780 bytes .../Durango/4JLibs/libs/4J_Render_d.lib | Bin 0 -> 9620842 bytes .../Durango/4JLibs/libs/4J_Storage.lib | Bin 0 -> 32030854 bytes .../Durango/4JLibs/libs/4J_Storage_d.lib | Bin 0 -> 41228808 bytes .../Durango/4JLibs/libs/4J_Storage_r.lib | Bin 0 -> 32343876 bytes .../Durango/Achievements/AchievementManager.cpp | 15 + .../Durango/Achievements/AchievementManager.h | 8 + Minecraft.Client/Durango/ApplicationView.cpp | 346 + Minecraft.Client/Durango/ApplicationView.h | 44 + .../Durango/Autogenerated.appxmanifest | 194 + Minecraft.Client/Durango/CU/DLCXbox1.cmp | Bin 0 -> 1714 bytes .../Durango/DLCImages/MPHA_360x360.png | Bin 0 -> 143326 bytes .../Durango/DLCImages/MPMA_360x360.png | Bin 0 -> 129724 bytes .../Durango/DLCImages/MPSR_360x360.png | Bin 0 -> 169511 bytes Minecraft.Client/Durango/DLCImages/SP1_360x360.png | Bin 0 -> 211965 bytes Minecraft.Client/Durango/DLCImages/SP2_360x360.png | Bin 0 -> 205373 bytes Minecraft.Client/Durango/DLCImages/SP3_360x360.png | Bin 0 -> 218151 bytes Minecraft.Client/Durango/DLCImages/SP4_360x360.png | Bin 0 -> 138908 bytes Minecraft.Client/Durango/DLCImages/SP5_360x360.png | Bin 0 -> 135222 bytes Minecraft.Client/Durango/DLCImages/SP6_360x360.png | Bin 0 -> 136534 bytes .../Durango/DLCImages/SPB2_360x360.png | Bin 0 -> 149039 bytes Minecraft.Client/Durango/DLCImages/SPB_360x360.png | Bin 0 -> 122667 bytes Minecraft.Client/Durango/DLCImages/SPC_360x360.png | Bin 0 -> 145302 bytes .../Durango/DLCImages/SPD1_360x360.png | Bin 0 -> 143413 bytes Minecraft.Client/Durango/DLCImages/SPF_360x360.png | Bin 0 -> 140603 bytes Minecraft.Client/Durango/DLCImages/SPG_360x360.png | Bin 0 -> 140522 bytes Minecraft.Client/Durango/DLCImages/SPI_360x360.png | Bin 0 -> 154628 bytes Minecraft.Client/Durango/DLCImages/SPM_360x360.png | Bin 0 -> 144016 bytes Minecraft.Client/Durango/DLCImages/SPZ_360x360.png | Bin 0 -> 154505 bytes .../Durango/DLCImages/TP01_360x360.png | Bin 0 -> 129958 bytes .../Durango/DLCImages/TP02_360x360.png | Bin 0 -> 223839 bytes .../Durango/DLCImages/TP03_360x360.png | Bin 0 -> 132702 bytes .../Durango/DLCImages/TP04_360x360.png | Bin 0 -> 204711 bytes .../Durango/DLCImages/TP05_360x360.png | Bin 0 -> 140905 bytes .../Durango/DLCImages/TP06_360x360.png | Bin 0 -> 100435 bytes .../Durango/DLCImages/TP07_360x360.png | Bin 0 -> 105405 bytes Minecraft.Client/Durango/DLCXbox1.cmp | Bin 0 -> 1644 bytes .../Durango/DurangoExtras/DurangoStubs.cpp | 128 + .../Durango/DurangoExtras/DurangoStubs.h | 9 + .../Durango/DurangoExtras/xcompress.dll | Bin 0 -> 36864 bytes Minecraft.Client/Durango/DurangoExtras/xcompress.h | 253 + .../Durango/DurangoExtras/xcompress.lib | Bin 0 -> 5164 bytes Minecraft.Client/Durango/Durango_App.cpp | 799 ++ Minecraft.Client/Durango/Durango_App.h | 87 + Minecraft.Client/Durango/Durango_Minecraft.cpp | 1173 +++ Minecraft.Client/Durango/Durango_UIController.cpp | 195 + Minecraft.Client/Durango/Durango_UIController.h | 30 + .../Durango/Iggy/gdraw/gdraw_d3d10_shaders.inl | 3427 ++++++++ .../Durango/Iggy/gdraw/gdraw_d3d11.cpp | 147 + Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d11.h | 137 + .../Durango/Iggy/gdraw/gdraw_d3d1x_shared.inl | 2491 ++++++ .../Durango/Iggy/gdraw/gdraw_shared.inl | 2595 ++++++ Minecraft.Client/Durango/Iggy/include/gdraw.h | 726 ++ Minecraft.Client/Durango/Iggy/include/iggy.h | 1295 +++ .../Durango/Iggy/include/iggyexpruntime.h | 49 + .../Durango/Iggy/include/iggyperfmon.h | 89 + Minecraft.Client/Durango/Iggy/include/rrCore.h | 2322 ++++++ Minecraft.Client/Durango/Iggy/lib/iggy_durango.lib | Bin 0 -> 3416568 bytes .../Durango/Iggy/lib/iggy_durango_debugcrt.lib | Bin 0 -> 3418016 bytes .../Durango/Iggy/lib/iggyperfmon_durango.lib | Bin 0 -> 206850 bytes .../Iggy/lib/iggyperfmon_durango_debugcrt.lib | Bin 0 -> 207062 bytes .../Durango/Layout/Image/Loose/CU/DLCXbox1.cmp | Bin 0 -> 1714 bytes .../Image/Loose/Common/media/MediaDurango.arc | Bin 0 -> 19606036 bytes .../Loose/Common/media/font/CHT/DFHeiMedium-B5.ttf | Bin 0 -> 8132620 bytes .../Common/media/font/JPN/DF-DotDotGothic16.ttf | Bin 0 -> 4041932 bytes .../Common/media/font/JPN/DFGMaruGothic-Md.ttf | Bin 0 -> 3433848 bytes .../Image/Loose/Common/media/font/KOR/BOKMSD.ttf | Bin 0 -> 1100020 bytes .../Loose/Common/media/font/KOR/candadite2.ttf | Bin 0 -> 4871702 bytes .../Loose/Common/media/font/Mojang Font_11.ttf | Bin 0 -> 69116 bytes .../Loose/Common/media/font/Mojang Font_7.ttf | Bin 0 -> 69100 bytes .../Image/Loose/Common/media/font/Mojangles.ttf | Bin 0 -> 71900 bytes .../Image/Loose/Common/media/font/RU/SpaceMace.ttf | Bin 0 -> 109392 bytes .../Loose/Common/res/1_2_2/achievement/bg.png | Bin 0 -> 3636 bytes .../Loose/Common/res/1_2_2/achievement/icons.png | Bin 0 -> 1489 bytes .../Image/Loose/Common/res/1_2_2/armor/chain_1.png | Bin 0 -> 964 bytes .../Image/Loose/Common/res/1_2_2/armor/chain_2.png | Bin 0 -> 523 bytes .../Image/Loose/Common/res/1_2_2/armor/cloth_1.png | Bin 0 -> 1139 bytes .../Image/Loose/Common/res/1_2_2/armor/cloth_2.png | Bin 0 -> 710 bytes .../Loose/Common/res/1_2_2/armor/diamond_1.png | Bin 0 -> 1218 bytes .../Loose/Common/res/1_2_2/armor/diamond_2.png | Bin 0 -> 724 bytes .../Image/Loose/Common/res/1_2_2/armor/gold_1.png | Bin 0 -> 1198 bytes .../Image/Loose/Common/res/1_2_2/armor/gold_2.png | Bin 0 -> 708 bytes .../Image/Loose/Common/res/1_2_2/armor/iron_1.png | Bin 0 -> 1133 bytes .../Image/Loose/Common/res/1_2_2/armor/iron_2.png | Bin 0 -> 686 bytes .../Image/Loose/Common/res/1_2_2/armor/power.png | Bin 0 -> 1800 bytes .../Layout/Image/Loose/Common/res/1_2_2/art/kz.png | Bin 0 -> 78021 bytes .../Loose/Common/res/1_2_2/environment/clouds.png | Bin 0 -> 13711 bytes .../Common/res/1_2_2/environment/light_normal.png | Bin 0 -> 1207 bytes .../Loose/Common/res/1_2_2/environment/rain.png | Bin 0 -> 2540 bytes .../Loose/Common/res/1_2_2/environment/snow.png | Bin 0 -> 818 bytes .../Loose/Common/res/1_2_2/font/alternate.png | Bin 0 -> 1189 bytes .../Image/Loose/Common/res/1_2_2/font/default.png | Bin 0 -> 2817 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_00.png | Bin 0 -> 2509 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_01.png | Bin 0 -> 2417 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_02.png | Bin 0 -> 2240 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_03.png | Bin 0 -> 1996 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_04.png | Bin 0 -> 2395 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_05.png | Bin 0 -> 1924 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_06.png | Bin 0 -> 2583 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_07.png | Bin 0 -> 2515 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_09.png | Bin 0 -> 3694 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_0A.png | Bin 0 -> 2485 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_0B.png | Bin 0 -> 2610 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_0C.png | Bin 0 -> 2720 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_0D.png | Bin 0 -> 2954 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_0E.png | Bin 0 -> 1562 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_0F.png | Bin 0 -> 2513 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_10.png | Bin 0 -> 2799 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_11.png | Bin 0 -> 2108 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_12.png | Bin 0 -> 3095 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_13.png | Bin 0 -> 3034 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_14.png | Bin 0 -> 1741 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_15.png | Bin 0 -> 2291 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_16.png | Bin 0 -> 2510 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_17.png | Bin 0 -> 2875 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_18.png | Bin 0 -> 2099 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_19.png | Bin 0 -> 2723 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_1A.png | Bin 0 -> 635 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_1B.png | Bin 0 -> 2322 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_1C.png | Bin 0 -> 1593 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_1D.png | Bin 0 -> 2185 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_1E.png | Bin 0 -> 2114 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_1F.png | Bin 0 -> 1313 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_20.png | Bin 0 -> 2263 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_21.png | Bin 0 -> 2535 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_22.png | Bin 0 -> 2010 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_23.png | Bin 0 -> 2405 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_24.png | Bin 0 -> 2742 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_25.png | Bin 0 -> 1352 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_26.png | Bin 0 -> 2801 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_27.png | Bin 0 -> 3641 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_28.png | Bin 0 -> 425 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_29.png | Bin 0 -> 2906 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_2A.png | Bin 0 -> 2821 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_2B.png | Bin 0 -> 1163 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_2C.png | Bin 0 -> 2626 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_2D.png | Bin 0 -> 2480 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_2E.png | Bin 0 -> 2685 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_2F.png | Bin 0 -> 4446 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_30.png | Bin 0 -> 3802 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_31.png | Bin 0 -> 3254 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_32.png | Bin 0 -> 3493 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_33.png | Bin 0 -> 4617 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_34.png | Bin 0 -> 6178 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_35.png | Bin 0 -> 6340 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_36.png | Bin 0 -> 6506 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_37.png | Bin 0 -> 6238 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_38.png | Bin 0 -> 6370 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_39.png | Bin 0 -> 6495 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_3A.png | Bin 0 -> 6534 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_3B.png | Bin 0 -> 6650 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_3C.png | Bin 0 -> 6594 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_3D.png | Bin 0 -> 6921 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_3E.png | Bin 0 -> 6538 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_3F.png | Bin 0 -> 6413 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_40.png | Bin 0 -> 6468 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_41.png | Bin 0 -> 6031 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_42.png | Bin 0 -> 6266 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_43.png | Bin 0 -> 6509 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_44.png | Bin 0 -> 6004 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_45.png | Bin 0 -> 6425 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_46.png | Bin 0 -> 6487 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_47.png | Bin 0 -> 6561 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_48.png | Bin 0 -> 6524 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_49.png | Bin 0 -> 6514 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_4A.png | Bin 0 -> 6209 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_4B.png | Bin 0 -> 6356 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_4C.png | Bin 0 -> 6490 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_4D.png | Bin 0 -> 5119 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_4E.png | Bin 0 -> 4894 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_4F.png | Bin 0 -> 5773 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_50.png | Bin 0 -> 6337 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_51.png | Bin 0 -> 5876 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_52.png | Bin 0 -> 5773 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_53.png | Bin 0 -> 5295 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_54.png | Bin 0 -> 5572 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_55.png | Bin 0 -> 6268 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_56.png | Bin 0 -> 6551 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_57.png | Bin 0 -> 5636 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_58.png | Bin 0 -> 6327 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_59.png | Bin 0 -> 5634 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_5A.png | Bin 0 -> 6375 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_5B.png | Bin 0 -> 5943 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_5C.png | Bin 0 -> 5649 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_5D.png | Bin 0 -> 6364 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_5E.png | Bin 0 -> 5705 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_5F.png | Bin 0 -> 6033 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_60.png | Bin 0 -> 5920 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_61.png | Bin 0 -> 6706 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_62.png | Bin 0 -> 5846 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_63.png | Bin 0 -> 6196 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_64.png | Bin 0 -> 6741 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_65.png | Bin 0 -> 6402 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_66.png | Bin 0 -> 5994 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_67.png | Bin 0 -> 5757 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_68.png | Bin 0 -> 6117 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_69.png | Bin 0 -> 6431 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_6A.png | Bin 0 -> 6793 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_6B.png | Bin 0 -> 6556 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_6C.png | Bin 0 -> 5670 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_6D.png | Bin 0 -> 6029 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_6E.png | Bin 0 -> 6350 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_6F.png | Bin 0 -> 6621 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_70.png | Bin 0 -> 6667 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_71.png | Bin 0 -> 6597 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_72.png | Bin 0 -> 6518 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_73.png | Bin 0 -> 6385 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_74.png | Bin 0 -> 6435 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_75.png | Bin 0 -> 5731 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_76.png | Bin 0 -> 6109 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_77.png | Bin 0 -> 6110 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_78.png | Bin 0 -> 6167 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_79.png | Bin 0 -> 6278 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_7A.png | Bin 0 -> 6089 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_7B.png | Bin 0 -> 5345 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_7C.png | Bin 0 -> 6298 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_7D.png | Bin 0 -> 6087 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_7E.png | Bin 0 -> 6601 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_7F.png | Bin 0 -> 6291 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_80.png | Bin 0 -> 6020 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_81.png | Bin 0 -> 6199 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_82.png | Bin 0 -> 5367 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_83.png | Bin 0 -> 5187 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_84.png | Bin 0 -> 5717 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_85.png | Bin 0 -> 6038 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_86.png | Bin 0 -> 6176 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_87.png | Bin 0 -> 6657 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_88.png | Bin 0 -> 6436 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_89.png | Bin 0 -> 6725 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_8A.png | Bin 0 -> 5676 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_8B.png | Bin 0 -> 6352 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_8C.png | Bin 0 -> 6533 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_8D.png | Bin 0 -> 5974 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_8E.png | Bin 0 -> 6502 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_8F.png | Bin 0 -> 5825 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_90.png | Bin 0 -> 5943 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_91.png | Bin 0 -> 6168 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_92.png | Bin 0 -> 6046 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_93.png | Bin 0 -> 6711 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_94.png | Bin 0 -> 6631 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_95.png | Bin 0 -> 5482 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_96.png | Bin 0 -> 5947 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_97.png | Bin 0 -> 5926 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_98.png | Bin 0 -> 6146 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_99.png | Bin 0 -> 6394 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_9A.png | Bin 0 -> 6208 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_9B.png | Bin 0 -> 5985 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_9C.png | Bin 0 -> 6336 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_9D.png | Bin 0 -> 6131 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_9E.png | Bin 0 -> 6534 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_9F.png | Bin 0 -> 4898 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_A0.png | Bin 0 -> 3412 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_A1.png | Bin 0 -> 3702 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_A2.png | Bin 0 -> 3557 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_A3.png | Bin 0 -> 3569 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_A4.png | Bin 0 -> 2689 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_A5.png | Bin 0 -> 3346 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_A6.png | Bin 0 -> 1811 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_A7.png | Bin 0 -> 1639 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_A8.png | Bin 0 -> 2698 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_A9.png | Bin 0 -> 1209 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_AA.png | Bin 0 -> 1463 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_AB.png | Bin 0 -> 319 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_AC.png | Bin 0 -> 1411 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_AD.png | Bin 0 -> 1625 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_AE.png | Bin 0 -> 1472 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_AF.png | Bin 0 -> 1716 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_B0.png | Bin 0 -> 1604 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_B1.png | Bin 0 -> 1514 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_B2.png | Bin 0 -> 1522 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_B3.png | Bin 0 -> 1500 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_B4.png | Bin 0 -> 1583 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_B5.png | Bin 0 -> 1453 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_B6.png | Bin 0 -> 1685 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_B7.png | Bin 0 -> 1522 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_B8.png | Bin 0 -> 1765 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_B9.png | Bin 0 -> 1722 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_BA.png | Bin 0 -> 1603 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_BB.png | Bin 0 -> 1519 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_BC.png | Bin 0 -> 1359 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_BD.png | Bin 0 -> 1567 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_BE.png | Bin 0 -> 1536 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_BF.png | Bin 0 -> 1710 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_C0.png | Bin 0 -> 1768 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_C1.png | Bin 0 -> 1760 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_C2.png | Bin 0 -> 1638 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_C3.png | Bin 0 -> 1548 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_C4.png | Bin 0 -> 1628 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_C5.png | Bin 0 -> 1466 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_C6.png | Bin 0 -> 1647 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_C7.png | Bin 0 -> 1715 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_C8.png | Bin 0 -> 1734 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_C9.png | Bin 0 -> 1724 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_CA.png | Bin 0 -> 1784 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_CB.png | Bin 0 -> 1600 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_CC.png | Bin 0 -> 1585 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_CD.png | Bin 0 -> 1792 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_CE.png | Bin 0 -> 1711 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_CF.png | Bin 0 -> 1701 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_D0.png | Bin 0 -> 1646 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_D1.png | Bin 0 -> 1615 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_D2.png | Bin 0 -> 1535 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_D3.png | Bin 0 -> 1424 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_D4.png | Bin 0 -> 1643 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_D5.png | Bin 0 -> 1641 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_D6.png | Bin 0 -> 1910 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_D7.png | Bin 0 -> 1439 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_F9.png | Bin 0 -> 6766 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_FA.png | Bin 0 -> 5604 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_FB.png | Bin 0 -> 1713 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_FC.png | Bin 0 -> 2445 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_FD.png | Bin 0 -> 2730 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_FE.png | Bin 0 -> 1884 bytes .../Image/Loose/Common/res/1_2_2/font/glyph_FF.png | Bin 0 -> 2822 bytes .../Loose/Common/res/1_2_2/font/glyph_sizes.bin | Bin 0 -> 65536 bytes .../Image/Loose/Common/res/1_2_2/gui/alchemy.png | Bin 0 -> 1682 bytes .../Image/Loose/Common/res/1_2_2/gui/allitems.png | Bin 0 -> 2055 bytes .../Loose/Common/res/1_2_2/gui/background.png | Bin 0 -> 1011 bytes .../Image/Loose/Common/res/1_2_2/gui/container.png | Bin 0 -> 2795 bytes .../Image/Loose/Common/res/1_2_2/gui/crafting.png | Bin 0 -> 2756 bytes .../Loose/Common/res/1_2_2/gui/crash_logo.png | Bin 0 -> 4981 bytes .../Image/Loose/Common/res/1_2_2/gui/enchant.png | Bin 0 -> 3010 bytes .../Image/Loose/Common/res/1_2_2/gui/furnace.png | Bin 0 -> 1520 bytes .../Image/Loose/Common/res/1_2_2/gui/gui.png | Bin 0 -> 17421 bytes .../Image/Loose/Common/res/1_2_2/gui/icons.png | Bin 0 -> 6311 bytes .../Image/Loose/Common/res/1_2_2/gui/inventory.png | Bin 0 -> 7211 bytes .../Image/Loose/Common/res/1_2_2/gui/items.png | Bin 0 -> 29730 bytes .../Image/Loose/Common/res/1_2_2/gui/particles.png | Bin 0 -> 1992 bytes .../Image/Loose/Common/res/1_2_2/gui/slot.png | Bin 0 -> 2699 bytes .../Image/Loose/Common/res/1_2_2/gui/trap.png | Bin 0 -> 2121 bytes .../Loose/Common/res/1_2_2/gui/unknown_pack.png | Bin 0 -> 13013 bytes .../Image/Loose/Common/res/1_2_2/item/arrows.png | Bin 0 -> 322 bytes .../Image/Loose/Common/res/1_2_2/item/boat.png | Bin 0 -> 2389 bytes .../Image/Loose/Common/res/1_2_2/item/book.png | Bin 0 -> 1105 bytes .../Image/Loose/Common/res/1_2_2/item/cart.png | Bin 0 -> 2945 bytes .../Image/Loose/Common/res/1_2_2/item/chest.png | Bin 0 -> 1339 bytes .../Image/Loose/Common/res/1_2_2/item/door.png | Bin 0 -> 1029 bytes .../Loose/Common/res/1_2_2/item/largechest.png | Bin 0 -> 1865 bytes .../Image/Loose/Common/res/1_2_2/item/sign.png | Bin 0 -> 1260 bytes .../Image/Loose/Common/res/1_2_2/item/xporb.png | Bin 0 -> 1096 bytes .../Image/Loose/Common/res/1_2_2/misc/dial.png | Bin 0 -> 231 bytes .../Loose/Common/res/1_2_2/misc/explosion.png | Bin 0 -> 2105 bytes .../Loose/Common/res/1_2_2/misc/foliagecolor.png | Bin 0 -> 17693 bytes .../Loose/Common/res/1_2_2/misc/footprint.png | Bin 0 -> 946 bytes .../Image/Loose/Common/res/1_2_2/misc/glint.png | Bin 0 -> 1042 bytes .../Loose/Common/res/1_2_2/misc/grasscolor.png | Bin 0 -> 25237 bytes .../Image/Loose/Common/res/1_2_2/misc/mapbg.png | Bin 0 -> 1538 bytes .../Image/Loose/Common/res/1_2_2/misc/mapicons.png | Bin 0 -> 1062 bytes .../Loose/Common/res/1_2_2/misc/particlefield.png | Bin 0 -> 12227 bytes .../Loose/Common/res/1_2_2/misc/pumpkinblur.png | Bin 0 -> 42123 bytes .../Image/Loose/Common/res/1_2_2/misc/shadow.png | Bin 0 -> 868 bytes .../Image/Loose/Common/res/1_2_2/misc/tunnel.png | Bin 0 -> 44404 bytes .../Image/Loose/Common/res/1_2_2/misc/vignette.png | Bin 0 -> 24157 bytes .../Image/Loose/Common/res/1_2_2/misc/water.png | Bin 0 -> 306 bytes .../Loose/Common/res/1_2_2/misc/watercolor.png | Bin 0 -> 5446 bytes .../Image/Loose/Common/res/1_2_2/mob/cat_black.png | Bin 0 -> 1399 bytes .../Image/Loose/Common/res/1_2_2/mob/cat_red.png | Bin 0 -> 2043 bytes .../Loose/Common/res/1_2_2/mob/cat_siamese.png | Bin 0 -> 2717 bytes .../Loose/Common/res/1_2_2/mob/cavespider.png | Bin 0 -> 3396 bytes .../Image/Loose/Common/res/1_2_2/mob/char.png | Bin 0 -> 1360 bytes .../Image/Loose/Common/res/1_2_2/mob/chicken.png | Bin 0 -> 492 bytes .../Image/Loose/Common/res/1_2_2/mob/cow.png | Bin 0 -> 1954 bytes .../Image/Loose/Common/res/1_2_2/mob/creeper.png | Bin 0 -> 3000 bytes .../Common/res/1_2_2/mob/enderdragon/beam.png | Bin 0 -> 2116 bytes .../Common/res/1_2_2/mob/enderdragon/body.png | Bin 0 -> 7720 bytes .../Common/res/1_2_2/mob/enderdragon/crystal.png | Bin 0 -> 3321 bytes .../Common/res/1_2_2/mob/enderdragon/dragon.png | Bin 0 -> 10791 bytes .../Common/res/1_2_2/mob/enderdragon/ender.png | Bin 0 -> 7956 bytes .../res/1_2_2/mob/enderdragon/ender_eyes.png | Bin 0 -> 1964 bytes .../Common/res/1_2_2/mob/enderdragon/shuffle.png | Bin 0 -> 50180 bytes .../Image/Loose/Common/res/1_2_2/mob/enderman.png | Bin 0 -> 737 bytes .../Loose/Common/res/1_2_2/mob/enderman_eyes.png | Bin 0 -> 1242 bytes .../Image/Loose/Common/res/1_2_2/mob/fire.png | Bin 0 -> 3328 bytes .../Image/Loose/Common/res/1_2_2/mob/ghast.png | Bin 0 -> 896 bytes .../Loose/Common/res/1_2_2/mob/ghast_fire.png | Bin 0 -> 943 bytes .../Image/Loose/Common/res/1_2_2/mob/lava.png | Bin 0 -> 1457 bytes .../Image/Loose/Common/res/1_2_2/mob/ozelot.png | Bin 0 -> 3121 bytes .../Image/Loose/Common/res/1_2_2/mob/pig.png | Bin 0 -> 3305 bytes .../Image/Loose/Common/res/1_2_2/mob/pigman.png | Bin 0 -> 2662 bytes .../Image/Loose/Common/res/1_2_2/mob/pigzombie.png | Bin 0 -> 3013 bytes .../Image/Loose/Common/res/1_2_2/mob/redcow.png | Bin 0 -> 1605 bytes .../Image/Loose/Common/res/1_2_2/mob/saddle.png | Bin 0 -> 379 bytes .../Image/Loose/Common/res/1_2_2/mob/sheep.png | Bin 0 -> 3119 bytes .../Image/Loose/Common/res/1_2_2/mob/sheep_fur.png | Bin 0 -> 1661 bytes .../Loose/Common/res/1_2_2/mob/silverfish.png | Bin 0 -> 1782 bytes .../Image/Loose/Common/res/1_2_2/mob/skeleton.png | Bin 0 -> 894 bytes .../Image/Loose/Common/res/1_2_2/mob/slime.png | Bin 0 -> 633 bytes .../Image/Loose/Common/res/1_2_2/mob/snowman.png | Bin 0 -> 1799 bytes .../Image/Loose/Common/res/1_2_2/mob/spider.png | Bin 0 -> 2554 bytes .../Loose/Common/res/1_2_2/mob/spider_eyes.png | Bin 0 -> 255 bytes .../Image/Loose/Common/res/1_2_2/mob/squid.png | Bin 0 -> 918 bytes .../Image/Loose/Common/res/1_2_2/mob/villager.png | Bin 0 -> 2092 bytes .../Common/res/1_2_2/mob/villager/butcher.png | Bin 0 -> 1877 bytes .../Loose/Common/res/1_2_2/mob/villager/farmer.png | Bin 0 -> 1971 bytes .../Common/res/1_2_2/mob/villager/librarian.png | Bin 0 -> 2093 bytes .../Loose/Common/res/1_2_2/mob/villager/priest.png | Bin 0 -> 2093 bytes .../Loose/Common/res/1_2_2/mob/villager/smith.png | Bin 0 -> 1877 bytes .../Common/res/1_2_2/mob/villager/villager.png | Bin 0 -> 2093 bytes .../Loose/Common/res/1_2_2/mob/villager_golem.png | Bin 0 -> 7871 bytes .../Image/Loose/Common/res/1_2_2/mob/wolf.png | Bin 0 -> 4365 bytes .../Loose/Common/res/1_2_2/mob/wolf_angry.png | Bin 0 -> 3223 bytes .../Image/Loose/Common/res/1_2_2/mob/wolf_tame.png | Bin 0 -> 4391 bytes .../Image/Loose/Common/res/1_2_2/mob/zombie.png | Bin 0 -> 1847 bytes .../Layout/Image/Loose/Common/res/1_2_2/pack.png | Bin 0 -> 27267 bytes .../Layout/Image/Loose/Common/res/1_2_2/pack.txt | 2 + .../Image/Loose/Common/res/1_2_2/particles.png | Bin 0 -> 1913 bytes .../Image/Loose/Common/res/1_2_2/terrain.png | Bin 0 -> 86269 bytes .../Image/Loose/Common/res/1_2_2/terrain/moon.png | Bin 0 -> 910 bytes .../Loose/Common/res/1_2_2/terrain/moon_phases.png | Bin 0 -> 1569 bytes .../Image/Loose/Common/res/1_2_2/terrain/sun.png | Bin 0 -> 713 bytes .../Loose/Common/res/1_2_2/title/bg/panorama0.png | Bin 0 -> 64756 bytes .../Loose/Common/res/1_2_2/title/bg/panorama1.png | Bin 0 -> 67021 bytes .../Loose/Common/res/1_2_2/title/bg/panorama2.png | Bin 0 -> 49292 bytes .../Loose/Common/res/1_2_2/title/bg/panorama3.png | Bin 0 -> 71279 bytes .../Loose/Common/res/1_2_2/title/bg/panorama4.png | Bin 0 -> 2514 bytes .../Loose/Common/res/1_2_2/title/bg/panorama5.png | Bin 0 -> 52916 bytes .../Image/Loose/Common/res/1_2_2/title/black.png | Bin 0 -> 174 bytes .../Image/Loose/Common/res/1_2_2/title/credits.txt | 57 + .../Loose/Common/res/1_2_2/title/earlyplayers.txt | 722 ++ .../Image/Loose/Common/res/1_2_2/title/mclogo.png | Bin 0 -> 5213 bytes .../Image/Loose/Common/res/1_2_2/title/mojang.png | Bin 0 -> 7706 bytes .../Loose/Common/res/1_2_2/title/splashes.txt | 304 + .../Image/Loose/Common/res/1_2_2/title/win.txt | 151 + .../res/TitleUpdate/DLC/Candy/Data/TexturePack.xzp | Bin 0 -> 3590769 bytes .../res/TitleUpdate/DLC/Candy/Data/x16Data.pck | Bin 0 -> 869992 bytes .../res/TitleUpdate/DLC/City/Data/TexturePack.xzp | Bin 0 -> 4060458 bytes .../res/TitleUpdate/DLC/City/Data/x32Data.pck | Bin 0 -> 2636993 bytes .../TitleUpdate/DLC/Fantasy/Data/TexturePack.xzp | Bin 0 -> 4777159 bytes .../res/TitleUpdate/DLC/Fantasy/Data/x32Data.pck | Bin 0 -> 2527182 bytes .../TitleUpdate/DLC/Halloween/Data/TexturePack.xzp | Bin 0 -> 3705530 bytes .../res/TitleUpdate/DLC/Halloween/Data/x16Data.pck | Bin 0 -> 786598 bytes .../res/TitleUpdate/DLC/Halo/Data/GameRules.grf | Bin 0 -> 503 bytes .../res/TitleUpdate/DLC/Halo/Data/TexturePack.xzp | Bin 0 -> 4123875 bytes .../res/TitleUpdate/DLC/Halo/Data/x16Data.pck | Bin 0 -> 967988 bytes .../res/TitleUpdate/DLC/Halo/TexturePack.pck | Bin 0 -> 217553 bytes .../TitleUpdate/DLC/MassEffect/Data/GameRules.grf | Bin 0 -> 343 bytes .../DLC/MassEffect/Data/TexturePack.xzp | Bin 0 -> 3022739 bytes .../TitleUpdate/DLC/MassEffect/Data/masseffect.mcs | Bin 0 -> 3485486 bytes .../TitleUpdate/DLC/MassEffect/Data/x16Data.pck | Bin 0 -> 733891 bytes .../res/TitleUpdate/DLC/MassEffect/TexturePack.pck | Bin 0 -> 176514 bytes .../TitleUpdate/DLC/Natural/Data/TexturePack.xzp | Bin 0 -> 4166364 bytes .../res/TitleUpdate/DLC/Natural/Data/x32Data.pck | Bin 0 -> 2894225 bytes .../TitleUpdate/DLC/Plastic/Data/TexturePack.xzp | Bin 0 -> 2607406 bytes .../res/TitleUpdate/DLC/Plastic/Data/x16Data.pck | Bin 0 -> 567845 bytes .../res/TitleUpdate/DLC/Skyrim/Data/GameRules.grf | Bin 0 -> 505 bytes .../TitleUpdate/DLC/Skyrim/Data/TexturePack.xzp | Bin 0 -> 3413075 bytes .../res/TitleUpdate/DLC/Skyrim/Data/x16Data.pck | Bin 0 -> 996979 bytes .../res/TitleUpdate/DLC/Skyrim/TexturePack.pck | Bin 0 -> 181667 bytes .../TitleUpdate/GameRules/BuildOnly/BuildAll.cmd | 10 + .../GameRules/BuildOnly/BuildGameRule.cmd | 19 + .../GameRules/BuildOnly/BuildGameRule_Durango.cmd | 28 + .../GameRules/BuildOnly/BuildGameRule_Orbis.cmd | 28 + .../GameRules/BuildOnly/BuildGameRule_PS3.cmd | 28 + .../GameRules/BuildOnly/BuildGameRule_PSVita.cmd | 28 + .../BuildOnly/BuildGameRule_Windows64.cmd | 28 + .../GameRules/BuildOnly/BuildGameRule_Xbox.cmd | 28 + .../TitleUpdate/GameRules/BuildOnly/GameRules.sln | 30 + .../GameRules/BuildOnly/GameRules.vcxproj | 103 + .../GameRules/BuildOnly/GameRules.vcxproj.filters | 114 + .../GameRules/BuildOnly/GameRules.vcxproj.vspscc | 10 + .../GameRules/BuildOnly/GameRulesDefinition.xsd | 2848 +++++++ .../GameRules/BuildOnly/Tutorial/GameRules.grf | Bin 0 -> 97468 bytes .../GameRules/BuildOnly/Tutorial/GameRules.grh | Bin 0 -> 267 bytes .../GameRules/BuildOnly/Tutorial/GameRules.xml | Bin 0 -> 45442 bytes .../Tutorial/Strings/Microsoft/de-DE.lang | 4 + .../Tutorial/Strings/Microsoft/es-ES.lang | 5 + .../Tutorial/Strings/Microsoft/fr-FR.lang | 4 + .../Tutorial/Strings/Microsoft/it-IT.lang | 4 + .../Tutorial/Strings/Microsoft/ja-JP.lang | 4 + .../Tutorial/Strings/Microsoft/ko-KR.lang | 4 + .../Tutorial/Strings/Microsoft/pt-BR.lang | 4 + .../Tutorial/Strings/Microsoft/pt-PT.lang | 4 + .../Tutorial/Strings/Microsoft/zh-CHT.lang | 4 + .../BuildOnly/Tutorial/Strings/en-EN.lang | 5 + .../Tutorial/Strings_Durango/Microsoft/de-DE.lang | 4 + .../Tutorial/Strings_Durango/Microsoft/es-ES.lang | 5 + .../Tutorial/Strings_Durango/Microsoft/fr-FR.lang | 4 + .../Tutorial/Strings_Durango/Microsoft/it-IT.lang | 4 + .../Tutorial/Strings_Durango/Microsoft/ja-JP.lang | 4 + .../Tutorial/Strings_Durango/Microsoft/ko-KR.lang | 4 + .../Tutorial/Strings_Durango/Microsoft/pt-BR.lang | 4 + .../Tutorial/Strings_Durango/Microsoft/pt-PT.lang | 4 + .../Tutorial/Strings_Durango/Microsoft/zh-CHT.lang | 4 + .../BuildOnly/Tutorial/Strings_Durango/en-EN.lang | 5 + .../Tutorial/Strings_Orbis/Sony/da-DA.lang | 6 + .../Tutorial/Strings_Orbis/Sony/de-DE.lang | 4 + .../Tutorial/Strings_Orbis/Sony/es-ES.lang | 5 + .../Tutorial/Strings_Orbis/Sony/fi-FI.lang | 6 + .../Tutorial/Strings_Orbis/Sony/fr-FR.lang | 4 + .../Tutorial/Strings_Orbis/Sony/it-IT.lang | 4 + .../Tutorial/Strings_Orbis/Sony/ja-JP.lang | 4 + .../Tutorial/Strings_Orbis/Sony/ko-KR.lang | 4 + .../Tutorial/Strings_Orbis/Sony/la-LAS.lang | 6 + .../Tutorial/Strings_Orbis/Sony/nl-NL.lang | 6 + .../Tutorial/Strings_Orbis/Sony/no-NO.lang | 6 + .../Tutorial/Strings_Orbis/Sony/pl-PL.lang | 6 + .../Tutorial/Strings_Orbis/Sony/pt-BR.lang | 4 + .../Tutorial/Strings_Orbis/Sony/pt-PT.lang | 4 + .../Tutorial/Strings_Orbis/Sony/ru-RU.lang | 5 + .../Tutorial/Strings_Orbis/Sony/sv-SV.lang | 6 + .../Tutorial/Strings_Orbis/Sony/tr-TR.lang | 6 + .../Tutorial/Strings_Orbis/Sony/zh-CHT.lang | 4 + .../BuildOnly/Tutorial/Strings_Orbis/en-EN.lang | 5 + .../BuildOnly/Tutorial/Strings_PS3/Sony/da-DA.lang | 6 + .../BuildOnly/Tutorial/Strings_PS3/Sony/de-DE.lang | 4 + .../BuildOnly/Tutorial/Strings_PS3/Sony/es-ES.lang | 5 + .../BuildOnly/Tutorial/Strings_PS3/Sony/fi-FI.lang | 6 + .../BuildOnly/Tutorial/Strings_PS3/Sony/fr-FR.lang | 4 + .../BuildOnly/Tutorial/Strings_PS3/Sony/it-IT.lang | 4 + .../BuildOnly/Tutorial/Strings_PS3/Sony/ja-JP.lang | 4 + .../BuildOnly/Tutorial/Strings_PS3/Sony/ko-KR.lang | 4 + .../Tutorial/Strings_PS3/Sony/la-LAS.lang | 6 + .../BuildOnly/Tutorial/Strings_PS3/Sony/nl-NL.lang | 6 + .../BuildOnly/Tutorial/Strings_PS3/Sony/no-NO.lang | 6 + .../BuildOnly/Tutorial/Strings_PS3/Sony/pl-PL.lang | 6 + .../BuildOnly/Tutorial/Strings_PS3/Sony/pt-BR.lang | 4 + .../BuildOnly/Tutorial/Strings_PS3/Sony/pt-PT.lang | 4 + .../BuildOnly/Tutorial/Strings_PS3/Sony/ru-RU.lang | 5 + .../BuildOnly/Tutorial/Strings_PS3/Sony/sv-SV.lang | 6 + .../BuildOnly/Tutorial/Strings_PS3/Sony/tr-TR.lang | 6 + .../Tutorial/Strings_PS3/Sony/zh-CHT.lang | 4 + .../BuildOnly/Tutorial/Strings_PS3/en-EN.lang | 5 + .../Tutorial/Strings_PSVita/Sony/da-DA.lang | 6 + .../Tutorial/Strings_PSVita/Sony/de-DE.lang | 4 + .../Tutorial/Strings_PSVita/Sony/es-ES.lang | 5 + .../Tutorial/Strings_PSVita/Sony/fi-FI.lang | 6 + .../Tutorial/Strings_PSVita/Sony/fr-FR.lang | 4 + .../Tutorial/Strings_PSVita/Sony/it-IT.lang | 4 + .../Tutorial/Strings_PSVita/Sony/ja-JP.lang | 4 + .../Tutorial/Strings_PSVita/Sony/ko-KR.lang | 4 + .../Tutorial/Strings_PSVita/Sony/la-LAS.lang | 6 + .../Tutorial/Strings_PSVita/Sony/nl-NL.lang | 6 + .../Tutorial/Strings_PSVita/Sony/no-NO.lang | 6 + .../Tutorial/Strings_PSVita/Sony/pl-PL.lang | 6 + .../Tutorial/Strings_PSVita/Sony/pt-BR.lang | 4 + .../Tutorial/Strings_PSVita/Sony/pt-PT.lang | 4 + .../Tutorial/Strings_PSVita/Sony/ru-RU.lang | 5 + .../Tutorial/Strings_PSVita/Sony/sv-SV.lang | 6 + .../Tutorial/Strings_PSVita/Sony/tr-TR.lang | 6 + .../Tutorial/Strings_PSVita/Sony/zh-CHT.lang | 4 + .../BuildOnly/Tutorial/Strings_PSVita/en-EN.lang | 5 + .../Tutorial/Strings_Win64/Microsoft/de-DE.lang | 4 + .../Tutorial/Strings_Win64/Microsoft/es-ES.lang | 5 + .../Tutorial/Strings_Win64/Microsoft/fr-FR.lang | 4 + .../Tutorial/Strings_Win64/Microsoft/it-IT.lang | 4 + .../Tutorial/Strings_Win64/Microsoft/ja-JP.lang | 4 + .../Tutorial/Strings_Win64/Microsoft/ko-KR.lang | 4 + .../Tutorial/Strings_Win64/Microsoft/pt-BR.lang | 4 + .../Tutorial/Strings_Win64/Microsoft/pt-PT.lang | 4 + .../Tutorial/Strings_Win64/Microsoft/zh-CHT.lang | 4 + .../BuildOnly/Tutorial/Strings_Win64/en-EN.lang | 5 + .../Tutorial/Strings_Xbox360/Microsoft/de-DE.lang | 4 + .../Tutorial/Strings_Xbox360/Microsoft/es-ES.lang | 5 + .../Tutorial/Strings_Xbox360/Microsoft/fr-FR.lang | 4 + .../Tutorial/Strings_Xbox360/Microsoft/it-IT.lang | 4 + .../Tutorial/Strings_Xbox360/Microsoft/ja-JP.lang | 4 + .../Tutorial/Strings_Xbox360/Microsoft/ko-KR.lang | 4 + .../Tutorial/Strings_Xbox360/Microsoft/pt-BR.lang | 4 + .../Tutorial/Strings_Xbox360/Microsoft/pt-PT.lang | 4 + .../Tutorial/Strings_Xbox360/Microsoft/zh-CHT.lang | 4 + .../BuildOnly/Tutorial/Strings_Xbox360/en-EN.lang | 5 + .../GameRules/BuildOnly/Tutorial/Tutorial.pck | Bin 0 -> 99710 bytes .../GameRules/BuildOnly/Tutorial/Tutorial.xml | Bin 0 -> 1304 bytes .../GameRules/BuildOnly/Tutorial/languages.loc | Bin 0 -> 2138 bytes .../BuildOnly/Tutorial/schematics/Boat.sch | Bin 0 -> 2099 bytes .../BuildOnly/Tutorial/schematics/CasTes1.sch | Bin 0 -> 37085 bytes .../BuildOnly/Tutorial/schematics/CasTes2.sch | Bin 0 -> 49504 bytes .../BuildOnly/Tutorial/schematics/JungleTemp.sch | Bin 0 -> 1836 bytes .../BuildOnly/Tutorial/schematics/Lava.sch | Bin 0 -> 732 bytes .../Tutorial/schematics/MinecraftSign.sch | Bin 0 -> 711 bytes .../BuildOnly/Tutorial/schematics/Mushroom.sch | Bin 0 -> 1272 bytes .../BuildOnly/Tutorial/schematics/PillarHouse.sch | Bin 0 -> 1831 bytes .../BuildOnly/Tutorial/schematics/Pyramid.sch | Bin 0 -> 2327 bytes .../BuildOnly/Tutorial/schematics/RuinedHouse.sch | Bin 0 -> 1391 bytes .../BuildOnly/Tutorial/schematics/Ship.sch | Bin 0 -> 784 bytes .../BuildOnly/Tutorial/schematics/Smithy.sch | Bin 0 -> 571 bytes .../BuildOnly/Tutorial/schematics/SnowHouse.sch | Bin 0 -> 603 bytes .../BuildOnly/Tutorial/schematics/Spider.sch | Bin 0 -> 946 bytes .../BuildOnly/Tutorial/schematics/Stairs.sch | Bin 0 -> 246 bytes .../BuildOnly/Tutorial/schematics/StoneCircle.sch | Bin 0 -> 738 bytes .../BuildOnly/Tutorial/schematics/StoneTemp.sch | Bin 0 -> 2857 bytes .../BuildOnly/Tutorial/schematics/Tower.sch | Bin 0 -> 832 bytes .../BuildOnly/Tutorial/schematics/UWChamber.sch | Bin 0 -> 659 bytes .../TitleUpdate/GameRules/BuildOnly/launchCMD.cmd | 1 + .../Common/res/TitleUpdate/GameRules/Tutorial.pck | Bin 0 -> 90648 bytes .../res/TitleUpdate/GameRules/Tutorial_Durango.pck | Bin 0 -> 98687 bytes .../res/TitleUpdate/GameRules/Tutorial_Orbis.pck | Bin 0 -> 99710 bytes .../res/TitleUpdate/audio/AdditionalMusic.xwb | Bin 0 -> 30693376 bytes .../Common/res/TitleUpdate/audio/Minecraft.xgs | Bin 0 -> 488 bytes .../Common/res/TitleUpdate/audio/additional.xsb | Bin 0 -> 3047 bytes .../Common/res/TitleUpdate/audio/additional.xwb | Bin 0 -> 1226752 bytes .../Common/res/TitleUpdate/audio/minecraft.xsb | Bin 0 -> 9468 bytes .../Common/res/TitleUpdate/res/armor/cloth_1.png | Bin 0 -> 1712 bytes .../Common/res/TitleUpdate/res/armor/cloth_1_b.png | Bin 0 -> 1688 bytes .../Common/res/TitleUpdate/res/armor/cloth_2.png | Bin 0 -> 868 bytes .../Common/res/TitleUpdate/res/armor/cloth_2_b.png | Bin 0 -> 835 bytes .../Common/res/TitleUpdate/res/armor/power.png | Bin 0 -> 1800 bytes .../Loose/Common/res/TitleUpdate/res/art/kz.png | Bin 0 -> 80612 bytes .../Loose/Common/res/TitleUpdate/res/colours.col | Bin 0 -> 5258 bytes .../Loose/Common/res/TitleUpdate/res/colours.xml | 283 + .../Common/res/TitleUpdate/res/font/Default.png | Bin 0 -> 4343 bytes .../res/TitleUpdate/res/font/Mojangles_11.png | Bin 0 -> 7024 bytes .../res/TitleUpdate/res/font/Mojangles_7.png | Bin 0 -> 5322 bytes .../Loose/Common/res/TitleUpdate/res/item/book.png | Bin 0 -> 571 bytes .../Common/res/TitleUpdate/res/item/enderchest.png | Bin 0 -> 2526 bytes .../Loose/Common/res/TitleUpdate/res/items.png | Bin 0 -> 121590 bytes .../TitleUpdate/res/misc/additionalmapicons.png | Bin 0 -> 352 bytes .../Common/res/TitleUpdate/res/misc/explosion.png | Bin 0 -> 1614 bytes .../Common/res/TitleUpdate/res/misc/footprint.png | Bin 0 -> 151 bytes .../Common/res/TitleUpdate/res/misc/glint.png | Bin 0 -> 418 bytes .../Common/res/TitleUpdate/res/misc/mapicons.png | Bin 0 -> 723 bytes .../res/TitleUpdate/res/misc/particlefield.png | Bin 0 -> 23124 bytes .../Common/res/TitleUpdate/res/misc/tunnel.png | Bin 0 -> 43306 bytes .../res/TitleUpdate/res/mob/enderdragon/beam.png | Bin 0 -> 3542 bytes .../res/TitleUpdate/res/mob/enderdragon/ender.png | Bin 0 -> 10990 bytes .../TitleUpdate/res/mob/enderdragon/ender_eyes.png | Bin 0 -> 541 bytes .../res/TitleUpdate/res/mob/enderman_eyes.png | Bin 0 -> 213 bytes .../Common/res/TitleUpdate/res/mob/redcow.png | Bin 0 -> 1956 bytes .../res/TitleUpdate/res/mob/skeleton_wither.png | Bin 0 -> 1403 bytes .../Common/res/TitleUpdate/res/mob/snowman.png | Bin 0 -> 1081 bytes .../res/TitleUpdate/res/mob/villager/butcher.png | Bin 0 -> 1390 bytes .../res/TitleUpdate/res/mob/villager/farmer.png | Bin 0 -> 1655 bytes .../res/TitleUpdate/res/mob/villager/librarian.png | Bin 0 -> 1935 bytes .../res/TitleUpdate/res/mob/villager/priest.png | Bin 0 -> 1933 bytes .../res/TitleUpdate/res/mob/villager/smith.png | Bin 0 -> 1383 bytes .../res/TitleUpdate/res/mob/villager/villager.png | Bin 0 -> 1947 bytes .../Common/res/TitleUpdate/res/mob/wolf_collar.png | Bin 0 -> 4327 bytes .../Common/res/TitleUpdate/res/mob/wolf_tame.png | Bin 0 -> 4379 bytes .../Common/res/TitleUpdate/res/mob/zombie.png | Bin 0 -> 1618 bytes .../res/TitleUpdate/res/mob/zombie_villager.png | Bin 0 -> 2409 bytes .../Loose/Common/res/TitleUpdate/res/particles.png | Bin 0 -> 3645 bytes .../Loose/Common/res/TitleUpdate/res/terrain.png | Bin 0 -> 122236 bytes .../res/TitleUpdate/res/terrainMipMapLevel2.png | Bin 0 -> 30830 bytes .../res/TitleUpdate/res/terrainMipMapLevel3.png | Bin 0 -> 10551 bytes .../res/TitleUpdate/res/textures/blocks/fire_0.png | Bin 0 -> 16576 bytes .../res/TitleUpdate/res/textures/blocks/fire_0.txt | 16 + .../res/TitleUpdate/res/textures/blocks/fire_1.png | Bin 0 -> 16723 bytes .../res/TitleUpdate/res/textures/blocks/fire_1.txt | 1 + .../res/TitleUpdate/res/textures/blocks/lava.png | Bin 0 -> 10420 bytes .../res/TitleUpdate/res/textures/blocks/lava.txt | 38 + .../TitleUpdate/res/textures/blocks/lava_flow.png | Bin 0 -> 9931 bytes .../TitleUpdate/res/textures/blocks/lava_flow.txt | 16 + .../res/TitleUpdate/res/textures/blocks/portal.png | Bin 0 -> 14166 bytes .../res/TitleUpdate/res/textures/blocks/portal.txt | 1 + .../res/TitleUpdate/res/textures/blocks/water.png | Bin 0 -> 14567 bytes .../res/TitleUpdate/res/textures/blocks/water.txt | 32 + .../TitleUpdate/res/textures/blocks/water_flow.png | Bin 0 -> 10198 bytes .../TitleUpdate/res/textures/blocks/water_flow.txt | 1 + .../res/TitleUpdate/res/textures/items/clock.png | Bin 0 -> 3217 bytes .../res/TitleUpdate/res/textures/items/clock.txt | 1 + .../res/TitleUpdate/res/textures/items/compass.png | Bin 0 -> 1205 bytes .../res/TitleUpdate/res/textures/items/compass.txt | 1 + .../Loose/Common/res/TitleUpdate/tutorialDiff | Bin 0 -> 89396 bytes .../Image/Loose/Common/res/achievement/bg.png | Bin 0 -> 3636 bytes .../Image/Loose/Common/res/achievement/icons.png | Bin 0 -> 1489 bytes .../Image/Loose/Common/res/armor/chain_1.png | Bin 0 -> 964 bytes .../Image/Loose/Common/res/armor/chain_2.png | Bin 0 -> 523 bytes .../Image/Loose/Common/res/armor/cloth_1.png | Bin 0 -> 1139 bytes .../Image/Loose/Common/res/armor/cloth_2.png | Bin 0 -> 710 bytes .../Image/Loose/Common/res/armor/diamond_1.png | Bin 0 -> 1218 bytes .../Image/Loose/Common/res/armor/diamond_2.png | Bin 0 -> 724 bytes .../Layout/Image/Loose/Common/res/armor/gold_1.png | Bin 0 -> 1198 bytes .../Layout/Image/Loose/Common/res/armor/gold_2.png | Bin 0 -> 708 bytes .../Layout/Image/Loose/Common/res/armor/iron_1.png | Bin 0 -> 1133 bytes .../Layout/Image/Loose/Common/res/armor/iron_2.png | Bin 0 -> 686 bytes .../Layout/Image/Loose/Common/res/armor/power.png | Bin 0 -> 1800 bytes .../Layout/Image/Loose/Common/res/art/kz.png | Bin 0 -> 78021 bytes .../Image/Loose/Common/res/audio/Minecraft.xgs | Bin 0 -> 488 bytes .../Image/Loose/Common/res/audio/minecraft.xsb | Bin 0 -> 9088 bytes .../Image/Loose/Common/res/audio/resident.xwb | Bin 0 -> 7647232 bytes .../Image/Loose/Common/res/audio/streamed.xwb | Bin 0 -> 60653568 bytes .../Image/Loose/Common/res/environment/clouds.png | Bin 0 -> 13711 bytes .../Image/Loose/Common/res/environment/rain.png | Bin 0 -> 2540 bytes .../Image/Loose/Common/res/environment/snow.png | Bin 0 -> 818 bytes .../Image/Loose/Common/res/font/Mojangles_11.png | Bin 0 -> 4078 bytes .../Image/Loose/Common/res/font/Mojangles_7.png | Bin 0 -> 3018 bytes .../Layout/Image/Loose/Common/res/font/default.png | Bin 0 -> 2817 bytes .../Image/Loose/Common/res/gui/background.png | Bin 0 -> 1011 bytes .../Image/Loose/Common/res/gui/container.png | Bin 0 -> 2795 bytes .../Layout/Image/Loose/Common/res/gui/crafting.png | Bin 0 -> 2756 bytes .../Layout/Image/Loose/Common/res/gui/furnace.png | Bin 0 -> 3153 bytes .../Layout/Image/Loose/Common/res/gui/gui.png | Bin 0 -> 14210 bytes .../Layout/Image/Loose/Common/res/gui/icons.png | Bin 0 -> 2423 bytes .../Image/Loose/Common/res/gui/inventory.png | Bin 0 -> 2761 bytes .../Layout/Image/Loose/Common/res/gui/items.png | Bin 0 -> 21381 bytes .../Layout/Image/Loose/Common/res/gui/logo.png | Bin 0 -> 12925 bytes .../Image/Loose/Common/res/gui/particles.png | Bin 0 -> 1992 bytes .../Layout/Image/Loose/Common/res/gui/slot.png | Bin 0 -> 1829 bytes .../Layout/Image/Loose/Common/res/gui/trap.png | Bin 0 -> 2121 bytes .../Image/Loose/Common/res/gui/unknown_pack.png | Bin 0 -> 13013 bytes .../Layout/Image/Loose/Common/res/item/arrows.png | Bin 0 -> 322 bytes .../Layout/Image/Loose/Common/res/item/boat.png | Bin 0 -> 2389 bytes .../Layout/Image/Loose/Common/res/item/cart.png | Bin 0 -> 2254 bytes .../Layout/Image/Loose/Common/res/item/door.png | Bin 0 -> 1029 bytes .../Layout/Image/Loose/Common/res/item/sign.png | Bin 0 -> 1260 bytes .../Layout/Image/Loose/Common/res/misc/dial.png | Bin 0 -> 231 bytes .../Image/Loose/Common/res/misc/foliagecolor.png | Bin 0 -> 17693 bytes .../Image/Loose/Common/res/misc/footprint.png | Bin 0 -> 946 bytes .../Image/Loose/Common/res/misc/grasscolor.png | Bin 0 -> 25237 bytes .../Layout/Image/Loose/Common/res/misc/mapbg.png | Bin 0 -> 597 bytes .../Image/Loose/Common/res/misc/mapicons.png | Bin 0 -> 3170 bytes .../Image/Loose/Common/res/misc/pumpkinblur.png | Bin 0 -> 42123 bytes .../Layout/Image/Loose/Common/res/misc/shadow.png | Bin 0 -> 868 bytes .../Image/Loose/Common/res/misc/vignette.png | Bin 0 -> 24157 bytes .../Layout/Image/Loose/Common/res/misc/water.png | Bin 0 -> 306 bytes .../Image/Loose/Common/res/misc/watercolor.png | Bin 0 -> 3474 bytes .../Layout/Image/Loose/Common/res/mob/char.png | Bin 0 -> 1360 bytes .../Layout/Image/Loose/Common/res/mob/char1.png | Bin 0 -> 1755 bytes .../Layout/Image/Loose/Common/res/mob/char2.png | Bin 0 -> 4339 bytes .../Layout/Image/Loose/Common/res/mob/char3.png | Bin 0 -> 4234 bytes .../Layout/Image/Loose/Common/res/mob/char4.png | Bin 0 -> 4647 bytes .../Layout/Image/Loose/Common/res/mob/char5.png | Bin 0 -> 4251 bytes .../Layout/Image/Loose/Common/res/mob/char6.png | Bin 0 -> 4541 bytes .../Layout/Image/Loose/Common/res/mob/char7.png | Bin 0 -> 2347 bytes .../Layout/Image/Loose/Common/res/mob/chicken.png | Bin 0 -> 492 bytes .../Layout/Image/Loose/Common/res/mob/cow.png | Bin 0 -> 1338 bytes .../Layout/Image/Loose/Common/res/mob/creeper.png | Bin 0 -> 3000 bytes .../Layout/Image/Loose/Common/res/mob/ghast.png | Bin 0 -> 896 bytes .../Image/Loose/Common/res/mob/ghast_fire.png | Bin 0 -> 943 bytes .../Layout/Image/Loose/Common/res/mob/pig.png | Bin 0 -> 3791 bytes .../Layout/Image/Loose/Common/res/mob/pigman.png | Bin 0 -> 2662 bytes .../Image/Loose/Common/res/mob/pigzombie.png | Bin 0 -> 3013 bytes .../Layout/Image/Loose/Common/res/mob/saddle.png | Bin 0 -> 379 bytes .../Layout/Image/Loose/Common/res/mob/sheep.png | Bin 0 -> 2434 bytes .../Image/Loose/Common/res/mob/sheep_fur.png | Bin 0 -> 1661 bytes .../Layout/Image/Loose/Common/res/mob/skeleton.png | Bin 0 -> 894 bytes .../Layout/Image/Loose/Common/res/mob/slime.png | Bin 0 -> 633 bytes .../Layout/Image/Loose/Common/res/mob/spider.png | Bin 0 -> 2554 bytes .../Image/Loose/Common/res/mob/spider_eyes.png | Bin 0 -> 255 bytes .../Layout/Image/Loose/Common/res/mob/squid.png | Bin 0 -> 918 bytes .../Layout/Image/Loose/Common/res/mob/wolf.png | Bin 0 -> 4352 bytes .../Image/Loose/Common/res/mob/wolf_angry.png | Bin 0 -> 3223 bytes .../Image/Loose/Common/res/mob/wolf_tame.png | Bin 0 -> 4367 bytes .../Layout/Image/Loose/Common/res/mob/zombie.png | Bin 0 -> 1343 bytes .../Durango/Layout/Image/Loose/Common/res/pack.png | Bin 0 -> 27267 bytes .../Layout/Image/Loose/Common/res/particles.png | Bin 0 -> 844 bytes .../Layout/Image/Loose/Common/res/terrain.png | Bin 0 -> 65050 bytes .../Layout/Image/Loose/Common/res/terrain/moon.png | Bin 0 -> 910 bytes .../Layout/Image/Loose/Common/res/terrain/sun.png | Bin 0 -> 799 bytes .../Layout/Image/Loose/Common/res/title/black.png | Bin 0 -> 174 bytes .../Layout/Image/Loose/Common/res/title/mclogo.png | Bin 0 -> 5410 bytes .../Layout/Image/Loose/Common/res/title/mojang.png | Bin 0 -> 1905 bytes .../DLC/Battle And Beasts 2/BattleAndBeasts2.pck | Bin 0 -> 66877 bytes .../DLC/Battle And Beasts/BattleAndBeasts.pck | Bin 0 -> 59732 bytes .../Loose/DLC/Candy Texture Pack/Data/media.arc | Bin 0 -> 14520184 bytes .../Loose/DLC/Candy Texture Pack/Data/x16Data.pck | Bin 0 -> 869992 bytes .../Loose/DLC/Candy Texture Pack/TexturePack.pck | Bin 0 -> 120537 bytes .../Loose/DLC/Cartoon Texture Pack/Data/media.arc | Bin 0 -> 9446383 bytes .../DLC/Cartoon Texture Pack/Data/x32Data.pck | Bin 0 -> 1248634 bytes .../Loose/DLC/Cartoon Texture Pack/TexturePack.pck | Bin 0 -> 103803 bytes .../Loose/DLC/City Texture Pack/Data/media.arc | Bin 0 -> 11744500 bytes .../Loose/DLC/City Texture Pack/Data/x32Data.pck | Bin 0 -> 2636954 bytes .../Loose/DLC/City Texture Pack/TexturePack.pck | Bin 0 -> 134127 bytes .../Doctor Who Skins Volume I/SkinPackDrWho.pck | Bin 0 -> 170705 bytes .../Loose/DLC/Fantasy Texture Pack/Data/media.arc | Bin 0 -> 11803365 bytes .../DLC/Fantasy Texture Pack/Data/x32Data.pck | Bin 0 -> 2529576 bytes .../Loose/DLC/Fantasy Texture Pack/TexturePack.pck | Bin 0 -> 144457 bytes .../Loose/DLC/Festive Skin Pack/SkinsFestive.pck | Bin 0 -> 233036 bytes .../DLC/Halloween Texture Pack/Data/media.arc | Bin 0 -> 7783553 bytes .../DLC/Halloween Texture Pack/Data/x16Data.pck | Bin 0 -> 786598 bytes .../DLC/Halloween Texture Pack/TexturePack.pck | Bin 0 -> 101644 bytes .../Loose/DLC/Halo/Data/Action Figure Hands.binka | Bin 0 -> 2031650 bytes .../Loose/DLC/Halo/Data/An End of Dying.binka | Bin 0 -> 2883778 bytes .../Image/Loose/DLC/Halo/Data/Cairo Suite 2.binka | Bin 0 -> 2737338 bytes .../Loose/DLC/Halo/Data/Cloaked in Blackness.binka | Bin 0 -> 4414104 bytes .../Loose/DLC/Halo/Data/Delta Halo Suite.binka | Bin 0 -> 4662490 bytes .../Image/Loose/DLC/Halo/Data/Dewy Decimate.binka | Bin 0 -> 4510584 bytes .../Image/Loose/DLC/Halo/Data/Earth City.binka | Bin 0 -> 3189298 bytes .../Image/Loose/DLC/Halo/Data/Finale 1.binka | Bin 0 -> 1311164 bytes .../DLC/Halo/Data/Fingerprints Are Broken.binka | Bin 0 -> 2423084 bytes .../Image/Loose/DLC/Halo/Data/First Step.binka | Bin 0 -> 2532442 bytes .../Loose/DLC/Halo/Data/Flip and Sizzle.binka | Bin 0 -> 2356444 bytes .../Layout/Image/Loose/DLC/Halo/Data/Flollo.binka | Bin 0 -> 1769340 bytes .../Layout/Image/Loose/DLC/Halo/Data/GameRules.grf | Bin 0 -> 459 bytes .../Image/Loose/DLC/Halo/Data/HALO M02.binka | Bin 0 -> 790700 bytes .../Loose/DLC/Halo/Data/High Charity Suite 1.binka | Bin 0 -> 1609158 bytes .../Data/Insignificantia (All Sloppy-No Joe).binka | Bin 0 -> 3170960 bytes .../Image/Loose/DLC/Halo/Data/Intimate.binka | Bin 0 -> 629852 bytes .../Loose/DLC/Halo/Data/Money or Meteors.binka | Bin 0 -> 2366176 bytes .../Image/Loose/DLC/Halo/Data/Night Dreams.binka | Bin 0 -> 2705926 bytes .../Loose/DLC/Halo/Data/Opening Suite 2.binka | Bin 0 -> 1530340 bytes .../Image/Loose/DLC/Halo/Data/Quiet Giant.binka | Bin 0 -> 3441502 bytes .../Image/Loose/DLC/Halo/Data/Rising Legacy.binka | Bin 0 -> 2657756 bytes .../Loose/DLC/Halo/Data/Sacred Icon Suite 1.binka | Bin 0 -> 3098740 bytes .../Image/Loose/DLC/Halo/Data/Spirit of Fire.binka | Bin 0 -> 1530590 bytes .../Image/Loose/DLC/Halo/Data/Still, Moving.binka | Bin 0 -> 1881578 bytes .../Image/Loose/DLC/Halo/Data/Suite Fall.binka | Bin 0 -> 3690264 bytes .../Layout/Image/Loose/DLC/Halo/Data/Survive.binka | Bin 0 -> 3048346 bytes .../Image/Loose/DLC/Halo/Data/The Big Guns.binka | Bin 0 -> 2262956 bytes .../DLC/Halo/Data/Truth And Reconciliation.binka | Bin 0 -> 5117170 bytes .../Loose/DLC/Halo/Data/Wolverines Reborn.binka | Bin 0 -> 2792374 bytes .../Halo/Data/Work Burns and Runaway Grunts.binka | Bin 0 -> 2254088 bytes .../Layout/Image/Loose/DLC/Halo/Data/halo.mcs | Bin 0 -> 10031472 bytes .../Layout/Image/Loose/DLC/Halo/Data/media.arc | Bin 0 -> 9722892 bytes .../Layout/Image/Loose/DLC/Halo/Data/x16Data.pck | Bin 0 -> 967988 bytes .../Layout/Image/Loose/DLC/Halo/TexturePack.pck | Bin 0 -> 217553 bytes .../Marvel Avengers/SkinPackMarvelAvengers1.pck | Bin 0 -> 73017 bytes .../Marvel Guardians Of The Galaxy/SkinPackGOG.pck | Bin 0 -> 64145 bytes .../Marvel Spider-Man/SkinPackMarvelSpiderman.pck | Bin 0 -> 68169 bytes .../Data/01-The Fate of the Galaxy.binka | Bin 0 -> 855934 bytes .../DLC/Mass Effect/Data/02-Leaving Earth.binka | Bin 0 -> 1408694 bytes .../Image/Loose/DLC/Mass Effect/Data/03-Mars.binka | Bin 0 -> 4700158 bytes .../DLC/Mass Effect/Data/04-A Cerberus Agent.binka | Bin 0 -> 1781708 bytes .../Mass Effect/Data/05-The View of Palaven.binka | Bin 0 -> 3514046 bytes .../Data/06-A Future for the Krogan.binka | Bin 0 -> 3076508 bytes .../Loose/DLC/Mass Effect/Data/07-Surkesh.binka | Bin 0 -> 2486460 bytes .../DLC/Mass Effect/Data/08-The Ardat Yakshi.binka | Bin 0 -> 2478440 bytes .../Loose/DLC/Mass Effect/Data/09-Rannoch.binka | Bin 0 -> 3168520 bytes .../Loose/DLC/Mass Effect/Data/10-I'm Sorry.binka | Bin 0 -> 2435808 bytes .../Mass Effect/Data/11-The Cerberus Plot.binka | Bin 0 -> 3705508 bytes .../DLC/Mass Effect/Data/12-The Scientists.binka | Bin 0 -> 2981462 bytes .../DLC/Mass Effect/Data/13-Aralakh Company.binka | Bin 0 -> 2861598 bytes .../DLC/Mass Effect/Data/14-Prothean Beacon.binka | Bin 0 -> 2490984 bytes .../Loose/DLC/Mass Effect/Data/15-Defeat.binka | Bin 0 -> 2573282 bytes .../DLC/Mass Effect/Data/16-Reaper Chase.binka | Bin 0 -> 2242810 bytes .../Data/17-Stand Strong, Stand Together.binka | Bin 0 -> 1706384 bytes .../Data/18-I Was Lost Without You.binka | Bin 0 -> 1421460 bytes .../Mass Effect/Data/19-The Fleets Arrive.binka | Bin 0 -> 1701508 bytes .../Data/20-We Face Our Enemy Together.binka | Bin 0 -> 1386464 bytes .../DLC/Mass Effect/Data/21-I'm Proud Of You.binka | Bin 0 -> 849274 bytes .../Data/22-An End, Once and For All.binka | Bin 0 -> 1395928 bytes .../Image/Loose/DLC/Mass Effect/Data/GameRules.grf | Bin 0 -> 294 bytes .../Loose/DLC/Mass Effect/Data/masseffect.mcs | Bin 0 -> 3586274 bytes .../Image/Loose/DLC/Mass Effect/Data/media.arc | Bin 0 -> 10191921 bytes .../Image/Loose/DLC/Mass Effect/Data/x16Data.pck | Bin 0 -> 733891 bytes .../Image/Loose/DLC/Mass Effect/TexturePack.pck | Bin 0 -> 176514 bytes .../Loose/DLC/Natural Texture Pack/Data/media.arc | Bin 0 -> 11048730 bytes .../DLC/Natural Texture Pack/Data/x32Data.pck | Bin 0 -> 2892274 bytes .../Loose/DLC/Natural Texture Pack/TexturePack.pck | Bin 0 -> 153119 bytes .../Loose/DLC/Plastic Texture Pack/Data/media.arc | Bin 0 -> 8317574 bytes .../DLC/Plastic Texture Pack/Data/x16Data.pck | Bin 0 -> 567845 bytes .../Loose/DLC/Plastic Texture Pack/TexturePack.pck | Bin 0 -> 81062 bytes .../Layout/Image/Loose/DLC/Skin Pack 1/Skins1.pck | Bin 0 -> 266700 bytes .../Layout/Image/Loose/DLC/Skin Pack 2/Skins2.pck | Bin 0 -> 184353 bytes .../Layout/Image/Loose/DLC/Skin Pack 3/Skins3.pck | Bin 0 -> 64147 bytes .../Image/Loose/DLC/Skin Pack 4/Skins4_XB1.pck | Bin 0 -> 116441 bytes .../Image/Loose/DLC/Skin Pack 5/SkinPack5.pck | Bin 0 -> 74631 bytes .../Image/Loose/DLC/Skin Pack 6/SkinPack6.pck | Bin 0 -> 98134 bytes .../Loose/DLC/Skyrim/Data/01 (A) Dragonborn.binka | Bin 0 -> 3982824 bytes .../Image/Loose/DLC/Skyrim/Data/02 (A) Awake.binka | Bin 0 -> 977184 bytes .../Skyrim/Data/03 (A) From Past To Present.binka | Bin 0 -> 3269410 bytes .../DLC/Skyrim/Data/06 (A) The City Gates.binka | Bin 0 -> 2782402 bytes .../DLC/Skyrim/Data/08 (A) Dragonsreach.binka | Bin 0 -> 1435524 bytes .../DLC/Skyrim/Data/09 (A) Tooth and Claw.binka | Bin 0 -> 1118430 bytes .../DLC/Skyrim/Data/13 (A) Distant Horizons.binka | Bin 0 -> 2542020 bytes .../Image/Loose/DLC/Skyrim/Data/14 (A) Dawn.binka | Bin 0 -> 2320560 bytes .../Skyrim/Data/15 (A) The Jerall Mountains.binka | Bin 0 -> 2120848 bytes .../Loose/DLC/Skyrim/Data/17 (A) Secunda.binka | Bin 0 -> 958574 bytes .../Loose/DLC/Skyrim/Data/19 (B) Frostfall.binka | Bin 0 -> 2109820 bytes .../DLC/Skyrim/Data/21 (B) Into Darkness.binka | Bin 0 -> 885238 bytes .../Loose/DLC/Skyrim/Data/23 (B) Unbound.binka | Bin 0 -> 993118 bytes .../DLC/Skyrim/Data/24 (B) Far Horizons.binka | Bin 0 -> 3785320 bytes .../Data/27 (B) The Streets of Whiterun.binka | Bin 0 -> 3130818 bytes .../DLC/Skyrim/Data/29 (B) The White River.binka | Bin 0 -> 1929148 bytes .../DLC/Skyrim/Data/31 (B) Standing Stones.binka | Bin 0 -> 4365996 bytes .../Loose/DLC/Skyrim/Data/33 (B) Tundra.binka | Bin 0 -> 2245850 bytes .../DLC/Skyrim/Data/34 (B) Journey's End.binka | Bin 0 -> 2663988 bytes .../Skyrim/Data/39 (C) Shadows and Echoes.binka | Bin 0 -> 1154572 bytes .../Loose/DLC/Skyrim/Data/41 (C) Aurora.binka | Bin 0 -> 4443128 bytes .../Skyrim/Data/43 (C) Towers and Shadows.binka | Bin 0 -> 1159944 bytes .../Loose/DLC/Skyrim/Data/45 (C) Solitude.binka | Bin 0 -> 1514670 bytes .../DLC/Skyrim/Data/46 (C) Watch the Skies.binka | Bin 0 -> 2362688 bytes .../Skyrim/Data/49 (C) Death in the Darkness.binka | Bin 0 -> 879654 bytes .../DLC/Skyrim/Data/52 (C) Wind Guide You.binka | Bin 0 -> 5626580 bytes .../Image/Loose/DLC/Skyrim/Data/GameRules.grf | Bin 0 -> 461 bytes .../Layout/Image/Loose/DLC/Skyrim/Data/media.arc | Bin 0 -> 3738671 bytes .../Layout/Image/Loose/DLC/Skyrim/Data/skyrim.mcs | Bin 0 -> 10509553 bytes .../Layout/Image/Loose/DLC/Skyrim/Data/x16Data.pck | Bin 0 -> 996897 bytes .../Layout/Image/Loose/DLC/Skyrim/TexturePack.pck | Bin 0 -> 181667 bytes .../Layout/Image/Loose/DLCImages/MPHA_360x360.png | Bin 0 -> 143326 bytes .../Layout/Image/Loose/DLCImages/MPMA_360x360.png | Bin 0 -> 129724 bytes .../Layout/Image/Loose/DLCImages/MPSR_360x360.png | Bin 0 -> 169511 bytes .../Layout/Image/Loose/DLCImages/SP1_360x360.png | Bin 0 -> 211965 bytes .../Layout/Image/Loose/DLCImages/SP2_360x360.png | Bin 0 -> 205373 bytes .../Layout/Image/Loose/DLCImages/SP3_360x360.png | Bin 0 -> 218151 bytes .../Layout/Image/Loose/DLCImages/SP4_360x360.png | Bin 0 -> 138908 bytes .../Layout/Image/Loose/DLCImages/SP5_360x360.png | Bin 0 -> 135222 bytes .../Layout/Image/Loose/DLCImages/SP6_360x360.png | Bin 0 -> 136534 bytes .../Layout/Image/Loose/DLCImages/SPB2_360x360.png | Bin 0 -> 149039 bytes .../Layout/Image/Loose/DLCImages/SPB_360x360.png | Bin 0 -> 122667 bytes .../Layout/Image/Loose/DLCImages/SPC_360x360.png | Bin 0 -> 145302 bytes .../Layout/Image/Loose/DLCImages/SPD1_360x360.png | Bin 0 -> 143413 bytes .../Layout/Image/Loose/DLCImages/SPF_360x360.png | Bin 0 -> 140603 bytes .../Layout/Image/Loose/DLCImages/SPG_360x360.png | Bin 0 -> 140522 bytes .../Layout/Image/Loose/DLCImages/SPI_360x360.png | Bin 0 -> 154628 bytes .../Layout/Image/Loose/DLCImages/SPM_360x360.png | Bin 0 -> 144016 bytes .../Layout/Image/Loose/DLCImages/SPZ_360x360.png | Bin 0 -> 154505 bytes .../Layout/Image/Loose/DLCImages/TP01_360x360.png | Bin 0 -> 129958 bytes .../Layout/Image/Loose/DLCImages/TP02_360x360.png | Bin 0 -> 223839 bytes .../Layout/Image/Loose/DLCImages/TP03_360x360.png | Bin 0 -> 132702 bytes .../Layout/Image/Loose/DLCImages/TP04_360x360.png | Bin 0 -> 204711 bytes .../Layout/Image/Loose/DLCImages/TP05_360x360.png | Bin 0 -> 140905 bytes .../Layout/Image/Loose/DLCImages/TP06_360x360.png | Bin 0 -> 100435 bytes .../Layout/Image/Loose/DLCImages/TP07_360x360.png | Bin 0 -> 105405 bytes .../Durango/Layout/Image/Loose/DLCXbox1.cmp | Bin 0 -> 1644 bytes .../Durango/Layout/Image/Loose/SmallLogo.png | Bin 0 -> 18640 bytes .../Layout/Image/Loose/Sound/Minecraft.msscmp | Bin 0 -> 12276954 bytes .../Durango/Layout/Image/Loose/SplashScreen.png | Bin 0 -> 1063095 bytes .../Durango/Layout/Image/Loose/StoreLogo.png | Bin 0 -> 61628 bytes .../Layout/Image/Loose/Update.alignmentchunk | 1 + .../Durango/Layout/Image/Loose/WideLogo.png | Bin 0 -> 200365 bytes .../Durango/Layout/Image/Loose/music/cds/11.binka | Bin 0 -> 565292 bytes .../Durango/Layout/Image/Loose/music/cds/13.binka | Bin 0 -> 704668 bytes .../Layout/Image/Loose/music/cds/blocks.binka | Bin 0 -> 2420602 bytes .../Durango/Layout/Image/Loose/music/cds/cat.binka | Bin 0 -> 2551504 bytes .../Layout/Image/Loose/music/cds/chirp.binka | Bin 0 -> 1354308 bytes .../Durango/Layout/Image/Loose/music/cds/far.binka | Bin 0 -> 1060452 bytes .../Layout/Image/Loose/music/cds/mall.binka | Bin 0 -> 1125814 bytes .../Layout/Image/Loose/music/cds/mellohi.binka | Bin 0 -> 594454 bytes .../Layout/Image/Loose/music/cds/stal.binka | Bin 0 -> 1025342 bytes .../Layout/Image/Loose/music/cds/strad.binka | Bin 0 -> 1210434 bytes .../Layout/Image/Loose/music/cds/ward.binka | Bin 0 -> 2163216 bytes .../Image/Loose/music/cds/where_are_we_now.binka | Bin 0 -> 1470548 bytes .../Layout/Image/Loose/music/music/calm1.binka | Bin 0 -> 1756530 bytes .../Layout/Image/Loose/music/music/calm2.binka | Bin 0 -> 1524728 bytes .../Layout/Image/Loose/music/music/calm3.binka | Bin 0 -> 1237544 bytes .../Layout/Image/Loose/music/music/creative1.binka | Bin 0 -> 4107796 bytes .../Layout/Image/Loose/music/music/creative2.binka | Bin 0 -> 3557606 bytes .../Layout/Image/Loose/music/music/creative3.binka | Bin 0 -> 3792318 bytes .../Layout/Image/Loose/music/music/creative4.binka | Bin 0 -> 5020152 bytes .../Layout/Image/Loose/music/music/creative5.binka | Bin 0 -> 6689166 bytes .../Layout/Image/Loose/music/music/creative6.binka | Bin 0 -> 5668790 bytes .../Layout/Image/Loose/music/music/hal1.binka | Bin 0 -> 1201732 bytes .../Layout/Image/Loose/music/music/hal2.binka | Bin 0 -> 1230612 bytes .../Layout/Image/Loose/music/music/hal3.binka | Bin 0 -> 1322980 bytes .../Layout/Image/Loose/music/music/hal4.binka | Bin 0 -> 1628720 bytes .../Layout/Image/Loose/music/music/menu1.binka | Bin 0 -> 1588836 bytes .../Layout/Image/Loose/music/music/menu2.binka | Bin 0 -> 1465918 bytes .../Layout/Image/Loose/music/music/menu3.binka | Bin 0 -> 1357074 bytes .../Layout/Image/Loose/music/music/menu4.binka | Bin 0 -> 1896532 bytes .../Layout/Image/Loose/music/music/nether1.binka | Bin 0 -> 3079956 bytes .../Layout/Image/Loose/music/music/nether2.binka | Bin 0 -> 2474174 bytes .../Layout/Image/Loose/music/music/nether3.binka | Bin 0 -> 2451172 bytes .../Layout/Image/Loose/music/music/nether4.binka | Bin 0 -> 2111956 bytes .../Layout/Image/Loose/music/music/nuance1.binka | Bin 0 -> 248264 bytes .../Layout/Image/Loose/music/music/nuance2.binka | Bin 0 -> 330608 bytes .../Layout/Image/Loose/music/music/piano1.binka | Bin 0 -> 390386 bytes .../Layout/Image/Loose/music/music/piano2.binka | Bin 0 -> 552446 bytes .../Layout/Image/Loose/music/music/piano3.binka | Bin 0 -> 1737498 bytes .../Loose/music/music/the_end_dragon_alive.binka | Bin 0 -> 3931786 bytes .../Image/Loose/music/music/the_end_end.binka | Bin 0 -> 2021786 bytes .../Durango/Layout/Image/Loose/xcompress.dll | Bin 0 -> 36864 bytes .../Leaderboards/DurangoLeaderboardManager.cpp | 717 ++ .../Leaderboards/DurangoLeaderboardManager.h | 94 + .../Durango/Leaderboards/DurangoStatsDebugger.cpp | 487 ++ .../Durango/Leaderboards/DurangoStatsDebugger.h | 94 + .../Durango/Leaderboards/GameProgress.cpp | 107 + .../Durango/Leaderboards/GameProgress.h | 23 + Minecraft.Client/Durango/Miles/include/mss.h | 8429 ++++++++++++++++++++ Minecraft.Client/Durango/Miles/include/rrCore.h | 2322 ++++++ .../Durango/Miles/lib/auddurango.LTCG.lib | Bin 0 -> 505764 bytes Minecraft.Client/Durango/Miles/lib/auddurango.lib | Bin 0 -> 140914 bytes .../Durango/Miles/lib/binkadurango.LTCG.lib | Bin 0 -> 248300 bytes .../Durango/Miles/lib/binkadurango.lib | Bin 0 -> 91330 bytes .../Durango/Miles/lib/fltdurango.LTCG.lib | Bin 0 -> 1405336 bytes Minecraft.Client/Durango/Miles/lib/fltdurango.lib | Bin 0 -> 249466 bytes .../Durango/Miles/lib/mssdurango.LTCG.lib | Bin 0 -> 3451006 bytes Minecraft.Client/Durango/Miles/lib/mssdurango.lib | Bin 0 -> 1279616 bytes .../Durango/Miles/lib/mssdurangomidi.LTCG.lib | Bin 0 -> 946906 bytes .../Durango/Miles/lib/mssdurangomidi.lib | Bin 0 -> 375172 bytes Minecraft.Client/Durango/Minecraft_Macros.h | 42 + .../Durango/Network/ChatIntegrationLayer.cpp | 805 ++ .../Durango/Network/ChatIntegrationLayer.h | 244 + .../Durango/Network/DQRNetworkManager.cpp | 3093 +++++++ .../Durango/Network/DQRNetworkManager.h | 582 ++ .../Network/DQRNetworkManager_FriendSessions.cpp | 591 ++ .../Durango/Network/DQRNetworkManager_Log.cpp | 303 + .../Network/DQRNetworkManager_SendReceive.cpp | 409 + .../Network/DQRNetworkManager_XRNSEvent.cpp | 651 ++ .../Durango/Network/DQRNetworkPlayer.cpp | 204 + .../Durango/Network/DQRNetworkPlayer.h | 65 + .../Durango/Network/NetworkPlayerDurango.cpp | 113 + .../Durango/Network/NetworkPlayerDurango.h | 39 + .../Durango/Network/PartyController.cpp | 1205 +++ Minecraft.Client/Durango/Network/PartyController.h | 74 + .../Network/PlatformNetworkManagerDurango.cpp | 940 +++ .../Network/PlatformNetworkManagerDurango.h | 168 + .../Windows.Xbox.Networking.RealtimeSession.dll | Bin 0 -> 235520 bytes Minecraft.Client/Durango/Network/base64.cpp | 156 + Minecraft.Client/Durango/Network/base64.h | 6 + .../windows.xbox.networking.realtimesession.pdb | Bin 0 -> 4952064 bytes .../windows.xbox.networking.realtimesession.winmd | Bin 0 -> 18944 bytes Minecraft.Client/Durango/PresenceIds.h | 27 + Minecraft.Client/Durango/Resource.h | 31 + .../Durango/Sentient/DurangoTelemetry.cpp | 986 +++ .../Durango/Sentient/DurangoTelemetry.h | 50 + .../Durango/Sentient/DynamicConfigurations.h | 68 + .../Durango/Sentient/MinecraftTelemetry.h | 3 + .../Durango/Sentient/SentientManager.h | 83 + Minecraft.Client/Durango/Sentient/SentientStats.h | 88 + .../Durango/Sentient/SentientTelemetryCommon.h | 190 + Minecraft.Client/Durango/Sentient/TelemetryEnum.h | 229 + Minecraft.Client/Durango/ServiceConfig/Enums.xlsx | Bin 0 -> 13377 bytes .../ServiceConfig/Events-XBLA.8-149E11AEEvents.h | 1216 +++ .../HelpDocument/controls/ButtonA.png | Bin 0 -> 1294 bytes .../HelpDocument/controls/ButtonB.png | Bin 0 -> 1293 bytes .../HelpDocument/controls/ButtonBack.png | Bin 0 -> 1308 bytes .../HelpDocument/controls/ButtonDpadD.png | Bin 0 -> 1249 bytes .../HelpDocument/controls/ButtonDpadL.png | Bin 0 -> 1258 bytes .../HelpDocument/controls/ButtonDpadR.png | Bin 0 -> 1254 bytes .../HelpDocument/controls/ButtonDpadU.png | Bin 0 -> 1253 bytes .../HelpDocument/controls/ButtonLS.png | Bin 0 -> 1432 bytes .../HelpDocument/controls/ButtonLeftBumper.png | Bin 0 -> 1287 bytes .../HelpDocument/controls/ButtonLeftStick.png | Bin 0 -> 1360 bytes .../controls/ButtonLeftStick_Navigate.png | Bin 0 -> 1547 bytes .../controls/ButtonLeftStick_sides.png | Bin 0 -> 1463 bytes .../HelpDocument/controls/ButtonLeftTrigger.png | Bin 0 -> 1276 bytes .../HelpDocument/controls/ButtonRS.png | Bin 0 -> 1441 bytes .../HelpDocument/controls/ButtonRightBumper.png | Bin 0 -> 1214 bytes .../HelpDocument/controls/ButtonRightStick.png | Bin 0 -> 1367 bytes .../HelpDocument/controls/ButtonRightTrigger.png | Bin 0 -> 1273 bytes .../HelpDocument/controls/ButtonStart.png | Bin 0 -> 1294 bytes .../HelpDocument/controls/ButtonX.png | Bin 0 -> 1311 bytes .../HelpDocument/controls/ButtonY.png | Bin 0 -> 1301 bytes .../Durango/ServiceConfig/HelpDocument/index.html | 184 + .../ServiceConfig/HelpDocument/left_arrow.png | Bin 0 -> 708 bytes .../HelpDocument/left_arrow_hoverFocus.png | Bin 0 -> 2357 bytes .../Durango/ServiceConfig/HelpDocument/main.css | 279 + .../Durango/ServiceConfig/HelpDocument/mobile.css | 160 + .../ServiceConfig/HelpDocument/sg_logo_20.png | Bin 0 -> 5121 bytes .../Durango/ServiceConfig/HelpDocument/skin.css | 51 + .../Durango/ServiceConfig/HelpDocument/snapped.css | 53 + .../Durango/ServiceConfig/HelpDocument/tablet.css | 117 + .../Durango/ServiceConfig/HelpDocument_de-DE.zip | Bin 0 -> 77388 bytes .../Durango/ServiceConfig/HelpDocument_en-GB.zip | Bin 0 -> 77198 bytes .../Durango/ServiceConfig/HelpDocument_es-ES.zip | Bin 0 -> 77420 bytes .../Durango/ServiceConfig/HelpDocument_fr-FR.zip | Bin 0 -> 77480 bytes .../Durango/ServiceConfig/HelpDocument_it-IT.zip | Bin 0 -> 77344 bytes .../Durango/ServiceConfig/HelpDocument_ja-JP.zip | Bin 0 -> 77588 bytes .../Durango/ServiceConfig/HelpDocument_ko-KR.zip | Bin 0 -> 77355 bytes .../Durango/ServiceConfig/HelpDocument_pt-BR.zip | Bin 0 -> 77330 bytes .../Durango/ServiceConfig/HelpDocument_pt-PT.zip | Bin 0 -> 77314 bytes .../Durango/ServiceConfig/HelpDocument_zh-CHT.zip | Bin 0 -> 77279 bytes Minecraft.Client/Durango/ServiceConfig/MakeZips.py | 62 + .../Minecraft_Service Config Workbook v1.2.xlsx | Bin 0 -> 123507 bytes .../Durango/ServiceConfig/loc/de-DE/index.html | 170 + .../Durango/ServiceConfig/loc/en-GB/index.html | 170 + .../Durango/ServiceConfig/loc/es-ES/index.html | 170 + .../Durango/ServiceConfig/loc/fr-FR/index.html | 170 + .../Durango/ServiceConfig/loc/it-IT/index.html | 170 + .../Durango/ServiceConfig/loc/ja-JP/index.html | 170 + .../Durango/ServiceConfig/loc/ko-KR/index.html | 170 + .../Durango/ServiceConfig/loc/pt-BR/index.html | 170 + .../Durango/ServiceConfig/loc/pt-PT/index.html | 170 + .../Durango/ServiceConfig/loc/zh-CHT/index.html | 170 + Minecraft.Client/Durango/SmallLogo.png | Bin 0 -> 18640 bytes Minecraft.Client/Durango/Social/SocialManager.h | 137 + Minecraft.Client/Durango/Sound/Minecraft.msscmp | Bin 0 -> 12276954 bytes Minecraft.Client/Durango/SplashScreen.png | Bin 0 -> 1063095 bytes Minecraft.Client/Durango/StoreLogo.png | Bin 0 -> 61628 bytes Minecraft.Client/Durango/Update.alignmentchunk | 1 + Minecraft.Client/Durango/WideLogo.png | Bin 0 -> 200365 bytes Minecraft.Client/Durango/XML/ATGXmlParser.cpp | 968 +++ Minecraft.Client/Durango/XML/ATGXmlParser.h | 156 + Minecraft.Client/Durango/XML/xmlFilesCallback.h | 337 + Minecraft.Client/Durango/XboxGameMode.cpp | 9 + Minecraft.Client/Durango/XboxGameMode.h | 10 + Minecraft.Client/Durango/Xbox_Awards_enum.h | 46 + Minecraft.Client/Durango/Xbox_BuildVer.h | 53 + Minecraft.Client/Durango/Xbox_Debug_enum.h | 36 + Minecraft.Client/Durango/Xbox_Utils.cpp | 40 + Minecraft.Client/Durango/manifest.xml | 194 + Minecraft.Client/Durango/targetver.h | 8 + 1074 files changed, 52769 insertions(+) create mode 100644 Minecraft.Client/Durango/4JLibs/Media/4J_strings.resx create mode 100644 Minecraft.Client/Durango/4JLibs/inc/4J_Input.h create mode 100644 Minecraft.Client/Durango/4JLibs/inc/4J_Profile.h create mode 100644 Minecraft.Client/Durango/4JLibs/inc/4J_Render.h create mode 100644 Minecraft.Client/Durango/4JLibs/inc/4J_Storage.h create mode 100644 Minecraft.Client/Durango/4JLibs/libs/4J_Input.lib create mode 100644 Minecraft.Client/Durango/4JLibs/libs/4J_Input_d.lib create mode 100644 Minecraft.Client/Durango/4JLibs/libs/4J_Input_r.lib create mode 100644 Minecraft.Client/Durango/4JLibs/libs/4J_Profile.lib create mode 100644 Minecraft.Client/Durango/4JLibs/libs/4J_Profile_d.lib create mode 100644 Minecraft.Client/Durango/4JLibs/libs/4J_Profile_r.lib create mode 100644 Minecraft.Client/Durango/4JLibs/libs/4J_Render.lib create mode 100644 Minecraft.Client/Durango/4JLibs/libs/4J_Render_d.lib create mode 100644 Minecraft.Client/Durango/4JLibs/libs/4J_Storage.lib create mode 100644 Minecraft.Client/Durango/4JLibs/libs/4J_Storage_d.lib create mode 100644 Minecraft.Client/Durango/4JLibs/libs/4J_Storage_r.lib create mode 100644 Minecraft.Client/Durango/Achievements/AchievementManager.cpp create mode 100644 Minecraft.Client/Durango/Achievements/AchievementManager.h create mode 100644 Minecraft.Client/Durango/ApplicationView.cpp create mode 100644 Minecraft.Client/Durango/ApplicationView.h create mode 100644 Minecraft.Client/Durango/Autogenerated.appxmanifest create mode 100644 Minecraft.Client/Durango/CU/DLCXbox1.cmp create mode 100644 Minecraft.Client/Durango/DLCImages/MPHA_360x360.png create mode 100644 Minecraft.Client/Durango/DLCImages/MPMA_360x360.png create mode 100644 Minecraft.Client/Durango/DLCImages/MPSR_360x360.png create mode 100644 Minecraft.Client/Durango/DLCImages/SP1_360x360.png create mode 100644 Minecraft.Client/Durango/DLCImages/SP2_360x360.png create mode 100644 Minecraft.Client/Durango/DLCImages/SP3_360x360.png create mode 100644 Minecraft.Client/Durango/DLCImages/SP4_360x360.png create mode 100644 Minecraft.Client/Durango/DLCImages/SP5_360x360.png create mode 100644 Minecraft.Client/Durango/DLCImages/SP6_360x360.png create mode 100644 Minecraft.Client/Durango/DLCImages/SPB2_360x360.png create mode 100644 Minecraft.Client/Durango/DLCImages/SPB_360x360.png create mode 100644 Minecraft.Client/Durango/DLCImages/SPC_360x360.png create mode 100644 Minecraft.Client/Durango/DLCImages/SPD1_360x360.png create mode 100644 Minecraft.Client/Durango/DLCImages/SPF_360x360.png create mode 100644 Minecraft.Client/Durango/DLCImages/SPG_360x360.png create mode 100644 Minecraft.Client/Durango/DLCImages/SPI_360x360.png create mode 100644 Minecraft.Client/Durango/DLCImages/SPM_360x360.png create mode 100644 Minecraft.Client/Durango/DLCImages/SPZ_360x360.png create mode 100644 Minecraft.Client/Durango/DLCImages/TP01_360x360.png create mode 100644 Minecraft.Client/Durango/DLCImages/TP02_360x360.png create mode 100644 Minecraft.Client/Durango/DLCImages/TP03_360x360.png create mode 100644 Minecraft.Client/Durango/DLCImages/TP04_360x360.png create mode 100644 Minecraft.Client/Durango/DLCImages/TP05_360x360.png create mode 100644 Minecraft.Client/Durango/DLCImages/TP06_360x360.png create mode 100644 Minecraft.Client/Durango/DLCImages/TP07_360x360.png create mode 100644 Minecraft.Client/Durango/DLCXbox1.cmp create mode 100644 Minecraft.Client/Durango/DurangoExtras/DurangoStubs.cpp create mode 100644 Minecraft.Client/Durango/DurangoExtras/DurangoStubs.h create mode 100644 Minecraft.Client/Durango/DurangoExtras/xcompress.dll create mode 100644 Minecraft.Client/Durango/DurangoExtras/xcompress.h create mode 100644 Minecraft.Client/Durango/DurangoExtras/xcompress.lib create mode 100644 Minecraft.Client/Durango/Durango_App.cpp create mode 100644 Minecraft.Client/Durango/Durango_App.h create mode 100644 Minecraft.Client/Durango/Durango_Minecraft.cpp create mode 100644 Minecraft.Client/Durango/Durango_UIController.cpp create mode 100644 Minecraft.Client/Durango/Durango_UIController.h create mode 100644 Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d10_shaders.inl create mode 100644 Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d11.cpp create mode 100644 Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d11.h create mode 100644 Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d1x_shared.inl create mode 100644 Minecraft.Client/Durango/Iggy/gdraw/gdraw_shared.inl create mode 100644 Minecraft.Client/Durango/Iggy/include/gdraw.h create mode 100644 Minecraft.Client/Durango/Iggy/include/iggy.h create mode 100644 Minecraft.Client/Durango/Iggy/include/iggyexpruntime.h create mode 100644 Minecraft.Client/Durango/Iggy/include/iggyperfmon.h create mode 100644 Minecraft.Client/Durango/Iggy/include/rrCore.h create mode 100644 Minecraft.Client/Durango/Iggy/lib/iggy_durango.lib create mode 100644 Minecraft.Client/Durango/Iggy/lib/iggy_durango_debugcrt.lib create mode 100644 Minecraft.Client/Durango/Iggy/lib/iggyperfmon_durango.lib create mode 100644 Minecraft.Client/Durango/Iggy/lib/iggyperfmon_durango_debugcrt.lib create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/CU/DLCXbox1.cmp create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/media/MediaDurango.arc create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/CHT/DFHeiMedium-B5.ttf create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/JPN/DF-DotDotGothic16.ttf create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/JPN/DFGMaruGothic-Md.ttf create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/KOR/BOKMSD.ttf create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/KOR/candadite2.ttf create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/Mojang Font_11.ttf create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/Mojang Font_7.ttf create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/Mojangles.ttf create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/RU/SpaceMace.ttf create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/achievement/bg.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/achievement/icons.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/chain_1.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/chain_2.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/cloth_1.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/cloth_2.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/diamond_1.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/diamond_2.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/gold_1.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/gold_2.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/iron_1.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/iron_2.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/power.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/art/kz.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/environment/clouds.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/environment/light_normal.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/environment/rain.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/environment/snow.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/alternate.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/default.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_00.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_01.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_02.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_03.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_04.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_05.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_06.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_07.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_09.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_0A.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_0B.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_0C.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_0D.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_0E.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_0F.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_10.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_11.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_12.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_13.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_14.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_15.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_16.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_17.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_18.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_19.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_1A.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_1B.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_1C.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_1D.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_1E.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_1F.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_20.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_21.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_22.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_23.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_24.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_25.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_26.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_27.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_28.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_29.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_2A.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_2B.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_2C.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_2D.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_2E.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_2F.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_30.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_31.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_32.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_33.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_34.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_35.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_36.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_37.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_38.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_39.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_3A.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_3B.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_3C.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_3D.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_3E.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_3F.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_40.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_41.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_42.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_43.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_44.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_45.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_46.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_47.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_48.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_49.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_4A.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_4B.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_4C.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_4D.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_4E.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_4F.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_50.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_51.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_52.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_53.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_54.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_55.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_56.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_57.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_58.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_59.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_5A.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_5B.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_5C.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_5D.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_5E.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_5F.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_60.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_61.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_62.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_63.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_64.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_65.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_66.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_67.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_68.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_69.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_6A.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_6B.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_6C.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_6D.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_6E.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_6F.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_70.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_71.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_72.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_73.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_74.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_75.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_76.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_77.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_78.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_79.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_7A.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_7B.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_7C.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_7D.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_7E.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_7F.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_80.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_81.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_82.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_83.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_84.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_85.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_86.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_87.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_88.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_89.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_8A.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_8B.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_8C.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_8D.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_8E.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_8F.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_90.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_91.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_92.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_93.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_94.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_95.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_96.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_97.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_98.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_99.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_9A.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_9B.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_9C.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_9D.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_9E.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_9F.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A0.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A1.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A2.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A3.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A4.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A5.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A6.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A7.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A8.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A9.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_AA.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_AB.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_AC.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_AD.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_AE.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_AF.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B0.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B1.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B2.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B3.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B4.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B5.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B6.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B7.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B8.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B9.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_BA.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_BB.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_BC.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_BD.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_BE.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_BF.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C0.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C1.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C2.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C3.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C4.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C5.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C6.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C7.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C8.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C9.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_CA.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_CB.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_CC.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_CD.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_CE.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_CF.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D0.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D1.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D2.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D3.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D4.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D5.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D6.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D7.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_F9.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_FA.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_FB.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_FC.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_FD.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_FE.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_FF.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_sizes.bin create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/alchemy.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/allitems.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/background.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/container.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/crafting.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/crash_logo.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/enchant.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/furnace.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/gui.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/icons.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/inventory.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/items.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/particles.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/slot.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/trap.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/unknown_pack.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/arrows.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/boat.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/book.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/cart.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/chest.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/door.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/largechest.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/sign.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/xporb.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/dial.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/explosion.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/foliagecolor.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/footprint.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/glint.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/grasscolor.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/mapbg.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/mapicons.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/particlefield.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/pumpkinblur.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/shadow.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/tunnel.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/vignette.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/water.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/watercolor.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/cat_black.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/cat_red.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/cat_siamese.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/cavespider.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/char.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/chicken.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/cow.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/creeper.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/beam.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/body.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/crystal.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/dragon.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/ender.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/ender_eyes.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/shuffle.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderman.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderman_eyes.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/fire.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/ghast.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/ghast_fire.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/lava.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/ozelot.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/pig.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/pigman.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/pigzombie.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/redcow.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/saddle.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/sheep.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/sheep_fur.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/silverfish.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/skeleton.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/slime.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/snowman.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/spider.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/spider_eyes.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/squid.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager/butcher.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager/farmer.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager/librarian.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager/priest.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager/smith.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager/villager.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager_golem.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/wolf.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/wolf_angry.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/wolf_tame.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/zombie.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/pack.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/pack.txt create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/particles.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/terrain.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/terrain/moon.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/terrain/moon_phases.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/terrain/sun.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/bg/panorama0.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/bg/panorama1.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/bg/panorama2.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/bg/panorama3.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/bg/panorama4.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/bg/panorama5.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/black.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/credits.txt create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/earlyplayers.txt create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/mclogo.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/mojang.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/splashes.txt create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/win.txt create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Candy/Data/TexturePack.xzp create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Candy/Data/x16Data.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/City/Data/TexturePack.xzp create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/City/Data/x32Data.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Fantasy/Data/TexturePack.xzp create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Fantasy/Data/x32Data.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Halloween/Data/TexturePack.xzp create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Halloween/Data/x16Data.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Halo/Data/GameRules.grf create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Halo/Data/TexturePack.xzp create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Halo/Data/x16Data.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Halo/TexturePack.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/MassEffect/Data/GameRules.grf create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/MassEffect/Data/TexturePack.xzp create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/MassEffect/Data/masseffect.mcs create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/MassEffect/Data/x16Data.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/MassEffect/TexturePack.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Natural/Data/TexturePack.xzp create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Natural/Data/x32Data.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Plastic/Data/TexturePack.xzp create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Plastic/Data/x16Data.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Skyrim/Data/GameRules.grf create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Skyrim/Data/TexturePack.xzp create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Skyrim/Data/x16Data.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Skyrim/TexturePack.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildAll.cmd create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule.cmd create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule_Durango.cmd create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule_Orbis.cmd create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule_PS3.cmd create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule_PSVita.cmd create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule_Windows64.cmd create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule_Xbox.cmd create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/GameRules.sln create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/GameRules.vcxproj create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/GameRules.vcxproj.filters create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/GameRules.vcxproj.vspscc create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/GameRulesDefinition.xsd create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/GameRules.grf create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/GameRules.grh create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/GameRules.xml create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/de-DE.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/es-ES.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/fr-FR.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/it-IT.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/ja-JP.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/ko-KR.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/pt-BR.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/pt-PT.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/zh-CHT.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/en-EN.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/de-DE.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/es-ES.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/fr-FR.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/it-IT.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/ja-JP.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/ko-KR.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/pt-BR.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/pt-PT.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/zh-CHT.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/en-EN.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/da-DA.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/de-DE.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/es-ES.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/fi-FI.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/fr-FR.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/it-IT.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/ja-JP.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/ko-KR.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/la-LAS.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/nl-NL.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/no-NO.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/pl-PL.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/pt-BR.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/pt-PT.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/ru-RU.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/sv-SV.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/tr-TR.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/zh-CHT.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/en-EN.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/da-DA.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/de-DE.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/es-ES.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/fi-FI.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/fr-FR.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/it-IT.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/ja-JP.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/ko-KR.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/la-LAS.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/nl-NL.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/no-NO.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/pl-PL.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/pt-BR.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/pt-PT.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/ru-RU.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/sv-SV.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/tr-TR.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/zh-CHT.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/en-EN.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/da-DA.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/de-DE.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/es-ES.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/fi-FI.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/fr-FR.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/it-IT.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/ja-JP.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/ko-KR.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/la-LAS.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/nl-NL.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/no-NO.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/pl-PL.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/pt-BR.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/pt-PT.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/ru-RU.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/sv-SV.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/tr-TR.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/zh-CHT.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/en-EN.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/de-DE.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/es-ES.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/fr-FR.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/it-IT.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/ja-JP.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/ko-KR.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/pt-BR.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/pt-PT.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/zh-CHT.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/en-EN.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/de-DE.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/es-ES.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/fr-FR.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/it-IT.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/ja-JP.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/ko-KR.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/pt-BR.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/pt-PT.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/zh-CHT.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/en-EN.lang create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Tutorial.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Tutorial.xml create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/languages.loc create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Boat.sch create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/CasTes1.sch create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/CasTes2.sch create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/JungleTemp.sch create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Lava.sch create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/MinecraftSign.sch create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Mushroom.sch create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/PillarHouse.sch create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Pyramid.sch create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/RuinedHouse.sch create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Ship.sch create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Smithy.sch create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/SnowHouse.sch create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Spider.sch create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Stairs.sch create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/StoneCircle.sch create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/StoneTemp.sch create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Tower.sch create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/UWChamber.sch create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/launchCMD.cmd create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/Tutorial.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/Tutorial_Durango.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/Tutorial_Orbis.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/audio/AdditionalMusic.xwb create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/audio/Minecraft.xgs create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/audio/additional.xsb create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/audio/additional.xwb create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/audio/minecraft.xsb create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/armor/cloth_1.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/armor/cloth_1_b.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/armor/cloth_2.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/armor/cloth_2_b.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/armor/power.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/art/kz.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/colours.col create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/colours.xml create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/font/Default.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/font/Mojangles_11.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/font/Mojangles_7.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/item/book.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/item/enderchest.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/items.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/additionalmapicons.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/explosion.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/footprint.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/glint.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/mapicons.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/particlefield.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/tunnel.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/enderdragon/beam.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/enderdragon/ender.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/enderdragon/ender_eyes.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/enderman_eyes.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/redcow.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/skeleton_wither.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/snowman.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/villager/butcher.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/villager/farmer.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/villager/librarian.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/villager/priest.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/villager/smith.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/villager/villager.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/wolf_collar.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/wolf_tame.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/zombie.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/zombie_villager.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/particles.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/terrain.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/terrainMipMapLevel2.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/terrainMipMapLevel3.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/fire_0.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/fire_0.txt create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/fire_1.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/fire_1.txt create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/lava.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/lava.txt create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/lava_flow.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/lava_flow.txt create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/portal.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/portal.txt create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/water.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/water.txt create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/water_flow.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/water_flow.txt create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/items/clock.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/items/clock.txt create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/items/compass.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/items/compass.txt create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/tutorialDiff create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/achievement/bg.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/achievement/icons.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/chain_1.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/chain_2.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/cloth_1.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/cloth_2.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/diamond_1.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/diamond_2.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/gold_1.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/gold_2.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/iron_1.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/iron_2.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/power.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/art/kz.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/audio/Minecraft.xgs create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/audio/minecraft.xsb create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/audio/resident.xwb create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/audio/streamed.xwb create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/environment/clouds.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/environment/rain.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/environment/snow.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/font/Mojangles_11.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/font/Mojangles_7.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/font/default.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/background.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/container.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/crafting.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/furnace.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/gui.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/icons.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/inventory.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/items.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/logo.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/particles.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/slot.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/trap.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/unknown_pack.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/item/arrows.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/item/boat.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/item/cart.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/item/door.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/item/sign.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/dial.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/foliagecolor.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/footprint.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/grasscolor.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/mapbg.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/mapicons.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/pumpkinblur.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/shadow.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/vignette.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/water.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/watercolor.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char1.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char2.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char3.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char4.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char5.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char6.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char7.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/chicken.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/cow.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/creeper.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/ghast.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/ghast_fire.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/pig.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/pigman.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/pigzombie.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/saddle.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/sheep.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/sheep_fur.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/skeleton.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/slime.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/spider.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/spider_eyes.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/squid.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/wolf.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/wolf_angry.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/wolf_tame.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/zombie.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/pack.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/particles.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/terrain.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/terrain/moon.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/terrain/sun.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/title/black.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/title/mclogo.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Common/res/title/mojang.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Battle And Beasts 2/BattleAndBeasts2.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Battle And Beasts/BattleAndBeasts.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Candy Texture Pack/Data/media.arc create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Candy Texture Pack/Data/x16Data.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Candy Texture Pack/TexturePack.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Cartoon Texture Pack/Data/media.arc create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Cartoon Texture Pack/Data/x32Data.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Cartoon Texture Pack/TexturePack.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/City Texture Pack/Data/media.arc create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/City Texture Pack/Data/x32Data.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/City Texture Pack/TexturePack.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Doctor Who Skins Volume I/SkinPackDrWho.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Fantasy Texture Pack/Data/media.arc create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Fantasy Texture Pack/Data/x32Data.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Fantasy Texture Pack/TexturePack.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Festive Skin Pack/SkinsFestive.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halloween Texture Pack/Data/media.arc create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halloween Texture Pack/Data/x16Data.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halloween Texture Pack/TexturePack.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Action Figure Hands.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/An End of Dying.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Cairo Suite 2.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Cloaked in Blackness.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Delta Halo Suite.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Dewy Decimate.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Earth City.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Finale 1.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Fingerprints Are Broken.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/First Step.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Flip and Sizzle.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Flollo.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/GameRules.grf create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/HALO M02.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/High Charity Suite 1.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Insignificantia (All Sloppy-No Joe).binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Intimate.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Money or Meteors.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Night Dreams.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Opening Suite 2.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Quiet Giant.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Rising Legacy.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Sacred Icon Suite 1.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Spirit of Fire.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Still, Moving.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Suite Fall.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Survive.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/The Big Guns.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Truth And Reconciliation.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Wolverines Reborn.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Work Burns and Runaway Grunts.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/halo.mcs create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/media.arc create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/x16Data.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/TexturePack.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Marvel Avengers/SkinPackMarvelAvengers1.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Marvel Guardians Of The Galaxy/SkinPackGOG.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Marvel Spider-Man/SkinPackMarvelSpiderman.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/01-The Fate of the Galaxy.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/02-Leaving Earth.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/03-Mars.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/04-A Cerberus Agent.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/05-The View of Palaven.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/06-A Future for the Krogan.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/07-Surkesh.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/08-The Ardat Yakshi.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/09-Rannoch.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/10-I'm Sorry.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/11-The Cerberus Plot.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/12-The Scientists.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/13-Aralakh Company.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/14-Prothean Beacon.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/15-Defeat.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/16-Reaper Chase.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/17-Stand Strong, Stand Together.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/18-I Was Lost Without You.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/19-The Fleets Arrive.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/20-We Face Our Enemy Together.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/21-I'm Proud Of You.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/22-An End, Once and For All.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/GameRules.grf create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/masseffect.mcs create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/media.arc create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/x16Data.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/TexturePack.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Natural Texture Pack/Data/media.arc create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Natural Texture Pack/Data/x32Data.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Natural Texture Pack/TexturePack.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Plastic Texture Pack/Data/media.arc create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Plastic Texture Pack/Data/x16Data.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Plastic Texture Pack/TexturePack.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skin Pack 1/Skins1.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skin Pack 2/Skins2.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skin Pack 3/Skins3.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skin Pack 4/Skins4_XB1.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skin Pack 5/SkinPack5.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skin Pack 6/SkinPack6.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/01 (A) Dragonborn.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/02 (A) Awake.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/03 (A) From Past To Present.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/06 (A) The City Gates.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/08 (A) Dragonsreach.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/09 (A) Tooth and Claw.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/13 (A) Distant Horizons.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/14 (A) Dawn.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/15 (A) The Jerall Mountains.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/17 (A) Secunda.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/19 (B) Frostfall.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/21 (B) Into Darkness.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/23 (B) Unbound.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/24 (B) Far Horizons.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/27 (B) The Streets of Whiterun.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/29 (B) The White River.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/31 (B) Standing Stones.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/33 (B) Tundra.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/34 (B) Journey's End.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/39 (C) Shadows and Echoes.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/41 (C) Aurora.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/43 (C) Towers and Shadows.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/45 (C) Solitude.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/46 (C) Watch the Skies.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/49 (C) Death in the Darkness.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/52 (C) Wind Guide You.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/GameRules.grf create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/media.arc create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/skyrim.mcs create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/x16Data.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/TexturePack.pck create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/MPHA_360x360.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/MPMA_360x360.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/MPSR_360x360.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SP1_360x360.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SP2_360x360.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SP3_360x360.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SP4_360x360.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SP5_360x360.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SP6_360x360.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPB2_360x360.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPB_360x360.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPC_360x360.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPD1_360x360.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPF_360x360.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPG_360x360.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPI_360x360.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPM_360x360.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPZ_360x360.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP01_360x360.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP02_360x360.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP03_360x360.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP04_360x360.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP05_360x360.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP06_360x360.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP07_360x360.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/DLCXbox1.cmp create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/SmallLogo.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Sound/Minecraft.msscmp create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/SplashScreen.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/StoreLogo.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/Update.alignmentchunk create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/WideLogo.png create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/cds/11.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/cds/13.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/cds/blocks.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/cds/cat.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/cds/chirp.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/cds/far.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/cds/mall.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/cds/mellohi.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/cds/stal.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/cds/strad.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/cds/ward.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/cds/where_are_we_now.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/calm1.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/calm2.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/calm3.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/creative1.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/creative2.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/creative3.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/creative4.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/creative5.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/creative6.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/hal1.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/hal2.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/hal3.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/hal4.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/menu1.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/menu2.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/menu3.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/menu4.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/nether1.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/nether2.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/nether3.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/nether4.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/nuance1.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/nuance2.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/piano1.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/piano2.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/piano3.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/the_end_dragon_alive.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/music/music/the_end_end.binka create mode 100644 Minecraft.Client/Durango/Layout/Image/Loose/xcompress.dll create mode 100644 Minecraft.Client/Durango/Leaderboards/DurangoLeaderboardManager.cpp create mode 100644 Minecraft.Client/Durango/Leaderboards/DurangoLeaderboardManager.h create mode 100644 Minecraft.Client/Durango/Leaderboards/DurangoStatsDebugger.cpp create mode 100644 Minecraft.Client/Durango/Leaderboards/DurangoStatsDebugger.h create mode 100644 Minecraft.Client/Durango/Leaderboards/GameProgress.cpp create mode 100644 Minecraft.Client/Durango/Leaderboards/GameProgress.h create mode 100644 Minecraft.Client/Durango/Miles/include/mss.h create mode 100644 Minecraft.Client/Durango/Miles/include/rrCore.h create mode 100644 Minecraft.Client/Durango/Miles/lib/auddurango.LTCG.lib create mode 100644 Minecraft.Client/Durango/Miles/lib/auddurango.lib create mode 100644 Minecraft.Client/Durango/Miles/lib/binkadurango.LTCG.lib create mode 100644 Minecraft.Client/Durango/Miles/lib/binkadurango.lib create mode 100644 Minecraft.Client/Durango/Miles/lib/fltdurango.LTCG.lib create mode 100644 Minecraft.Client/Durango/Miles/lib/fltdurango.lib create mode 100644 Minecraft.Client/Durango/Miles/lib/mssdurango.LTCG.lib create mode 100644 Minecraft.Client/Durango/Miles/lib/mssdurango.lib create mode 100644 Minecraft.Client/Durango/Miles/lib/mssdurangomidi.LTCG.lib create mode 100644 Minecraft.Client/Durango/Miles/lib/mssdurangomidi.lib create mode 100644 Minecraft.Client/Durango/Minecraft_Macros.h create mode 100644 Minecraft.Client/Durango/Network/ChatIntegrationLayer.cpp create mode 100644 Minecraft.Client/Durango/Network/ChatIntegrationLayer.h create mode 100644 Minecraft.Client/Durango/Network/DQRNetworkManager.cpp create mode 100644 Minecraft.Client/Durango/Network/DQRNetworkManager.h create mode 100644 Minecraft.Client/Durango/Network/DQRNetworkManager_FriendSessions.cpp create mode 100644 Minecraft.Client/Durango/Network/DQRNetworkManager_Log.cpp create mode 100644 Minecraft.Client/Durango/Network/DQRNetworkManager_SendReceive.cpp create mode 100644 Minecraft.Client/Durango/Network/DQRNetworkManager_XRNSEvent.cpp create mode 100644 Minecraft.Client/Durango/Network/DQRNetworkPlayer.cpp create mode 100644 Minecraft.Client/Durango/Network/DQRNetworkPlayer.h create mode 100644 Minecraft.Client/Durango/Network/NetworkPlayerDurango.cpp create mode 100644 Minecraft.Client/Durango/Network/NetworkPlayerDurango.h create mode 100644 Minecraft.Client/Durango/Network/PartyController.cpp create mode 100644 Minecraft.Client/Durango/Network/PartyController.h create mode 100644 Minecraft.Client/Durango/Network/PlatformNetworkManagerDurango.cpp create mode 100644 Minecraft.Client/Durango/Network/PlatformNetworkManagerDurango.h create mode 100644 Minecraft.Client/Durango/Network/Windows.Xbox.Networking.RealtimeSession.dll create mode 100644 Minecraft.Client/Durango/Network/base64.cpp create mode 100644 Minecraft.Client/Durango/Network/base64.h create mode 100644 Minecraft.Client/Durango/Network/windows.xbox.networking.realtimesession.pdb create mode 100644 Minecraft.Client/Durango/Network/windows.xbox.networking.realtimesession.winmd create mode 100644 Minecraft.Client/Durango/PresenceIds.h create mode 100644 Minecraft.Client/Durango/Resource.h create mode 100644 Minecraft.Client/Durango/Sentient/DurangoTelemetry.cpp create mode 100644 Minecraft.Client/Durango/Sentient/DurangoTelemetry.h create mode 100644 Minecraft.Client/Durango/Sentient/DynamicConfigurations.h create mode 100644 Minecraft.Client/Durango/Sentient/MinecraftTelemetry.h create mode 100644 Minecraft.Client/Durango/Sentient/SentientManager.h create mode 100644 Minecraft.Client/Durango/Sentient/SentientStats.h create mode 100644 Minecraft.Client/Durango/Sentient/SentientTelemetryCommon.h create mode 100644 Minecraft.Client/Durango/Sentient/TelemetryEnum.h create mode 100644 Minecraft.Client/Durango/ServiceConfig/Enums.xlsx create mode 100644 Minecraft.Client/Durango/ServiceConfig/Events-XBLA.8-149E11AEEvents.h create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonA.png create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonB.png create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonBack.png create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonDpadD.png create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonDpadL.png create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonDpadR.png create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonDpadU.png create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonLS.png create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonLeftBumper.png create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonLeftStick.png create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonLeftStick_Navigate.png create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonLeftStick_sides.png create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonLeftTrigger.png create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonRS.png create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonRightBumper.png create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonRightStick.png create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonRightTrigger.png create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonStart.png create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonX.png create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonY.png create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/index.html create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/left_arrow.png create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/left_arrow_hoverFocus.png create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/main.css create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/mobile.css create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/sg_logo_20.png create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/skin.css create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/snapped.css create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument/tablet.css create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument_de-DE.zip create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument_en-GB.zip create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument_es-ES.zip create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument_fr-FR.zip create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument_it-IT.zip create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument_ja-JP.zip create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument_ko-KR.zip create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument_pt-BR.zip create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument_pt-PT.zip create mode 100644 Minecraft.Client/Durango/ServiceConfig/HelpDocument_zh-CHT.zip create mode 100644 Minecraft.Client/Durango/ServiceConfig/MakeZips.py create mode 100644 Minecraft.Client/Durango/ServiceConfig/Minecraft_Service Config Workbook v1.2.xlsx create mode 100644 Minecraft.Client/Durango/ServiceConfig/loc/de-DE/index.html create mode 100644 Minecraft.Client/Durango/ServiceConfig/loc/en-GB/index.html create mode 100644 Minecraft.Client/Durango/ServiceConfig/loc/es-ES/index.html create mode 100644 Minecraft.Client/Durango/ServiceConfig/loc/fr-FR/index.html create mode 100644 Minecraft.Client/Durango/ServiceConfig/loc/it-IT/index.html create mode 100644 Minecraft.Client/Durango/ServiceConfig/loc/ja-JP/index.html create mode 100644 Minecraft.Client/Durango/ServiceConfig/loc/ko-KR/index.html create mode 100644 Minecraft.Client/Durango/ServiceConfig/loc/pt-BR/index.html create mode 100644 Minecraft.Client/Durango/ServiceConfig/loc/pt-PT/index.html create mode 100644 Minecraft.Client/Durango/ServiceConfig/loc/zh-CHT/index.html create mode 100644 Minecraft.Client/Durango/SmallLogo.png create mode 100644 Minecraft.Client/Durango/Social/SocialManager.h create mode 100644 Minecraft.Client/Durango/Sound/Minecraft.msscmp create mode 100644 Minecraft.Client/Durango/SplashScreen.png create mode 100644 Minecraft.Client/Durango/StoreLogo.png create mode 100644 Minecraft.Client/Durango/Update.alignmentchunk create mode 100644 Minecraft.Client/Durango/WideLogo.png create mode 100644 Minecraft.Client/Durango/XML/ATGXmlParser.cpp create mode 100644 Minecraft.Client/Durango/XML/ATGXmlParser.h create mode 100644 Minecraft.Client/Durango/XML/xmlFilesCallback.h create mode 100644 Minecraft.Client/Durango/XboxGameMode.cpp create mode 100644 Minecraft.Client/Durango/XboxGameMode.h create mode 100644 Minecraft.Client/Durango/Xbox_Awards_enum.h create mode 100644 Minecraft.Client/Durango/Xbox_BuildVer.h create mode 100644 Minecraft.Client/Durango/Xbox_Debug_enum.h create mode 100644 Minecraft.Client/Durango/Xbox_Utils.cpp create mode 100644 Minecraft.Client/Durango/manifest.xml create mode 100644 Minecraft.Client/Durango/targetver.h (limited to 'Minecraft.Client/Durango') diff --git a/Minecraft.Client/Durango/4JLibs/Media/4J_strings.resx b/Minecraft.Client/Durango/4JLibs/Media/4J_strings.resx new file mode 100644 index 00000000..c8243fc0 --- /dev/null +++ b/Minecraft.Client/Durango/4JLibs/Media/4J_strings.resx @@ -0,0 +1,171 @@ + + + + Not Used + + + + OK + + + Back + + + Cancel + + + Yes + + + No + + + Corrupt Save + + + Your save data appears to be corrupt. Create a new save and overwrite the corrupt one? + + + No Free Space + + + Your selected storage device doesn't have enough free space to create a game save. + + + Select again + + + Play without saving + + + Create a new save + + + Overwrite save? + + + Your selected storage device already contains this save. Is it OK to overwrite it? + + + No - don't overwrite + + + Overwrite and save + + + Save failed + + + Storage Device Problem + + + Your storage device is unavailable or has an error + + + Your storage device is unavailable or has an error. Please select a new storage device. + + + Select a new storage device + + + No storage device selected + + + If you do not select a storage device, game saves will be disabled + + + Select a storage device + + + Continue without saving + + + Your storage device has been removed. Please select a new one. + + + Loading failed + + + Name the save + + + Enter a name for your savegame + + + Return to Xbox Dashboard + + + Are you sure you want to exit the game? + + + + Signed out + + + You have been returned to the title screen because your gamer profile was signed out + + + The match has ended because a gamer profile was signed out + + + Continue playing + + + + Gamer profile not online + + + This game has some features which require an Xbox LIVE enabled gamer profile, but you are currently offline. + + + This feature requires a gamer profile which is signed into Xbox LIVE. + + + Connect to Xbox LIVE + + + Continue playing offline + + + + + Achievement Award Problem + + + There was a problem accessing your gamer profile. Your achievement could not be awarded at this time. + + + + + Gamer profile problem + + + Saving of settings to gamer profile has failed. + + + + Guest Gamer Profile + + + Guest gamer profile cannot access this feature. Please use a different gamer profile. + + + + Saving… + + + Saving content. Please don't turn off your console. + + + Unlock Full Game + + + This is the Minecraft trial game. If you had the full game, you would just have earned an achievement! +Unlock the full game to experience the joy of Minecraft and to play with your friends across the globe through Xbox LIVE. +Would you like to unlock the full game? + + + You are being returned to the main menu because of a problem reading your profile. + + + diff --git a/Minecraft.Client/Durango/4JLibs/inc/4J_Input.h b/Minecraft.Client/Durango/4JLibs/inc/4J_Input.h new file mode 100644 index 00000000..884f281e --- /dev/null +++ b/Minecraft.Client/Durango/4JLibs/inc/4J_Input.h @@ -0,0 +1,165 @@ +#pragma once + +#define MAP_STYLE_0 0 +#define MAP_STYLE_1 1 +#define MAP_STYLE_2 2 + +#define _360_JOY_BUTTON_A 0x00000001 +#define _360_JOY_BUTTON_B 0x00000002 +#define _360_JOY_BUTTON_X 0x00000004 +#define _360_JOY_BUTTON_Y 0x00000008 + +#define _360_JOY_BUTTON_START 0x00000010 +#define _360_JOY_BUTTON_BACK 0x00000020 +#define _360_JOY_BUTTON_RB 0x00000040 +#define _360_JOY_BUTTON_LB 0x00000080 + +#define _360_JOY_BUTTON_RTHUMB 0x00000100 +#define _360_JOY_BUTTON_LTHUMB 0x00000200 +#define _360_JOY_BUTTON_DPAD_UP 0x00000400 +#define _360_JOY_BUTTON_DPAD_DOWN 0x00000800 + +#define _360_JOY_BUTTON_DPAD_LEFT 0x00001000 +#define _360_JOY_BUTTON_DPAD_RIGHT 0x00002000 +// fake digital versions of analog values +#define _360_JOY_BUTTON_LSTICK_RIGHT 0x00004000 +#define _360_JOY_BUTTON_LSTICK_LEFT 0x00008000 + +#define _360_JOY_BUTTON_RSTICK_DOWN 0x00010000 +#define _360_JOY_BUTTON_RSTICK_UP 0x00020000 +#define _360_JOY_BUTTON_RSTICK_RIGHT 0x00040000 +#define _360_JOY_BUTTON_RSTICK_LEFT 0x00080000 + +#define _360_JOY_BUTTON_LSTICK_DOWN 0x00100000 +#define _360_JOY_BUTTON_LSTICK_UP 0x00200000 +#define _360_JOY_BUTTON_RT 0x00400000 +#define _360_JOY_BUTTON_LT 0x00800000 + +#define _360_GTC_PLAY 0x01000000 +#define _360_GTC_PAUSE 0x02000000 +#define _360_GTC_MENU 0x04000000 +#define _360_GTC_VIEW 0x08000000 +#define _360_GTC_BACK 0x10000000 + +// Stick axis maps - to allow changes for SouthPaw in-game axis mapping +#define AXIS_MAP_LX 0 +#define AXIS_MAP_LY 1 +#define AXIS_MAP_RX 2 +#define AXIS_MAP_RY 3 + +// Trigger map - to allow for swap triggers in-game +#define TRIGGER_MAP_0 0 +#define TRIGGER_MAP_1 1 + +typedef struct _STRING_VERIFY_RESPONSE +{ + WORD wNumStrings; + HRESULT *pStringResult; +} +STRING_VERIFY_RESPONSE; + +class C4JStringTable +{ +public: + LPCWSTR Lookup(LPCWSTR szId) {return NULL;} + LPCWSTR Lookup(UINT nIndex) {return NULL;} + void Clear(); + HRESULT Load(LPCWSTR szId) {return S_OK;} +}; + +class C_4JInput +{ +public: + static const int MAX_GAMEPADS = 8; + enum EKeyboardResult + { + EKeyboard_Pending, + EKeyboard_Cancelled, + EKeyboard_ResultAccept, + EKeyboard_ResultDecline, + }; + + enum EKeyboardMode + { + EKeyboardMode_Default, + EKeyboardMode_Numeric, + EKeyboardMode_Password, + EKeyboardMode_Alphabet, + EKeyboardMode_Full, + EKeyboardMode_Alphabet_Extended, + EKeyboardMode_IP_Address, + EKeyboardMode_Phone, + EKeyboardMode_URL, + EKeyboardMode_Email + + }; + + void Initialise( int iInputStateC, unsigned char ucMapC,unsigned char ucActionC, unsigned char ucMenuActionC ); + void Tick(void); + void SetDeadzoneAndMovementRange(unsigned int uiDeadzoneAnalog, unsigned int uiDeadzoneDigital ,unsigned int uiAnalogMovementRangeMax ); + void SetGameJoypadMaps(unsigned char ucMap,unsigned char ucAction,unsigned int uiActionVal); + unsigned int GetGameJoypadMaps(unsigned char ucMap,unsigned char ucAction); + void SetJoypadMapVal(int iPad,unsigned char ucMap); + unsigned char GetJoypadMapVal(int iPad); + void SetJoypadSensitivity(int iPad, float fSensitivity); + unsigned int GetValue(int iPad,unsigned char ucAction, bool bRepeat=false); + bool ButtonPressed(int iPad,unsigned char ucAction=255); // toggled + bool ButtonReleased(int iPad,unsigned char ucAction); //toggled + bool ButtonDown(int iPad,unsigned char ucAction=255); // button held down + // Functions to remap the axis and triggers for in-game (not menus) - SouthPaw, etc + void SetJoypadStickAxisMap(int iPad,unsigned int uiFrom, unsigned int uiTo); + void SetJoypadStickTriggerMap(int iPad,unsigned int uiFrom, unsigned int uiTo); + void SetKeyRepeatRate(float fRepeatDelaySecs,float fRepeatRateSecs); + void SetDebugSequence( const char *chSequenceA,int( *Func)(LPVOID),LPVOID lpParam ); + FLOAT GetIdleSeconds(int iPad); + unsigned int GetConnectedGamepadCount(); + bool IsPadConnected(int iPad); + bool IsPadLocked(int iPad); + + // In-Game values which may have been remapped due to Southpaw, swap triggers, etc + float GetJoypadStick_LX(int iPad, bool bCheckMenuDisplay=true); + float GetJoypadStick_LY(int iPad, bool bCheckMenuDisplay=true); + float GetJoypadStick_RX(int iPad, bool bCheckMenuDisplay=true); + float GetJoypadStick_RY(int iPad, bool bCheckMenuDisplay=true); + unsigned char GetJoypadLTrigger(int iPad, bool bCheckMenuDisplay=true); + unsigned char GetJoypadRTrigger(int iPad, bool bCheckMenuDisplay=true); + + void SetMenuDisplayed(int iPad, bool bVal); + +// EKeyboardResult RequestKeyboard(UINT uiTitle, UINT uiText, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam,EKeyboardMode eMode,C4JStringTable *pStringTable=NULL); +// EKeyboardResult RequestKeyboard(UINT uiTitle, LPCWSTR pwchDefault, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam, EKeyboardMode eMode,C4JStringTable *pStringTable=NULL); + EKeyboardResult RequestKeyboard(LPCWSTR Title, LPCWSTR Text, DWORD dwPad, int iMaxChars, int( *Func)(LPVOID,const bool),LPVOID lpParam,C_4JInput::EKeyboardMode eMode); + void DestroyKeyboard(); + + bool IsCircleCrossSwapped(); + void GetText(uint16_t *UTF16String); + // Online check strings against offensive list - TCR 92 + // TCR # 092 CMTV Player Text String Verification + // Requirement Any player-entered text visible to another player on Xbox LIVE must be verified using the Xbox LIVE service before being transmitted. Text that is rejected by the Xbox LIVE service must not be displayed. + // + // Remarks + // This requirement applies to any player-entered string that can be exposed to other players on Xbox LIVE. It includes session names, content descriptions, text messages, tags, team names, mottos, comments, and so on. + // + // Games may decide to not send the text, blank it out, or use generic text if the text was rejected by the Xbox LIVE service. + // + // Games verify the text by calling the XStringVerify function. + // + // Exemption It is not required to use the Xbox LIVE service to verify real-time text communication. An example of real-time text communication is in-game text chat. + // + // Intent Protect players from inappropriate language. + bool VerifyStrings(WCHAR **pwStringA,int iStringC,int( *Func)(LPVOID,STRING_VERIFY_RESPONSE *),LPVOID lpParam); + void CancelQueuedVerifyStrings(int( *Func)(LPVOID,STRING_VERIFY_RESPONSE *),LPVOID lpParam); + void CancelAllVerifyInProgress(void); + + //bool InputDetected(DWORD dwUserIndex,WCHAR *pwchInput); + + void SetEnabledGtcButtons(long long llEnabledButtons); + + Windows::Xbox::System::User^ GetUserForGamepad(int iPad); + + // Handle PLM events + void Resume(); +}; + +// Singleton +extern C_4JInput InputManager; diff --git a/Minecraft.Client/Durango/4JLibs/inc/4J_Profile.h b/Minecraft.Client/Durango/4JLibs/inc/4J_Profile.h new file mode 100644 index 00000000..dab46417 --- /dev/null +++ b/Minecraft.Client/Durango/4JLibs/inc/4J_Profile.h @@ -0,0 +1,162 @@ +#pragma once + +namespace WXAMS = Windows::Xbox::ApplicationModel::Store; +namespace WXS = Windows::Xbox::System; +namespace MXS = Microsoft::Xbox::Services; + +enum eAwardType +{ + eAwardType_Achievement = 0, + eAwardType_GamerPic, + eAwardType_Theme, + eAwardType_AvatarItem, +}; + +enum eUpsellType +{ + eUpsellType_Custom = 0, // This is the default, and means that the upsell dialog was initiated in the app code + eUpsellType_Achievement, + eUpsellType_GamerPic, + eUpsellType_Theme, + eUpsellType_AvatarItem, +}; + +enum eUpsellResponse +{ + eUpsellResponse_Declined, + eUpsellResponse_Accepted_NoPurchase, + eUpsellResponse_Accepted_Purchase, +}; + +// Public version of PlayerUID that hides any C++/Cx functions +class PlayerUID +{ +protected: + std::wstring m_UID; + +public: + class Hash + { + public: + std::size_t operator()(PlayerUID const& k) const; + }; + + PlayerUID(); + PlayerUID(std::wstring fromString); + + bool operator==(const PlayerUID &rhs) const; + bool operator!=(const PlayerUID &rhs); + + std::wstring toString() const; +}; +typedef PlayerUID *PPlayerUID; + +class C_4JProfile +{ +public: + struct PROFILESETTINGS + { + int iYAxisInversion; + int iControllerSensitivity; + int iVibration; + bool bSwapSticks; + }; + + + // 4 players have game defined data, puiGameDefinedDataChangedBitmask needs to be checked by the game side to see if there's an update needed - it'll have the bits set for players to be updated + void Initialise( const std::wstring &serviceConfigId, const std::wstring &titleProductId ); + //void SetTrialTextStringTable(CXuiStringTable *pStringTable,int iAccept,int iReject); + void SetTrialAwardText(eAwardType AwardType,int iTitle,int iText); // achievement popup in the trial game + int GetLockedProfile(); + void SetLockedProfile(int iProf); + bool IsSignedIn(int iQuadrant); + bool IsSignedInLive(int iProf); + bool IsGuest(int iQuadrant); + UINT RequestSignInUI(bool bFromInvite,bool bLocalGame,bool bNoGuestsAllowed,bool bMultiplayerSignIn,bool bAddUser, int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY); + UINT DisplayOfflineProfile(int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY); + UINT RequestConvertOfflineToGuestUI(int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY); + void SetPrimaryPlayerChanged(bool bVal); + bool QuerySigninStatus(void); + void GetXUID(int iPad, PlayerUID *pXuid,bool bOnlineXuid); + BOOL AreXUIDSEqual(PlayerUID xuid1,PlayerUID xuid2); + BOOL XUIDIsGuest(PlayerUID xuid); + bool AllowedToPlayMultiplayer(int iProf); + void StartTrialGame(); // disables saves and leaderboard, and change state to readyforgame from pregame + void AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly, BOOL *allAllowed, BOOL *friendsAllowed); + BOOL CanViewPlayerCreatedContent(int iPad, bool thisQuadrantOnly, PPlayerUID pXuids, DWORD dwXuidCount ); + bool GetProfileAvatar(int iPad,int( *Func)(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes), LPVOID lpParam); + void CancelProfileAvatarRequest(); + void ShowProfileCard(int iPad, PlayerUID targetUid); + void ShowAddFriend(int iPad, PlayerUID targetUid); + + void CheckPrivilege(int iPad, bool thisQuadrantOnly, WXAMS::KnownPrivileges privilege, void( *Func)(LPVOID, bool, int),LPVOID lpParam); + void CheckPrivileges(int iPad, bool thisQuadrantOnly, const std::vector &privileges, void( *Func)(LPVOID, bool, int),LPVOID lpParam); + + // Some helper functions to wrap common combinations of privileges + void CheckMultiplayerPrivileges(int iPad, bool thisQuadrantOnly, void( *Func)(LPVOID, bool, int),LPVOID lpParam); + + + // SYS + WXS::User^ GetUser(int iPad, bool incUsersSigningOut = false); + int GetPrimaryPad(); + void SetPrimaryPad(int iPad); + int AddGamepadToGame(int iPad); + void RemoveGamepadFromGame(int iPad); + void ClearGameUsers(); + char* GetGamertag(int iPad); + std::wstring GetDisplayName(int iPad); + bool IsFullVersion(); + void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam); + void SetNotificationsCallback(void ( *Func)(LPVOID, DWORD, unsigned int),LPVOID lpParam); + bool RegionIsNorthAmerica(void); + bool LocaleIsUSorCanada(void); + HRESULT GetLiveConnectionStatus(); + bool IsSystemUIDisplayed(); + void SetProfileReadErrorCallback(void ( *Func)(LPVOID), LPVOID lpParam); + void CompleteDeferredSignouts(); + void SetDeferredSignoutEnabled(bool enabled); + + // PROFILE DATA + //int SetDefaultOptionsCallback(int( *Func)(LPVOID,PROFILESETTINGS *, const int iPad),LPVOID lpParam); + //int SetOldProfileVersionCallback(int( *Func)(LPVOID,unsigned char *, const unsigned short,const int),LPVOID lpParam); + //PROFILESETTINGS * GetDashboardProfileSettings(int iPad); + //void WriteToProfile(int iQuadrant, bool bGameDefinedDataChanged=false, bool bOverride5MinuteLimitOnProfileWrites=false); + //void ForceQueuedProfileWrites(int iPad=XUSER_INDEX_ANY); + //void *GetGameDefinedProfileData(int iQuadrant); + void ResetProfileProcessState(); // after a sign out from the primary player, call this + void Tick( void ); + + void GetProfile(PlayerUID xuid, void (*func)(LPVOID, Microsoft::Xbox::Services::Social::XboxUserProfile^), LPVOID param); + void GetProfiles(std::vector xuids, void (*func)(LPVOID, std::vector), LPVOID param); + + // ACHIEVEMENTS & AWARDS + + //void RegisterAward(int iAwardNumber,int iGamerconfigID, eAwardType eType, bool bLeaderboardAffected=false, + // CXuiStringTable*pStringTable=NULL, int iTitleStr=-1, int iTextStr=-1, int iAcceptStr=-1, char *pszThemeName=NULL, unsigned int uiThemeSize=0L); + //int GetAwardId(int iAwardNumber); + eAwardType GetAwardType(int iAwardNumber); + bool CanBeAwarded(int iQuadrant, int iAwardNumber); + void Award(int iQuadrant, int iAwardNumber, bool bForce=false); + //bool IsAwardsFlagSet(int iQuadrant, int iAward); + + // RICH PRESENCE + + //void RichPresenceInit(int iPresenceCount, int iContextCount); + //void RegisterRichPresenceContext(int iGameConfigContextID); + //void SetRichPresenceContextValue(int iPad,int iContextID, int iVal); + void RegisterPresence(int presenceId, const std::wstring &presence); + void SetCurrentGameActivity(int iPad,int iNewPresence, bool bSetOthersToIdle=false); + void SetGameActivityForAllActiveUsers(int iNewPresence); + + // PURCHASE + void DisplayFullVersionPurchase(bool bRequired, int iQuadrant, int iUpsellParam = -1); + void SetUpsellCallback(void ( *Func)(LPVOID lpParam, eUpsellType type, eUpsellResponse response, int iUserData),LPVOID lpParam); + + // Debug + void SetDebugFullOverride(bool bVal); // To override the license version (trail/full). Only in debug/release, not ContentPackage + +}; + +// Singleton +extern C_4JProfile ProfileManager; + diff --git a/Minecraft.Client/Durango/4JLibs/inc/4J_Render.h b/Minecraft.Client/Durango/4JLibs/inc/4J_Render.h new file mode 100644 index 00000000..737caa98 --- /dev/null +++ b/Minecraft.Client/Durango/4JLibs/inc/4J_Render.h @@ -0,0 +1,302 @@ +#pragma once + +class ImageFileBuffer +{ +public: + enum EImageType + { + e_typePNG, + e_typeJPG + }; + + EImageType m_type; + void* m_pBuffer; + int m_bufferSize; + + int GetType() { return m_type; } + void *GetBufferPointer() { return m_pBuffer; } + int GetBufferSize() { return m_bufferSize; } + void Release() { free(m_pBuffer); m_pBuffer = NULL; } + bool Allocated() { return m_pBuffer != NULL; } +}; + +typedef struct +{ + int Width; + int Height; +}D3DXIMAGE_INFO; + +typedef struct _XSOCIAL_PREVIEWIMAGE { + BYTE *pBytes; + DWORD Pitch; + DWORD Width; + DWORD Height; +// D3DFORMAT Format; +} XSOCIAL_PREVIEWIMAGE, *PXSOCIAL_PREVIEWIMAGE; + +class C4JRender +{ +public: + void Tick(); + void UpdateGamma(unsigned short usGamma); + + // Matrix stack + void MatrixMode(int type); + void MatrixSetIdentity(); + void MatrixTranslate(float x,float y,float z); + void MatrixRotate(float angle, float x, float y, float z); + void MatrixScale(float x, float y, float z); + void MatrixPerspective(float fovy, float aspect, float zNear, float zFar); + void MatrixOrthogonal(float left,float right,float bottom,float top,float zNear,float zFar); + void MatrixPop(); + void MatrixPush(); + void MatrixMult(float *mat); + const float *MatrixGet(int type); + void Set_matrixDirty(); + + // Core + void Initialise(ID3D11Device *pDevice, IDXGISwapChain *pSwapChain); + void InitialiseContext(); + void StartFrame(); + void DoScreenGrabOnNextPresent(); + void Present(); + void Clear(int flags, D3D11_RECT *pRect = NULL); + void SetClearColour(const float colourRGBA[4]); + bool IsWidescreen(); + bool IsHiDef(); + void CaptureThumbnail(ImageFileBuffer *pngOut); + void CaptureScreen(ImageFileBuffer *jpgOut, XSOCIAL_PREVIEWIMAGE *previewOut); + void BeginConditionalSurvey(int identifier); + void EndConditionalSurvey(); + void BeginConditionalRendering(int identifier); + void EndConditionalRendering(); + + // Vertex data handling + typedef enum + { + VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 DWORD + VERTEX_TYPE_COMPRESSED, // Compressed format - see comment at top of VS_PS3_TS2_CS1.hlsl for description of layout + VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with lighting applied, + VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with tex gen + VERTEX_TYPE_COUNT + } eVertexType; + + // Pixel shader + typedef enum + { + PIXEL_SHADER_TYPE_STANDARD, + PIXEL_SHADER_TYPE_PROJECTION, + PIXEL_SHADER_TYPE_FORCELOD, + PIXEL_SHADER_COUNT + } ePixelShaderType; + + typedef enum + { + VIEWPORT_TYPE_FULLSCREEN, + VIEWPORT_TYPE_SPLIT_TOP, + VIEWPORT_TYPE_SPLIT_BOTTOM, + VIEWPORT_TYPE_SPLIT_LEFT, + VIEWPORT_TYPE_SPLIT_RIGHT, + VIEWPORT_TYPE_QUADRANT_TOP_LEFT, + VIEWPORT_TYPE_QUADRANT_TOP_RIGHT, + VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT, + VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT, + } eViewportType; + + typedef enum + { + PRIMITIVE_TYPE_TRIANGLE_LIST, + PRIMITIVE_TYPE_TRIANGLE_STRIP, + PRIMITIVE_TYPE_TRIANGLE_FAN, + PRIMITIVE_TYPE_QUAD_LIST, + PRIMITIVE_TYPE_LINE_LIST, + PRIMITIVE_TYPE_LINE_STRIP, + PRIMITIVE_TYPE_COUNT + } ePrimitiveType; + + void DrawVertices(ePrimitiveType PrimitiveType, int count, void *dataIn, eVertexType vType, C4JRender::ePixelShaderType psType); + void DrawVertexBuffer(ePrimitiveType PrimitiveType, int count, ID3D11Buffer *buffer, C4JRender::eVertexType vType, C4JRender::ePixelShaderType psType); + + // Command buffers + void CBuffLockStaticCreations(); + int CBuffCreate(int count); + void CBuffDelete(int first, int count); + void CBuffStart(int index, bool full = false); + void CBuffClear(int index); + int CBuffSize(int index); + void CBuffEnd(); + bool CBuffCall(int index, bool full = true); + void CBuffTick(); + void CBuffDeferredModeStart(); + void CBuffDeferredModeEnd(); + + typedef enum + { + TEXTURE_FORMAT_RxGyBzAw, // Normal 32-bit RGBA texture, 8 bits per component + /* Don't think these are all directly available on D3D 11 - leaving for now + TEXTURE_FORMAT_R0G0B0Ax, // One 8-bit component mapped to alpha channel, R=G=B=0 + TEXTURE_FORMAT_R1G1B1Ax, // One 8-bit component mapped to alpha channel, R=G=B=1 + TEXTURE_FORMAT_RxGxBxAx, // One 8-bit component mapped to all channels + */ + MAX_TEXTURE_FORMATS + } eTextureFormat; + + // Textures + int TextureCreate(); + void TextureFree(int idx); + void TextureBind(int idx); + void TextureBindVertex(int idx); + void TextureSetTextureLevels(int levels); + int TextureGetTextureLevels(); + void TextureData(int width, int height, void *data, int level, eTextureFormat format = TEXTURE_FORMAT_RxGyBzAw); + void TextureDataUpdate(int xoffset, int yoffset, int width, int height, void *data, int level); + void TextureSetParam(int param, int value); + void TextureDynamicUpdateStart(); + void TextureDynamicUpdateEnd(); + HRESULT LoadTextureData(const char *szFilename,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut); + HRESULT LoadTextureData(BYTE *pbData, DWORD dwBytes,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut); + HRESULT SaveTextureData(const char *szFilename, D3DXIMAGE_INFO *pSrcInfo, int *ppDataOut); + HRESULT SaveTextureDataToMemory(void *pOutput, int outputCapacity, int *outputLength, int width, int height, int *ppDataIn); + void TextureGetStats(); + ID3D11ShaderResourceView *TextureGetTexture(int idx); + + // State control + void StateSetColour(float r, float g, float b, float a); + void StateSetDepthMask(bool enable); + void StateSetBlendEnable(bool enable); + void StateSetBlendFunc(int src, int dst); + void StateSetBlendFactor(unsigned int colour); + void StateSetAlphaFunc(int func, float param); + void StateSetDepthFunc(int func); + void StateSetFaceCull(bool enable); + void StateSetFaceCullCW(bool enable); + void StateSetLineWidth(float width); + void StateSetWriteEnable(bool red, bool green, bool blue, bool alpha); + void StateSetDepthTestEnable(bool enable); + void StateSetAlphaTestEnable(bool enable); + void StateSetDepthSlopeAndBias(float slope, float bias); + void StateSetFogEnable(bool enable); + void StateSetFogMode(int mode); + void StateSetFogNearDistance(float dist); + void StateSetFogFarDistance(float dist); + void StateSetFogDensity(float density); + void StateSetFogColour(float red, float green, float blue); + void StateSetLightingEnable(bool enable); + void StateSetVertexTextureUV( float u, float v); + void StateSetLightColour(int light, float red, float green, float blue); + void StateSetLightAmbientColour(float red, float green, float blue); + void StateSetLightDirection(int light, float x, float y, float z); + void StateSetLightEnable(int light, bool enable); + void StateSetViewport(eViewportType viewportType); + void StateSetEnableViewportClipPlanes(bool enable); + void StateSetTexGenCol(int col, float x, float y, float z, float w, bool eyeSpace); + void StateSetStencil(int Function, uint8_t stencil_ref, uint8_t stencil_func_mask, uint8_t stencil_write_mask); + void StateSetForceLOD(int LOD); + + // Event tracking + void BeginEvent(LPCWSTR eventName); + void EndEvent(); + + // PLM event handling + void Suspend(); + bool Suspended(); + void Resume(); +}; + + +const int GL_MODELVIEW_MATRIX = 0; +const int GL_PROJECTION_MATRIX = 1; +const int GL_MODELVIEW = 0; +const int GL_PROJECTION = 1; +const int GL_TEXTURE = 2; + +// These things required for tex gen + +const int GL_S = 0; +const int GL_T = 1; +const int GL_R = 2; +const int GL_Q = 3; + +const int GL_TEXTURE_GEN_S = 0; +const int GL_TEXTURE_GEN_T = 1; +const int GL_TEXTURE_GEN_Q = 2; +const int GL_TEXTURE_GEN_R = 3; + +const int GL_TEXTURE_GEN_MODE = 0; +const int GL_OBJECT_LINEAR = 0; +const int GL_EYE_LINEAR = 1; +const int GL_OBJECT_PLANE = 0; +const int GL_EYE_PLANE = 1; + + +// These things are used by glEnable/glDisable so must be different and non-zero (zero is used by things we haven't assigned yet) +const int GL_TEXTURE_2D = 1; +const int GL_BLEND = 2; +const int GL_CULL_FACE = 3; +const int GL_ALPHA_TEST = 4; +const int GL_DEPTH_TEST = 5; +const int GL_FOG = 6; +const int GL_LIGHTING = 7; +const int GL_LIGHT0 = 8; +const int GL_LIGHT1 = 9; + +const int CLEAR_DEPTH_FLAG = 1; +const int CLEAR_COLOUR_FLAG = 2; + +const int GL_DEPTH_BUFFER_BIT = CLEAR_DEPTH_FLAG; +const int GL_COLOR_BUFFER_BIT = CLEAR_COLOUR_FLAG; + +const int GL_SRC_ALPHA = D3D11_BLEND_SRC_ALPHA; +const int GL_ONE_MINUS_SRC_ALPHA = D3D11_BLEND_INV_SRC_ALPHA; +const int GL_ONE = D3D11_BLEND_ONE; +const int GL_ZERO = D3D11_BLEND_ZERO; +const int GL_DST_ALPHA = D3D11_BLEND_DEST_ALPHA; +const int GL_SRC_COLOR = D3D11_BLEND_SRC_COLOR; +const int GL_DST_COLOR = D3D11_BLEND_DEST_COLOR; +const int GL_ONE_MINUS_DST_COLOR = D3D11_BLEND_INV_DEST_COLOR; +const int GL_ONE_MINUS_SRC_COLOR = D3D11_BLEND_INV_SRC_COLOR; +const int GL_CONSTANT_ALPHA = D3D11_BLEND_BLEND_FACTOR; +const int GL_ONE_MINUS_CONSTANT_ALPHA = D3D11_BLEND_INV_BLEND_FACTOR; + +const int GL_GREATER = D3D11_COMPARISON_GREATER; +const int GL_EQUAL = D3D11_COMPARISON_EQUAL; +const int GL_LEQUAL = D3D11_COMPARISON_LESS_EQUAL; +const int GL_GEQUAL = D3D11_COMPARISON_GREATER_EQUAL; +const int GL_ALWAYS = D3D11_COMPARISON_ALWAYS; + +const int GL_TEXTURE_MIN_FILTER = 1; +const int GL_TEXTURE_MAG_FILTER = 2; +const int GL_TEXTURE_WRAP_S = 3; +const int GL_TEXTURE_WRAP_T = 4; + +const int GL_NEAREST = 0; +const int GL_LINEAR = 1; +const int GL_EXP = 2; +const int GL_NEAREST_MIPMAP_LINEAR = 0; // TODO - mipmapping bit of this + +const int GL_CLAMP = 0; +const int GL_REPEAT = 1; + +const int GL_FOG_START = 1; +const int GL_FOG_END = 2; +const int GL_FOG_MODE = 3; +const int GL_FOG_DENSITY = 4; +const int GL_FOG_COLOR = 5; + +const int GL_POSITION = 1; +const int GL_AMBIENT = 2; +const int GL_DIFFUSE = 3; +const int GL_SPECULAR = 4; + +const int GL_LIGHT_MODEL_AMBIENT = 1; + +const int GL_LINES = C4JRender::PRIMITIVE_TYPE_LINE_LIST; +const int GL_LINE_STRIP = C4JRender::PRIMITIVE_TYPE_LINE_STRIP; +const int GL_QUADS = C4JRender::PRIMITIVE_TYPE_QUAD_LIST; +const int GL_TRIANGLE_FAN = C4JRender::PRIMITIVE_TYPE_TRIANGLE_FAN; +const int GL_TRIANGLE_STRIP = C4JRender::PRIMITIVE_TYPE_TRIANGLE_STRIP; + +// Singleton +extern C4JRender RenderManager; + + diff --git a/Minecraft.Client/Durango/4JLibs/inc/4J_Storage.h b/Minecraft.Client/Durango/4JLibs/inc/4J_Storage.h new file mode 100644 index 00000000..be5d57fd --- /dev/null +++ b/Minecraft.Client/Durango/4JLibs/inc/4J_Storage.h @@ -0,0 +1,492 @@ +#pragma once +using namespace std; + +#define MAX_DISPLAYNAME_LENGTH 128 // SCE_SAVE_DATA_SUBTITLE_MAXSIZE on PS4 +#define MAX_SAVEFILENAME_LENGTH 32 // SCE_SAVE_DATA_DIRNAME_DATA_MAXSIZE +#define USER_INDEX_ANY 0x000000FF +#define RESULT LONG + +class StringTable; + +typedef struct +{ + time_t modifiedTime; + unsigned int dataSize; + unsigned int thumbnailSize; +} +CONTAINER_METADATA; + +typedef struct +{ + wchar_t UTF16SaveFilename[MAX_SAVEFILENAME_LENGTH]; + wchar_t UTF16SaveTitle[MAX_DISPLAYNAME_LENGTH]; + CONTAINER_METADATA metaData; + PBYTE thumbnailData; + uint64 totalSize; + bool needsSync; + //int sizeKB; +} +SAVE_INFO,*PSAVE_INFO; + +typedef struct +{ + int iSaveC; + int iThumbnailC; + PSAVE_INFO SaveInfoA; +} +SAVE_DETAILS,*PSAVE_DETAILS; + +class CONTENT_DATA +{ +public: + int DeviceID; + DWORD dwContentType; + WCHAR wszDisplayName[256]; + WCHAR wszProductID[64]; + bool bTrialLicense; + //WCHAR szFileName[MAX_SAVEFILENAME_LENGTH]; +}; + +typedef CONTENT_DATA XCONTENT_DATA, *PXCONTENT_DATA; + +typedef struct _MARKETPLACE_CONTENTOFFER_INFO +{ + WCHAR *wszProductID; + WCHAR *wszOfferName; + BOOL fUserHasPurchased; + WCHAR *wszSellText; + WCHAR *wszCurrencyPrice; + WCHAR *wszSignedOfferID; +} MARKETPLACE_CONTENTOFFER_INFO, *PMARKETPLACE_CONTENTOFFER_INFO; + +typedef enum +{ + XMARKETPLACE_OFFERING_TYPE_CONTENT = 0x00000002, + //XMARKETPLACE_OFFERING_TYPE_GAME_DEMO = 0x00000020, + //XMARKETPLACE_OFFERING_TYPE_GAME_TRAILER = 0x00000040, + XMARKETPLACE_OFFERING_TYPE_THEME = 0x00000080, + XMARKETPLACE_OFFERING_TYPE_TILE = 0x00000800, + //XMARKETPLACE_OFFERING_TYPE_ARCADE = 0x00002000, + //XMARKETPLACE_OFFERING_TYPE_VIDEO = 0x00004000, + //XMARKETPLACE_OFFERING_TYPE_CONSUMABLE = 0x00010000, + XMARKETPLACE_OFFERING_TYPE_AVATARITEM = 0x00100000 +} XMARKETPLACE_OFFERING_TYPE; + + + +enum eWebServiceState +{ + eWebService_idle, + eWebService_notsignedin, + eWebService_pending, + eWebService_error, + eWebService_busy +}; + +enum eTitleStorageState +{ + eTitleStorage_idle, + eTitleStorage_notsignedin, + eTitleStorage_pending, + eTitleStorage_complete, + eTitleStorage_readcomplete, + eTitleStorage_readfilelistcomplete, + eTitleStorage_writecomplete, + eTitleStorage_deletecomplete, + eTitleStorage_error, + eTitleStorage_readerror, + eTitleStorage_readfilelisterror, + eTitleStorage_writeerror, + eTitleStorage_deleteerror, + eTitleStorage_busy +}; + +// Current version of the dlc data creator +#define CURRENT_DLC_VERSION_NUM 3 + +class C4JStorage +{ +public: + + struct PROFILESETTINGS + { + int iYAxisInversion; + int iControllerSensitivity; + int iVibration; + bool bSwapSticks; + }; + + // Structs defined in the DLC_Creator, but added here to be used in the app + typedef struct + { + unsigned int uiFileSize; + DWORD dwType; + DWORD dwWchCount; // count of WCHAR in next array + WCHAR wchFile[1]; + } + DLC_FILE_DETAILS, *PDLC_FILE_DETAILS; + + typedef struct + { + DWORD dwType; + DWORD dwWchCount; // count of WCHAR in next array; + WCHAR wchData[1]; // will be an array of size dwBytes + } + DLC_FILE_PARAM, *PDLC_FILE_PARAM; + // End of DLC_Creator structs + + typedef struct + { + DWORD dwVersion; + DWORD dwNewOffers; + DWORD dwTotalOffers; + DWORD dwInstalledTotalOffers; + BYTE bPadding[1024-sizeof(DWORD)*4]; // future expansion + } + DLC_TMS_DETAILS; + + typedef struct + { + DWORD dwSize; + PBYTE pbData; + } + TMSPP_FILEDATA, *PTMSPP_FILEDATA; + + enum eTMS_FILETYPEVAL + { + TMS_FILETYPE_BINARY=0, + TMS_FILETYPE_CONFIG=1, + TMS_FILETYPE_JSON=2, + TMS_FILETYPE_MAX, + }; + + typedef struct + { + WCHAR wchFilename[64]; + unsigned long ulFileSize; + eTMS_FILETYPEVAL eFileTypeVal; + } + TMSPP_FILE_DETAILS, *PTMSPP_FILE_DETAILS; + + typedef struct + { + int iCount; + PTMSPP_FILE_DETAILS FileDetailsA; + } + TMSPP_FILE_LIST, *PTMSPP_FILE_LIST; + + typedef struct + { + PBYTE pbData; + unsigned long ulFileLen; + } + SAVETRANSFER_FILE_DETAILS; + + enum eGlobalStorage + { + //eGlobalStorage_GameClip=0, + eGlobalStorage_Title=0, + eGlobalStorage_TitleUser, + eGlobalStorage_Max + }; + + enum EMessageResult + { + EMessage_Undefined=0, + EMessage_Busy, + EMessage_Pending, + EMessage_Cancelled, + EMessage_ResultAccept, + EMessage_ResultDecline, + EMessage_ResultThirdOption, + EMessage_ResultFourthOption + }; + + enum ESaveGameState + { + ESaveGame_Idle=0, + + ESaveGame_Save, + ESaveGame_SaveCompleteSuccess, + ESaveGame_SaveCompleteFail, + ESaveGame_SaveIncomplete, + ESaveGame_SaveIncomplete_WaitingOnResponse, + + ESaveGame_SaveSubfiles, + ESaveGame_SaveSubfilesCompleteSuccess, + ESaveGame_SaveSubfilesCompleteFail, + ESaveGame_SaveSubfilesIncomplete, + ESaveGame_SaveSubfilesIncomplete_WaitingOnResponse, + + ESaveGame_Load, + ESaveGame_LoadComplete, + ESaveGame_EnumerateSubfiles, + ESaveGame_EnumerateSubfilesComplete, + ESaveGame_LoadSubfiles, + ESaveGame_LoadCompleteSuccess, + + ESaveGame_LoadCompleteFail, + + ESaveGame_Delete, + ESaveGame_DeleteSuccess, + ESaveGame_DeleteFail, + + ESaveGame_Rename, + ESaveGame_RenameSuccess, + ESaveGame_RenameFail, + + ESaveGame_GetSaveThumbnail, + ESaveGame_GetSaveThumbnailComplete, + + ESaveGame_Copy, + ESaveGame_CopyCompleteSuccess, + ESaveGame_CopyCompleteFail, + }; + + enum EOptionsState + { + EOptions_Idle=0, + EOptions_Save, + EOptions_Load, + EOptions_Delete, + EOptions_NoSpace, + EOptions_Corrupt, + }; + + enum ESaveGameStatus + { + EDeleteGame_Idle=0, + EDeleteGame_InProgress, + }; + + enum EDLCStatus + { + EDLC_Error=0, + EDLC_Idle, + EDLC_NoOffers, + EDLC_AlreadyEnumeratedAllOffers, + EDLC_NoInstalledDLC, + EDLC_Pending, + EDLC_LoadInProgress, + EDLC_Loaded, + EDLC_ChangedDevice + }; + + enum ESavingMessage + { + ESavingMessage_None=0, + ESavingMessage_Short, + ESavingMessage_Long + }; + + enum ESaveIncompleteType + { + ESaveIncomplete_None, + ESaveIncomplete_OutOfQuota, + ESaveIncomplete_OutOfLocalStorage, + ESaveIncomplete_Unknown + }; + + enum ETMSStatus + { + ETMSStatus_Idle=0, + ETMSStatus_Fail, + ETMSStatus_ReadInProgress, + ETMSStatus_ReadFileListInProgress, + ETMSStatus_WriteInProgress, + ETMSStatus_Fail_ReadInProgress, + ETMSStatus_Fail_ReadFileListInProgress, + ETMSStatus_Fail_ReadDetailsNotRetrieved, + ETMSStatus_Fail_WriteInProgress, + ETMSStatus_DeleteInProgress, + ETMSStatus_Pending, + }; + + enum eTMS_FileType + { + eTMS_FileType_Normal=0, + eTMS_FileType_Graphic, + }; + + enum ESGIStatus + { + ESGIStatus_Error=0, + ESGIStatus_Idle, + ESGIStatus_ReadInProgress, + ESGIStatus_NoSaves, + }; + + enum + { + PROFILE_READTYPE_ALL, + PROFILE_READTYPE_XBOXSETTINGS // just read the settings (after a notification of settings change) + }; + + enum eOptionsCallback + { + eOptions_Callback_Idle, + eOptions_Callback_Write, + eOptions_Callback_Write_Fail_NoSpace, + eOptions_Callback_Write_Fail, + eOptions_Callback_Read, + eOptions_Callback_Read_Fail, + eOptions_Callback_Read_FileNotFound, + eOptions_Callback_Read_Corrupt, + eOptions_Callback_Read_CorruptDeletePending, + eOptions_Callback_Read_CorruptDeleted + }; + + enum eSaveTransferState + { + eSaveTransfer_Idle, + eSaveTransfer_Busy, + eSaveTransfer_GettingFileSize, + eSaveTransfer_FileSizeRetrieved, + eSaveTransfer_GetFileData, + eSaveTransfer_GettingFileData, + eSaveTransfer_FileDataRetrieved, + eSaveTransfer_Converting, + eSaveTransfer_Saving, + }; + + ///////////////////////////////////////////////////////////////////////////// Global storage manager ////////////////////////////////////////////////////////////////////////////// + + C4JStorage(); + void Tick(void); // General storage manager tick to be called from game + + ///////////////////////////////////////////////////////////////////////////// Savegame data /////////////////////////////////////////////////////////////////////////////////////// + + // Initialisation + void Init(unsigned int uiSaveVersion,LPCWSTR pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize, // General manager initialisation + int( *Func)(LPVOID, const ESavingMessage, int),LPVOID lpParam, + bool(*SetRetrieveProductIDFn)(XCONTENT_DATA &Data),WCHAR *pwchSCID,WCHAR *pwchTitleId); + void SetGameSaveFolderTitle(WCHAR *wszGameSaveFolderTitle); // Sets the title to be set in the param.sfo of saves (this doesn't vary, the sub-title is used for the user cho + void SetSaveCacheFolderTitle(WCHAR *wszSaveCacheFolderTitle); // Sets the title to be set in the param.sfo of the save cache + void SetOptionsFolderTitle(WCHAR *wszOptionsFolderTitle); // Sets the title to be set in the param.sfo of the options file + void SetGameSaveFolderPrefix(char *szGameSaveFolderPrefix); // Sets the prefix to be added to the unique filename of each save to construct a final folder name + void SetMaxSaves(int iMaxC); // Sets the maximum number of saves to be evaluated by GetSavesInfo etc. + void SetDefaultImages(PBYTE pbSaveThumbnail,DWORD dwSaveThumbnailBytes); // Sets default save thumbnail, which can be used when saving a game that hasn't generated any yet + void SetIncompleteSaveCallback(void( *Func)(LPVOID, const ESaveIncompleteType), LPVOID param); // Sets callback to be used in the event of a save method not being able to complete + + // Miscellaneous control + void SetSaveDisabled(bool bDisable); // Sets saving disabled/enabled state + bool GetSaveDisabled(void); // Determines whether saving has been disabled + void ResetSaveData(); // Releases any internal storage being held for previously saved/loaded data + C4JStorage::ESaveGameState DoesSaveExist(bool *pbExists); // Determine if current savegame exists on storage device + bool EnoughSpaceForAMinSaveGame(); + C4JStorage::ESaveGameState GetSaveState(); + + // Get details of existing savedata + C4JStorage::ESaveGameState GetSavesInfo(int iPad,int ( *Func)(LPVOID lpParam,SAVE_DETAILS *pSaveDetails,const bool),LPVOID lpParam,char *pszSavePackName); // Start search + PSAVE_DETAILS ReturnSavesInfo(); // Returns result of search (or NULL if not yet received) + void ClearSavesInfo(); // Clears results + C4JStorage::ESaveGameState LoadSaveDataThumbnail(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes), LPVOID lpParam, bool force=false); // Get the thumbnail for an individual save referenced by pSaveInfo + + // Loading savedata & obtaining information from just-loaded file + C4JStorage::ESaveGameState LoadSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool, const bool), LPVOID lpParam); // Loads savedata referenced by pSaveInfo, calls callback once complete + unsigned int GetSaveSize(); // Obtains sizse of just-loaded save + void GetSaveData(void *pvData,unsigned int *puiBytes); // Obtains pointer to, and size, of just-loaded save + bool GetSaveUniqueNumber(INT *piVal); // Gets the unique numeric portion of the folder name used for the save (encodes m + bool GetSaveUniqueFilename(char *pszName); // Get the full unique "filename" used as part of the folder name for the save + + // Handling of sub-files (numerically indexed ) within the save + unsigned int GetSubfileCount(); // Get the number of sub-files in the just-loaded save + void ResetSubfiles(); // Reset storage manager's references to sub-files, to be called when we are finished with the save game + void GetSubfileDetails(int idx, unsigned int *subfileId, unsigned char **data, unsigned int *sizeOut); // Gets details for sub-file from 0 to GetSubfileCount() - 1. Caller is responsible for data allocation after this point. + void UpdateSubfile(int idx, unsigned char *data, unsigned int size); // Update internal details for a sub-file, from 0 to GetSubfileCount() - 1. + int AddSubfile(unsigned int subfileId); // Adds an additional sub-file with a given subfileId, returns index + C4JStorage::ESaveGameState SaveSubfiles(int( *Func)(LPVOID ,const bool),LPVOID lpParam); // Writes all modified sub-files, calling callback on completion + + // Saving savedata + void SetSaveTitle(const wchar_t *UTF16String); // Sets the name which is used as a sub-title in the savedata param.sfo + PVOID AllocateSaveData(unsigned int uiBytes); // Allocate storage manager owned memory to the data which is to be saved to + void SetSaveDataSize(unsigned int uiBytes); // Set the actual size of data to be saved + void GetDefaultSaveImage(PBYTE *ppbSaveImage,DWORD *pdwSaveImageBytes); // Get the default save thumbnail (as set by SetDefaultImages) for use on saving games t + void GetDefaultSaveThumbnail(PBYTE *ppbSaveThumbnail,DWORD *pdwSaveThumbnailBytes); // Get the default save image (as set by SetDefaultImages) for use on saving games that + void SetSaveImages( PBYTE pbThumbnail,DWORD dwThumbnailBytes,PBYTE pbImage,DWORD dwImageBytes, PBYTE pbTextData ,DWORD dwTextDataBytes); // Sets the thumbnail & image for the save, optionally setting the metadata in the png + C4JStorage::ESaveGameState SaveSaveData(int( *Func)(LPVOID ,const bool),LPVOID lpParam); // Save the actual data, calling callback on completion + + // Handling of incomplete saves (either sub-files or save data). To be used after game has had callback for an incomplete save event + void ContinueIncompleteOperation(); + void CancelIncompleteOperation(); + + // Other file operations + C4JStorage::ESaveGameState DeleteSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool), LPVOID lpParam); // Deletes savedata referenced by pSaveInfo, calls callback when comple + C4JStorage::ESaveGameState CopySaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID ,const bool,C4JStorage::ESaveGameState state),bool( *FuncProg)(LPVOID ,const int),LPVOID lpParam); // Copies savedata referenced by pSaveInfo, calls callback when complete + C4JStorage::ESaveGameState RenameSaveData(int iRenameIndex,uint16_t*pui16NewName,int( *Func)(LPVOID lpParam,const bool), LPVOID lpParam); // Renamed savedata with index from last established ReturnSavesInfo. + + // Internal methods + void GetSaveImage(PBYTE *ppbSaveImage, int *puiSaveImageBytes); + void GetSaveThumbnail(PBYTE *ppbSaveThumbnail, int *puiSaveThumbnailBytes); + void SetSaveUniqueFilename(wchar_t *szFilename); + + ///////////////////////////////////////////////////////////////////////////// Profile data //////////////////////////////////////////////////////////////////////////////////////// + // Initialisation + void InitialiseProfileData(unsigned short usProfileVersion, UINT uiProfileValuesC, UINT uiProfileSettingsC, DWORD *pdwProfileSettingsA, int iGameDefinedDataSizeX4, unsigned int *puiGameDefinedDataChangedBitmask); // General initialisation + int SetDefaultOptionsCallback(int( *Func)(LPVOID,PROFILESETTINGS *, const int iPad),LPVOID lpParam); // Set a callback that can initialise a profile's storage to its default settings + void SetOptionsDataCallback(int( *Func)(LPVOID, int iPad, unsigned short usVersion, C4JStorage::eOptionsCallback),LPVOID lpParam); // Sets callback that is called when status of any options has changed + int SetOldProfileVersionCallback(int( *Func)(LPVOID,unsigned char *, const unsigned short,const int),LPVOID lpParam); + + // Getting and setting of profile data + PROFILESETTINGS * GetDashboardProfileSettings(int iPad); // Get pointer to the standard (originally xbox dashboard) profile data for one user + void *GetGameDefinedProfileData(int iQuadrant); // Get pointer to the game-defined profile data for one user + + // Reading and writing profiles + void ReadFromProfile(int iQuadrant, int iReadType=PROFILE_READTYPE_ALL); // Initiate read profile data for one user - read type is ignored on this platform + void WriteToProfile(int iQuadrant, bool bGameDefinedDataChanged=false, bool bOverride5MinuteLimitOnProfileWrites=false); // Initiate write profile for one user + void DeleteOptionsData(int iPad); // Delete profile data for one user + void ForceQueuedProfileWrites(int iPad=-1); // Force any queued profile writes to write now + + // DLC + C4JStorage::EDLCStatus GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam); + void SetLicenseChangeFn(void( *Func)(void)); + + XCONTENT_DATA& GetDLC(DWORD dw); + DWORD MountInstalledDLC(int iPad,DWORD dwDLC,int( *Func)(LPVOID, int, DWORD,DWORD),LPVOID lpParam,LPWSTR szMountDrive = NULL); + DWORD UnmountInstalledDLC(LPWSTR szMountDrive = NULL); + void GetMountedDLCFileList(const char* szMountDrive, std::vector& fileList); + std::wstring GetMountedPath(std::wstring szMount); + XCONTENT_DATA * GetInstalledDLC(WCHAR *wszProductID); + + C4JStorage::EDLCStatus GetDLCOffers(int iPad,int( *Func)(LPVOID, int, DWORD, int),LPVOID lpParam, DWORD dwOfferTypesBitmaskT); + MARKETPLACE_CONTENTOFFER_INFO& GetOffer(DWORD dw); + DWORD InstallOffer(int iOfferIDC,WCHAR *pwchProductId,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial=false); + + void UpdateDLCProductIDs(); // once we have the dlc info, we can give local installed DLC their product ids + + //void SetRetrieveProductIDFn(int( *Func)(XCONTENT_DATA&)); // Retrieve a product id for the dlc from the game + + void Suspend(); + bool Suspended(); + + ///////////////////////////////////////////////////////////////////////////// Unimplemented stubs ///////////////////////////////////////////////////////////////////////////////// +#pragma warning(disable: 4100) + void SetSaveDeviceSelected(unsigned int uiPad,bool bSelected) {} + bool GetSaveDeviceSelected(unsigned int iPad) { return true; } + void ClearDLCOffers(); +// C4JStorage::ETMSStatus ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType, WCHAR *pwchFilename,BYTE **ppBuffer,DWORD *pdwBufferSize,int( *Func)(LPVOID, WCHAR *,int, bool, int),LPVOID lpParam, int iAction);// { return C4JStorage::ETMSStatus_Idle; } +// bool WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,LPWSTR wszFilename,BYTE *pBuffer,DWORD dwBufferSize); + bool DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,LPWSTR wszFilename); + + // TMS++ + C4JStorage::ETMSStatus TMSPP_GetUserQuotaInfo(C4JStorage::eGlobalStorage eStorageFacility,int iPad);//,TMSCLIENT_CALLBACK Func,LPVOID lpParam, int iUserData=0); + eTitleStorageState TMSPP_WriteFile(int iQuadrant,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPWSTR wszFilename,BYTE *pbBuffer,DWORD dwBufferSize,int( *Func)(LPVOID,int,int)=NULL,LPVOID lpParam=NULL, int iUserData=0); + eTitleStorageState TMSPP_ReadFile(int iQuadrant,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPWSTR wszFilename,int( *Func)(LPVOID,int,int,LPVOID, WCHAR *),LPVOID lpParam, int iUserData); + eTitleStorageState TMSPP_DeleteFile(int iQuadrant,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPWSTR wszFilename,int( *Func)(LPVOID,int,int),LPVOID lpParam, int iUserData); + eTitleStorageState TMSPP_ReadFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,int( *Func)(LPVOID,int,int,LPVOID,WCHAR *)=NULL,LPVOID lpParam=NULL, int iUserData=0); + bool TMSPP_InFileList(eGlobalStorage eStorageFacility, int iPad,const wstring &Filename); + + eTitleStorageState TMSPP_GetTitleStorageState(int iPad); + void TMSPP_ClearTitleStorageState(int iPad); + + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + // SAVE TRANSFERS + C4JStorage::eSaveTransferState SaveTransferClearState(); + C4JStorage::eSaveTransferState SaveTransferGetDetails(int iPad, eGlobalStorage source, wchar_t *file, int ( *Func)(LPVOID lpParam,C4JStorage::SAVETRANSFER_FILE_DETAILS *pSaveTransferDetails),LPVOID lpParam); + C4JStorage::eSaveTransferState SaveTransferGetData(int iPad, eGlobalStorage source, wchar_t *file,int ( *Func)(LPVOID lpParam,C4JStorage::SAVETRANSFER_FILE_DETAILS *pSaveTransferDetails),int ( *ProgressFunc)(LPVOID lpParam,unsigned long),LPVOID lpParam,LPVOID lpProgressParam); + void CancelSaveTransfer(int ( *CancelCompleteFunc)(LPVOID lpParam),LPVOID lpParam); +}; + +extern C4JStorage StorageManager; diff --git a/Minecraft.Client/Durango/4JLibs/libs/4J_Input.lib b/Minecraft.Client/Durango/4JLibs/libs/4J_Input.lib new file mode 100644 index 00000000..ebce7841 Binary files /dev/null and b/Minecraft.Client/Durango/4JLibs/libs/4J_Input.lib differ diff --git a/Minecraft.Client/Durango/4JLibs/libs/4J_Input_d.lib b/Minecraft.Client/Durango/4JLibs/libs/4J_Input_d.lib new file mode 100644 index 00000000..d0686722 Binary files /dev/null and b/Minecraft.Client/Durango/4JLibs/libs/4J_Input_d.lib differ diff --git a/Minecraft.Client/Durango/4JLibs/libs/4J_Input_r.lib b/Minecraft.Client/Durango/4JLibs/libs/4J_Input_r.lib new file mode 100644 index 00000000..cd2ca385 Binary files /dev/null and b/Minecraft.Client/Durango/4JLibs/libs/4J_Input_r.lib differ diff --git a/Minecraft.Client/Durango/4JLibs/libs/4J_Profile.lib b/Minecraft.Client/Durango/4JLibs/libs/4J_Profile.lib new file mode 100644 index 00000000..facfb26a Binary files /dev/null and b/Minecraft.Client/Durango/4JLibs/libs/4J_Profile.lib differ diff --git a/Minecraft.Client/Durango/4JLibs/libs/4J_Profile_d.lib b/Minecraft.Client/Durango/4JLibs/libs/4J_Profile_d.lib new file mode 100644 index 00000000..8133278f Binary files /dev/null and b/Minecraft.Client/Durango/4JLibs/libs/4J_Profile_d.lib differ diff --git a/Minecraft.Client/Durango/4JLibs/libs/4J_Profile_r.lib b/Minecraft.Client/Durango/4JLibs/libs/4J_Profile_r.lib new file mode 100644 index 00000000..0bdeaa19 Binary files /dev/null and b/Minecraft.Client/Durango/4JLibs/libs/4J_Profile_r.lib differ diff --git a/Minecraft.Client/Durango/4JLibs/libs/4J_Render.lib b/Minecraft.Client/Durango/4JLibs/libs/4J_Render.lib new file mode 100644 index 00000000..32288097 Binary files /dev/null and b/Minecraft.Client/Durango/4JLibs/libs/4J_Render.lib differ diff --git a/Minecraft.Client/Durango/4JLibs/libs/4J_Render_d.lib b/Minecraft.Client/Durango/4JLibs/libs/4J_Render_d.lib new file mode 100644 index 00000000..6c513a73 Binary files /dev/null and b/Minecraft.Client/Durango/4JLibs/libs/4J_Render_d.lib differ diff --git a/Minecraft.Client/Durango/4JLibs/libs/4J_Storage.lib b/Minecraft.Client/Durango/4JLibs/libs/4J_Storage.lib new file mode 100644 index 00000000..579727b8 Binary files /dev/null and b/Minecraft.Client/Durango/4JLibs/libs/4J_Storage.lib differ diff --git a/Minecraft.Client/Durango/4JLibs/libs/4J_Storage_d.lib b/Minecraft.Client/Durango/4JLibs/libs/4J_Storage_d.lib new file mode 100644 index 00000000..52cc4e72 Binary files /dev/null and b/Minecraft.Client/Durango/4JLibs/libs/4J_Storage_d.lib differ diff --git a/Minecraft.Client/Durango/4JLibs/libs/4J_Storage_r.lib b/Minecraft.Client/Durango/4JLibs/libs/4J_Storage_r.lib new file mode 100644 index 00000000..b6a85059 Binary files /dev/null and b/Minecraft.Client/Durango/4JLibs/libs/4J_Storage_r.lib differ diff --git a/Minecraft.Client/Durango/Achievements/AchievementManager.cpp b/Minecraft.Client/Durango/Achievements/AchievementManager.cpp new file mode 100644 index 00000000..b645734f --- /dev/null +++ b/Minecraft.Client/Durango/Achievements/AchievementManager.cpp @@ -0,0 +1,15 @@ +#include "stdafx.h" +#include "AchievementManager.h" + +using namespace Platform; +using namespace Windows::Data; +using namespace Windows::Foundation; +using namespace Windows::Foundation::Collections; +using namespace Windows::Xbox::System; +using namespace Microsoft::WRL; +using namespace Microsoft::WRL::Details; +using namespace Microsoft::Xbox::Services; +using namespace Microsoft::Xbox::Services::Achievements; + + +AchievementManager *AchievementManager::m_instance = new AchievementManager(); //Singleton instance of the Achievement Manager \ No newline at end of file diff --git a/Minecraft.Client/Durango/Achievements/AchievementManager.h b/Minecraft.Client/Durango/Achievements/AchievementManager.h new file mode 100644 index 00000000..d891f916 --- /dev/null +++ b/Minecraft.Client/Durango/Achievements/AchievementManager.h @@ -0,0 +1,8 @@ +#pragma once + +class AchievementManager +{ + +private: + static AchievementManager *m_instance; +}; \ No newline at end of file diff --git a/Minecraft.Client/Durango/ApplicationView.cpp b/Minecraft.Client/Durango/ApplicationView.cpp new file mode 100644 index 00000000..2af86496 --- /dev/null +++ b/Minecraft.Client/Durango/ApplicationView.cpp @@ -0,0 +1,346 @@ +// +// ApplicationView.cpp - +// + +#include "stdafx.h" +#include "ApplicationView.h" +#include "MinecraftServer.h" + +using namespace Windows::Foundation; +using namespace Windows::ApplicationModel; +using namespace Windows::ApplicationModel::Core; +using namespace Windows::ApplicationModel::Activation; +using namespace Windows::UI::Core; + +ApplicationView::ApplicationView() +{ + m_activationComplete = false; + m_windowClosed = false; + m_inviteProcessed = false; +} + +XALLOC_ATTRIBUTES ExpandAllocAttributes( _In_ LONGLONG dwAttributes ) +{ + XALLOC_ATTRIBUTES attr; + attr = *((XALLOC_ATTRIBUTES *)&dwAttributes); + return attr; +} + +SIZE_T totalTracked = 0; +unordered_map tracker; +static volatile bool memDump = false; +static volatile bool memReset = false; +static bool memDumpInit = false; +static CRITICAL_SECTION memTrackCS; +static volatile SIZE_T memSizeComp = 0; +static long long lastTrackTime = 0; + +PVOID WINAPI XMemAllocLog( _In_ SIZE_T dwSize, _In_ ULONGLONG dwAttributes ) +{ + if( !memDumpInit ) + { + InitializeCriticalSection(&memTrackCS); + memDumpInit = true; + } + + PVOID result = XMemAllocDefault(dwSize,dwAttributes); + XALLOC_ATTRIBUTES expanded_attributes = ExpandAllocAttributes(dwAttributes); + EnterCriticalSection(&memTrackCS); + tracker[(uintptr_t)result] = dwSize; + totalTracked += dwSize; + LeaveCriticalSection(&memTrackCS); +// app.DebugPrintf("XMemAllocLog %p, Size: %d, AllocatorId: 0x%02x, ObjectType: 0x%04x, PageSize: %d, Alignment: %d, MemoryType: %d\n", result, dwSize, expanded_attributes.s.dwAllocatorId, expanded_attributes.s.dwObjectType, expanded_attributes.s.dwPageSize, expanded_attributes.s.dwAlignment, expanded_attributes.s.dwMemoryType ); + return result; +} + +VOID WINAPI XMemFreeLog( _In_ PVOID lpAddress, _In_ ULONGLONG dwAttributes ) +{ + EnterCriticalSection(&memTrackCS); + auto it = tracker.find((uintptr_t)lpAddress); + if( it != tracker.end() ) + { + totalTracked -= it->second; + tracker.erase(it); + } + LeaveCriticalSection(&memTrackCS); + XALLOC_ATTRIBUTES expanded_attributes = ExpandAllocAttributes(dwAttributes); +// app.DebugPrintf("XMemFreeLog %p, AllocatorId: 0x%02x, ObjectType: 0x%04x, PageSize: %d, Alignment: %d, MemoryType: %d\n", lpAddress, expanded_attributes.s.dwAllocatorId, expanded_attributes.s.dwObjectType, expanded_attributes.s.dwPageSize, expanded_attributes.s.dwAlignment, expanded_attributes.s.dwMemoryType ); + XMemFreeDefault(lpAddress,dwAttributes); + + long long currentTime = System::currentTimeMillis(); + if( ( currentTime - lastTrackTime ) > 1000 ) + { + app.DebugPrintf("Total memory tracked: %d\n", totalTracked); + lastTrackTime = currentTime; + } + + if( memReset ) + { + tracker.clear(); + memReset = false; + totalTracked = 0; + } + + if( memDump ) + { + for( auto it = tracker.begin(); it != tracker.end(); it++ ) + { + app.DebugPrintf("0x%x : %d\n",it->first,it->second); + } + memDump = false; + } +} + +// Called by the system. Perform application initialization here, +// hooking application wide events, etc. +void ApplicationView::Initialize(CoreApplicationView^ applicationView) +{ +// XMemSetAllocationHooks( &XMemAllocLog, &XMemFreeLog ); + applicationView->Activated += ref new TypedEventHandler(this, &ApplicationView::OnActivated); + + CoreApplication::Suspending += ref new EventHandler(this, &ApplicationView::OnSuspending); + + CoreApplication::Resuming += ref new EventHandler(this, &ApplicationView::OnResuming); + + CoreApplication::ResourceAvailabilityChanged += ref new EventHandler< Platform::Object^ >( this, &ApplicationView::OnResourceAvailabilityChanged ); +} + +// Called when we are provided a window. +void ApplicationView::SetWindow(CoreWindow^ window) +{ + window->Closed += ref new TypedEventHandler(this, &ApplicationView::OnWindowClosed); +} + +// The purpose of this method is to get the application entry point. +void ApplicationView::Load(Platform::String^ entryPoint) +{ +} + +void InitializeDurango(Windows::UI::Core::CoreWindow^ window); +void oldWinMainInit(); +void oldWinMainTick(); + +// Called by the system after initialization is complete. This +// implements the traditional game loop +void ApplicationView::Run() +{ +// m_game = ref new Game(); + InitializeDurango(CoreWindow::GetForCurrentThread()); + + // Ensure we finish activation and let the system know we’re responsive + while (!m_activationComplete) + { + CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent); + } + +#ifndef _CONTENT_PACKAGE + char buf[256]; + sprintf(buf,"0x%llx this\n",this); + OutputDebugStringA(buf); +#endif + oldWinMainInit(); + + + while (!app.getShutdownFlag() && !m_windowClosed) + { + CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent); + + oldWinMainTick(); + } + + Windows::ApplicationModel::Core::CoreApplication::Exit(); +} + +void ApplicationView::Uninitialize() +{ +} + +// Called when the application is activated. For now, there is just one activation +// kind - Launch. +void ApplicationView::OnActivated(CoreApplicationView^ applicationView, IActivatedEventArgs^ args) +{ + CoreWindow::GetForCurrentThread()->Activate(); + + Windows::Xbox::Multiplayer::PartyConfig::SuppressGameSessionReadyToast = true; + Windows::Xbox::Multiplayer::PartyConfig::SuppressGameSessionReadyToastMode = Windows::Xbox::Multiplayer::SuppressGameSessionReadyToastMode::Always; + + // On starting up the game for the first time, we'll get one kind of onActivated message through. This will also + // be called at other times though, so don't rely on it only happening once for anything + if( !m_activationComplete ) + { + if (args->Kind == Windows::ApplicationModel::Activation::ActivationKind::Launch) + { + // We get ActivationKind::Launch of we've just been started up from the user selecting us in the system UI, or if we are run normally from the debugger + ILaunchActivatedEventArgs^ newArgs = static_cast< ILaunchActivatedEventArgs^>(args); + + + } + else if (args->Kind == Windows::ApplicationModel::Activation::ActivationKind::Protocol) + { + // We get Windows::ApplicationModel::Activation::ActivationKind::Protocol if we have been started from accepting a party invite (including joining an open party ourselves), or from a game session being ready + IProtocolActivatedEventArgs^ proArgs = static_cast< IProtocolActivatedEventArgs^>(args); + + Platform::String^ uriType = proArgs->Uri->Host; + if( uriType == L"partyInviteAccept") + { + if( !m_inviteProcessed ) + { + DQRNetworkManager::SetPartyProcessJoinParty(); + DQRNetworkManager::SetInviteReceivedFlag(); + m_inviteProcessed = true; + } + } + else if( uriType == L"gameSessionReady" ) + { + Platform::String^ uriCommand = ref new Platform::String(proArgs->Uri->RawUri->Data()); + auto uri = ref new Windows::Foundation::Uri(uriCommand); + WwwFormUrlDecoder^ query = uri->QueryParsed; + + DQRNetworkManager::SetPartyProcessJoinSession(0,query->GetFirstValueByName(L"sessionName"),query->GetFirstValueByName(L"serviceConfigurationId"),query->GetFirstValueByName(L"sessionTemplateName")); + } + } + + m_activationComplete = true; + } + else + { + // This type of activation protocol can come in at any time during the game. Not sure of the best way to handle both this and gamesessionready events, so for now going to only process these + // (1) once + // (2) until the main menu is reached + // To try and minimise any conflict of them coming in in the middle of the game when we are already handling this gamesessionready. + if (args->Kind == Windows::ApplicationModel::Activation::ActivationKind::Protocol) + { + if( !app.HasReachedMainMenu() ) + { + app.DebugPrintf("Accepting party invite after initial activation\n"); + // We get Windows::ApplicationModel::Activation::ActivationKind::Protocol if we have been started from accepting a party invite (including joining an open party ourselves), or from a game session being ready + IProtocolActivatedEventArgs^ proArgs = static_cast< IProtocolActivatedEventArgs^>(args); + + Platform::String^ uriType = proArgs->Uri->Host; + if( uriType == L"partyInviteAccept") + { + if( !m_inviteProcessed ) + { + DQRNetworkManager::SetPartyProcessJoinParty(); + DQRNetworkManager::SetInviteReceivedFlag(); + m_inviteProcessed = true; + } + } + } + else + { + DQRNetworkManager::SetInviteReceivedFlag(); // This just informs the network manager that an invite has been received, not to start processing it + } + } + } +} + +// Called when the application is suspending. +void ApplicationView::OnSuspending(Platform::Object^ sender, SuspendingEventArgs^ args) +{ + // TODO: Save game progress using the ConnectedStroage API. + app.DebugPrintf("###################################\n\n\n"); + app.DebugPrintf("Suspending!"); + app.DebugPrintf("\n\n\n###################################"); + + // Get the frequency of the timer + LARGE_INTEGER qwTicksPerSec, qwTime, qwNewTime, qwDeltaTime; + float fElapsedTime = 0.0f; + QueryPerformanceFrequency( &qwTicksPerSec ); + float fSecsPerTick = 1.0f / (float)qwTicksPerSec.QuadPart; + // Save the start time + QueryPerformanceCounter( &qwTime ); + + // Request deferral + SuspendingDeferral^ deferral = args->SuspendingOperation->GetDeferral(); + + MinecraftServer *server = MinecraftServer::getInstance(); + if(server) + { + server->Suspend(); + } + + // Start suspend process for libraries + StorageManager.Suspend(); + RenderManager.Suspend(); + + // Wait for libraries to finish suspending + while(!StorageManager.Suspended() || !RenderManager.Suspended()) + { + Sleep(10); + } + + deferral->Complete(); + + QueryPerformanceCounter( &qwNewTime ); + + qwDeltaTime.QuadPart = qwNewTime.QuadPart - qwTime.QuadPart; + fElapsedTime = fSecsPerTick * ((FLOAT)(qwDeltaTime.QuadPart)); + + app.DebugPrintf("Entire suspend process: Elapsed time %f\n", fElapsedTime); +} + +// Called when the application is resuming from suspended. +void ApplicationView::OnResuming(Platform::Object^ sender, Platform::Object^ args) +{ + app.DebugPrintf("###################################\n\n\n"); + app.DebugPrintf("Resuming!"); + app.DebugPrintf("\n\n\n###################################"); + + // Start resume process for libraries + RenderManager.Resume(); + InputManager.Resume(); + + // Switch to offline if we were in an online game + if (!g_NetworkManager.IsLocalGame() && g_NetworkManager.IsInGameplay()) + { + // Bit specific but we want to avoid switching to offline if the primary player has signed out + // (and AFAIK there's no other way to find out until a few ticks time) + if (app.GetXuiAction(0) != eAppAction_PrimaryPlayerSignedOut) + { + // We've lost the party so switch to offline, previously we exited the world here but this seems friendlier + app.SetAction(ProfileManager.GetPrimaryPad(), eAppAction_EthernetDisconnected); + } + } + + // 4J-PB - clear all DLC info, and recheck, since someone may have suspended after starting a DLCinstall, and we won't have received any install/ license change event + app.ClearDLCInstalled(); + ui.HandleDLCInstalled(ProfileManager.GetPrimaryPad()); + +} + +void ApplicationView::OnResourceAvailabilityChanged( Platform::Object^ /*sender*/, Platform::Object^ /*args*/ ) +{ + app.DebugPrintf("###################################\n\n\n"); + if( Windows::ApplicationModel::Core::CoreApplication::ResourceAvailability == Windows::ApplicationModel::Core::ResourceAvailability::Full ) + { + app.DebugPrintf( "Entered the 'Full Running' state." ); + } + else + { + app.DebugPrintf( "Entered the 'Constrained' PLM state." ); + } + app.DebugPrintf("\n\n\n###################################"); +} + +void ApplicationView::OnWindowClosed(CoreWindow^ sender, CoreWindowEventArgs^ args) +{ + m_windowClosed = true; +} + +// Implements a IFrameworkView factory. +IFrameworkView^ ApplicationViewSource::CreateView() +{ + return ref new ApplicationView(); +} + +// Application entry point +[Platform::MTAThread] +int main(Platform::Array^) +{ + auto applicationViewSource = ref new ApplicationViewSource(); + + CoreApplication::Run(applicationViewSource); + + return 0; +} diff --git a/Minecraft.Client/Durango/ApplicationView.h b/Minecraft.Client/Durango/ApplicationView.h new file mode 100644 index 00000000..a8b87a43 --- /dev/null +++ b/Minecraft.Client/Durango/ApplicationView.h @@ -0,0 +1,44 @@ +// +// ApplicationView.h +// + +#pragma once + +// Application - implements the required functionality for a application +ref class ApplicationView sealed : public Windows::ApplicationModel::Core::IFrameworkView +{ +public: + + ApplicationView(); + + // IFrameworkView Methods + virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView); + virtual void SetWindow(Windows::UI::Core::CoreWindow^ window); + virtual void Load(Platform::String^ entryPoint); + virtual void Run(); + virtual void Uninitialize(); + +protected: + + // Event Handlers + void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args); + void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args); + void OnResuming(Platform::Object^ sender, Platform::Object^ args); + void OnResourceAvailabilityChanged( Platform::Object^ sender, Platform::Object^ args ); + void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args); + +private: + +// Game^ m_game; + bool m_activationComplete; + bool m_windowClosed; + bool m_inviteProcessed; +}; + +// ApplicationSource - responsible for creating the Application instance +// and passing it back to the system +ref class ApplicationViewSource : Windows::ApplicationModel::Core::IFrameworkViewSource +{ +public: + virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView(); +}; diff --git a/Minecraft.Client/Durango/Autogenerated.appxmanifest b/Minecraft.Client/Durango/Autogenerated.appxmanifest new file mode 100644 index 00000000..7b45889c --- /dev/null +++ b/Minecraft.Client/Durango/Autogenerated.appxmanifest @@ -0,0 +1,194 @@ + + + + + + + Minecraft: Xbox One Edition + Microsoft Studios + StoreLogo.png + Minecraft + + + + 6.2 + 6.2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ESRB:E10 + PEGI:7 + PEGI-PT:6 + FPB:PG + USK:6 + COB-AU:PG + OFLC-NZ:PG + DJCTQ:L + CERO:A + GRB:All + CSRR:P + PCBP:6 + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/CU/DLCXbox1.cmp b/Minecraft.Client/Durango/CU/DLCXbox1.cmp new file mode 100644 index 00000000..5943983b Binary files /dev/null and b/Minecraft.Client/Durango/CU/DLCXbox1.cmp differ diff --git a/Minecraft.Client/Durango/DLCImages/MPHA_360x360.png b/Minecraft.Client/Durango/DLCImages/MPHA_360x360.png new file mode 100644 index 00000000..6a805f47 Binary files /dev/null and b/Minecraft.Client/Durango/DLCImages/MPHA_360x360.png differ diff --git a/Minecraft.Client/Durango/DLCImages/MPMA_360x360.png b/Minecraft.Client/Durango/DLCImages/MPMA_360x360.png new file mode 100644 index 00000000..22fd45c2 Binary files /dev/null and b/Minecraft.Client/Durango/DLCImages/MPMA_360x360.png differ diff --git a/Minecraft.Client/Durango/DLCImages/MPSR_360x360.png b/Minecraft.Client/Durango/DLCImages/MPSR_360x360.png new file mode 100644 index 00000000..9a6db8e2 Binary files /dev/null and b/Minecraft.Client/Durango/DLCImages/MPSR_360x360.png differ diff --git a/Minecraft.Client/Durango/DLCImages/SP1_360x360.png b/Minecraft.Client/Durango/DLCImages/SP1_360x360.png new file mode 100644 index 00000000..ed4cc736 Binary files /dev/null and b/Minecraft.Client/Durango/DLCImages/SP1_360x360.png differ diff --git a/Minecraft.Client/Durango/DLCImages/SP2_360x360.png b/Minecraft.Client/Durango/DLCImages/SP2_360x360.png new file mode 100644 index 00000000..a576039c Binary files /dev/null and b/Minecraft.Client/Durango/DLCImages/SP2_360x360.png differ diff --git a/Minecraft.Client/Durango/DLCImages/SP3_360x360.png b/Minecraft.Client/Durango/DLCImages/SP3_360x360.png new file mode 100644 index 00000000..1c35e16b Binary files /dev/null and b/Minecraft.Client/Durango/DLCImages/SP3_360x360.png differ diff --git a/Minecraft.Client/Durango/DLCImages/SP4_360x360.png b/Minecraft.Client/Durango/DLCImages/SP4_360x360.png new file mode 100644 index 00000000..69924440 Binary files /dev/null and b/Minecraft.Client/Durango/DLCImages/SP4_360x360.png differ diff --git a/Minecraft.Client/Durango/DLCImages/SP5_360x360.png b/Minecraft.Client/Durango/DLCImages/SP5_360x360.png new file mode 100644 index 00000000..56ab6465 Binary files /dev/null and b/Minecraft.Client/Durango/DLCImages/SP5_360x360.png differ diff --git a/Minecraft.Client/Durango/DLCImages/SP6_360x360.png b/Minecraft.Client/Durango/DLCImages/SP6_360x360.png new file mode 100644 index 00000000..e418a96d Binary files /dev/null and b/Minecraft.Client/Durango/DLCImages/SP6_360x360.png differ diff --git a/Minecraft.Client/Durango/DLCImages/SPB2_360x360.png b/Minecraft.Client/Durango/DLCImages/SPB2_360x360.png new file mode 100644 index 00000000..c88e8d0c Binary files /dev/null and b/Minecraft.Client/Durango/DLCImages/SPB2_360x360.png differ diff --git a/Minecraft.Client/Durango/DLCImages/SPB_360x360.png b/Minecraft.Client/Durango/DLCImages/SPB_360x360.png new file mode 100644 index 00000000..f7966758 Binary files /dev/null and b/Minecraft.Client/Durango/DLCImages/SPB_360x360.png differ diff --git a/Minecraft.Client/Durango/DLCImages/SPC_360x360.png b/Minecraft.Client/Durango/DLCImages/SPC_360x360.png new file mode 100644 index 00000000..65a93bc1 Binary files /dev/null and b/Minecraft.Client/Durango/DLCImages/SPC_360x360.png differ diff --git a/Minecraft.Client/Durango/DLCImages/SPD1_360x360.png b/Minecraft.Client/Durango/DLCImages/SPD1_360x360.png new file mode 100644 index 00000000..10125eaf Binary files /dev/null and b/Minecraft.Client/Durango/DLCImages/SPD1_360x360.png differ diff --git a/Minecraft.Client/Durango/DLCImages/SPF_360x360.png b/Minecraft.Client/Durango/DLCImages/SPF_360x360.png new file mode 100644 index 00000000..db5af5c1 Binary files /dev/null and b/Minecraft.Client/Durango/DLCImages/SPF_360x360.png differ diff --git a/Minecraft.Client/Durango/DLCImages/SPG_360x360.png b/Minecraft.Client/Durango/DLCImages/SPG_360x360.png new file mode 100644 index 00000000..8e47c8d1 Binary files /dev/null and b/Minecraft.Client/Durango/DLCImages/SPG_360x360.png differ diff --git a/Minecraft.Client/Durango/DLCImages/SPI_360x360.png b/Minecraft.Client/Durango/DLCImages/SPI_360x360.png new file mode 100644 index 00000000..8d29b155 Binary files /dev/null and b/Minecraft.Client/Durango/DLCImages/SPI_360x360.png differ diff --git a/Minecraft.Client/Durango/DLCImages/SPM_360x360.png b/Minecraft.Client/Durango/DLCImages/SPM_360x360.png new file mode 100644 index 00000000..99cd9572 Binary files /dev/null and b/Minecraft.Client/Durango/DLCImages/SPM_360x360.png differ diff --git a/Minecraft.Client/Durango/DLCImages/SPZ_360x360.png b/Minecraft.Client/Durango/DLCImages/SPZ_360x360.png new file mode 100644 index 00000000..69f2e042 Binary files /dev/null and b/Minecraft.Client/Durango/DLCImages/SPZ_360x360.png differ diff --git a/Minecraft.Client/Durango/DLCImages/TP01_360x360.png b/Minecraft.Client/Durango/DLCImages/TP01_360x360.png new file mode 100644 index 00000000..4c7a51cb Binary files /dev/null and b/Minecraft.Client/Durango/DLCImages/TP01_360x360.png differ diff --git a/Minecraft.Client/Durango/DLCImages/TP02_360x360.png b/Minecraft.Client/Durango/DLCImages/TP02_360x360.png new file mode 100644 index 00000000..e199b492 Binary files /dev/null and b/Minecraft.Client/Durango/DLCImages/TP02_360x360.png differ diff --git a/Minecraft.Client/Durango/DLCImages/TP03_360x360.png b/Minecraft.Client/Durango/DLCImages/TP03_360x360.png new file mode 100644 index 00000000..8ad4f300 Binary files /dev/null and b/Minecraft.Client/Durango/DLCImages/TP03_360x360.png differ diff --git a/Minecraft.Client/Durango/DLCImages/TP04_360x360.png b/Minecraft.Client/Durango/DLCImages/TP04_360x360.png new file mode 100644 index 00000000..c6a30056 Binary files /dev/null and b/Minecraft.Client/Durango/DLCImages/TP04_360x360.png differ diff --git a/Minecraft.Client/Durango/DLCImages/TP05_360x360.png b/Minecraft.Client/Durango/DLCImages/TP05_360x360.png new file mode 100644 index 00000000..ee9f8b86 Binary files /dev/null and b/Minecraft.Client/Durango/DLCImages/TP05_360x360.png differ diff --git a/Minecraft.Client/Durango/DLCImages/TP06_360x360.png b/Minecraft.Client/Durango/DLCImages/TP06_360x360.png new file mode 100644 index 00000000..bbe59598 Binary files /dev/null and b/Minecraft.Client/Durango/DLCImages/TP06_360x360.png differ diff --git a/Minecraft.Client/Durango/DLCImages/TP07_360x360.png b/Minecraft.Client/Durango/DLCImages/TP07_360x360.png new file mode 100644 index 00000000..6449e656 Binary files /dev/null and b/Minecraft.Client/Durango/DLCImages/TP07_360x360.png differ diff --git a/Minecraft.Client/Durango/DLCXbox1.cmp b/Minecraft.Client/Durango/DLCXbox1.cmp new file mode 100644 index 00000000..14359d2c Binary files /dev/null and b/Minecraft.Client/Durango/DLCXbox1.cmp differ diff --git a/Minecraft.Client/Durango/DurangoExtras/DurangoStubs.cpp b/Minecraft.Client/Durango/DurangoExtras/DurangoStubs.cpp new file mode 100644 index 00000000..81b9d7cf --- /dev/null +++ b/Minecraft.Client/Durango/DurangoExtras/DurangoStubs.cpp @@ -0,0 +1,128 @@ +#include "stdafx.h" + +#define DURANGO_STUBBED +//printf("missing function on Xbox One : %s\n", __FUNCTION__); + +//static char sc_loadPath[] = {"/"}; + +//const char* getConsoleHomePath() { return sc_loadPath; } + +DWORD GetFileSize(HANDLE fh,DWORD *pdwHigh) +{ + LARGE_INTEGER FileSize; + + BOOL bRes=GetFileSizeEx(fh,&FileSize); + + if(bRes==FALSE) + { + if(pdwHigh) *pdwHigh=0; + return 0; + } + else + { + if(pdwHigh) *pdwHigh=FileSize.HighPart; + return FileSize.LowPart; + } +} + +DWORD XGetLanguage() +{ + //StringTable::eLocale eCurrentLocale=StringTable::eLocale_American; + bool bLocaleFound; + + WCHAR wchLocaleName[LOCALE_NAME_MAX_LENGTH]; + GetUserDefaultLocaleName(wchLocaleName,LOCALE_NAME_MAX_LENGTH); + eMCLang eLang=(eMCLang)app.get_eMCLang(wchLocaleName); + +#ifdef _DEBUG + app.DebugPrintf("XGetLanguage() ==> '%ls'\n", wchLocaleName); +#endif + + // need to map locale to language + switch(eLang) + { + case eMCLang_jaJP: + return XC_LANGUAGE_JAPANESE; + case eMCLang_deDE: + case eMCLang_deAT: + return XC_LANGUAGE_GERMAN; + case eMCLang_frFR: + case eMCLang_frCA: + return XC_LANGUAGE_FRENCH; + case eMCLang_esES: + case eMCLang_esMX: + return XC_LANGUAGE_SPANISH; + case eMCLang_itIT: + return XC_LANGUAGE_ITALIAN; + case eMCLang_koKR: + return XC_LANGUAGE_KOREAN; + case eMCLang_zhHK: + case eMCLang_zhSG: + case eMCLang_zhTW: + case eMCLang_zhCHT: + return XC_LANGUAGE_TCHINESE; + case eMCLang_zhCHS: + case eMCLang_zhCN: + return XC_LANGUAGE_SCHINESE; + case eMCLang_ptPT: + case eMCLang_ptBR: + return XC_LANGUAGE_PORTUGUESE; + case eMCLang_ruRU: + return XC_LANGUAGE_RUSSIAN; + case eMCLang_nlNL: + case eMCLang_nlBE: + return XC_LANGUAGE_DUTCH; + case eMCLang_fiFI: + return XC_LANGUAGE_FINISH; + case eMCLang_svSV: + case eMCLang_svSE: + return XC_LANGUAGE_SWEDISH; + case eMCLang_daDA: + case eMCLang_daDK: + return XC_LANGUAGE_DANISH; + case eMCLang_noNO: + case eMCLang_nnNO: + case eMCLang_nbNO: + return XC_LANGUAGE_BNORWEGIAN; + case eMCLang_plPL: + return XC_LANGUAGE_POLISH; + case eMCLang_trTR: + return XC_LANGUAGE_TURKISH; + case eMCLang_laLAS: + return XC_LANGUAGE_LATINAMERICANSPANISH; + case eMCLang_elEL: + case eMCLang_elGR: + case eMCLang_enGR: // Hack redirect + return XC_LANGUAGE_GREEK; + case eMCLang_csCZ: + case eMCLang_enCZ: // Hack redirect + return XC_LANGUAGE_CZECH; + case eMCLang_skSK: + case eMCLang_enSK: // Hack redirect + return XC_LANGUAGE_SLOVAK; + case eMCLang_enUS: + case eMCLang_enGB: + case eMCLang_enIE: + case eMCLang_enAU: + case eMCLang_enNZ: + case eMCLang_enCA: + default: + return XC_LANGUAGE_ENGLISH; + } +} + +DWORD XGetLocale() +{ + //return XC_LOCALE_SWEDEN; + + WCHAR wchLocaleName[LOCALE_NAME_MAX_LENGTH]; + GetUserDefaultLocaleName(wchLocaleName,LOCALE_NAME_MAX_LENGTH); + + return app.get_xcLang(wchLocaleName); +} + +DWORD XEnableGuestSignin(BOOL fEnable) +{ + return 0; +} + diff --git a/Minecraft.Client/Durango/DurangoExtras/DurangoStubs.h b/Minecraft.Client/Durango/DurangoExtras/DurangoStubs.h new file mode 100644 index 00000000..2c15b703 --- /dev/null +++ b/Minecraft.Client/Durango/DurangoExtras/DurangoStubs.h @@ -0,0 +1,9 @@ +#pragma once + +//const char* getConsoleHomePath(); + +DWORD GetFileSize(HANDLE fh,DWORD *pdwHigh); + +DWORD XGetLanguage(); +DWORD XGetLocale(); +DWORD XEnableGuestSignin(BOOL fEnable); \ No newline at end of file diff --git a/Minecraft.Client/Durango/DurangoExtras/xcompress.dll b/Minecraft.Client/Durango/DurangoExtras/xcompress.dll new file mode 100644 index 00000000..b95e3701 Binary files /dev/null and b/Minecraft.Client/Durango/DurangoExtras/xcompress.dll differ diff --git a/Minecraft.Client/Durango/DurangoExtras/xcompress.h b/Minecraft.Client/Durango/DurangoExtras/xcompress.h new file mode 100644 index 00000000..c577ad02 --- /dev/null +++ b/Minecraft.Client/Durango/DurangoExtras/xcompress.h @@ -0,0 +1,253 @@ +/************************************************************************ +* * +* xcompress.h -- This module defines the Xbox Compression APIs * +* * +* Copyright (c) Microsoft Corp. All rights reserved. * +* * +************************************************************************/ +#pragma once + +#ifndef _XCOMPRESS_H_ +#define _XCOMPRESS_H_ + +#include + +#ifndef XBOXAPI +#define XBOXAPI +#endif + +#ifdef __cplusplus +#define XCTDEXTERN extern "C" +#else +#define XCTDEXTERN extern +#endif + +#ifdef __cplusplus +extern "C" +{ +#endif + +#pragma warning(push) +#pragma warning(disable: 4200) // zero-sized array + +typedef enum _XMEMCODEC_TYPE +{ + XMEMCODEC_DEFAULT = 0, + XMEMCODEC_LZX = 1 +} XMEMCODEC_TYPE; + +/* + * Data compression flags + */ + +#define XMEMCOMPRESS_STREAM 0x00000001 + +/* + * Data compression functions + */ + +typedef VOID* XMEMCOMPRESSION_CONTEXT; + +XBOXAPI +HRESULT +WINAPI +XMemCreateCompressionContext( + __in XMEMCODEC_TYPE CodecType, + __in_opt CONST VOID* pCodecParams, + __in DWORD Flags, + __deref_out XMEMCOMPRESSION_CONTEXT* pContext + ); + +XBOXAPI +XMEMCOMPRESSION_CONTEXT +WINAPI +XMemInitializeCompressionContext( + __in XMEMCODEC_TYPE CodecType, + __in_opt CONST VOID* pCodecParams, + __in DWORD Flags, + __out_bcount(ContextSize) VOID* pContextData, + __in SIZE_T ContextSize + ); + +XBOXAPI +VOID +WINAPI +XMemDestroyCompressionContext( + __in XMEMCOMPRESSION_CONTEXT Context + ); + +XBOXAPI +SIZE_T +WINAPI +XMemGetCompressionContextSize( + __in XMEMCODEC_TYPE CodecType, + __in_opt CONST VOID* pCodecParams, + __in DWORD Flags + ); + +XBOXAPI +HRESULT +WINAPI +XMemResetCompressionContext( + __in XMEMCOMPRESSION_CONTEXT Context); + +XBOXAPI +HRESULT +WINAPI +XMemCompress( + __in XMEMCOMPRESSION_CONTEXT Context, + __out_bcount_opt( *pDestSize ) VOID* pDestination, + __inout SIZE_T* pDestSize, + __in_bcount( SrcSize ) CONST VOID* pSource, + __in SIZE_T SrcSize + ); + +XBOXAPI +HRESULT +WINAPI +XMemCompressStream( + __in XMEMCOMPRESSION_CONTEXT Context, + __out_bcount_opt( *pDestSize ) VOID* pDestination, + __inout SIZE_T* pDestSize, + __in_bcount( *pSrcSize ) CONST VOID* pSource, + __inout SIZE_T* pSrcSize + ); + +/* + * Data decompression functions + */ + +typedef VOID* XMEMDECOMPRESSION_CONTEXT; + +XBOXAPI +HRESULT +WINAPI +XMemCreateDecompressionContext( + __in XMEMCODEC_TYPE CodecType, + __in_opt CONST VOID* pCodecParams, + __in DWORD Flags, + __deref_out XMEMDECOMPRESSION_CONTEXT* pContext + ); + +XBOXAPI +XMEMDECOMPRESSION_CONTEXT +WINAPI +XMemInitializeDecompressionContext( + __in XMEMCODEC_TYPE CodecType, + __in_opt CONST VOID* pCodecParams, + __in DWORD Flags, + __out_bcount( ContextSize ) VOID* pContextData, + __in SIZE_T ContextSize + ); + +XBOXAPI +VOID +WINAPI +XMemDestroyDecompressionContext( + __in XMEMDECOMPRESSION_CONTEXT Context + ); + +XBOXAPI +SIZE_T +WINAPI +XMemGetDecompressionContextSize( + __in XMEMCODEC_TYPE CodecType, + __in_opt CONST VOID* pCodecParams, + __in DWORD Flags + ); + +XBOXAPI +HRESULT +WINAPI +XMemResetDecompressionContext( + __in XMEMDECOMPRESSION_CONTEXT Context); + +XBOXAPI +HRESULT +WINAPI +XMemDecompress( + __in XMEMDECOMPRESSION_CONTEXT Context, + __out_bcount( *pDestSize ) VOID* pDestination, + __inout SIZE_T* pDestSize, + __in_bcount( SrcSize) CONST VOID* pSource, + __in SIZE_T SrcSize + ); + +XBOXAPI +HRESULT +WINAPI +XMemDecompressStream( + __in XMEMDECOMPRESSION_CONTEXT Context, + __out_bcount( *pDestSize ) VOID* pDestination, + __inout SIZE_T* pDestSize, + __in_bcount( *pSrcSize ) CONST VOID* pSource, + __inout SIZE_T* pSrcSize + ); + +/* + * LZX codec for lossless compression + */ + +typedef struct _XMEMCODEC_PARAMETERS_LZX +{ + DWORD Flags; + DWORD WindowSize; + DWORD CompressionPartitionSize; +} XMEMCODEC_PARAMETERS_LZX; + +#define XCOMPRESS_LZX_BLOCK_SIZE (32 * 1024) +#define XCOMPRESS_LZX_BLOCK_GROWTH_SIZE_MAX 6155 + +/* + * Error codes + */ + +#define XMCDERR_MOREDATA _HRESULT_TYPEDEF_(0x81DE2001) + +/* + * Compression file headers + */ + +#define XCOMPRESS_FILE_IDENTIFIER_LZXTDECODE 0x0FF512ED +#define XCOMPRESS_FILE_IDENTIFIER_LZXNATIVE 0x0FF512EE + +#define XCOMPRESS_SET_FILE_VERSION(Major, Minor) ((((Major) & 0xFF) << 8) | ((Minor) & 0xFF)) +#define XCOMPRESS_GET_FILE_VERSION_MAJOR(Version) (((Version) >> 8) & 0xFF) +#define XCOMPRESS_GET_FILE_VERSION_MINOR(Version) ((Version) & 0xFF) + +#define XCOMPRESS_LZXNATIVE_VERSION_MAJOR 1 +#define XCOMPRESS_LZXNATIVE_VERSION_MINOR 3 + +typedef struct _XCOMPRESS_FILE_HEADER +{ + DWORD Identifier; + WORD Version; + WORD Reserved; +} XCOMPRESS_FILE_HEADER; + +typedef struct _XCOMPRESS_FILE_HEADER_LZXNATIVE +{ + XCOMPRESS_FILE_HEADER Common; + DWORD ContextFlags; + XMEMCODEC_PARAMETERS_LZX CodecParams; + DWORD UncompressedSizeHigh; + DWORD UncompressedSizeLow; + DWORD CompressedSizeHigh; + DWORD CompressedSizeLow; + DWORD UncompressedBlockSize; + DWORD CompressedBlockSizeMax; +} XCOMPRESS_FILE_HEADER_LZXNATIVE; + +typedef struct _XCOMPRESS_BLOCK_HEADER_LZXNATIVE +{ + DWORD CompressedBlockSize; + BYTE pCompressedData[0]; +} XCOMPRESS_BLOCK_HEADER_LZXNATIVE; + +#pragma warning(pop) + +#ifdef __cplusplus +} +#endif + +#endif /* _XCOMPRESS_H_ */ diff --git a/Minecraft.Client/Durango/DurangoExtras/xcompress.lib b/Minecraft.Client/Durango/DurangoExtras/xcompress.lib new file mode 100644 index 00000000..efc72de8 Binary files /dev/null and b/Minecraft.Client/Durango/DurangoExtras/xcompress.lib differ diff --git a/Minecraft.Client/Durango/Durango_App.cpp b/Minecraft.Client/Durango/Durango_App.cpp new file mode 100644 index 00000000..2ec81a29 --- /dev/null +++ b/Minecraft.Client/Durango/Durango_App.cpp @@ -0,0 +1,799 @@ +#include "stdafx.h" +#include "..\Common\Consoles_App.h" +#include "..\User.h" +#include "..\..\Minecraft.Client\Minecraft.h" +#include "..\..\Minecraft.Client\MinecraftServer.h" +#include "..\..\Minecraft.Client\PlayerList.h" +#include "..\..\Minecraft.Client\ServerPlayer.h" +#include "..\..\Minecraft.World\Level.h" +#include "..\..\Minecraft.World\LevelSettings.h" +#include "..\..\Minecraft.World\BiomeSource.h" +#include "..\..\Minecraft.World\LevelType.h" +#include "ServiceConfig\Events-XBLA.8-149E11AEEvents.h" +#include "..\..\Minecraft.World\DurangoStats.h" +#include "..\..\Minecraft.Client\Durango\XML\xmlFilesCallback.h" + +CConsoleMinecraftApp app; + +CConsoleMinecraftApp::CConsoleMinecraftApp() : CMinecraftApp() +{ + memset(&m_ThumbnailBuffer,0,sizeof(ImageFileBuffer)); + m_bShutdown=false; + + m_bRead_TMS_DLCINFO_XML=false; + m_bTMSPP_GlobalFileListRead=false; + m_bTMSPP_UserFileListRead=false; + + for (int i=0; ibTrialLicense==false)) + { + DLCPack *pack = app.m_dlcManager.getPackFromProductID(xOffer.wszProductID); + if(pack) + { + // Clear the DLC installed flag so the scenes will pick up the new dlc (could be a full pack install) + app.ClearDLCInstalled(); + app.DebugPrintf(">>> HandleDLCLicenseChange - Updating license for DLC [%ls]\n",xOffer.wszOfferName); + pack->updateLicenseMask(1); + } + else + { + app.DebugPrintf(">>> HandleDLCLicenseChange - Couldn't find licensed DLC [%ls] in app.m_dlcManager\n",xOffer.wszOfferName); + } + } + } + + ui.HandleDLCLicenseChange(); +} + + +void CConsoleMinecraftApp::SetRichPresenceContext(int iPad, int contextId) +{ + if(iPad < XUSER_MAX_COUNT && Minecraft::GetInstance()->localplayers[iPad]) + { + PlayerUID uid; + ProfileManager.GetXUID(iPad, &uid, true); + + if (uid != INVALID_XUID) + { + // 4J-JEV: Player has changed, update cached player and ensure this next presence is sent. + if (uid != m_xuidLastPresencePlayer[iPad]) + { + m_xuidLastPresencePlayer[iPad] = uid; + m_iLastPresenceContext[iPad] = -1; + } + + if (m_iLastPresenceContext[iPad] != contextId) + { + app.DebugPrintf(">>> EventWriteRichPresenceState(%ls,_,%d)\n", uid.toString().c_str(), contextId); + EventWriteRichPresenceState(uid.toString().c_str(), DurangoStats::getPlayerSession(), contextId); + + m_iLastPresenceContext[iPad] = contextId; + } + } + } +} + +void CConsoleMinecraftApp::StoreLaunchData() +{ +} +void CConsoleMinecraftApp::ExitGame() +{ + //Windows::ApplicationModel::Core::CoreApplication::Exit(); + m_bShutdown=true; +} +void CConsoleMinecraftApp::FatalLoadError() +{ + // 4J-PB - + //for(int i=0;i<10;i++) + { +#ifndef _CONTENT_PACKAGE + OutputDebugStringA("FatalLoadError\n"); +#endif + //Sleep(5000); + } +} + +void CConsoleMinecraftApp::CaptureSaveThumbnail() +{ + RenderManager.CaptureThumbnail(&m_ThumbnailBuffer); +} +void CConsoleMinecraftApp::GetSaveThumbnail(PBYTE *pbData,DWORD *pdwSize) +{ + // on a save caused by a create world, the thumbnail capture won't have happened + if(m_ThumbnailBuffer.Allocated()) + { + if( pbData ) + { + *pbData= new BYTE [m_ThumbnailBuffer.GetBufferSize()]; + *pdwSize=m_ThumbnailBuffer.GetBufferSize(); + memcpy(*pbData,m_ThumbnailBuffer.GetBufferPointer(),*pdwSize); + } + m_ThumbnailBuffer.Release(); + } + else + { + if( pbData ) + { + // use the default image + StorageManager.GetDefaultSaveThumbnail(pbData,pdwSize); + } + } +} +void CConsoleMinecraftApp::ReleaseSaveThumbnail() +{ + +} + +void CConsoleMinecraftApp::GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize) +{ + +} + +int CConsoleMinecraftApp::GetLocalTMSFileIndex(WCHAR *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT) +{ + return -1; +} + + +int CConsoleMinecraftApp::LoadLocalTMSFile(WCHAR *wchTMSFile) +{ + return -1; +} + +int CConsoleMinecraftApp::LoadLocalTMSFile(WCHAR *wchTMSFile, eFileExtensionType eExt) +{ + return -1; +} + +void CConsoleMinecraftApp::FreeLocalTMSFiles(eTMSFileType eType) +{ + +} + +int CConsoleMinecraftApp::LoadLocalDLCImages() +{ + unordered_map *pDLCInfoA=app.GetDLCInfo(); + // 4J-PB - Any local graphic files for the Minecraft Store? + for( AUTO_VAR(it, pDLCInfoA->begin()); it != pDLCInfoA->end(); it++ ) + { + DLC_INFO * pDLCInfo=(*it).second; + + LoadLocalDLCImage(pDLCInfo->wchBanner,&pDLCInfo->pbImageData,&pDLCInfo->dwImageBytes); + } + return 0; +} + +void CConsoleMinecraftApp::FreeLocalDLCImages() +{ + // 4J-PB - Any local graphic files for the Minecraft Store? + unordered_map *pDLCInfoA=app.GetDLCInfo(); + + for( AUTO_VAR(it, pDLCInfoA->begin()); it != pDLCInfoA->end(); it++ ) + { + DLC_INFO * pDLCInfo=(*it).second; + + if(pDLCInfo->dwImageBytes!=0) + { + free(pDLCInfo->pbImageData); + pDLCInfo->dwImageBytes=0; + pDLCInfo->pbImageData=NULL; + } + } +} + + +int CConsoleMinecraftApp::LoadLocalDLCImage(WCHAR *wchName,PBYTE *ppbImageData,DWORD *pdwBytes) +{ + // load the local file + WCHAR wchFilename[64]; + + + // 4J-PB - Read the file containing the product codes. This will be different for the SCEE/SCEA/SCEJ builds + swprintf(wchFilename,L"DLCImages/%s",wchName); + HANDLE hFile = CreateFile(wchFilename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + + if( hFile == INVALID_HANDLE_VALUE ) + { + app.DebugPrintf("Failed to open %ls\n", wchFilename); + return FALSE; + } + + DWORD dwHigh=0; + *pdwBytes = GetFileSize(hFile,&dwHigh); + + if(*pdwBytes!=0) + { + DWORD dwBytesRead; + PBYTE pbImageData=(PBYTE)malloc(*pdwBytes); + + if(ReadFile(hFile,pbImageData,*pdwBytes,&dwBytesRead,NULL)==FALSE) + { + // failed + free(pbImageData); + *pdwBytes=0; + } + else + { + *ppbImageData=pbImageData; + } + } + + CloseHandle(hFile); + + return 0; +} + +void CConsoleMinecraftApp::TemporaryCreateGameStart() +{ + ////////////////////////////////////////////////////////////////////////////////////////////// From CScene_Main::OnInit + + app.setLevelGenerationOptions(NULL); + + // From CScene_Main::RunPlayGame + Minecraft *pMinecraft=Minecraft::GetInstance(); + app.ReleaseSaveThumbnail(); + ProfileManager.SetLockedProfile(0); + pMinecraft->user->name = L"Durango"; + app.ApplyGameSettingsChanged(0); + + ////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameJoinLoad::OnInit + MinecraftServer::resetFlags(); + + // From CScene_MultiGameJoinLoad::OnNotifyPressEx + app.SetTutorialMode( false ); + app.SetCorruptSaveDeleted(false); + + ////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame + + app.ClearTerrainFeaturePosition(); + wstring wWorldName = L"TestWorld"; + + StorageManager.ResetSaveData(); + StorageManager.SetSaveTitle(wWorldName.c_str()); + + bool isFlat = false; + __int64 seedValue = BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements + + NetworkGameInitData *param = new NetworkGameInitData(); + param->seed = seedValue; + param->saveData = NULL; + + app.SetGameHostOption(eGameHostOption_Difficulty,0); + app.SetGameHostOption(eGameHostOption_FriendsOfFriends,0); + app.SetGameHostOption(eGameHostOption_Gamertags,1); + app.SetGameHostOption(eGameHostOption_BedrockFog,1); + + app.SetGameHostOption(eGameHostOption_GameType,GameType::SURVIVAL->getId() ); + app.SetGameHostOption(eGameHostOption_LevelType, 0 ); + app.SetGameHostOption(eGameHostOption_Structures, 1 ); + app.SetGameHostOption(eGameHostOption_BonusChest, 0 ); + + app.SetGameHostOption(eGameHostOption_PvP, 1); + app.SetGameHostOption(eGameHostOption_TrustPlayers, 1 ); + app.SetGameHostOption(eGameHostOption_FireSpreads, 1 ); + app.SetGameHostOption(eGameHostOption_TNT, 1 ); + app.SetGameHostOption(eGameHostOption_HostCanFly, 1); + app.SetGameHostOption(eGameHostOption_HostCanChangeHunger, 1); + app.SetGameHostOption(eGameHostOption_HostCanBeInvisible, 1 ); + + param->settings = app.GetGameHostOption( eGameHostOption_All ); + + g_NetworkManager.FakeLocalPlayerJoined(); + + LoadingInputParams *loadingParams = new LoadingInputParams(); + loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc; + loadingParams->lpParam = (LPVOID)param; + + // Reset the autosave time + app.SetAutosaveTimerTime(); + + C4JThread* thread = new C4JThread(loadingParams->func, loadingParams->lpParam, "RunNetworkGame"); + thread->Run(); +} + +typedef struct +{ + eDLCContentType e_DLC_Type; + //WCHAR *wchDisplayName; + WCHAR *wchProductId; + WCHAR *wchBannerName; + WCHAR *wchFirstSkin; + int iConfig; + unsigned int uiSortIndex; +} +DLC_DETAILS; + +#define MAX_DLC_DETAILS 18 +/*DLC_DETAILS DLCDetailsA[MAX_DLC_DETAILS] = +{ + // skin packs + + // Skin Pack Festive + { e_DLC_SkinPack,L"Festive Skin Pack",L"6dffc4d6-a2d2-4c8c-9284-c607f77e431a",L"SPF.png",L"dlcskin00000600.png",0,1}, + // Skin Pack 1 + { e_DLC_SkinPack,L"Skin Pack 1",L"8ecf0f25-a119-4987-a32b-ee0a5925ad8d",L"SP1.png",L"dlcskin00000000.png",0,2}, + // Skin Pack 2 + { e_DLC_SkinPack,L"Skin Pack 2",L"cc59b688-7cfb-4fa0-a76e-84aa55b92cae",L"SP2.png",L"dlcskin00000900.png",0,3}, + // Skin Pack 6 + //{ e_DLC_SkinPack,L"0037a29f-876e-4709-8bb8-a388738e6f51","SP6.png","dlcskin00000900.png",0,3}, + // Skin Pack Battle And Beasts + { e_DLC_SkinPack,L"Battle And Beasts",L"eeeb6489-02a3-4c6e-a8c9-2ace2aa1094d",L"SPC.png",L"dlcskin00000800.png",0,4}, + // Skin Pack Battle And Beasts 2 + { e_DLC_SkinPack,L"Battle And Beasts 2",L"b858200a-59a8-4e1f-a049-f3e73db2d786",L"SPZ.png",L"dlcskin00001000.png",0,5}, + // Skin Pack Marvel Avengers + { e_DLC_SkinPack,L"Marvel Avengers",L"d59757dd-7757-4c5e-8499-dbe4743baa10",L"SPM.png",L"dlcskin00001700.png",0,6}, + // Skin Pack Marvel Spider-Man + { e_DLC_SkinPack,L"Marvel Spider-Man",L"cdca1bff-13d1-435a-8aee-e7a35002473f",L"SPI.png",L"dlcskin00001800.png",0,7}, + // Skin Pack Birthday 1 + { e_DLC_SkinPack,L"Birthday Skin Pack",L"951e8062-3d4e-470c-8177-5eca91bc08b3",L"SPB.png",L"dlcskin00000700.png",0,8}, + // Skin Pack Birthday 2 + { e_DLC_SkinPack,L"2nd Birthday Skin Pack",L"c7157788-468d-4ca8-9ecf-5d77a09850fc",L"SPB2.png",L"dlcskin00002200.png",0,9}, + + // Texture Packs + + // Plastic Texture Pack + { e_DLC_TexturePacks,L"Plastic Texture Pack",L"52ecdcf1-d362-47a1-973b-1eeca0db0ea8",L"TP01.png",L"",2049,1}, + // Natural Texture Pack + { e_DLC_TexturePacks,L"Natural Texture Pack",L"1c56db0c-ff49-4bb1-b372-2122b0e813c1",L"TP02.png",L"",2053,2}, + // Halloween Texture Pack + { e_DLC_TexturePacks,L"Halloween Texture Pack",L"8cb331d1-8fa1-4367-a41a-d4830a80ce67",L"TP03.png",L"",2052,3}, + // Fantasy Texture Pack + { e_DLC_TexturePacks,L"Fantasy Texture Pack",L"375a1df4-5550-415b-b278-20f65b31a7a3",L"TP04.png",L"",2051,4}, + // City Texture Pack + { e_DLC_TexturePacks,L"City Texture Pack",L"ea5c7b40-e04d-4469-9382-8806467ca2c4",L"TP05.png",L"",2054,5}, + // Candy Texture Pack + { e_DLC_TexturePacks,L"Candy Texture Pack",L"94c75e45-0757-4886-916c-ab026ae27ca9",L"TP06.png",L"",2050,6}, + // Comic Texture Pack + //{ e_DLC_TexturePacks,L"Comic Texture Pack",L"3e14cf0f-26eb-40df-897d-7af905456e58",L"TP07.png",L"",2055,7}, + + // Mash-up Packs + + // Mass Effect + { e_DLC_MashupPacks,L"Mass Effect",L"ead4f3bb-b388-42da-8fa9-f1f91570b5c7",L"MPMA.png",L"dlcskin00001100.png",1024,1}, + // Skyrim + { e_DLC_MashupPacks,L"Skyrim",L"81cc4261-7b63-4e48-af1c-60b9ae099644",L"MPSR.png",L"dlcskin00001400.png",1025,2}, + // Halo + { e_DLC_MashupPacks,L"Halo",L"1e06dafc-ea27-475e-945c-fcee0c455f87",L"MPHA.png",L"dlcskin00001600.png",1026,3}, +};*/ + +void CConsoleMinecraftApp::InitialiseDLCDetails() +{ + for(int i=0;i<18;i++) + { + //RegisterDLCData(DLCDetailsA[i].e_DLC_Type, DLCDetailsA[i].wchBannerName, DLCDetailsA[i].wchDisplayName, DLCDetailsA[i].wchProductId, DLCDetailsA[i].wchFirstSkin, DLCDetailsA[i].iConfig, DLCDetailsA[i].uiSortIndex); + } +} + +bool CConsoleMinecraftApp::UpdateProductId(XCONTENT_DATA &Data) +{ + // Do we have a product id for this? + DLC_INFO *pDLCInfo=app.GetDLCInfoForProductName(Data.wszDisplayName); + + if(pDLCInfo!=NULL) + { + app.DebugPrintf("Updating product id for %ls\n",Data.wszDisplayName); + swprintf_s(Data.wszProductID, 64,L"%ls",pDLCInfo->wsProductId.c_str()); + return true; + } + else + { + app.DebugPrintf("Couldn't find %ls\n",Data.wszDisplayName); + } + + return false; +} + +void CConsoleMinecraftApp::Shutdown() +{ + m_bShutdown=true; +} + +bool CConsoleMinecraftApp::getShutdownFlag() +{ + return m_bShutdown; +} + + +// TMS +bool CConsoleMinecraftApp::TMSPP_ReadBannedList(int iPad,eTMSAction NextAction) +{ + app.DebugPrintf("CConsoleMinecraftApp::TMSPP_ReadBannedList\n"); + eTitleStorageState eResult; + bool bSendBanFileRetrievedMsg=false; + + if(GetBanListRead(iPad)==false) + { + // Attempt to read the ban list + // do we have one in our user filelist? + //if(StorageManager.TMSPP_InFileList(C4JStorage::eGlobalStorage_TitleUser,iPad,L"BannedList")) + { + SetBanListRead(iPad,true); + ClearBanList(iPad); + + eResult=StorageManager.TMSPP_ReadFile(iPad,C4JStorage::eGlobalStorage_TitleUser,C4JStorage::TMS_FILETYPE_BINARY,L"BannedList",&CConsoleMinecraftApp::Callback_TMSPPReadBannedList,this,NextAction); + if(eResult!=eTitleStorage_pending) + { + // something went wrong + app.SetTMSAction(iPad,(eTMSAction)NextAction); + bSendBanFileRetrievedMsg=true; + } + } + } + else + { + bSendBanFileRetrievedMsg=true; + } + + if(bSendBanFileRetrievedMsg) + { + ui.HandleTMSBanFileRetrieved(iPad); + } + + app.SetTMSAction(iPad,(eTMSAction)NextAction); + + return true; +} + +int CConsoleMinecraftApp::Callback_TMSPPReadBannedList(void *pParam,int iPad, int iUserData, LPVOID lpvData,WCHAR *wchFilename) +{ + app.DebugPrintf("CConsoleMinecraftApp::Callback_TMSPPReadBannedList\n"); + C4JStorage::PTMSPP_FILEDATA pFileData=(C4JStorage::PTMSPP_FILEDATA)lpvData; + + CConsoleMinecraftApp* pClass = (CConsoleMinecraftApp*)pParam; + + if(pFileData) + { + // put the entries into the vector + int iEntries=pFileData->dwSize/sizeof(BANNEDLISTDATA); + PBANNEDLISTDATA pData=(PBANNEDLISTDATA)pFileData->pbData; + + for(int i=0;iAddLevelToBannedLevelList(iPad,&pData[i], false); + } + // mark the level as not checked against banned levels - it'll be checked once the level starts + app.SetBanListCheck(iPad,false); + + // Xbox One will clear things within the DownloadBlob +#ifndef _XBOX_ONE + delete [] pFileData->pbData; + delete [] pFileData; +#endif + + ui.HandleTMSBanFileRetrieved(iPad); + } + else + { + // read problem - set state to idel again + StorageManager.TMSPP_ClearTitleStorageState(iPad); + } + + // change the state to the next action + pClass->SetTMSAction(iPad,(eTMSAction)iUserData); + + return 0; +} + +void CConsoleMinecraftApp::TMSPP_ReadDLCFile(int iPad,eTMSAction NextAction) +{ + app.DebugPrintf("CConsoleMinecraftApp::TMSPP_ReadDLCFile\n"); + bool bRetrievedDLCFile=false; + // try reading the DLC.xml file (from TMS global) - only allowed to do this once an hour at the most, but we'll just read once each time the game launches + eTitleStorageState eResult; + if(m_bRead_TMS_DLCINFO_XML==false) + { +// 4J-PB - we're reading this info from a local file now + + eResult=StorageManager.TMSPP_ReadFile(iPad,C4JStorage::eGlobalStorage_Title,C4JStorage::TMS_FILETYPE_BINARY,L"DLCXbox1.cmp",&CConsoleMinecraftApp::Callback_TMSPPReadDLCFile,this,NextAction); + if(eResult!=eTitleStorage_pending) + { + // something went wrong + app.SetTMSAction(iPad,(eTMSAction)NextAction); + bRetrievedDLCFile=true; + m_bRead_TMS_DLCINFO_XML=true; + } + } + else + { + bRetrievedDLCFile=true; + } + + if(bRetrievedDLCFile) + { + ui.HandleTMSDLCFileRetrieved(iPad); + + app.SetTMSAction(iPad,(eTMSAction)NextAction); + } +} + +void CConsoleMinecraftApp::TMSPP_RetrieveFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,eTMSAction NextAction) +{ + app.DebugPrintf("CConsoleMinecraftApp::TMSPP_RetrieveFileList\n"); + + if(eStorageFacility==C4JStorage::eGlobalStorage_Title) + { + if(m_bTMSPP_GlobalFileListRead==false) + { + m_bTMSPP_GlobalFileListRead=true; + StorageManager.TMSPP_ReadFileList(iPad,eStorageFacility,&CConsoleMinecraftApp::Callback_TMSPPRetrieveFileList,this,NextAction); + } + else + { + SetTMSAction(iPad,NextAction); + } + } + else + { + if(m_bTMSPP_UserFileListRead==false) + { + m_bTMSPP_UserFileListRead=true; + StorageManager.TMSPP_ReadFileList(iPad,eStorageFacility,&CConsoleMinecraftApp::Callback_TMSPPRetrieveFileList,this,NextAction); + } + else + { + SetTMSAction(iPad,NextAction); + } + } +} + +int CConsoleMinecraftApp::Callback_TMSPPRetrieveFileList(void *pParam,int iPad, int iUserData, LPVOID lpvData, WCHAR *wchFilename) +{ + CConsoleMinecraftApp* pClass = (CConsoleMinecraftApp*)pParam; + app.DebugPrintf("CConsoleMinecraftApp::Callback_TMSPPRetrieveFileList\n"); + if(lpvData!=NULL) + { + vector *pvTmsFileDetails=(vector *)lpvData; + + if(pvTmsFileDetails->size()>0) + { + #ifdef _DEBUG + // dump out the file list + app.DebugPrintf("TMSPP filecount - %d\nFiles - \n",pvTmsFileDetails->size()); + int iCount=0; + AUTO_VAR(itEnd, pvTmsFileDetails->end()); + for( AUTO_VAR(it, pvTmsFileDetails->begin()); it != itEnd; it++ ) + { + C4JStorage::PTMSPP_FILE_DETAILS fd = *it; + app.DebugPrintf("%2d. %ls (size - %d)\n",iCount++,fd->wchFilename,fd->ulFileSize); + } + + #endif + } + } + // change the state to the next action + pClass->SetTMSAction(iPad,(eTMSAction)iUserData); + return 0; +} + +//#define WRITE_DLCINFO 1 +int CConsoleMinecraftApp::Callback_TMSPPReadDLCFile(void *pParam,int iPad, int iUserData, LPVOID lpvData ,WCHAR *pwchFilename) +{ + app.DebugPrintf("CConsoleMinecraftApp::Callback_TMSPPReadDLCFile\n"); + C4JStorage::PTMSPP_FILEDATA pFileData= (C4JStorage::PTMSPP_FILEDATA)lpvData; + CConsoleMinecraftApp* pClass = (CConsoleMinecraftApp*)pParam; + +#ifdef WRITE_DLCINFO + if(0) +#else + if(pFileData && pFileData->dwSize>0) +#endif + { + // the DLC.xml file is now compressed + + unsigned int uiDecompSize=*(unsigned int *)pFileData->pbData; + unsigned int uiCompSize=((unsigned int *)pFileData->pbData)[1]; + + BYTE *pDecompressedData = new BYTE [uiDecompSize]; + + Compression::ECompressionTypes eOriginalCompressionType=Compression::getCompression()->GetDecompressionType(); + Compression::getCompression()->SetDecompressionType(Compression::eCompressionType_LZXRLE); + Compression::getCompression()->Decompress(pDecompressedData,&uiDecompSize,&((unsigned int *)pFileData->pbData)[2],uiCompSize); + Compression::getCompression()->SetDecompressionType(eOriginalCompressionType); + + ATG::XMLParser xmlParser; + xmlDLCInfoCallback xmlCallback; + + xmlParser.RegisterSAXCallbackInterface( &xmlCallback ); + xmlParser.ParseXMLBuffer((CHAR *)pDecompressedData,uiDecompSize); + + pClass->m_bRead_TMS_DLCINFO_XML=true; + + delete pDecompressedData; + + // apply the dlc info to the locally installed DLC + StorageManager.UpdateDLCProductIDs(); + + ui.HandleTMSDLCFileRetrieved(iPad); + } + else + { + + // if there was a read error, reset to idle + StorageManager.TMSPP_ClearTitleStorageState(iPad); + +#ifdef WRITE_DLCINFO + HANDLE file; + DWORD dwHigh=0; + DWORD dwFileSize; + + // hack for now to upload the file + // open the local file + file = CreateFile(L"DLCXbox1.cmp", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if( file == INVALID_HANDLE_VALUE ) + { + DWORD error = GetLastError(); + app.DebugPrintf("Failed to open DLCXbox1.cmp with error code %d (%x)\n", error, error); + __debugbreak(); + return 0; + } + + dwHigh=0; + dwFileSize = GetFileSize(file,&dwHigh); + + if(dwFileSize!=0) + { + DWORD bytesRead; + + PBYTE pbData= new BYTE [dwFileSize]; + + ReadFile(file,pbData,dwFileSize,&bytesRead,NULL); + + if(bytesRead==dwFileSize) + { + //StorageManager.TMSPP_WriteFile(iPad,C4JStorage::eGlobalStorage_TitleUser,C4JStorage::TMS_FILETYPE_BINARY,L"DLCXbox1.cmp",(PBYTE) pbData, dwFileSize,NULL,NULL, 0); + StorageManager.TMSPP_WriteFile(iPad,C4JStorage::eGlobalStorage_TitleUser,C4JStorage::TMS_FILETYPE_BINARY,L"TP06.cmp",(PBYTE) pbData, dwFileSize,NULL,NULL, 0); + } + Sleep(5000); + } + + CloseHandle(file); + + /* + // now the icon + file = CreateFile(L"TP06.png", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if( file == INVALID_HANDLE_VALUE ) + { + DWORD error = GetLastError(); + app.DebugPrintf("Failed to open DLCXbox1.cmp with error code %d (%x)\n", error, error); + return 0; + } + + dwHigh=0; + dwFileSize = GetFileSize(file,&dwHigh); + + if(dwFileSize!=0) + { + DWORD bytesRead; + + PBYTE pbData= new BYTE [dwFileSize]; + + ReadFile(file,pbData,dwFileSize,&bytesRead,NULL); + + if(bytesRead==dwFileSize) + { + StorageManager.TMSPP_WriteFile(iPad,C4JStorage::eGlobalStorage_TitleUser,C4JStorage::TMS_FILETYPE_BINARY,L"TP06.png",(PBYTE) pbData, dwFileSize,NULL,NULL, 0); + } + Sleep(5000); + } + + CloseHandle(file);*/ +#endif + } + + // change the state to the next action + pClass->SetTMSAction(iPad,(eTMSAction)iUserData); + + return 0; +} + +void CConsoleMinecraftApp::Callback_SaveGameIncomplete(void *pParam, C4JStorage::ESaveIncompleteType saveIncompleteType) +{ + CConsoleMinecraftApp* pClass = (CConsoleMinecraftApp*)pParam; + + if ( saveIncompleteType == C4JStorage::ESaveIncomplete_OutOfQuota + || saveIncompleteType == C4JStorage::ESaveIncomplete_OutOfLocalStorage ) + { + StorageManager.SetSaveDisabled(true); + pClass->EnterSaveNotificationSection(); + + int message; + if (saveIncompleteType == C4JStorage::ESaveIncomplete_OutOfQuota) message = IDS_SAVE_INCOMPLETE_EXPLANATION_QUOTA; + else message = IDS_SAVE_INCOMPLETE_EXPLANATION_LOCAL_STORAGE; + + UINT uiIDA[3] = + { + IDS_SAVE_INCOMPLETE_RETRY_SAVING, + IDS_SAVE_INCOMPLETE_DISABLE_SAVING, + IDS_SAVE_INCOMPLETE_DELETE_SAVES + }; + + if ( ui.RequestMessageBox( IDS_SAVE_INCOMPLETE_TITLE, message, uiIDA,3,0,Callback_SaveGameIncompleteMessageBoxReturned,pClass, app.GetStringTable()) == C4JStorage::EMessage_Busy) + { + // If this failed to display, continue as if we cancelled. This isn't ideal, but the user should already have had some system notification of being out of memory, + // and if we instantly retry then they may not be able to navigate whatever other error is blocking this from appearing + Callback_SaveGameIncompleteMessageBoxReturned(pParam, 0, C4JStorage::EMessage_Cancelled); + } + } + else + { + // 4J-JEV: Unknown error, just cancel the operation. + Callback_SaveGameIncompleteMessageBoxReturned(pParam, 0, C4JStorage::EMessage_Cancelled); + } +} + +int CConsoleMinecraftApp::Callback_SaveGameIncompleteMessageBoxReturned(void *pParam,int iPad,C4JStorage::EMessageResult result) +{ + CConsoleMinecraftApp* pClass = (CConsoleMinecraftApp*)pParam; + + switch(result) + { + case C4JStorage::EMessage_ResultAccept: + pClass->LeaveSaveNotificationSection(); + StorageManager.SetSaveDisabled(false); + StorageManager.ContinueIncompleteOperation(); + break; + case C4JStorage::EMessage_ResultDecline: + case C4JStorage::EMessage_Cancelled: + pClass->LeaveSaveNotificationSection(); + // Set the global flag, so that we don't disable saving again once the message box is complete + app.SetGameHostOption(eGameHostOption_DisableSaving, 1); + StorageManager.CancelIncompleteOperation(); + break; + case C4JStorage::EMessage_ResultThirdOption: + ui.NavigateToScene(iPad, eUIScene_InGameSaveManagementMenu, NULL, eUILayer_Error, eUIGroup_Fullscreen); + break; + } + return 0; +} + +void CConsoleMinecraftApp::ReadLocalDLCList(void) +{ + char szFile[255]; + DWORD dwLength; + // read the local dlc list + File fDLCList(L"CU/DLCXbox1.cmp") ; + if(fDLCList.exists()) + { + dwLength = fDLCList.length(); + byteArray data(dwLength); + + FileInputStream fis(fDLCList); + fis.read(data,0,dwLength); + fis.close(); + + unsigned int uiDecompSize=*(unsigned int *)data.data; + unsigned int uiCompSize=((unsigned int *)data.data)[1]; + + BYTE *pDecompressedData = new BYTE [uiDecompSize]; + + Compression::ECompressionTypes eOriginalCompressionType=Compression::getCompression()->GetDecompressionType(); + Compression::getCompression()->SetDecompressionType(Compression::eCompressionType_LZXRLE); + Compression::getCompression()->Decompress(pDecompressedData,&uiDecompSize,&((unsigned int *)data.data)[2],uiCompSize); + Compression::getCompression()->SetDecompressionType(eOriginalCompressionType); + + ATG::XMLParser xmlParser; + xmlDLCInfoCallback xmlCallback; + + xmlParser.RegisterSAXCallbackInterface( &xmlCallback ); + xmlParser.ParseXMLBuffer((CHAR *)pDecompressedData,uiDecompSize); + + delete pDecompressedData; + } +} \ No newline at end of file diff --git a/Minecraft.Client/Durango/Durango_App.h b/Minecraft.Client/Durango/Durango_App.h new file mode 100644 index 00000000..6e021232 --- /dev/null +++ b/Minecraft.Client/Durango/Durango_App.h @@ -0,0 +1,87 @@ +#pragma once + +#define SERVICE_CONFIG_ID L"05c20100-6e60-45d5-878a-4903149e11ae" +#define TITLE_PRODUCT_ID L"582e7bcc-11bc-4702-ab1b-b31566f8e327" // Parent Title's ProductID + + +class CConsoleMinecraftApp : public CMinecraftApp +{ + +public: + ImageFileBuffer m_ThumbnailBuffer; + + CConsoleMinecraftApp(); + +private: + int m_iLastPresenceContext[MAX_LOCAL_PLAYERS]; + PlayerUID m_xuidLastPresencePlayer[MAX_LOCAL_PLAYERS]; +public: + virtual void SetRichPresenceContext(int iPad, int contextId); + + virtual void StoreLaunchData(); + virtual void ExitGame(); + virtual void FatalLoadError(); + + virtual void CaptureSaveThumbnail(); + virtual void GetSaveThumbnail(PBYTE*,DWORD*); + virtual void ReleaseSaveThumbnail(); + virtual void GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize); + + virtual int LoadLocalTMSFile(WCHAR *wchTMSFile); + virtual int LoadLocalTMSFile(WCHAR *wchTMSFile, eFileExtensionType eExt); + int LoadLocalDLCImage(WCHAR *wchName,PBYTE *ppbImageData,DWORD *pdwBytes); + int LoadLocalDLCImages(); + void FreeLocalDLCImages(); + + virtual void FreeLocalTMSFiles(eTMSFileType eType); + virtual int GetLocalTMSFileIndex(WCHAR *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT=eFileExtensionType_PNG); + + // BANNED LEVEL LIST + virtual void ReadBannedList(int iPad, eTMSAction action=(eTMSAction)0, bool bCallback=false) {} + + // TMS++ + void TMSPP_RetrieveFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,eTMSAction NextAction); +// void TMSPP_ReadXuidsFile(int iPad,eTMSAction NextAction); +// void TMSPP_ReadConfigFile(int iPad,eTMSAction NextAction); + void TMSPP_ReadDLCFile(int iPad,eTMSAction NextAction); + bool TMSPP_ReadBannedList(int iPad,eTMSAction NextAction); + + static int Callback_TMSPPRetrieveFileList(void *pParam,int iPad, int iUserData, LPVOID lpvData,WCHAR *wchFilename); +// static int Callback_TMSPPReadXuidsFile(void *pParam,int iPad, int iUserData, C4JStorage::PTMSPP_FILEDATA pFileData,LPCSTR szFilename); +// static int Callback_TMSPPReadConfigFile(void *pParam,int iPad, int iUserData, C4JStorage::PTMSPP_FILEDATA pFileData, LPCSTR szFilename); + static int Callback_TMSPPReadDLCFile(void *pParam,int iPad, int iUserData, LPVOID lpvData,WCHAR *wchFilename); + static int Callback_TMSPPReadBannedList(void *pParam,int iPad, int iUserData, LPVOID lpvData,WCHAR *wchFilename); + virtual bool GetTMSDLCInfoRead() { return m_bRead_TMS_DLCINFO_XML;} + virtual bool GetTMSGlobalFileListRead() { return m_bTMSPP_GlobalFileListRead;} + virtual bool GetTMSUserFileListRead() { return m_bTMSPP_UserFileListRead;} + + static void Callback_SaveGameIncomplete(void *pParam, C4JStorage::ESaveIncompleteType saveIncompleteType); + static int Callback_SaveGameIncompleteMessageBoxReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); + + C4JStringTable *GetStringTable() { return NULL;} + + // original code + virtual void TemporaryCreateGameStart(); + + void InitialiseDLCDetails(); + static bool UpdateProductId(XCONTENT_DATA &Data); + + void Shutdown(); + bool getShutdownFlag(); + + void ReadLocalDLCList(void); + static void HandleDLCLicenseChange(); + +private: + DLC_INFO *m_DLCDetailsA; + bool m_bShutdown; + + bool m_bRead_TMS_DLCINFO_XML; // track whether we have already read the TMS DLC.xml file + bool m_bTMSPP_GlobalFileListRead; // track whether we have already read the file list from TMSPP + bool m_bTMSPP_UserFileListRead; // track whether we have already read the file list from TMSPP + +}; + +extern CConsoleMinecraftApp app; + + diff --git a/Minecraft.Client/Durango/Durango_Minecraft.cpp b/Minecraft.Client/Durango/Durango_Minecraft.cpp new file mode 100644 index 00000000..48d5c319 --- /dev/null +++ b/Minecraft.Client/Durango/Durango_Minecraft.cpp @@ -0,0 +1,1173 @@ +// Minecraft.cpp : Defines the entry point for the application. +// + +#include "stdafx.h" + +#include +#include "..\MinecraftServer.h" +#include "..\LocalPlayer.h" +#include "..\..\Minecraft.World\ItemInstance.h" +#include "..\..\Minecraft.World\MapItem.h" +#include "..\..\Minecraft.World\Recipes.h" +#include "..\..\Minecraft.World\Recipy.h" +#include "..\..\Minecraft.World\Language.h" +#include "..\..\Minecraft.World\StringHelpers.h" +#include "..\..\Minecraft.World\AABB.h" +#include "..\..\Minecraft.World\Vec3.h" +#include "..\..\Minecraft.World\Level.h" +#include "..\..\Minecraft.World\net.minecraft.world.level.tile.h" + +#include "Leaderboards\GameProgress.h" +#include "..\ClientConnection.h" +#include "..\User.h" +#include "..\..\Minecraft.World\Socket.h" +#include "..\..\Minecraft.World\ThreadName.h" +#include "..\..\Minecraft.Client\StatsCounter.h" +#include "..\ConnectScreen.h" +#include "Leaderboards\DurangoLeaderboardManager.h" +#include "..\..\Minecraft.Client\Tesselator.h" +#include "..\..\Minecraft.Client\Options.h" +#include "Sentient\SentientManager.h" +#include "..\..\Minecraft.World\IntCache.h" +#include "..\Textures.h" +#include "Resource.h" +#include "..\..\Minecraft.World\compression.h" +#include "..\..\Minecraft.World\OldChunkStorage.h" +#include + +//using namespace Windows::Xbox::Input; +using namespace Windows::Foundation::Collections; + +#define THEME_NAME "584111F70AAAAAAA" +#define THEME_FILESIZE 2797568 + +//#define THREE_MB 3145728 // minimum save size (checking for this on a selected device) +//#define FIVE_MB 5242880 // minimum save size (checking for this on a selected device) +//#define FIFTY_TWO_MB (1024*1024*52) // Maximum TCR space required for a save (checking for this on a selected device) +#define FIFTY_ONE_MB (1000000*51) // Maximum TCR space required for a save is 52MB (checking for this on a selected device) + +//#define PROFILE_VERSION 3 // new version for the interim bug fix 166 TU +#define NUM_PROFILE_VALUES 5 +#define NUM_PROFILE_SETTINGS 4 +DWORD dwProfileSettingsA[NUM_PROFILE_VALUES]= +{ +#ifdef _XBOX + XPROFILE_OPTION_CONTROLLER_VIBRATION, + XPROFILE_GAMER_YAXIS_INVERSION, + XPROFILE_GAMER_CONTROL_SENSITIVITY, + XPROFILE_GAMER_ACTION_MOVEMENT_CONTROL, + XPROFILE_TITLE_SPECIFIC1, +#else + 0,0,0,0,0 +#endif +}; + +//------------------------------------------------------------------------------------- +// Time Since fAppTime is a float, we need to keep the quadword app time +// as a LARGE_INTEGER so that we don't lose precision after running +// for a long time. +//------------------------------------------------------------------------------------- + + +BOOL g_bWidescreen = TRUE; + + +void DefineActions(void) +{ + // The app needs to define the actions required, and the possible mappings for these + + // Split into Menu actions, and in-game actions + + InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_A, _360_JOY_BUTTON_A); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_B, _360_JOY_BUTTON_B | _360_GTC_BACK); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_X, _360_JOY_BUTTON_X); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_Y, _360_JOY_BUTTON_Y); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_OK, _360_JOY_BUTTON_A); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_CANCEL, _360_JOY_BUTTON_B | _360_GTC_BACK); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_UP, _360_JOY_BUTTON_DPAD_UP | _360_JOY_BUTTON_LSTICK_UP); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_DOWN, _360_JOY_BUTTON_DPAD_DOWN | _360_JOY_BUTTON_LSTICK_DOWN); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_LEFT, _360_JOY_BUTTON_DPAD_LEFT | _360_JOY_BUTTON_LSTICK_LEFT); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT | _360_JOY_BUTTON_LSTICK_RIGHT); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_PAGEUP, _360_JOY_BUTTON_LT); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_PAGEDOWN, _360_JOY_BUTTON_RT); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_RIGHT_SCROLL, _360_JOY_BUTTON_RB); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_LEFT_SCROLL, _360_JOY_BUTTON_LB); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_PAUSEMENU, _360_JOY_BUTTON_START | _360_GTC_MENU); + + InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_GTC_PAUSE, _360_GTC_PAUSE); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_GTC_RESUME, _360_GTC_PLAY); + + InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_STICK_PRESS, _360_JOY_BUTTON_LTHUMB); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_OTHER_STICK_PRESS, _360_JOY_BUTTON_RTHUMB); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_OTHER_STICK_UP, _360_JOY_BUTTON_RSTICK_UP); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_OTHER_STICK_DOWN, _360_JOY_BUTTON_RSTICK_DOWN); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_OTHER_STICK_LEFT, _360_JOY_BUTTON_RSTICK_LEFT); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,ACTION_MENU_OTHER_STICK_RIGHT, _360_JOY_BUTTON_RSTICK_RIGHT); + + InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_JUMP, _360_JOY_BUTTON_A); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_FORWARD, _360_JOY_BUTTON_LSTICK_UP); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_BACKWARD, _360_JOY_BUTTON_LSTICK_DOWN); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_LEFT, _360_JOY_BUTTON_LSTICK_LEFT); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_RIGHT, _360_JOY_BUTTON_LSTICK_RIGHT); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_LOOK_LEFT, _360_JOY_BUTTON_RSTICK_LEFT); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_LOOK_RIGHT, _360_JOY_BUTTON_RSTICK_RIGHT); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_LOOK_UP, _360_JOY_BUTTON_RSTICK_UP); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_LOOK_DOWN, _360_JOY_BUTTON_RSTICK_DOWN); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_USE, _360_JOY_BUTTON_LT); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_ACTION, _360_JOY_BUTTON_RT); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_RIGHT_SCROLL, _360_JOY_BUTTON_RB); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_LEFT_SCROLL, _360_JOY_BUTTON_LB); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_INVENTORY, _360_JOY_BUTTON_Y); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_PAUSEMENU, _360_JOY_BUTTON_START | _360_GTC_MENU); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_DROP, _360_JOY_BUTTON_B); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_SNEAK_TOGGLE, _360_JOY_BUTTON_RTHUMB); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_CRAFTING, _360_JOY_BUTTON_X); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_RENDER_THIRD_PERSON, _360_JOY_BUTTON_LTHUMB); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_GAME_INFO, _360_JOY_BUTTON_BACK | _360_GTC_VIEW); + + InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_DPAD_LEFT, _360_JOY_BUTTON_DPAD_LEFT); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_DPAD_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_DPAD_UP, _360_JOY_BUTTON_DPAD_UP); + InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_DPAD_DOWN, _360_JOY_BUTTON_DPAD_DOWN); + + InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_A, _360_JOY_BUTTON_A); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_B, _360_JOY_BUTTON_B | _360_GTC_BACK); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_X, _360_JOY_BUTTON_X); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_Y, _360_JOY_BUTTON_Y); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_OK, _360_JOY_BUTTON_A); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_CANCEL, _360_JOY_BUTTON_B | _360_GTC_BACK); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_UP, _360_JOY_BUTTON_DPAD_UP | _360_JOY_BUTTON_LSTICK_UP); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_DOWN, _360_JOY_BUTTON_DPAD_DOWN | _360_JOY_BUTTON_LSTICK_DOWN); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_LEFT, _360_JOY_BUTTON_DPAD_LEFT | _360_JOY_BUTTON_LSTICK_LEFT); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT | _360_JOY_BUTTON_LSTICK_RIGHT); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_PAGEUP, _360_JOY_BUTTON_LB); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_PAGEDOWN, _360_JOY_BUTTON_RT); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_RIGHT_SCROLL, _360_JOY_BUTTON_RB); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_LEFT_SCROLL, _360_JOY_BUTTON_LB); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_PAUSEMENU, _360_JOY_BUTTON_START | _360_GTC_MENU); + + InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_GTC_PAUSE, _360_GTC_PAUSE); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_GTC_RESUME, _360_GTC_PLAY); + + InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_STICK_PRESS, _360_JOY_BUTTON_LTHUMB); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_OTHER_STICK_PRESS, _360_JOY_BUTTON_RTHUMB); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_OTHER_STICK_UP, _360_JOY_BUTTON_RSTICK_UP); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_OTHER_STICK_DOWN, _360_JOY_BUTTON_RSTICK_DOWN); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_OTHER_STICK_LEFT, _360_JOY_BUTTON_RSTICK_LEFT); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_OTHER_STICK_RIGHT, _360_JOY_BUTTON_RSTICK_RIGHT); + + InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_JUMP, _360_JOY_BUTTON_RB); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_FORWARD, _360_JOY_BUTTON_LSTICK_UP); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_BACKWARD, _360_JOY_BUTTON_LSTICK_DOWN); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_LEFT, _360_JOY_BUTTON_LSTICK_LEFT); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_RIGHT, _360_JOY_BUTTON_LSTICK_RIGHT); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_LOOK_LEFT, _360_JOY_BUTTON_RSTICK_LEFT); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_LOOK_RIGHT, _360_JOY_BUTTON_RSTICK_RIGHT); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_LOOK_UP, _360_JOY_BUTTON_RSTICK_UP); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_LOOK_DOWN, _360_JOY_BUTTON_RSTICK_DOWN); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_USE, _360_JOY_BUTTON_RT); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_ACTION, _360_JOY_BUTTON_LT); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_RIGHT_SCROLL, _360_JOY_BUTTON_DPAD_RIGHT); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_LEFT_SCROLL, _360_JOY_BUTTON_DPAD_LEFT); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_INVENTORY, _360_JOY_BUTTON_Y); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_PAUSEMENU, _360_JOY_BUTTON_START | _360_GTC_MENU); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_DROP, _360_JOY_BUTTON_B); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_SNEAK_TOGGLE, _360_JOY_BUTTON_LTHUMB); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_CRAFTING, _360_JOY_BUTTON_X); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_RENDER_THIRD_PERSON, _360_JOY_BUTTON_RTHUMB); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_GAME_INFO, _360_JOY_BUTTON_BACK | _360_GTC_VIEW); + + InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_DPAD_LEFT, _360_JOY_BUTTON_DPAD_LEFT); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_DPAD_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_DPAD_UP, _360_JOY_BUTTON_DPAD_UP); + InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_DPAD_DOWN, _360_JOY_BUTTON_DPAD_DOWN); + + InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_A, _360_JOY_BUTTON_A); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_B, _360_JOY_BUTTON_B | _360_GTC_BACK); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_X, _360_JOY_BUTTON_X); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_Y, _360_JOY_BUTTON_Y); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_OK, _360_JOY_BUTTON_A); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_CANCEL, _360_JOY_BUTTON_B | _360_GTC_BACK); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_UP, _360_JOY_BUTTON_DPAD_UP | _360_JOY_BUTTON_LSTICK_UP); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_DOWN, _360_JOY_BUTTON_DPAD_DOWN | _360_JOY_BUTTON_LSTICK_DOWN); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_LEFT, _360_JOY_BUTTON_DPAD_LEFT | _360_JOY_BUTTON_LSTICK_LEFT); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT | _360_JOY_BUTTON_LSTICK_RIGHT); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_PAGEUP, _360_JOY_BUTTON_DPAD_UP | _360_JOY_BUTTON_LB); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_PAGEDOWN, _360_JOY_BUTTON_RT); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_RIGHT_SCROLL, _360_JOY_BUTTON_RB); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_LEFT_SCROLL, _360_JOY_BUTTON_LB); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_PAUSEMENU, _360_JOY_BUTTON_START | _360_GTC_MENU); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_STICK_PRESS, _360_JOY_BUTTON_LTHUMB); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_OTHER_STICK_PRESS, _360_JOY_BUTTON_RTHUMB); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_OTHER_STICK_UP, _360_JOY_BUTTON_RSTICK_UP); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_OTHER_STICK_DOWN, _360_JOY_BUTTON_RSTICK_DOWN); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_OTHER_STICK_LEFT, _360_JOY_BUTTON_RSTICK_LEFT); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_OTHER_STICK_RIGHT, _360_JOY_BUTTON_RSTICK_RIGHT); + + InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_GTC_PAUSE, _360_GTC_PAUSE); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_GTC_RESUME, _360_GTC_PLAY); + + InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_JUMP, _360_JOY_BUTTON_LT); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_FORWARD, _360_JOY_BUTTON_LSTICK_UP); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_BACKWARD, _360_JOY_BUTTON_LSTICK_DOWN); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_LEFT, _360_JOY_BUTTON_LSTICK_LEFT); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_RIGHT, _360_JOY_BUTTON_LSTICK_RIGHT); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_LOOK_LEFT, _360_JOY_BUTTON_RSTICK_LEFT); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_LOOK_RIGHT, _360_JOY_BUTTON_RSTICK_RIGHT); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_LOOK_UP, _360_JOY_BUTTON_RSTICK_UP); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_LOOK_DOWN, _360_JOY_BUTTON_RSTICK_DOWN); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_USE, _360_JOY_BUTTON_RT); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_ACTION, _360_JOY_BUTTON_A); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_RIGHT_SCROLL, _360_JOY_BUTTON_DPAD_RIGHT); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_LEFT_SCROLL, _360_JOY_BUTTON_DPAD_LEFT); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_INVENTORY, _360_JOY_BUTTON_Y); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_PAUSEMENU, _360_JOY_BUTTON_START | _360_GTC_MENU); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_DROP, _360_JOY_BUTTON_B); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_SNEAK_TOGGLE, _360_JOY_BUTTON_LB); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_CRAFTING, _360_JOY_BUTTON_X); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_RENDER_THIRD_PERSON, _360_JOY_BUTTON_LTHUMB); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_GAME_INFO, _360_JOY_BUTTON_BACK | _360_GTC_VIEW); + + InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_DPAD_LEFT, _360_JOY_BUTTON_DPAD_LEFT); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_DPAD_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_DPAD_UP, _360_JOY_BUTTON_DPAD_UP); + InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_DPAD_DOWN, _360_JOY_BUTTON_DPAD_DOWN); +} + +#if 0 +HRESULT InitD3D( IDirect3DDevice9 **ppDevice, + D3DPRESENT_PARAMETERS *pd3dPP ) +{ + IDirect3D9 *pD3D; + + pD3D = Direct3DCreate9( D3D_SDK_VERSION ); + + // Set up the structure used to create the D3DDevice + // Using a permanent 1280x720 backbuffer now no matter what the actual video resolution.right Have also disabled letterboxing, + // which would letterbox a 1280x720 output if it detected a 4:3 video source - we're doing an anamorphic squash in this + // mode so don't need this functionality. + + ZeroMemory( pd3dPP, sizeof(D3DPRESENT_PARAMETERS) ); + XVIDEO_MODE VideoMode; + XGetVideoMode( &VideoMode ); + g_bWidescreen = VideoMode.fIsWideScreen; + pd3dPP->BackBufferWidth = 1280; + pd3dPP->BackBufferHeight = 720; + pd3dPP->BackBufferFormat = D3DFMT_A8R8G8B8; + pd3dPP->BackBufferCount = 1; + pd3dPP->EnableAutoDepthStencil = TRUE; + pd3dPP->AutoDepthStencilFormat = D3DFMT_D24S8; + pd3dPP->SwapEffect = D3DSWAPEFFECT_DISCARD; + pd3dPP->PresentationInterval = D3DPRESENT_INTERVAL_ONE; + //pd3dPP->Flags = D3DPRESENTFLAG_NO_LETTERBOX; + //ERR[D3D]: Can't set D3DPRESENTFLAG_NO_LETTERBOX when wide-screen is enabled + // in the launcher/dashboard. + if(g_bWidescreen) + pd3dPP->Flags=0; + else + pd3dPP->Flags = D3DPRESENTFLAG_NO_LETTERBOX; + + // Create the device. + return pD3D->CreateDevice( + 0, + D3DDEVTYPE_HAL, + NULL, + D3DCREATE_HARDWARE_VERTEXPROCESSING|D3DCREATE_BUFFER_2_FRAMES, + pd3dPP, + ppDevice ); +} +#endif +//#define MEMORY_TRACKING + +#ifdef MEMORY_TRACKING +void ResetMem(); +void DumpMem(); +void MemPixStuff(); +#else +void MemSect(int sect) +{ +} +#endif + + +HINSTANCE g_hInst = NULL; + +Platform::Agile g_window; +Windows::Foundation::Rect g_windowBounds; + +D3D_DRIVER_TYPE g_driverType = D3D_DRIVER_TYPE_NULL; +D3D_FEATURE_LEVEL g_featureLevel = D3D_FEATURE_LEVEL_11_0; +Microsoft::WRL::ComPtr g_d3dDevice; +Microsoft::WRL::ComPtr g_d3dContext; +Microsoft::WRL::ComPtr g_swapChain; +Microsoft::WRL::ComPtr g_renderTargetView; +Microsoft::WRL::ComPtr g_depthStencilView; +Microsoft::WRL::ComPtr g_depthStencil; + +void CreateDevice(); +void CreateResources(); +void InitializeDurango(Windows::UI::Core::CoreWindow^ window) +{ + SetThreadAffinityMask(GetCurrentThread(),1); + + g_window = window; + + CreateDevice(); + + CreateResources(); + + // TODO: Begin asynchronous loading of game assets. + + C4JThread::StaticInit(); +} + +namespace DX +{ + inline void ThrowIfFailed(HRESULT hr) + { + if (FAILED(hr)) + { + // Set a breakpoint on this line to catch DirectX API errors + throw Platform::Exception::CreateException(hr); + } + } +} + +void CreateDevice() +{ + // This flag adds support for surfaces with a different color channel ordering than the API default. + // It is recommended usage, and is required for compatibility with Direct2D. + UINT creationFlags = D3D11_CREATE_DEVICE_FAST_KICKOFFS; +#ifndef _CONTENT_PACKAGE + creationFlags |= D3D11_CREATE_DEVICE_VALIDATED; + creationFlags |= D3D11_CREATE_DEVICE_INSTRUMENTED; +#endif + + // This array defines the set of DirectX hardware feature levels this app will support. + // Note the ordering should be preserved. + // Don't forget to declare your application's minimum required feature level in its + // description. All applications are assumed to support 9.1 unless otherwise stated. + D3D_FEATURE_LEVEL featureLevels[] = + { + D3D_FEATURE_LEVEL_11_0 + }; + + // Create the DX11 API device object, and get a corresponding context. + Microsoft::WRL::ComPtr device; + Microsoft::WRL::ComPtr context; + + DX::ThrowIfFailed( + D3D11CreateDevice( + nullptr, // specify null to use the default adapter + D3D_DRIVER_TYPE_HARDWARE, + nullptr, // leave as nullptr unless software device + creationFlags, // optionally set debug and Direct2D compatibility flags + featureLevels, // list of feature levels this app can support + ARRAYSIZE(featureLevels), // number of entries in above list + D3D11_SDK_VERSION, // always set this to D3D11_SDK_VERSION + &device, // returns the Direct3D device created + &g_featureLevel, // returns feature level of device created + &context // returns the device immediate context + ) + ); + + // Get the DirectX11.1 device by QI off the DirectX11 one. + DX::ThrowIfFailed(device.As(&g_d3dDevice)); + + // And get the corresponding device context in the same way. + DX::ThrowIfFailed(context.As(&g_d3dContext)); +} + +// Allocate all memory resources that change on a window SizeChanged event. +void CreateResources() +{ + // Store the window bounds so the next time we get a SizeChanged event we can + // avoid rebuilding everything if the size is identical. + g_windowBounds = g_window.Get()->Bounds; + + // If the swap chain already exists, resize it, + // otherwise create one. + if(g_swapChain != nullptr) + { + DX::ThrowIfFailed(g_swapChain->ResizeBuffers(2, 0, 0, DXGI_FORMAT_B8G8R8A8_UNORM, 0)); + } + else + { + // First, retrieve the underlying DXGI Device from the D3D Device + Microsoft::WRL::ComPtr dxgiDevice; + DX::ThrowIfFailed(g_d3dDevice.As(&dxgiDevice)); + + // Identify the physical adapter (GPU or card) this device is running on. + Microsoft::WRL::ComPtr dxgiAdapter; + DX::ThrowIfFailed(dxgiDevice->GetAdapter(&dxgiAdapter)); + + // And obtain the factory object that created it. + Microsoft::WRL::ComPtr dxgiFactory; + DX::ThrowIfFailed(dxgiAdapter->GetParent(__uuidof(IDXGIFactory2), &dxgiFactory)); + + // Create a descriptor for the swap chain. + DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {0}; + + swapChainDesc.Width = 1920; + swapChainDesc.Height = 1080; + swapChainDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_SHADER_INPUT; + swapChainDesc.BufferCount = 2; + swapChainDesc.Stereo = false; + swapChainDesc.SampleDesc.Count = 1; + swapChainDesc.SampleDesc.Quality = 0; + swapChainDesc.Scaling = DXGI_SCALING_STRETCH; + swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; + swapChainDesc.Flags = 0; + + // Create a SwapChain from a CoreWindow. + DX::ThrowIfFailed(dxgiFactory->CreateSwapChainForCoreWindow(g_d3dDevice.Get(), reinterpret_cast(g_window.Get()), &swapChainDesc, nullptr, &g_swapChain)); + } + + // Obtain the backbuffer for this window which will be the final 3D rendertarget. + Microsoft::WRL::ComPtr backBuffer; + DX::ThrowIfFailed(g_swapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), &backBuffer)); + + // Create a view interface on the rendertarget to use on bind. + DX::ThrowIfFailed(g_d3dDevice->CreateRenderTargetView(backBuffer.Get(), nullptr, &g_renderTargetView)); + + // Cache the rendertarget dimensions in our helper class for convenient use. + D3D11_TEXTURE2D_DESC backBufferDesc = {0}; + backBuffer->GetDesc(&backBufferDesc); + + // Allocate a 2-D surface as the depth/stencil buffer and + // create a DepthStencil view on this surface to use on bind. + CD3D11_TEXTURE2D_DESC depthStencilDesc(DXGI_FORMAT_D24_UNORM_S8_UINT, backBufferDesc.Width, backBufferDesc.Height, 1, 1, D3D11_BIND_DEPTH_STENCIL); + + Microsoft::WRL::ComPtr depthStencil; + DX::ThrowIfFailed(g_d3dDevice->CreateTexture2D(&depthStencilDesc, nullptr, &depthStencil)); + + CD3D11_DEPTH_STENCIL_VIEW_DESC depthStencilViewDesc(D3D11_DSV_DIMENSION_TEXTURE2D); + DX::ThrowIfFailed(g_d3dDevice->CreateDepthStencilView(depthStencil.Get(), &depthStencilViewDesc, &g_depthStencilView)); + + // Create a viewport descriptor of the full window size. + CD3D11_VIEWPORT viewPort(0.0f, 0.0f, static_cast(backBufferDesc.Width), static_cast(backBufferDesc.Height)); + + // Set the current viewport using the descriptor. + g_d3dContext->RSSetViewports(1, &viewPort); + g_d3dContext->OMSetRenderTargets( 1, g_renderTargetView.GetAddressOf(), g_depthStencilView.Get() ); +} + +//-------------------------------------------------------------------------------------- +// Render the frame +//-------------------------------------------------------------------------------------- +void Render() +{ + // Just clear the backbuffer + float ClearColor[4] = { 0.0f, 0.125f, 0.3f, 1.0f }; //red,green,blue,alpha + + g_d3dContext->ClearRenderTargetView( g_renderTargetView.Get(), ClearColor ); + g_swapChain->Present( 0, 0 ); +} + + +void oldWinMainInit() +{ +#if 0 + // Main message loop + MSG msg = {0}; + while( WM_QUIT != msg.message ) + { + if( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) ) + { + TranslateMessage( &msg ); + DispatchMessage( &msg ); + } + else + { + Render(); + } + } + + return (int) msg.wParam; +#endif + + +#ifdef MEMORY_TRACKING + ResetMem(); + MEMORYSTATUS memStat; + GlobalMemoryStatus(&memStat); + printf("RESETMEM start: Avail. phys %d\n",memStat.dwAvailPhys/(1024*1024)); +#endif + +#if 0 + // Initialize D3D + hr = InitD3D( &pDevice, &d3dpp ); + g_pD3DDevice = pDevice; + if( FAILED(hr) ) + { + app.DebugPrintf + ( "Failed initializing D3D.\n" ); + return -1; + } + + // Initialize the application, assuming sharing of the d3d interface. + hr = app.InitShared( pDevice, &d3dpp, + XuiPNGTextureLoader ); + + if ( FAILED(hr) ) + { + app.DebugPrintf + ( "Failed initializing application.\n" ); + + return -1; + } + + +#endif + + app.loadMediaArchive(); + + RenderManager.Initialise(g_d3dDevice.Get(), g_swapChain.Get()); + + app.loadStringTable(); + + ui.init(g_d3dDevice,g_d3dContext,g_renderTargetView,g_depthStencilView,1920,1080); + + //////////////// + // Initialise // + //////////////// + +#if 0 + // 4J Stu - XACT was creating these automatically, but we need them for QNet. The setup params + // are just copied from a sample app and may need changed for our purposes + // Start XAudio2 + hr = XAudio2Create( &g_pXAudio2, 0, XAUDIO2_DEFAULT_PROCESSOR ); + if( FAILED( hr ) ) + { + app.DebugPrintf( "Initializing XAudio2 failed (err = 0x%08x)!\n", hr ); + app.FatalLoadError(); + } + + // Create an XAudio2 mastering voice (utilized by XHV2 when voice data is mixed to main speakers) + hr = g_pXAudio2->CreateMasteringVoice(&g_pXAudio2MasteringVoice, XAUDIO2_DEFAULT_CHANNELS, XAUDIO2_DEFAULT_SAMPLERATE, 0, 0, NULL); + if ( FAILED( hr ) ) + { + app.DebugPrintf( "Creating XAudio2 mastering voice failed (err = 0x%08x)!\n", hr ); + app.FatalLoadError(); + } +#endif + app.InitTime(); + + // Set the number of possible joypad layouts that the user can switch between, and the number of actions + InputManager.Initialise(1,3,MINECRAFT_ACTION_MAX, ACTION_MAX_MENU); + + // Set the default joypad action mappings for Minecraft + DefineActions(); + InputManager.SetJoypadMapVal(0,0); + InputManager.SetKeyRepeatRate(0.3f,0.2f); + + // looks like the Durango controller is a good bit more sensitive than XBOX360/PS3. Defaults in the lib are 10000 for deadzone and 32767 for movement range + InputManager.SetDeadzoneAndMovementRange(10000,20000,32767); + + // Initialise the profile manager with the game Title ID, Offer ID, a profile version number, and the number of profile values and settings + ProfileManager.Initialise(SERVICE_CONFIG_ID, TITLE_PRODUCT_ID); + + ProfileManager.RegisterPresence(CONTEXT_PRESENCE_IDLE,L"Idle"); + ProfileManager.RegisterPresence(CONTEXT_PRESENCE_MENUS,L"InMenus"); + ProfileManager.RegisterPresence(CONTEXT_PRESENCE_MULTIPLAYER,L"PlayingMultiplayer"); + ProfileManager.RegisterPresence(CONTEXT_PRESENCE_MULTIPLAYEROFFLINE,L"PlayingMultiplayerOffline"); + ProfileManager.RegisterPresence(CONTEXT_PRESENCE_MULTIPLAYER_1P,L"PlayingAlone"); + ProfileManager.RegisterPresence(CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE,L"PlayingAloneOffline"); + + // Fix for XboxOne #165025 - XR-049: Compliance: Title does not display Rich Presence strings for profiles in main menu. + ProfileManager.SetGameActivityForAllActiveUsers(CONTEXT_PRESENCE_IDLE); + + Compression::CreateNewThreadStorage(); + app.ReadLocalDLCList(); + + // initialise the storage manager with a default save display name, a Minimum save size, and a callback for displaying the saving message + StorageManager.Init(0,app.GetString(IDS_DEFAULT_SAVENAME),"savegame.dat",FIFTY_ONE_MB,&CConsoleMinecraftApp::DisplaySavingMessage,(LPVOID)&app, app.UpdateProductId,SERVICE_CONFIG_ID,TITLE_PRODUCT_ID); + + StorageManager.SetMaxSaves(99); + + byteArray baSaveThumbnail = app.getArchiveFile(L"DefaultSaveThumbnail64x64.png"); + + StorageManager.InitialiseProfileData(PROFILE_VERSION_BUILD_JUNE14, + NUM_PROFILE_VALUES, + NUM_PROFILE_SETTINGS, + dwProfileSettingsA, + app.GAME_DEFINED_PROFILE_DATA_BYTES*XUSER_MAX_COUNT, + &app.uiGameDefinedDataChangedBitmask); + + StorageManager.SetDefaultImages((PBYTE)baSaveThumbnail.data, baSaveThumbnail.length); + + // Set function to be called if a save game operation can't complete due to running out of storage space etc. + StorageManager.SetIncompleteSaveCallback(CConsoleMinecraftApp::Callback_SaveGameIncomplete, (LPVOID)&app); + + // set a function to be called when there's a sign in change, so we can exit a level if the primary player signs out + ProfileManager.SetSignInChangeCallback(&CConsoleMinecraftApp::SignInChangeCallback,(LPVOID)&app); + + // Set a callback for the default player options to be set - when there is no profile data for the player + StorageManager.SetDefaultOptionsCallback(&CConsoleMinecraftApp::DefaultOptionsCallback,(LPVOID)&app); + StorageManager.SetOptionsDataCallback(&CConsoleMinecraftApp::OptionsDataCallback,(LPVOID)&app); + + + // Set a callback to deal with old profile versions needing updated to new versions + StorageManager.SetOldProfileVersionCallback(&CConsoleMinecraftApp::OldProfileVersionCallback,(LPVOID)&app); + + g_NetworkManager.Initialise(); + + + // Initialise TLS for tesselator, for this main thread + Tesselator::CreateNewThreadStorage(1024*1024); + // Initialise TLS for AABB and Vec3 pools, for this main thread + AABB::CreateNewThreadStorage(); + Vec3::CreateNewThreadStorage(); + IntCache::CreateNewThreadStorage(); + OldChunkStorage::CreateNewThreadStorage(); + Level::enableLightingCache(); + Tile::CreateNewThreadStorage(); + + //4J-PB - after the init, which will have read all the local DLC, update the product ids by reading the local dlc file + StorageManager.UpdateDLCProductIDs(); + + Minecraft::main(); + Minecraft *pMinecraft=Minecraft::GetInstance(); + app.InitGameSettings(); + + // read the options here for controller 0 + // 4J-PB - we have no valid user to read a profile for on Xbox One, and there's no EULA anyway + //StorageManager.ReadFromProfile(0); + + app.InitialiseDLCDetails(); + StorageManager.SetLicenseChangeFn(&app.HandleDLCLicenseChange); + + + // debug switch to trial version + ProfileManager.SetDebugFullOverride(true); + + // set default values for controllers +// for(int i=0;i<4;i++) +// { +// //app.SetDefaultOptions(app.GetGameDefinedProfileData(i),i); +// app.SetDefaultOptions(ProfileManager.GetGameDefinedProfileData(i),i); +// } + + +#if 0 + //bool bDisplayPauseMenu=false; + + // set the default gamma level + float fVal=50.0f*327.68f; + RenderManager.UpdateGamma((unsigned short)fVal); + + // load any skins + //app.AddSkinsToMemoryTextureFiles(); + + // set the achievement text for a trial achievement, now we have the string table loaded + ProfileManager.SetTrialTextStringTable(app.GetStringTable(),IDS_CONFIRM_OK, IDS_CONFIRM_CANCEL); + ProfileManager.SetTrialAwardText(eAwardType_Achievement,IDS_UNLOCK_TITLE,IDS_UNLOCK_ACHIEVEMENT_TEXT); + ProfileManager.SetTrialAwardText(eAwardType_GamerPic,IDS_UNLOCK_TITLE,IDS_UNLOCK_GAMERPIC_TEXT); + ProfileManager.SetTrialAwardText(eAwardType_AvatarItem,IDS_UNLOCK_TITLE,IDS_UNLOCK_AVATAR_TEXT); + ProfileManager.SetTrialAwardText(eAwardType_Theme,IDS_UNLOCK_TITLE,IDS_UNLOCK_THEME_TEXT); + ProfileManager.SetUpsellCallback(&app.UpsellReturnedCallback,&app); + + // Set up a debug character press sequence +#ifndef _FINAL_BUILD + app.SetDebugSequence("LRLRYYY"); +#endif + + // Initialise the social networking manager. + CSocialManager::Instance()->Initialise(); + + // Update the base scene quick selects now that the minecraft class exists + //CXuiSceneBase::UpdateScreenSettings(0); +#endif + app.InitialiseTips(); +#if 0 + + DWORD initData=0; + + + +#ifndef _FINAL_BUILD +#ifndef _DEBUG + #pragma message(__LOC__"Need to define the _FINAL_BUILD before submission") +#endif +#endif + + // Set the default sound levels + pMinecraft->options->set(Options::Option::MUSIC,1.0f); + pMinecraft->options->set(Options::Option::SOUND,1.0f); + + app.NavigateToScene(XUSER_INDEX_ANY,eUIScene_Intro,&initData); +#endif + + + + //app.TemporaryCreateGameStart(); + + //Sleep(10000); +#if 0 + // Intro loop ? + while(app.IntroRunning()) + { + ProfileManager.Tick(); + // Tick XUI + app.RunFrame(); + + // 4J : WESTY : Added to ensure we always have clear background for intro. + RenderManager.SetClearColour(D3DCOLOR_RGBA(0,0,0,255)); + RenderManager.Clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + // Render XUI + hr = app.Render(); + + // Present the frame. + RenderManager.Present(); + + // Update XUI Timers + hr = XuiTimersRun(); + } +#endif +} +void oldWinMainTick() +{ + static bool bTrialTimerDisplayed=true; + + Minecraft *pMinecraft=Minecraft::GetInstance(); + RenderManager.StartFrame(); +#if 0 + if(pMinecraft->soundEngine->isStreamingWavebankReady() && + !pMinecraft->soundEngine->isPlayingStreamingGameMusic() && + !pMinecraft->soundEngine->isPlayingStreamingCDMusic() ) + { + // play some music in the menus + pMinecraft->soundEngine->playStreaming(L"", 0, 0, 0, 0, 0, false); + } +#endif + app.UpdateTime(); + PIXBeginNamedEvent(0,"Input manager tick"); + InputManager.Tick(); + PIXEndNamedEvent(); + PIXBeginNamedEvent(0,"Profile manager tick"); + ProfileManager.Tick(); + PIXEndNamedEvent(); + PIXBeginNamedEvent(0,"Storage manager tick"); + StorageManager.Tick(); + PIXEndNamedEvent(); + PIXBeginNamedEvent(0,"Render manager tick"); + RenderManager.Tick(); + PIXEndNamedEvent(); + + // Tick the social networking manager. + PIXBeginNamedEvent(0,"Social network manager tick"); +// CSocialManager::Instance()->Tick(); + PIXEndNamedEvent(); + + // Tick sentient. + PIXBeginNamedEvent(0,"Sentient tick"); + MemSect(37); +// SentientManager.Tick(); + MemSect(0); + PIXEndNamedEvent(); + + GameProgress::Tick(); + + PIXBeginNamedEvent(PIX_COLOR_INDEX(2),"Network manager do work #1"); + g_NetworkManager.DoWork(); + PIXEndNamedEvent(); + + LeaderboardManager::Instance()->Tick(); + // Render game graphics. + if(app.GetGameStarted()) + { + pMinecraft->run_middle(); + app.SetAppPaused( g_NetworkManager.IsLocalGame() && g_NetworkManager.GetPlayerCount() == 1 && ui.IsPauseMenuDisplayed(ProfileManager.GetPrimaryPad()) ); + } + else + { + MemSect(28); + pMinecraft->soundEngine->tick(NULL, 0.0f); + MemSect(0); + pMinecraft->textures->tick(true,false); + IntCache::Reset(); + if( app.GetReallyChangingSessionType() ) + { + pMinecraft->tickAllConnections(); // Added to stop timing out when we are waiting after converting to an offline game + } + } + + pMinecraft->soundEngine->playMusicTick(); + + +#ifdef MEMORY_TRACKING + static bool bResetMemTrack = false; + static bool bDumpMemTrack = false; + + MemPixStuff(); + + if( bResetMemTrack ) + { + ResetMem(); + MEMORYSTATUS memStat; + GlobalMemoryStatus(&memStat); + printf("RESETMEM: Avail. phys %d\n",memStat.dwAvailPhys/(1024*1024)); + bResetMemTrack = false; + } + + if( bDumpMemTrack ) + { + DumpMem(); + bDumpMemTrack = false; + MEMORYSTATUS memStat; + GlobalMemoryStatus(&memStat); + printf("DUMPMEM: Avail. phys %d\n",memStat.dwAvailPhys/(1024*1024)); + printf("Renderer used: %d\n",RenderManager.CBuffSize(-1)); + } +#endif +#if 0 + static bool bDumpTextureUsage = false; + if( bDumpTextureUsage ) + { + RenderManager.TextureGetStats(); + bDumpTextureUsage = false; + } +#endif + ui.tick(); + ui.render(); +#if 0 + app.HandleButtonPresses(); + + // store the minecraft renderstates, and re-set them after the xui render + GetRenderAndSamplerStates(pDevice,RenderStateA,SamplerStateA); + + // Tick XUI + PIXBeginNamedEvent(0,"Xui running"); + app.RunFrame(); + PIXEndNamedEvent(); + + // Render XUI + + PIXBeginNamedEvent(0,"XUI render"); + MemSect(7); + hr = app.Render(); + MemSect(0); + GetRenderAndSamplerStates(pDevice,RenderStateA2,SamplerStateA2); + PIXEndNamedEvent(); + + for(int i=0;i<8;i++) + { + if(RenderStateA2[i]!=RenderStateA[i]) + { + //printf("Reseting RenderStateA[%d] after a XUI render\n",i); + pDevice->SetRenderState(RenderStateModes[i],RenderStateA[i]); + } + } + for(int i=0;i<5;i++) + { + if(SamplerStateA2[i]!=SamplerStateA[i]) + { + //printf("Reseting SamplerStateA[%d] after a XUI render\n",i); + pDevice->SetSamplerState(0,SamplerStateModes[i],SamplerStateA[i]); + } + } + + RenderManager.Set_matrixDirty(); +#endif + +#if 0 // ndef _CONTENT_PACKAGE + if( InputManager.ButtonPressed(0,MINECRAFT_ACTION_DPAD_LEFT) || + InputManager.ButtonPressed(0,ACTION_MENU_STICK_PRESS)) + { + RenderManager.DoScreenGrabOnNextPresent(); + } +#endif + + // Present the frame. + RenderManager.Present(); + + ui.CheckMenuDisplayed(); + + PIXBeginNamedEvent(0,"Profile load check"); + // has the game defined profile data been changed (by a profile load) + if(app.uiGameDefinedDataChangedBitmask!=0) + { + void *pData; + for(int i=0;istats[ i ]->clear(); + pMinecraft->stats[i]->parse(pData); + } + } + +#if 0 + // Check to see if we can post to social networks. + CSocialManager::Instance()->RefreshPostingCapability(); +#endif + + // clear the flag + app.uiGameDefinedDataChangedBitmask=0; + + // Check if any profile write are needed + app.CheckGameSettingsChanged(); + + } + PIXEndNamedEvent(); + app.TickTMSPPFilesRetrieved(); + + app.TickDLCOffersRetrieved(); + + PIXBeginNamedEvent(0,"Network manager do work #2"); + // 4J Stu - Added this back as it was causing horrendous lag (and eventually a crash on a client) when playing with multiple clients + g_NetworkManager.DoWork(); // TODO - consider putting this back in. Removed because we are having trouble with how long the tick is taking on Durango + PIXEndNamedEvent(); + +#if 0 + PIXBeginNamedEvent(0,"Misc extra xui"); + // Update XUI Timers + hr = XuiTimersRun(); +#endif + // Any threading type things to deal with from the xui side? + app.HandleXuiActions(); +#if 0 + PIXEndNamedEvent(); +#endif + + // 4J-PB - Update the trial timer display if we are in the trial version + if(!ProfileManager.IsFullVersion()) + { + // display the trial timer + if(app.GetGameStarted()) + { + // 4J-PB - if the game is paused, add the elapsed time to the trial timer count so it doesn't tick down + if(app.IsAppPaused()) + { + app.UpdateTrialPausedTimer(); + } + ui.UpdateTrialTimer(ProfileManager.GetPrimaryPad()); + } + } + else + { + // need to turn off the trial timer if it was on , and we've unlocked the full version + if(bTrialTimerDisplayed) + { + ui.ShowTrialTimer(false); + bTrialTimerDisplayed=false; + } + } + + // Fix for #7318 - Title crashes after short soak in the leaderboards menu + // A memory leak was caused because the icon renderer kept creating new Vec3's because the pool wasn't reset + Vec3::resetPool(); +} + +#ifdef MEMORY_TRACKING + +int totalAllocGen = 0; +unordered_map allocCounts; +bool trackEnable = false; +bool trackStarted = false; +volatile size_t sizeCheckMin = 1160; +volatile size_t sizeCheckMax = 1160; +volatile int sectCheck = 48; +CRITICAL_SECTION memCS; +DWORD tlsIdx; + +LPVOID XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes) +{ + if( !trackStarted ) + { + void *p = XMemAllocDefault(dwSize,dwAllocAttributes); + size_t realSize = XMemSizeDefault(p, dwAllocAttributes); + totalAllocGen += realSize; + return p; + } + + EnterCriticalSection(&memCS); + + void *p=XMemAllocDefault(dwSize + 16,dwAllocAttributes); + size_t realSize = XMemSizeDefault(p,dwAllocAttributes) - 16; + + if( trackEnable ) + { +#if 1 + int sect = ((int) TlsGetValue(tlsIdx)) & 0x3f; + *(((unsigned char *)p)+realSize) = sect; + + if( ( realSize >= sizeCheckMin ) && ( realSize <= sizeCheckMax ) && ( ( sect == sectCheck ) || ( sectCheck == -1 ) ) ) + { + app.DebugPrintf("Found one\n"); + } +#endif + + if( p ) + { + totalAllocGen += realSize; + trackEnable = false; + int key = ( sect << 26 ) | realSize; + int oldCount = allocCounts[key]; + allocCounts[key] = oldCount + 1; + + trackEnable = true; + } + } + + LeaveCriticalSection(&memCS); + + return p; +} + +void* operator new (size_t size) +{ + return (unsigned char *)XMemAlloc(size,MAKE_XALLOC_ATTRIBUTES(0,FALSE,TRUE,FALSE,0,XALLOC_PHYSICAL_ALIGNMENT_DEFAULT,XALLOC_MEMPROTECT_READWRITE,FALSE,XALLOC_MEMTYPE_HEAP)); +} + +void operator delete (void *p) +{ + XMemFree(p,MAKE_XALLOC_ATTRIBUTES(0,FALSE,TRUE,FALSE,0,XALLOC_PHYSICAL_ALIGNMENT_DEFAULT,XALLOC_MEMPROTECT_READWRITE,FALSE,XALLOC_MEMTYPE_HEAP)); +} + +void WINAPI XMemFree(PVOID pAddress, DWORD dwAllocAttributes) +{ + bool special = false; + if( dwAllocAttributes == 0 ) + { + dwAllocAttributes = MAKE_XALLOC_ATTRIBUTES(0,FALSE,TRUE,FALSE,0,XALLOC_PHYSICAL_ALIGNMENT_DEFAULT,XALLOC_MEMPROTECT_READWRITE,FALSE,XALLOC_MEMTYPE_HEAP); + special = true; + } + if(!trackStarted ) + { + size_t realSize = XMemSizeDefault(pAddress, dwAllocAttributes); + XMemFreeDefault(pAddress, dwAllocAttributes); + totalAllocGen -= realSize; + return; + } + EnterCriticalSection(&memCS); + if( pAddress ) + { + size_t realSize = XMemSizeDefault(pAddress, dwAllocAttributes) - 16; + + if(trackEnable) + { + int sect = *(((unsigned char *)pAddress)+realSize); + totalAllocGen -= realSize; + trackEnable = false; + int key = ( sect << 26 ) | realSize; + int oldCount = allocCounts[key]; + allocCounts[key] = oldCount - 1; + trackEnable = true; + + } + XMemFreeDefault(pAddress, dwAllocAttributes); + } + LeaveCriticalSection(&memCS); +} + +SIZE_T WINAPI XMemSize( + PVOID pAddress, + DWORD dwAllocAttributes +) +{ + if( trackStarted ) + { + return XMemSizeDefault(pAddress, dwAllocAttributes) - 16; + } + else + { + return XMemSizeDefault(pAddress, dwAllocAttributes); + } +} + + +void DumpMem() +{ + int totalLeak = 0; + for(AUTO_VAR(it, allocCounts.begin()); it != allocCounts.end(); it++ ) + { + if(it->second > 0 ) + { + app.DebugPrintf("%d %d %d %d\n",( it->first >> 26 ) & 0x3f,it->first & 0x03ffffff, it->second, (it->first & 0x03ffffff) * it->second); + totalLeak += ( it->first & 0x03ffffff ) * it->second; + } + } + app.DebugPrintf("Total %d\n",totalLeak); +} + +void ResetMem() +{ + if( !trackStarted ) + { + trackEnable = true; + trackStarted = true; + totalAllocGen = 0; + InitializeCriticalSection(&memCS); + tlsIdx = TlsAlloc(); + } + EnterCriticalSection(&memCS); + trackEnable = false; + allocCounts.clear(); + trackEnable = true; + LeaveCriticalSection(&memCS); +} + +void MemSect(int section) +{ + unsigned int value = (unsigned int)TlsGetValue(tlsIdx); + if( section == 0 ) // pop + { + value = (value >> 6) & 0x03ffffff; + } + else + { + value = (value << 6) | section; + } + TlsSetValue(tlsIdx, (LPVOID)value); +} + +void MemPixStuff() +{ + const int MAX_SECT = 46; + + int totals[MAX_SECT] = {0}; + + for(AUTO_VAR(it, allocCounts.begin()); it != allocCounts.end(); it++ ) + { + if(it->second > 0 ) + { + int sect = ( it->first >> 26 ) & 0x3f; + int bytes = it->first & 0x03ffffff; + totals[sect] += bytes * it->second; + } + } + + unsigned int allSectsTotal = 0; + for( int i = 0; i < MAX_SECT; i++ ) + { + allSectsTotal += totals[i]; + PIXAddNamedCounter(((float)totals[i])/1024.0f,"MemSect%d",i); + } + + PIXAddNamedCounter(((float)allSectsTotal)/(4096.0f),"MemSect total pages"); +} + +#endif diff --git a/Minecraft.Client/Durango/Durango_UIController.cpp b/Minecraft.Client/Durango/Durango_UIController.cpp new file mode 100644 index 00000000..446ab87e --- /dev/null +++ b/Minecraft.Client/Durango/Durango_UIController.cpp @@ -0,0 +1,195 @@ +#include "stdafx.h" +#include "Durango_UIController.h" + +#define _ENABLEIGGY + +ConsoleUIController ui; + +void ConsoleUIController::init(Microsoft::WRL::ComPtr dev, Microsoft::WRL::ComPtr ctx, Microsoft::WRL::ComPtr pRenderTargetView, Microsoft::WRL::ComPtr pDepthStencilView, S32 w, S32 h) +{ +#ifdef _ENABLEIGGY + m_pRenderTargetView = pRenderTargetView; + m_pDepthStencilView = pDepthStencilView; + + // Shared init + preInit(w,h); + + gdraw_funcs = gdraw_D3D11_CreateContext(dev.Get(), ctx.Get(), w, h); + + if(!gdraw_funcs) + { + app.DebugPrintf("Failed to initialise GDraw!\n"); +#ifndef _CONTENT_PACKAGE + __debugbreak(); +#endif + app.FatalLoadError(); + } + + /* For each of the resource types, we specify the size of the cache that + GDraw will use. We specify both the number of possible objects + (the number of "handles") of each type, and the maximum memory + to use for each one. + + For some platforms, we would actually pass + in the memory to use, and the GDraw will strictly obey the resource + request. For D3D, storage is managed by D3D, and GDraw only + approximates the requested storage amount. In fact, you don't + even have to set these at all for D3D, which has some "reasonable" defaults, + but we'll set it here for clarity. + (The storage required for + the handles is separate, and always allocated through the global allocator + specified in IggyInit.) + + The size that's actually needed here depends on the content of your + Flash file. There's more info in the documentation about how to + determine how big they should be. But for now, we'll just set them + really big so if you substitute a different file it should work. */ + gdraw_D3D11_SetResourceLimits(GDRAW_D3D11_RESOURCE_vertexbuffer, 5000, 16 * 1024 * 1024); + gdraw_D3D11_SetResourceLimits(GDRAW_D3D11_RESOURCE_texture , 5000, 128 * 1024 * 1024); + gdraw_D3D11_SetResourceLimits(GDRAW_D3D11_RESOURCE_rendertarget, 10, 32 * 1024 * 1024); + gdraw_D3D11_SetResourceLimits(GDRAW_D3D11_RESOURCE_dynbuffer , 1, 2 * 1024 * 1024); + + /* GDraw is all set, so we'll point Iggy at it. */ + IggySetGDraw(gdraw_funcs); + + // Initialize audio + // TODO: 4J Stu - Currently Iggy crashes if I have audio enabled. Disabling for now. + //IggyAudioUseDefault(); + + // Shared init + postInit(); +#endif +} + +void ConsoleUIController::render() +{ +#ifdef _ENABLEIGGY + /* Now that we've cleared, we need to tell GDraw which + render target to use, what depth/stencil buffer to use, + and where the origin should be. + + If we were using multisampling, we'd also need to give + GDraw a render target view for a non-multisampled texture + the size of main_rtv as a resolve target (this is the third + parameter). But since we're not using multisampling in this + example, no resolve targets are required. */ + gdraw_D3D11_SetTileOrigin( m_pRenderTargetView.Get(), + m_pDepthStencilView.Get(), + NULL, + 0, + 0 ); + + renderScenes(); + + /* Finally we're ready to display the frame. We call GDraw to + let it know we're done rendering, so it can do any finalization + it needs to do. */ + gdraw_D3D11_NoMoreGDrawThisFrame(); +#endif +} + +void ConsoleUIController::beginIggyCustomDraw4J(IggyCustomDrawCallbackRegion *region, CustomDrawData *customDrawRegion) +{ + PIXBeginNamedEvent(0,"Starting Iggy custom draw\n"); + + PIXBeginNamedEvent(0,"Gdraw setup"); + // get the correct object-to-world matrix from GDraw, and set the render state to a normal state + gdraw_D3D11_BeginCustomDraw_4J(region, customDrawRegion->mat); + PIXEndNamedEvent(); +} + +CustomDrawData *ConsoleUIController::setupCustomDraw(UIScene *scene, IggyCustomDrawCallbackRegion *region) +{ + CustomDrawData *customDrawRegion = new CustomDrawData(); + customDrawRegion->x0 = region->x0; + customDrawRegion->x1 = region->x1; + customDrawRegion->y0 = region->y0; + customDrawRegion->y1 = region->y1; + + PIXBeginNamedEvent(0,"Starting Iggy custom draw\n"); + PIXBeginNamedEvent(0,"Setup"); + + PIXBeginNamedEvent(0,"Gdraw setup"); + // get the correct object-to-world matrix from GDraw, and set the render state to a normal state + gdraw_D3D11_BeginCustomDraw_4J(region, customDrawRegion->mat); + PIXEndNamedEvent(); + + PIXBeginNamedEvent(0,"Our setup"); + setupCustomDrawGameStateAndMatrices(scene, customDrawRegion); + PIXEndNamedEvent(); + PIXEndNamedEvent(); + + return customDrawRegion; +} + +CustomDrawData *ConsoleUIController::calculateCustomDraw(IggyCustomDrawCallbackRegion *region) +{ + CustomDrawData *customDrawRegion = new CustomDrawData(); + customDrawRegion->x0 = region->x0; + customDrawRegion->x1 = region->x1; + customDrawRegion->y0 = region->y0; + customDrawRegion->y1 = region->y1; + + gdraw_D3D11_CalculateCustomDraw_4J(region, customDrawRegion->mat); + + return customDrawRegion; +} + +void ConsoleUIController::endCustomDraw(IggyCustomDrawCallbackRegion *region) +{ + PIXBeginNamedEvent(0,"Teardown"); + PIXBeginNamedEvent(0,"Our teardown"); + endCustomDrawGameStateAndMatrices(); + PIXEndNamedEvent(); + + PIXBeginNamedEvent(0,"Gdraw teardown"); + gdraw_D3D11_EndCustomDraw(region); + PIXEndNamedEvent(); + PIXEndNamedEvent(); + PIXEndNamedEvent(); +} + +void ConsoleUIController::setTileOrigin(S32 xPos, S32 yPos) +{ + gdraw_D3D11_SetTileOrigin( m_pRenderTargetView.Get(), + m_pDepthStencilView.Get(), + NULL, + xPos, + yPos ); +} + +GDrawTexture *ConsoleUIController::getSubstitutionTexture(int textureId) +{ + /* Create a wrapped texture from a shader resource view. + A wrapped texture can be used to let Iggy draw using the contents of a texture + you create and manage on your own. For example, you might render to this texture, + or stream video into it. Wrapped textures take up a handle. They will never be + freed or otherwise modified by GDraw; nor will GDraw change any reference counts. + All this is up to the application. */ + ID3D11ShaderResourceView *tex = RenderManager.TextureGetTexture(textureId); + ID3D11Resource *resource; + tex->GetResource(&resource); + ID3D11Texture2D *tex2d = (ID3D11Texture2D *)resource; + D3D11_TEXTURE2D_DESC desc; + tex2d->GetDesc(&desc); + GDrawTexture *gdrawTex = gdraw_D3D11_WrappedTextureCreate(tex); + return gdrawTex; +} + +void ConsoleUIController::destroySubstitutionTexture(void *destroyCallBackData, GDrawTexture *handle) +{ + /* Destroys the GDraw wrapper for a wrapped texture object. This will free up + a GDraw texture handle but not release the associated D3D texture; that is + up to you. */ + gdraw_D3D11_WrappedTextureDestroy(handle); +} + +void ConsoleUIController::shutdown() +{ +#ifdef _ENABLEIGGY + /* Destroy the GDraw context. This frees all resources, shaders etc. + allocated by GDraw. Note this is only safe to call after all + active Iggy player have been destroyed! */ + gdraw_D3D11_DestroyContext(); +#endif +} \ No newline at end of file diff --git a/Minecraft.Client/Durango/Durango_UIController.h b/Minecraft.Client/Durango/Durango_UIController.h new file mode 100644 index 00000000..28fe08ad --- /dev/null +++ b/Minecraft.Client/Durango/Durango_UIController.h @@ -0,0 +1,30 @@ +#pragma once + +#include "..\Common\UI\UIController.h" + +class ConsoleUIController : public UIController +{ +private: + Microsoft::WRL::ComPtr m_pRenderTargetView; + Microsoft::WRL::ComPtr m_pDepthStencilView; +public: + void init(Microsoft::WRL::ComPtr dev, Microsoft::WRL::ComPtr ctx, Microsoft::WRL::ComPtr pRenderTargetView, Microsoft::WRL::ComPtr pDepthStencilView, S32 w, S32 h); + + void render(); + void beginIggyCustomDraw4J(IggyCustomDrawCallbackRegion *region, CustomDrawData *customDrawRegion); + virtual CustomDrawData *setupCustomDraw(UIScene *scene, IggyCustomDrawCallbackRegion *region); + virtual CustomDrawData *calculateCustomDraw(IggyCustomDrawCallbackRegion *region); + virtual void endCustomDraw(IggyCustomDrawCallbackRegion *region); + +protected: + virtual void setTileOrigin(S32 xPos, S32 yPos); + +public: + GDrawTexture *getSubstitutionTexture(int textureId); + void destroySubstitutionTexture(void *destroyCallBackData, GDrawTexture *handle); + +public: + void shutdown(); +}; + +extern ConsoleUIController ui; \ No newline at end of file diff --git a/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d10_shaders.inl b/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d10_shaders.inl new file mode 100644 index 00000000..d4d2bb22 --- /dev/null +++ b/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d10_shaders.inl @@ -0,0 +1,3427 @@ +// This file was automatically generated by shadergen. Do not edit by hand! + +static DWORD pshader_basic_0[239] = { + 0x43425844, 0x424a7ef2, 0x6c708f66, 0xff55849a, 0xbcc512aa, 0x00000001, 0x000003bc, 0x00000005, + 0x00000034, 0x000001a8, 0x00000200, 0x00000234, 0x00000340, 0x46454452, 0x0000016c, 0x00000001, + 0x0000008c, 0x00000003, 0x0000001c, 0xffff0400, 0x00008100, 0x00000139, 0x0000007c, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x00000001, 0x00000001, 0x00000083, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000007, 0x00000001, 0x0000000d, 0x00000088, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x74003178, + 0x00317865, 0x00635350, 0x00000088, 0x00000004, 0x000000a4, 0x00000040, 0x00000000, 0x00000000, + 0x00000104, 0x00000000, 0x00000010, 0x00000002, 0x00000110, 0x00000000, 0x00000120, 0x00000010, + 0x00000010, 0x00000000, 0x00000110, 0x00000000, 0x0000012a, 0x00000020, 0x00000010, 0x00000000, + 0x00000110, 0x00000000, 0x00000130, 0x00000030, 0x00000010, 0x00000000, 0x00000110, 0x00000000, + 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6f6c6f63, + 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, 0x63694d00, 0x6f736f72, 0x28207466, + 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, 0x2072656c, 0x39322e39, 0x3235392e, + 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, 0x00000008, 0x00000038, 0x00000000, + 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, + 0x00000001, 0x00000c0f, 0x505f5653, 0x7469736f, 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000104, 0x00000040, + 0x00000041, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x0300005a, 0x00106000, 0x00000007, + 0x04001858, 0x00107000, 0x00000007, 0x00005555, 0x03001062, 0x001010c2, 0x00000001, 0x03000065, + 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x0700000e, 0x00100012, 0x00000000, 0x0010102a, + 0x00000001, 0x0010103a, 0x00000001, 0x05000036, 0x00100022, 0x00000000, 0x0010103a, 0x00000001, + 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000007, 0x00106000, + 0x00000007, 0x09000038, 0x00100072, 0x00000001, 0x00208ff6, 0x00000000, 0x00000000, 0x00208246, + 0x00000000, 0x00000000, 0x06000036, 0x00100082, 0x00000001, 0x0020803a, 0x00000000, 0x00000000, + 0x07000038, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x00100e46, 0x00000001, 0x0100003e, + 0x54415453, 0x00000074, 0x00000007, 0x00000002, 0x00000000, 0x00000002, 0x00000003, 0x00000000, + 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_basic_1[261] = { + 0x43425844, 0x90372132, 0x718f790d, 0x41ee8636, 0x62f4522d, 0x00000001, 0x00000414, 0x00000005, + 0x00000034, 0x000001a8, 0x00000200, 0x00000234, 0x00000398, 0x46454452, 0x0000016c, 0x00000001, + 0x0000008c, 0x00000003, 0x0000001c, 0xffff0400, 0x00008100, 0x00000139, 0x0000007c, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x00000001, 0x00000001, 0x00000083, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000007, 0x00000001, 0x0000000d, 0x00000088, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x74003178, + 0x00317865, 0x00635350, 0x00000088, 0x00000004, 0x000000a4, 0x00000040, 0x00000000, 0x00000000, + 0x00000104, 0x00000000, 0x00000010, 0x00000002, 0x00000110, 0x00000000, 0x00000120, 0x00000010, + 0x00000010, 0x00000002, 0x00000110, 0x00000000, 0x0000012a, 0x00000020, 0x00000010, 0x00000000, + 0x00000110, 0x00000000, 0x00000130, 0x00000030, 0x00000010, 0x00000000, 0x00000110, 0x00000000, + 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6f6c6f63, + 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, 0x63694d00, 0x6f736f72, 0x28207466, + 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, 0x2072656c, 0x39322e39, 0x3235392e, + 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, 0x00000008, 0x00000038, 0x00000000, + 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, + 0x00000001, 0x00000c0f, 0x505f5653, 0x7469736f, 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x0000015c, 0x00000040, + 0x00000057, 0x04000059, 0x00208e46, 0x00000000, 0x00000002, 0x0300005a, 0x00106000, 0x00000007, + 0x04001858, 0x00107000, 0x00000007, 0x00005555, 0x03001062, 0x001010c2, 0x00000001, 0x03000065, + 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x0700000e, 0x00100012, 0x00000000, 0x0010102a, + 0x00000001, 0x0010103a, 0x00000001, 0x05000036, 0x00100022, 0x00000000, 0x0010103a, 0x00000001, + 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000007, 0x00106000, + 0x00000007, 0x09000038, 0x00100072, 0x00000001, 0x00208ff6, 0x00000000, 0x00000000, 0x00208246, + 0x00000000, 0x00000000, 0x06000036, 0x00100082, 0x00000001, 0x0020803a, 0x00000000, 0x00000000, + 0x07000038, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00100e46, 0x00000001, 0x0a000032, + 0x00100072, 0x00000000, 0x00208246, 0x00000000, 0x00000001, 0x00100ff6, 0x00000000, 0x00100246, + 0x00000000, 0x07000033, 0x00102072, 0x00000000, 0x00100ff6, 0x00000000, 0x00100246, 0x00000000, + 0x05000036, 0x00102082, 0x00000000, 0x0010003a, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, + 0x0000000a, 0x00000002, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000000, 0x00000001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_basic_2[249] = { + 0x43425844, 0xf18db76f, 0x60007209, 0xb95de8b5, 0x04b32ff3, 0x00000001, 0x000003e4, 0x00000005, + 0x00000034, 0x000001a8, 0x00000200, 0x00000234, 0x00000368, 0x46454452, 0x0000016c, 0x00000001, + 0x0000008c, 0x00000003, 0x0000001c, 0xffff0400, 0x00008100, 0x00000139, 0x0000007c, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x00000001, 0x00000001, 0x00000083, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000007, 0x00000001, 0x0000000d, 0x00000088, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x74003178, + 0x00317865, 0x00635350, 0x00000088, 0x00000004, 0x000000a4, 0x00000040, 0x00000000, 0x00000000, + 0x00000104, 0x00000000, 0x00000010, 0x00000002, 0x00000110, 0x00000000, 0x00000120, 0x00000010, + 0x00000010, 0x00000002, 0x00000110, 0x00000000, 0x0000012a, 0x00000020, 0x00000010, 0x00000000, + 0x00000110, 0x00000000, 0x00000130, 0x00000030, 0x00000010, 0x00000000, 0x00000110, 0x00000000, + 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6f6c6f63, + 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, 0x63694d00, 0x6f736f72, 0x28207466, + 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, 0x2072656c, 0x39322e39, 0x3235392e, + 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, 0x00000008, 0x00000038, 0x00000000, + 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, + 0x00000001, 0x00000c0f, 0x505f5653, 0x7469736f, 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x0000012c, 0x00000040, + 0x0000004b, 0x04000059, 0x00208e46, 0x00000000, 0x00000002, 0x0300005a, 0x00106000, 0x00000007, + 0x04001858, 0x00107000, 0x00000007, 0x00005555, 0x03001062, 0x001010c2, 0x00000001, 0x03000065, + 0x001020f2, 0x00000000, 0x02000068, 0x00000001, 0x0700000e, 0x00100012, 0x00000000, 0x0010102a, + 0x00000001, 0x0010103a, 0x00000001, 0x05000036, 0x00100022, 0x00000000, 0x0010103a, 0x00000001, + 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000007, 0x00106000, + 0x00000007, 0x0b000032, 0x00100012, 0x00000000, 0x0020803a, 0x00000000, 0x00000000, 0x0010003a, + 0x00000000, 0x0020803a, 0x00000000, 0x00000001, 0x09000000, 0x001000e2, 0x00000000, 0x00208906, + 0x00000000, 0x00000000, 0x00208906, 0x00000000, 0x00000001, 0x07000038, 0x00102072, 0x00000000, + 0x00100006, 0x00000000, 0x00100796, 0x00000000, 0x05000036, 0x00102082, 0x00000000, 0x0010000a, + 0x00000000, 0x0100003e, 0x54415453, 0x00000074, 0x00000008, 0x00000001, 0x00000000, 0x00000002, + 0x00000003, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, +}; + +static DWORD pshader_basic_3[298] = { + 0x43425844, 0x8666f1ab, 0x6789c83a, 0x84ddee9b, 0x99672a63, 0x00000001, 0x000004a8, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x0000042c, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000007, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000000, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000f0f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x000001a4, 0x00000040, 0x00000069, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000007, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000007, 0x00005555, 0x03001062, 0x001010f2, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x0a00000e, 0x00100012, + 0x00000000, 0x00004002, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x0010103a, 0x00000001, + 0x07000038, 0x00100032, 0x00000000, 0x00100006, 0x00000000, 0x00101046, 0x00000001, 0x09000045, + 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, + 0x09000038, 0x00100072, 0x00000001, 0x00208ff6, 0x00000000, 0x00000000, 0x00208246, 0x00000000, + 0x00000000, 0x06000036, 0x00100082, 0x00000001, 0x0020803a, 0x00000000, 0x00000000, 0x07000038, + 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00100e46, 0x00000001, 0x0700000e, 0x00100012, + 0x00000001, 0x0010102a, 0x00000001, 0x0010103a, 0x00000001, 0x05000036, 0x00100022, 0x00000001, + 0x0010103a, 0x00000001, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, + 0x00000007, 0x00106000, 0x00000007, 0x07000038, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, + 0x00100e46, 0x00000001, 0x0100003e, 0x54415453, 0x00000074, 0x0000000b, 0x00000002, 0x00000000, + 0x00000002, 0x00000006, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, +}; + +static DWORD pshader_basic_4[320] = { + 0x43425844, 0xc29dc729, 0xa89895e0, 0x45d2e5a7, 0x85a6e3df, 0x00000001, 0x00000500, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x00000484, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000007, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000002, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000000, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000f0f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x000001fc, 0x00000040, 0x0000007f, 0x04000059, 0x00208e46, 0x00000000, 0x00000002, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000007, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000007, 0x00005555, 0x03001062, 0x001010f2, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x0a00000e, 0x00100012, + 0x00000000, 0x00004002, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x0010103a, 0x00000001, + 0x07000038, 0x00100032, 0x00000000, 0x00100006, 0x00000000, 0x00101046, 0x00000001, 0x09000045, + 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, + 0x09000038, 0x00100072, 0x00000001, 0x00208ff6, 0x00000000, 0x00000000, 0x00208246, 0x00000000, + 0x00000000, 0x06000036, 0x00100082, 0x00000001, 0x0020803a, 0x00000000, 0x00000000, 0x07000038, + 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00100e46, 0x00000001, 0x0700000e, 0x00100012, + 0x00000001, 0x0010102a, 0x00000001, 0x0010103a, 0x00000001, 0x05000036, 0x00100022, 0x00000001, + 0x0010103a, 0x00000001, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, + 0x00000007, 0x00106000, 0x00000007, 0x07000038, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, + 0x00100e46, 0x00000001, 0x0a000032, 0x00100072, 0x00000000, 0x00208246, 0x00000000, 0x00000001, + 0x00100ff6, 0x00000000, 0x00100246, 0x00000000, 0x07000033, 0x00102072, 0x00000000, 0x00100ff6, + 0x00000000, 0x00100246, 0x00000000, 0x05000036, 0x00102082, 0x00000000, 0x0010003a, 0x00000000, + 0x0100003e, 0x54415453, 0x00000074, 0x0000000e, 0x00000002, 0x00000000, 0x00000002, 0x00000007, + 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_basic_5[337] = { + 0x43425844, 0xf38a8aa1, 0x76e83e07, 0xe035a58b, 0x8d62e8be, 0x00000001, 0x00000544, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x000004c8, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000007, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000002, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000000, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000f0f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x00000240, 0x00000040, 0x00000090, 0x04000059, 0x00208e46, 0x00000000, 0x00000002, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000007, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000007, 0x00005555, 0x03001062, 0x001010f2, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x0a00000e, 0x00100012, + 0x00000000, 0x00004002, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x0010103a, 0x00000001, + 0x07000038, 0x00100032, 0x00000000, 0x00100006, 0x00000000, 0x00101046, 0x00000001, 0x09000045, + 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, + 0x0a00000e, 0x00100012, 0x00000001, 0x00004002, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, + 0x0010003a, 0x00000000, 0x07000038, 0x00100072, 0x00000001, 0x00100246, 0x00000000, 0x00100006, + 0x00000001, 0x07000039, 0x00100082, 0x00000001, 0x0010003a, 0x00000000, 0x00004001, 0x00000000, + 0x09000037, 0x00100072, 0x00000000, 0x00100ff6, 0x00000001, 0x00100246, 0x00000001, 0x00100246, + 0x00000000, 0x08000038, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00208e46, 0x00000000, + 0x00000000, 0x0700000e, 0x00100012, 0x00000001, 0x0010102a, 0x00000001, 0x0010103a, 0x00000001, + 0x05000036, 0x00100022, 0x00000001, 0x0010103a, 0x00000001, 0x09000045, 0x001000f2, 0x00000001, + 0x00100046, 0x00000001, 0x00107e46, 0x00000007, 0x00106000, 0x00000007, 0x07000038, 0x00100082, + 0x00000000, 0x0010003a, 0x00000000, 0x0010003a, 0x00000001, 0x08000000, 0x001000f2, 0x00000000, + 0x00100e46, 0x00000000, 0x00208e46, 0x00000000, 0x00000001, 0x07000038, 0x00102072, 0x00000000, + 0x00100ff6, 0x00000000, 0x00100246, 0x00000000, 0x05000036, 0x00102082, 0x00000000, 0x0010003a, + 0x00000000, 0x0100003e, 0x54415453, 0x00000074, 0x00000010, 0x00000002, 0x00000000, 0x00000002, + 0x0000000a, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000004, + 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, +}; + +static DWORD pshader_basic_6[298] = { + 0x43425844, 0xf4bd11d7, 0x2d1585d4, 0xa2bece1a, 0x528591b0, 0x00000001, 0x000004a8, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x0000042c, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000007, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000000, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000f0f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x000001a4, 0x00000040, 0x00000069, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000007, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000007, 0x00005555, 0x03001062, 0x001010f2, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x0a00000e, 0x00100012, + 0x00000000, 0x00004002, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x0010103a, 0x00000001, + 0x07000038, 0x00100032, 0x00000000, 0x00100006, 0x00000000, 0x00101046, 0x00000001, 0x09000045, + 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, + 0x09000038, 0x00100072, 0x00000001, 0x00208ff6, 0x00000000, 0x00000000, 0x00208246, 0x00000000, + 0x00000000, 0x06000036, 0x00100082, 0x00000001, 0x0020803a, 0x00000000, 0x00000000, 0x07000038, + 0x001000f2, 0x00000000, 0x00100006, 0x00000000, 0x00100e46, 0x00000001, 0x0700000e, 0x00100012, + 0x00000001, 0x0010102a, 0x00000001, 0x0010103a, 0x00000001, 0x05000036, 0x00100022, 0x00000001, + 0x0010103a, 0x00000001, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, + 0x00000007, 0x00106000, 0x00000007, 0x07000038, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, + 0x00100e46, 0x00000001, 0x0100003e, 0x54415453, 0x00000074, 0x0000000b, 0x00000002, 0x00000000, + 0x00000002, 0x00000006, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, +}; + +static DWORD pshader_basic_7[320] = { + 0x43425844, 0xf035ea5f, 0x7228ce0c, 0x7acda6b1, 0x84f793b7, 0x00000001, 0x00000500, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x00000484, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000007, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000002, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000000, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000f0f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x000001fc, 0x00000040, 0x0000007f, 0x04000059, 0x00208e46, 0x00000000, 0x00000002, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000007, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000007, 0x00005555, 0x03001062, 0x001010f2, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x0a00000e, 0x00100012, + 0x00000000, 0x00004002, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x0010103a, 0x00000001, + 0x07000038, 0x00100032, 0x00000000, 0x00100006, 0x00000000, 0x00101046, 0x00000001, 0x09000045, + 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, + 0x09000038, 0x00100072, 0x00000001, 0x00208ff6, 0x00000000, 0x00000000, 0x00208246, 0x00000000, + 0x00000000, 0x06000036, 0x00100082, 0x00000001, 0x0020803a, 0x00000000, 0x00000000, 0x07000038, + 0x001000f2, 0x00000000, 0x00100006, 0x00000000, 0x00100e46, 0x00000001, 0x0700000e, 0x00100012, + 0x00000001, 0x0010102a, 0x00000001, 0x0010103a, 0x00000001, 0x05000036, 0x00100022, 0x00000001, + 0x0010103a, 0x00000001, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, + 0x00000007, 0x00106000, 0x00000007, 0x07000038, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, + 0x00100e46, 0x00000001, 0x0a000032, 0x00100072, 0x00000000, 0x00208246, 0x00000000, 0x00000001, + 0x00100ff6, 0x00000000, 0x00100246, 0x00000000, 0x07000033, 0x00102072, 0x00000000, 0x00100ff6, + 0x00000000, 0x00100246, 0x00000000, 0x05000036, 0x00102082, 0x00000000, 0x0010003a, 0x00000000, + 0x0100003e, 0x54415453, 0x00000074, 0x0000000e, 0x00000002, 0x00000000, 0x00000002, 0x00000007, + 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_basic_8[308] = { + 0x43425844, 0x8de8fdf8, 0x79362b3c, 0xd3e53d96, 0x9a753d05, 0x00000001, 0x000004d0, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x00000454, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000007, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000002, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000000, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000f0f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x000001cc, 0x00000040, 0x00000073, 0x04000059, 0x00208e46, 0x00000000, 0x00000002, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000007, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000007, 0x00005555, 0x03001062, 0x001010f2, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x0a00000e, 0x00100012, + 0x00000000, 0x00004002, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x0010103a, 0x00000001, + 0x07000038, 0x00100032, 0x00000000, 0x00100006, 0x00000000, 0x00101046, 0x00000001, 0x09000045, + 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, + 0x08000038, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0020803a, 0x00000000, 0x00000000, + 0x0700000e, 0x00100012, 0x00000001, 0x0010102a, 0x00000001, 0x0010103a, 0x00000001, 0x05000036, + 0x00100022, 0x00000001, 0x0010103a, 0x00000001, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, + 0x00000001, 0x00107e46, 0x00000007, 0x00106000, 0x00000007, 0x0a000032, 0x00100012, 0x00000000, + 0x0010000a, 0x00000000, 0x0010003a, 0x00000001, 0x0020803a, 0x00000000, 0x00000001, 0x09000000, + 0x001000e2, 0x00000000, 0x00208906, 0x00000000, 0x00000000, 0x00208906, 0x00000000, 0x00000001, + 0x07000038, 0x00102072, 0x00000000, 0x00100006, 0x00000000, 0x00100796, 0x00000000, 0x05000036, + 0x00102082, 0x00000000, 0x0010000a, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, 0x0000000c, + 0x00000002, 0x00000000, 0x00000002, 0x00000006, 0x00000000, 0x00000000, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_basic_9[310] = { + 0x43425844, 0xf476d124, 0xc7f0f06d, 0x96327107, 0x57955bd0, 0x00000001, 0x000004d8, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x0000045c, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000007, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000000, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000f0f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x000001d4, 0x00000040, 0x00000075, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000007, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000007, 0x00005555, 0x03001062, 0x001010f2, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x0a00000e, 0x00100012, + 0x00000000, 0x00004002, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x0010103a, 0x00000001, + 0x07000038, 0x00100032, 0x00000000, 0x00100006, 0x00000000, 0x00101046, 0x00000001, 0x0700000f, + 0x00100012, 0x00000000, 0x00100046, 0x00000000, 0x00100046, 0x00000000, 0x0500004b, 0x00100012, + 0x00000000, 0x0010000a, 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100006, 0x00000000, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x09000038, 0x00100072, 0x00000001, 0x00208ff6, + 0x00000000, 0x00000000, 0x00208246, 0x00000000, 0x00000000, 0x06000036, 0x00100082, 0x00000001, + 0x0020803a, 0x00000000, 0x00000000, 0x07000038, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, + 0x00100e46, 0x00000001, 0x0700000e, 0x00100012, 0x00000001, 0x0010102a, 0x00000001, 0x0010103a, + 0x00000001, 0x05000036, 0x00100022, 0x00000001, 0x0010103a, 0x00000001, 0x09000045, 0x001000f2, + 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000007, 0x00106000, 0x00000007, 0x07000038, + 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x00100e46, 0x00000001, 0x0100003e, 0x54415453, + 0x00000074, 0x0000000d, 0x00000002, 0x00000000, 0x00000002, 0x00000008, 0x00000000, 0x00000000, + 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_basic_10[332] = { + 0x43425844, 0x08449793, 0x6e27fb50, 0xe33f149a, 0x0f517c0c, 0x00000001, 0x00000530, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x000004b4, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000007, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000002, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000000, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000f0f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x0000022c, 0x00000040, 0x0000008b, 0x04000059, 0x00208e46, 0x00000000, 0x00000002, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000007, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000007, 0x00005555, 0x03001062, 0x001010f2, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x0a00000e, 0x00100012, + 0x00000000, 0x00004002, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x0010103a, 0x00000001, + 0x07000038, 0x00100032, 0x00000000, 0x00100006, 0x00000000, 0x00101046, 0x00000001, 0x0700000f, + 0x00100012, 0x00000000, 0x00100046, 0x00000000, 0x00100046, 0x00000000, 0x0500004b, 0x00100012, + 0x00000000, 0x0010000a, 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100006, 0x00000000, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x09000038, 0x00100072, 0x00000001, 0x00208ff6, + 0x00000000, 0x00000000, 0x00208246, 0x00000000, 0x00000000, 0x06000036, 0x00100082, 0x00000001, + 0x0020803a, 0x00000000, 0x00000000, 0x07000038, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, + 0x00100e46, 0x00000001, 0x0700000e, 0x00100012, 0x00000001, 0x0010102a, 0x00000001, 0x0010103a, + 0x00000001, 0x05000036, 0x00100022, 0x00000001, 0x0010103a, 0x00000001, 0x09000045, 0x001000f2, + 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000007, 0x00106000, 0x00000007, 0x07000038, + 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00100e46, 0x00000001, 0x0a000032, 0x00100072, + 0x00000000, 0x00208246, 0x00000000, 0x00000001, 0x00100ff6, 0x00000000, 0x00100246, 0x00000000, + 0x07000033, 0x00102072, 0x00000000, 0x00100ff6, 0x00000000, 0x00100246, 0x00000000, 0x05000036, + 0x00102082, 0x00000000, 0x0010003a, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, 0x00000010, + 0x00000002, 0x00000000, 0x00000002, 0x00000009, 0x00000000, 0x00000000, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_basic_11[349] = { + 0x43425844, 0x10a3f918, 0xf7959328, 0x525b10eb, 0x0f678477, 0x00000001, 0x00000574, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x000004f8, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000007, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000002, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000000, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000f0f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x00000270, 0x00000040, 0x0000009c, 0x04000059, 0x00208e46, 0x00000000, 0x00000002, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000007, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000007, 0x00005555, 0x03001062, 0x001010f2, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x0a00000e, 0x00100012, + 0x00000000, 0x00004002, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x0010103a, 0x00000001, + 0x07000038, 0x00100032, 0x00000000, 0x00100006, 0x00000000, 0x00101046, 0x00000001, 0x0700000f, + 0x00100012, 0x00000000, 0x00100046, 0x00000000, 0x00100046, 0x00000000, 0x0500004b, 0x00100012, + 0x00000000, 0x0010000a, 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100006, 0x00000000, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0a00000e, 0x00100012, 0x00000001, 0x00004002, + 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x0010003a, 0x00000000, 0x07000038, 0x00100072, + 0x00000001, 0x00100246, 0x00000000, 0x00100006, 0x00000001, 0x07000039, 0x00100082, 0x00000001, + 0x0010003a, 0x00000000, 0x00004001, 0x00000000, 0x09000037, 0x00100072, 0x00000000, 0x00100ff6, + 0x00000001, 0x00100246, 0x00000001, 0x00100246, 0x00000000, 0x08000038, 0x001000f2, 0x00000000, + 0x00100e46, 0x00000000, 0x00208e46, 0x00000000, 0x00000000, 0x0700000e, 0x00100012, 0x00000001, + 0x0010102a, 0x00000001, 0x0010103a, 0x00000001, 0x05000036, 0x00100022, 0x00000001, 0x0010103a, + 0x00000001, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000007, + 0x00106000, 0x00000007, 0x07000038, 0x00100082, 0x00000000, 0x0010003a, 0x00000000, 0x0010003a, + 0x00000001, 0x08000000, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00208e46, 0x00000000, + 0x00000001, 0x07000038, 0x00102072, 0x00000000, 0x00100ff6, 0x00000000, 0x00100246, 0x00000000, + 0x05000036, 0x00102082, 0x00000000, 0x0010003a, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, + 0x00000012, 0x00000002, 0x00000000, 0x00000002, 0x0000000c, 0x00000000, 0x00000000, 0x00000001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_basic_12[365] = { + 0x43425844, 0x50cde65f, 0xba0450c9, 0xc66a01ba, 0xf364c937, 0x00000001, 0x000005b4, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x00000538, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000007, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000002, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000000, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000f0f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x000002b0, 0x00000040, 0x000000ac, 0x04000059, 0x00208e46, 0x00000000, 0x00000003, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000007, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000007, 0x00005555, 0x03001062, 0x001010f2, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x0a00000e, 0x00100012, + 0x00000000, 0x00004002, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x0010103a, 0x00000001, + 0x07000038, 0x00100022, 0x00000000, 0x0010000a, 0x00000000, 0x0010101a, 0x00000001, 0x0a000032, + 0x00100012, 0x00000000, 0x0010100a, 0x00000001, 0x0010000a, 0x00000000, 0x0020800a, 0x00000000, + 0x00000002, 0x07000038, 0x00100022, 0x00000000, 0x0010001a, 0x00000000, 0x0010001a, 0x00000000, + 0x09000032, 0x00100022, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000000, 0x0010001a, + 0x00000000, 0x08000038, 0x00100042, 0x00000000, 0x0010000a, 0x00000000, 0x0020801a, 0x00000000, + 0x00000002, 0x07000038, 0x00100042, 0x00000000, 0x0010002a, 0x00000000, 0x0010002a, 0x00000000, + 0x0a000032, 0x00100022, 0x00000000, 0x0010001a, 0x00000000, 0x0020802a, 0x00000000, 0x00000002, + 0x0010002a, 0x00000000, 0x0500004b, 0x00100022, 0x00000000, 0x0010001a, 0x00000000, 0x0b000032, + 0x00100012, 0x00000000, 0x8010000a, 0x00000041, 0x00000000, 0x0020801a, 0x00000000, 0x00000002, + 0x0010001a, 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100006, 0x00000000, 0x00107e46, + 0x00000000, 0x00106000, 0x00000000, 0x09000038, 0x00100072, 0x00000001, 0x00208ff6, 0x00000000, + 0x00000000, 0x00208246, 0x00000000, 0x00000000, 0x06000036, 0x00100082, 0x00000001, 0x0020803a, + 0x00000000, 0x00000000, 0x07000038, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00100e46, + 0x00000001, 0x0700000e, 0x00100012, 0x00000001, 0x0010102a, 0x00000001, 0x0010103a, 0x00000001, + 0x05000036, 0x00100022, 0x00000001, 0x0010103a, 0x00000001, 0x09000045, 0x001000f2, 0x00000001, + 0x00100046, 0x00000001, 0x00107e46, 0x00000007, 0x00106000, 0x00000007, 0x07000038, 0x001020f2, + 0x00000000, 0x00100e46, 0x00000000, 0x00100e46, 0x00000001, 0x0100003e, 0x54415453, 0x00000074, + 0x00000013, 0x00000002, 0x00000000, 0x00000002, 0x0000000a, 0x00000000, 0x00000000, 0x00000001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_basic_13[387] = { + 0x43425844, 0x80d41dbd, 0x58a18bbb, 0x9707037c, 0x21268324, 0x00000001, 0x0000060c, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x00000590, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000007, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000002, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000002, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000000, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000f0f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x00000308, 0x00000040, 0x000000c2, 0x04000059, 0x00208e46, 0x00000000, 0x00000003, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000007, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000007, 0x00005555, 0x03001062, 0x001010f2, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x0a00000e, 0x00100012, + 0x00000000, 0x00004002, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x0010103a, 0x00000001, + 0x07000038, 0x00100022, 0x00000000, 0x0010000a, 0x00000000, 0x0010101a, 0x00000001, 0x0a000032, + 0x00100012, 0x00000000, 0x0010100a, 0x00000001, 0x0010000a, 0x00000000, 0x0020800a, 0x00000000, + 0x00000002, 0x07000038, 0x00100022, 0x00000000, 0x0010001a, 0x00000000, 0x0010001a, 0x00000000, + 0x09000032, 0x00100022, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000000, 0x0010001a, + 0x00000000, 0x08000038, 0x00100042, 0x00000000, 0x0010000a, 0x00000000, 0x0020801a, 0x00000000, + 0x00000002, 0x07000038, 0x00100042, 0x00000000, 0x0010002a, 0x00000000, 0x0010002a, 0x00000000, + 0x0a000032, 0x00100022, 0x00000000, 0x0010001a, 0x00000000, 0x0020802a, 0x00000000, 0x00000002, + 0x0010002a, 0x00000000, 0x0500004b, 0x00100022, 0x00000000, 0x0010001a, 0x00000000, 0x0b000032, + 0x00100012, 0x00000000, 0x8010000a, 0x00000041, 0x00000000, 0x0020801a, 0x00000000, 0x00000002, + 0x0010001a, 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100006, 0x00000000, 0x00107e46, + 0x00000000, 0x00106000, 0x00000000, 0x09000038, 0x00100072, 0x00000001, 0x00208ff6, 0x00000000, + 0x00000000, 0x00208246, 0x00000000, 0x00000000, 0x06000036, 0x00100082, 0x00000001, 0x0020803a, + 0x00000000, 0x00000000, 0x07000038, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00100e46, + 0x00000001, 0x0700000e, 0x00100012, 0x00000001, 0x0010102a, 0x00000001, 0x0010103a, 0x00000001, + 0x05000036, 0x00100022, 0x00000001, 0x0010103a, 0x00000001, 0x09000045, 0x001000f2, 0x00000001, + 0x00100046, 0x00000001, 0x00107e46, 0x00000007, 0x00106000, 0x00000007, 0x07000038, 0x001000f2, + 0x00000000, 0x00100e46, 0x00000000, 0x00100e46, 0x00000001, 0x0a000032, 0x00100072, 0x00000000, + 0x00208246, 0x00000000, 0x00000001, 0x00100ff6, 0x00000000, 0x00100246, 0x00000000, 0x07000033, + 0x00102072, 0x00000000, 0x00100ff6, 0x00000000, 0x00100246, 0x00000000, 0x05000036, 0x00102082, + 0x00000000, 0x0010003a, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, 0x00000016, 0x00000002, + 0x00000000, 0x00000002, 0x0000000b, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_basic_14[404] = { + 0x43425844, 0xb2a25f21, 0x5a5542ec, 0xc550e23f, 0x5a891887, 0x00000001, 0x00000650, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x000005d4, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000007, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000002, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000002, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000000, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000f0f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x0000034c, 0x00000040, 0x000000d3, 0x04000059, 0x00208e46, 0x00000000, 0x00000003, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000007, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000007, 0x00005555, 0x03001062, 0x001010f2, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x0a00000e, 0x00100012, + 0x00000000, 0x00004002, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x0010103a, 0x00000001, + 0x07000038, 0x00100022, 0x00000000, 0x0010000a, 0x00000000, 0x0010101a, 0x00000001, 0x0a000032, + 0x00100012, 0x00000000, 0x0010100a, 0x00000001, 0x0010000a, 0x00000000, 0x0020800a, 0x00000000, + 0x00000002, 0x07000038, 0x00100022, 0x00000000, 0x0010001a, 0x00000000, 0x0010001a, 0x00000000, + 0x09000032, 0x00100022, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000000, 0x0010001a, + 0x00000000, 0x08000038, 0x00100042, 0x00000000, 0x0010000a, 0x00000000, 0x0020801a, 0x00000000, + 0x00000002, 0x07000038, 0x00100042, 0x00000000, 0x0010002a, 0x00000000, 0x0010002a, 0x00000000, + 0x0a000032, 0x00100022, 0x00000000, 0x0010001a, 0x00000000, 0x0020802a, 0x00000000, 0x00000002, + 0x0010002a, 0x00000000, 0x0500004b, 0x00100022, 0x00000000, 0x0010001a, 0x00000000, 0x0b000032, + 0x00100012, 0x00000000, 0x8010000a, 0x00000041, 0x00000000, 0x0020801a, 0x00000000, 0x00000002, + 0x0010001a, 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100006, 0x00000000, 0x00107e46, + 0x00000000, 0x00106000, 0x00000000, 0x0a00000e, 0x00100012, 0x00000001, 0x00004002, 0x3f800000, + 0x3f800000, 0x3f800000, 0x3f800000, 0x0010003a, 0x00000000, 0x07000038, 0x00100072, 0x00000001, + 0x00100246, 0x00000000, 0x00100006, 0x00000001, 0x07000039, 0x00100082, 0x00000001, 0x0010003a, + 0x00000000, 0x00004001, 0x00000000, 0x09000037, 0x00100072, 0x00000000, 0x00100ff6, 0x00000001, + 0x00100246, 0x00000001, 0x00100246, 0x00000000, 0x08000038, 0x001000f2, 0x00000000, 0x00100e46, + 0x00000000, 0x00208e46, 0x00000000, 0x00000000, 0x0700000e, 0x00100012, 0x00000001, 0x0010102a, + 0x00000001, 0x0010103a, 0x00000001, 0x05000036, 0x00100022, 0x00000001, 0x0010103a, 0x00000001, + 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000007, 0x00106000, + 0x00000007, 0x07000038, 0x00100082, 0x00000000, 0x0010003a, 0x00000000, 0x0010003a, 0x00000001, + 0x08000000, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00208e46, 0x00000000, 0x00000001, + 0x07000038, 0x00102072, 0x00000000, 0x00100ff6, 0x00000000, 0x00100246, 0x00000000, 0x05000036, + 0x00102082, 0x00000000, 0x0010003a, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, 0x00000018, + 0x00000002, 0x00000000, 0x00000002, 0x0000000e, 0x00000000, 0x00000000, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_basic_15[322] = { + 0x43425844, 0xe9ac3a59, 0xb10c74ae, 0x7d8ea66b, 0x7f38f805, 0x00000001, 0x00000508, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x0000048c, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000007, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000000, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000f0f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x00000204, 0x00000040, 0x00000081, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000007, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000007, 0x00005555, 0x03001062, 0x001010f2, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000003, 0x0a00000e, 0x00100012, + 0x00000000, 0x00004002, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x0010103a, 0x00000001, + 0x07000038, 0x00100032, 0x00000000, 0x00100006, 0x00000000, 0x00101046, 0x00000001, 0x09000045, + 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, + 0x09000038, 0x00100072, 0x00000001, 0x00208ff6, 0x00000000, 0x00000000, 0x00208246, 0x00000000, + 0x00000000, 0x06000036, 0x00100082, 0x00000001, 0x0020803a, 0x00000000, 0x00000000, 0x07000038, + 0x001000f2, 0x00000000, 0x00100006, 0x00000000, 0x00100e46, 0x00000001, 0x0700000e, 0x00100012, + 0x00000001, 0x0010102a, 0x00000001, 0x0010103a, 0x00000001, 0x05000036, 0x00100022, 0x00000001, + 0x0010103a, 0x00000001, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, + 0x00000007, 0x00106000, 0x00000007, 0x09000032, 0x00100012, 0x00000002, 0x0010003a, 0x00000000, + 0x0010003a, 0x00000001, 0x00004001, 0xbf000000, 0x07000038, 0x001000f2, 0x00000000, 0x00100e46, + 0x00000000, 0x00100e46, 0x00000001, 0x05000036, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, + 0x07000031, 0x00100012, 0x00000000, 0x0010000a, 0x00000002, 0x00004001, 0x00000000, 0x0304000d, + 0x0010000a, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, 0x0000000f, 0x00000003, 0x00000000, + 0x00000002, 0x00000007, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, +}; + +static DWORD pshader_basic_16[339] = { + 0x43425844, 0x254d5609, 0xfb3546e9, 0x05f36a1e, 0x58e4fd27, 0x00000001, 0x0000054c, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x000004d0, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000007, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000002, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000000, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000f0f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x00000248, 0x00000040, 0x00000092, 0x04000059, 0x00208e46, 0x00000000, 0x00000002, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000007, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000007, 0x00005555, 0x03001062, 0x001010f2, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000003, 0x0a00000e, 0x00100012, + 0x00000000, 0x00004002, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x0010103a, 0x00000001, + 0x07000038, 0x00100032, 0x00000000, 0x00100006, 0x00000000, 0x00101046, 0x00000001, 0x09000045, + 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, + 0x09000038, 0x00100072, 0x00000001, 0x00208ff6, 0x00000000, 0x00000000, 0x00208246, 0x00000000, + 0x00000000, 0x06000036, 0x00100082, 0x00000001, 0x0020803a, 0x00000000, 0x00000000, 0x07000038, + 0x001000f2, 0x00000000, 0x00100006, 0x00000000, 0x00100e46, 0x00000001, 0x0700000e, 0x00100012, + 0x00000001, 0x0010102a, 0x00000001, 0x0010103a, 0x00000001, 0x05000036, 0x00100022, 0x00000001, + 0x0010103a, 0x00000001, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, + 0x00000007, 0x00106000, 0x00000007, 0x09000032, 0x00100012, 0x00000002, 0x0010003a, 0x00000000, + 0x0010003a, 0x00000001, 0x00004001, 0xbf000000, 0x07000038, 0x001000f2, 0x00000000, 0x00100e46, + 0x00000000, 0x00100e46, 0x00000001, 0x07000031, 0x00100012, 0x00000001, 0x0010000a, 0x00000002, + 0x00004001, 0x00000000, 0x0304000d, 0x0010000a, 0x00000001, 0x0a000032, 0x00100072, 0x00000000, + 0x00208246, 0x00000000, 0x00000001, 0x00100ff6, 0x00000000, 0x00100246, 0x00000000, 0x07000033, + 0x00102072, 0x00000000, 0x00100ff6, 0x00000000, 0x00100246, 0x00000000, 0x05000036, 0x00102082, + 0x00000000, 0x0010003a, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, 0x00000011, 0x00000003, + 0x00000000, 0x00000002, 0x00000008, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_basic_17[325] = { + 0x43425844, 0x9b76f721, 0x305d6ada, 0x87db10d5, 0x6ff15183, 0x00000001, 0x00000514, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x00000498, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000007, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000002, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000000, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000f0f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x00000210, 0x00000040, 0x00000084, 0x04000059, 0x00208e46, 0x00000000, 0x00000002, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000007, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000007, 0x00005555, 0x03001062, 0x001010f2, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x0a00000e, 0x00100012, + 0x00000000, 0x00004002, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x0010103a, 0x00000001, + 0x07000038, 0x00100032, 0x00000000, 0x00100006, 0x00000000, 0x00101046, 0x00000001, 0x09000045, + 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, + 0x08000038, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0020803a, 0x00000000, 0x00000000, + 0x0700000e, 0x00100012, 0x00000001, 0x0010102a, 0x00000001, 0x0010103a, 0x00000001, 0x05000036, + 0x00100022, 0x00000001, 0x0010103a, 0x00000001, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, + 0x00000001, 0x00107e46, 0x00000007, 0x00106000, 0x00000007, 0x0a000032, 0x00100012, 0x00000000, + 0x0010000a, 0x00000000, 0x0010003a, 0x00000001, 0x0020803a, 0x00000000, 0x00000001, 0x07000000, + 0x00100022, 0x00000000, 0x0010000a, 0x00000000, 0x00004001, 0xbf000000, 0x07000031, 0x00100022, + 0x00000000, 0x0010001a, 0x00000000, 0x00004001, 0x00000000, 0x0304000d, 0x0010001a, 0x00000000, + 0x09000000, 0x001000e2, 0x00000000, 0x00208906, 0x00000000, 0x00000000, 0x00208906, 0x00000000, + 0x00000001, 0x07000038, 0x00102072, 0x00000000, 0x00100006, 0x00000000, 0x00100796, 0x00000000, + 0x05000036, 0x00102082, 0x00000000, 0x0010000a, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, + 0x0000000f, 0x00000002, 0x00000000, 0x00000002, 0x00000008, 0x00000000, 0x00000000, 0x00000001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static ProgramWithCachedVariableLocations pshader_basic_arr[18] = { + { pshader_basic_0, 956, }, + { pshader_basic_1, 1044, }, + { pshader_basic_2, 996, }, + { pshader_basic_3, 1192, }, + { pshader_basic_4, 1280, }, + { pshader_basic_5, 1348, }, + { pshader_basic_6, 1192, }, + { pshader_basic_7, 1280, }, + { pshader_basic_8, 1232, }, + { pshader_basic_9, 1240, }, + { pshader_basic_10, 1328, }, + { pshader_basic_11, 1396, }, + { pshader_basic_12, 1460, }, + { pshader_basic_13, 1548, }, + { pshader_basic_14, 1616, }, + { pshader_basic_15, 1288, }, + { pshader_basic_16, 1356, }, + { pshader_basic_17, 1300, }, +}; + +static DWORD pshader_exceptional_blend_1[335] = { + 0x43425844, 0x0b4014f2, 0x2a24373f, 0xb6c4e09c, 0xd8c938b5, 0x00000001, 0x0000053c, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x000004c0, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000002, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000002, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x00000238, 0x00000040, 0x0000008e, 0x04000059, 0x00208e46, 0x00000000, 0x00000004, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000001, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x03001062, 0x00101032, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000003, 0x09000045, 0x001000f2, + 0x00000000, 0x00101046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, + 0x00100072, 0x00000000, 0x00100246, 0x00000000, 0x00208246, 0x00000000, 0x00000000, 0x08000038, + 0x001000f2, 0x00000001, 0x00100ff6, 0x00000000, 0x00208e46, 0x00000000, 0x00000001, 0x0a002032, + 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00208ff6, 0x00000000, 0x00000000, 0x00100e46, + 0x00000001, 0x08000000, 0x00100012, 0x00000001, 0x8010003a, 0x00000041, 0x00000000, 0x00004001, + 0x3f800000, 0x0b000032, 0x00100062, 0x00000001, 0x00101106, 0x00000001, 0x00208106, 0x00000000, + 0x00000003, 0x00208ba6, 0x00000000, 0x00000003, 0x09000045, 0x001000f2, 0x00000002, 0x00100596, + 0x00000001, 0x00107e46, 0x00000001, 0x00106000, 0x00000001, 0x07000038, 0x001000e2, 0x00000001, + 0x00100906, 0x00000000, 0x00100906, 0x00000002, 0x09000032, 0x00100072, 0x00000001, 0x00100006, + 0x00000001, 0x00100246, 0x00000002, 0x00100796, 0x00000001, 0x08000000, 0x00100082, 0x00000001, + 0x8010003a, 0x00000041, 0x00000002, 0x00004001, 0x3f800000, 0x09000032, 0x00102072, 0x00000000, + 0x00100ff6, 0x00000001, 0x00100246, 0x00000000, 0x00100246, 0x00000001, 0x07000000, 0x00100012, + 0x00000000, 0x0010003a, 0x00000000, 0x0010003a, 0x00000002, 0x0a000032, 0x00102082, 0x00000000, + 0x8010003a, 0x00000041, 0x00000000, 0x0010003a, 0x00000002, 0x0010000a, 0x00000000, 0x0100003e, + 0x54415453, 0x00000074, 0x0000000e, 0x00000003, 0x00000000, 0x00000002, 0x00000006, 0x00000000, + 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_exceptional_blend_2[361] = { + 0x43425844, 0xf906958b, 0x06acfe4b, 0x355048f1, 0x63cfff9c, 0x00000001, 0x000005a4, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x00000528, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000002, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000002, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x000002a0, 0x00000040, 0x000000a8, 0x04000059, 0x00208e46, 0x00000000, 0x00000004, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000001, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x03001062, 0x00101032, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000004, 0x09000045, 0x001000f2, + 0x00000000, 0x00101046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, + 0x00100072, 0x00000000, 0x00100246, 0x00000000, 0x00208246, 0x00000000, 0x00000000, 0x08000038, + 0x001000f2, 0x00000001, 0x00100ff6, 0x00000000, 0x00208e46, 0x00000000, 0x00000001, 0x0a002032, + 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00208ff6, 0x00000000, 0x00000000, 0x00100e46, + 0x00000001, 0x08000000, 0x00100072, 0x00000001, 0x80100246, 0x00000041, 0x00000000, 0x00100ff6, + 0x00000000, 0x0b000032, 0x00100032, 0x00000002, 0x00101046, 0x00000001, 0x00208046, 0x00000000, + 0x00000003, 0x00208ae6, 0x00000000, 0x00000003, 0x09000045, 0x001000f2, 0x00000002, 0x00100046, + 0x00000002, 0x00107e46, 0x00000001, 0x00106000, 0x00000001, 0x07000038, 0x00100082, 0x00000001, + 0x0010003a, 0x00000000, 0x0010003a, 0x00000002, 0x08000000, 0x00100072, 0x00000003, 0x80100246, + 0x00000041, 0x00000002, 0x00100ff6, 0x00000002, 0x0a000032, 0x00100072, 0x00000001, 0x80100246, + 0x00000041, 0x00000003, 0x00100246, 0x00000001, 0x00100ff6, 0x00000001, 0x08000000, 0x00100082, + 0x00000001, 0x8010003a, 0x00000041, 0x00000000, 0x00004001, 0x3f800000, 0x09000032, 0x00100072, + 0x00000001, 0x00100ff6, 0x00000001, 0x00100246, 0x00000002, 0x00100246, 0x00000001, 0x08000000, + 0x00100082, 0x00000001, 0x8010003a, 0x00000041, 0x00000002, 0x00004001, 0x3f800000, 0x09000032, + 0x00102072, 0x00000000, 0x00100ff6, 0x00000001, 0x00100246, 0x00000000, 0x00100246, 0x00000001, + 0x07000000, 0x00100012, 0x00000000, 0x0010003a, 0x00000000, 0x0010003a, 0x00000002, 0x0a000032, + 0x00102082, 0x00000000, 0x8010003a, 0x00000041, 0x00000000, 0x0010003a, 0x00000002, 0x0010000a, + 0x00000000, 0x0100003e, 0x54415453, 0x00000074, 0x00000011, 0x00000004, 0x00000000, 0x00000002, + 0x00000008, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, +}; + +static DWORD pshader_exceptional_blend_3[356] = { + 0x43425844, 0xfa19bb88, 0xda5ce80c, 0x160c8b13, 0xebac0845, 0x00000001, 0x00000590, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x00000514, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000002, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000002, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x0000028c, 0x00000040, 0x000000a3, 0x04000059, 0x00208e46, 0x00000000, 0x00000004, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000001, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x03001062, 0x00101032, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000004, 0x09000045, 0x001000f2, + 0x00000000, 0x00101046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, + 0x00100072, 0x00000000, 0x00100246, 0x00000000, 0x00208246, 0x00000000, 0x00000000, 0x08000038, + 0x001000f2, 0x00000001, 0x00100ff6, 0x00000000, 0x00208e46, 0x00000000, 0x00000001, 0x0a002032, + 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00208ff6, 0x00000000, 0x00000000, 0x00100e46, + 0x00000001, 0x08000000, 0x00100012, 0x00000001, 0x8010003a, 0x00000041, 0x00000000, 0x00004001, + 0x3f800000, 0x0b000032, 0x00100062, 0x00000001, 0x00101106, 0x00000001, 0x00208106, 0x00000000, + 0x00000003, 0x00208ba6, 0x00000000, 0x00000003, 0x09000045, 0x001000f2, 0x00000002, 0x00100596, + 0x00000001, 0x00107e46, 0x00000001, 0x00106000, 0x00000001, 0x07000038, 0x001000f2, 0x00000003, + 0x00100736, 0x00000000, 0x00100dc6, 0x00000002, 0x07000034, 0x00100032, 0x00000003, 0x001005d6, + 0x00000003, 0x00100086, 0x00000003, 0x07000038, 0x00100062, 0x00000001, 0x00100ef6, 0x00000000, + 0x00100ba6, 0x00000002, 0x07000034, 0x00100042, 0x00000003, 0x0010002a, 0x00000001, 0x0010001a, + 0x00000001, 0x09000032, 0x00100072, 0x00000001, 0x00100006, 0x00000001, 0x00100246, 0x00000002, + 0x00100246, 0x00000003, 0x08000000, 0x00100082, 0x00000001, 0x8010003a, 0x00000041, 0x00000002, + 0x00004001, 0x3f800000, 0x09000032, 0x00102072, 0x00000000, 0x00100ff6, 0x00000001, 0x00100246, + 0x00000000, 0x00100246, 0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010003a, 0x00000000, + 0x0010003a, 0x00000002, 0x0a000032, 0x00102082, 0x00000000, 0x8010003a, 0x00000041, 0x00000000, + 0x0010003a, 0x00000002, 0x0010000a, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, 0x00000011, + 0x00000004, 0x00000000, 0x00000002, 0x00000009, 0x00000000, 0x00000000, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_exceptional_blend_4[356] = { + 0x43425844, 0x51f459c3, 0x15565fe2, 0x4f2b3854, 0x901f8bb9, 0x00000001, 0x00000590, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x00000514, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000002, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000002, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x0000028c, 0x00000040, 0x000000a3, 0x04000059, 0x00208e46, 0x00000000, 0x00000004, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000001, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x03001062, 0x00101032, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000004, 0x09000045, 0x001000f2, + 0x00000000, 0x00101046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, + 0x00100072, 0x00000000, 0x00100246, 0x00000000, 0x00208246, 0x00000000, 0x00000000, 0x08000038, + 0x001000f2, 0x00000001, 0x00100ff6, 0x00000000, 0x00208e46, 0x00000000, 0x00000001, 0x0a002032, + 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00208ff6, 0x00000000, 0x00000000, 0x00100e46, + 0x00000001, 0x08000000, 0x00100012, 0x00000001, 0x8010003a, 0x00000041, 0x00000000, 0x00004001, + 0x3f800000, 0x0b000032, 0x00100062, 0x00000001, 0x00101106, 0x00000001, 0x00208106, 0x00000000, + 0x00000003, 0x00208ba6, 0x00000000, 0x00000003, 0x09000045, 0x001000f2, 0x00000002, 0x00100596, + 0x00000001, 0x00107e46, 0x00000001, 0x00106000, 0x00000001, 0x07000038, 0x001000f2, 0x00000003, + 0x00100736, 0x00000000, 0x00100dc6, 0x00000002, 0x07000033, 0x00100032, 0x00000003, 0x001005d6, + 0x00000003, 0x00100086, 0x00000003, 0x07000038, 0x00100062, 0x00000001, 0x00100ef6, 0x00000000, + 0x00100ba6, 0x00000002, 0x07000033, 0x00100042, 0x00000003, 0x0010002a, 0x00000001, 0x0010001a, + 0x00000001, 0x09000032, 0x00100072, 0x00000001, 0x00100006, 0x00000001, 0x00100246, 0x00000002, + 0x00100246, 0x00000003, 0x08000000, 0x00100082, 0x00000001, 0x8010003a, 0x00000041, 0x00000002, + 0x00004001, 0x3f800000, 0x09000032, 0x00102072, 0x00000000, 0x00100ff6, 0x00000001, 0x00100246, + 0x00000000, 0x00100246, 0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010003a, 0x00000000, + 0x0010003a, 0x00000002, 0x0a000032, 0x00102082, 0x00000000, 0x8010003a, 0x00000041, 0x00000000, + 0x0010003a, 0x00000002, 0x0010000a, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, 0x00000011, + 0x00000004, 0x00000000, 0x00000002, 0x00000009, 0x00000000, 0x00000000, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_exceptional_blend_5[294] = { + 0x43425844, 0x78df9480, 0x22fce9ea, 0x892ac708, 0xebd122be, 0x00000001, 0x00000498, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x0000041c, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000002, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000002, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x00000194, 0x00000040, 0x00000065, 0x04000059, 0x00208e46, 0x00000000, 0x00000004, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000001, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x03001062, 0x00101032, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x09000045, 0x001000f2, + 0x00000000, 0x00101046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, + 0x00100072, 0x00000000, 0x00100246, 0x00000000, 0x00208246, 0x00000000, 0x00000000, 0x08000038, + 0x001000f2, 0x00000001, 0x00100ff6, 0x00000000, 0x00208e46, 0x00000000, 0x00000001, 0x0a002032, + 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00208ff6, 0x00000000, 0x00000000, 0x00100e46, + 0x00000001, 0x0b000032, 0x00100032, 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000000, + 0x00000003, 0x00208ae6, 0x00000000, 0x00000003, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, + 0x00000001, 0x00107e46, 0x00000001, 0x00106000, 0x00000001, 0x07000000, 0x001000f2, 0x00000000, + 0x00100e46, 0x00000000, 0x00100e46, 0x00000001, 0x0a000033, 0x001020f2, 0x00000000, 0x00100e46, + 0x00000000, 0x00004002, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x0100003e, 0x54415453, + 0x00000074, 0x00000009, 0x00000002, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000000, + 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_exceptional_blend_6[309] = { + 0x43425844, 0x72cc2469, 0xfeb8ff3a, 0xc3c15aed, 0x5d2bdd8a, 0x00000001, 0x000004d4, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x00000458, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000002, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000002, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x000001d0, 0x00000040, 0x00000074, 0x04000059, 0x00208e46, 0x00000000, 0x00000004, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000001, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x03001062, 0x00101032, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x09000045, 0x001000f2, + 0x00000000, 0x00101046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, + 0x00100072, 0x00000000, 0x00100246, 0x00000000, 0x00208246, 0x00000000, 0x00000000, 0x08000038, + 0x001000f2, 0x00000001, 0x00100ff6, 0x00000000, 0x00208e46, 0x00000000, 0x00000001, 0x0a002032, + 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00208ff6, 0x00000000, 0x00000000, 0x00100e46, + 0x00000001, 0x0b000032, 0x00100032, 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000000, + 0x00000003, 0x00208ae6, 0x00000000, 0x00000003, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, + 0x00000001, 0x00107e46, 0x00000001, 0x00106000, 0x00000001, 0x08000000, 0x00100072, 0x00000000, + 0x80100246, 0x00000041, 0x00000000, 0x00100246, 0x00000001, 0x07000000, 0x00100082, 0x00000000, + 0x0010003a, 0x00000000, 0x0010003a, 0x00000001, 0x07000033, 0x00102082, 0x00000000, 0x0010003a, + 0x00000000, 0x00004001, 0x3f800000, 0x0a000034, 0x00102072, 0x00000000, 0x00100246, 0x00000000, + 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, + 0x0000000b, 0x00000002, 0x00000000, 0x00000002, 0x00000006, 0x00000000, 0x00000000, 0x00000001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_exceptional_blend_7[374] = { + 0x43425844, 0xeeebdd02, 0x607b5e55, 0x9b2d4bb0, 0x0c029c3e, 0x00000001, 0x000005d8, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x0000055c, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000002, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000002, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x000002d4, 0x00000040, 0x000000b5, 0x04000059, 0x00208e46, 0x00000000, 0x00000004, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000001, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x03001062, 0x00101032, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000004, 0x09000045, 0x001000f2, + 0x00000000, 0x00101046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, + 0x00100072, 0x00000000, 0x00100246, 0x00000000, 0x00208246, 0x00000000, 0x00000000, 0x08000038, + 0x001000f2, 0x00000001, 0x00100ff6, 0x00000000, 0x00208e46, 0x00000000, 0x00000001, 0x0a002032, + 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00208ff6, 0x00000000, 0x00000000, 0x00100e46, + 0x00000001, 0x08000000, 0x00100012, 0x00000001, 0x8010003a, 0x00000041, 0x00000000, 0x00004001, + 0x3f800000, 0x0b000032, 0x00100062, 0x00000001, 0x00101106, 0x00000001, 0x00208106, 0x00000000, + 0x00000003, 0x00208ba6, 0x00000000, 0x00000003, 0x09000045, 0x001000f2, 0x00000002, 0x00100596, + 0x00000001, 0x00107e46, 0x00000001, 0x00106000, 0x00000001, 0x07000038, 0x00100062, 0x00000001, + 0x00100106, 0x00000000, 0x00100ff6, 0x00000002, 0x0a000032, 0x00100062, 0x00000001, 0x00100ff6, + 0x00000000, 0x00100106, 0x00000002, 0x80100656, 0x00000041, 0x00000001, 0x06000036, 0x00100032, + 0x00000003, 0x80100596, 0x00000081, 0x00000001, 0x07000038, 0x00100022, 0x00000001, 0x0010002a, + 0x00000000, 0x0010003a, 0x00000002, 0x0a000032, 0x00100022, 0x00000001, 0x0010003a, 0x00000000, + 0x0010002a, 0x00000002, 0x8010001a, 0x00000041, 0x00000001, 0x06000036, 0x00100042, 0x00000003, + 0x8010001a, 0x00000081, 0x00000001, 0x09000032, 0x00100072, 0x00000001, 0x00100006, 0x00000001, + 0x00100246, 0x00000002, 0x00100246, 0x00000003, 0x08000000, 0x00100082, 0x00000001, 0x8010003a, + 0x00000041, 0x00000002, 0x00004001, 0x3f800000, 0x09000032, 0x00102072, 0x00000000, 0x00100ff6, + 0x00000001, 0x00100246, 0x00000000, 0x00100246, 0x00000001, 0x07000000, 0x00100012, 0x00000000, + 0x0010003a, 0x00000000, 0x0010003a, 0x00000002, 0x0a000032, 0x00102082, 0x00000000, 0x8010003a, + 0x00000041, 0x00000000, 0x0010003a, 0x00000002, 0x0010000a, 0x00000000, 0x0100003e, 0x54415453, + 0x00000074, 0x00000013, 0x00000004, 0x00000000, 0x00000002, 0x00000007, 0x00000000, 0x00000000, + 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_exceptional_blend_8[343] = { + 0x43425844, 0x4c133b76, 0xe54d7a26, 0xec03c69d, 0xd69182c1, 0x00000001, 0x0000055c, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x000004e0, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000002, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000002, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x00000258, 0x00000040, 0x00000096, 0x04000059, 0x00208e46, 0x00000000, 0x00000004, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000001, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x03001062, 0x00101032, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000003, 0x09000045, 0x001000f2, + 0x00000000, 0x00101046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, + 0x00100072, 0x00000000, 0x00100246, 0x00000000, 0x00208246, 0x00000000, 0x00000000, 0x08000038, + 0x001000f2, 0x00000001, 0x00100ff6, 0x00000000, 0x00208e46, 0x00000000, 0x00000001, 0x0a002032, + 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00208ff6, 0x00000000, 0x00000000, 0x00100e46, + 0x00000001, 0x08000000, 0x00100012, 0x00000001, 0x8010003a, 0x00000041, 0x00000000, 0x00004001, + 0x3f800000, 0x0b000032, 0x00100062, 0x00000001, 0x00101106, 0x00000001, 0x00208106, 0x00000000, + 0x00000003, 0x00208ba6, 0x00000000, 0x00000003, 0x09000045, 0x001000f2, 0x00000002, 0x00100596, + 0x00000001, 0x00107e46, 0x00000001, 0x00106000, 0x00000001, 0x07000038, 0x00100072, 0x00000001, + 0x00100006, 0x00000001, 0x00100246, 0x00000002, 0x08000000, 0x00100072, 0x00000002, 0x80100246, + 0x00000041, 0x00000002, 0x00100ff6, 0x00000002, 0x09000032, 0x00100072, 0x00000001, 0x00100ff6, + 0x00000000, 0x00100246, 0x00000002, 0x00100246, 0x00000001, 0x08000000, 0x00100082, 0x00000001, + 0x8010003a, 0x00000041, 0x00000002, 0x00004001, 0x3f800000, 0x09000032, 0x00102072, 0x00000000, + 0x00100ff6, 0x00000001, 0x00100246, 0x00000000, 0x00100246, 0x00000001, 0x07000000, 0x00100012, + 0x00000000, 0x0010003a, 0x00000000, 0x0010003a, 0x00000002, 0x0a000032, 0x00102082, 0x00000000, + 0x8010003a, 0x00000041, 0x00000000, 0x0010003a, 0x00000002, 0x0010000a, 0x00000000, 0x0100003e, + 0x54415453, 0x00000074, 0x0000000f, 0x00000003, 0x00000000, 0x00000002, 0x00000007, 0x00000000, + 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_exceptional_blend_9[430] = { + 0x43425844, 0x0e53b9bf, 0xa40806de, 0xc8710d16, 0xff1f73e9, 0x00000001, 0x000006b8, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x0000063c, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000002, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000002, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x000003b4, 0x00000040, 0x000000ed, 0x04000059, 0x00208e46, 0x00000000, 0x00000004, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000001, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x03001062, 0x00101032, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000005, 0x09000045, 0x001000f2, + 0x00000000, 0x00101046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, + 0x00100072, 0x00000000, 0x00100246, 0x00000000, 0x00208246, 0x00000000, 0x00000000, 0x08000038, + 0x001000f2, 0x00000001, 0x00100ff6, 0x00000000, 0x00208e46, 0x00000000, 0x00000001, 0x0a002032, + 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00208ff6, 0x00000000, 0x00000000, 0x00100e46, + 0x00000001, 0x08000000, 0x00100072, 0x00000001, 0x80100246, 0x00000041, 0x00000000, 0x00100ff6, + 0x00000000, 0x0b000032, 0x00100032, 0x00000002, 0x00101046, 0x00000001, 0x00208046, 0x00000000, + 0x00000003, 0x00208ae6, 0x00000000, 0x00000003, 0x09000045, 0x001000f2, 0x00000002, 0x00100046, + 0x00000002, 0x00107e46, 0x00000001, 0x00106000, 0x00000001, 0x07000038, 0x00100082, 0x00000001, + 0x0010003a, 0x00000000, 0x0010003a, 0x00000002, 0x08000000, 0x00100072, 0x00000003, 0x80100246, + 0x00000041, 0x00000002, 0x00100ff6, 0x00000002, 0x07000000, 0x00100072, 0x00000003, 0x00100246, + 0x00000003, 0x00100246, 0x00000003, 0x0a000032, 0x00100072, 0x00000001, 0x80100246, 0x00000041, + 0x00000003, 0x00100246, 0x00000001, 0x00100ff6, 0x00000001, 0x0700000f, 0x00100082, 0x00000001, + 0x00100006, 0x00000002, 0x00100006, 0x00000000, 0x07000038, 0x00100012, 0x00000003, 0x0010003a, + 0x00000002, 0x00004001, 0x3f000000, 0x07000031, 0x00100072, 0x00000003, 0x00100246, 0x00000002, + 0x00100006, 0x00000003, 0x09000037, 0x00100012, 0x00000004, 0x0010000a, 0x00000003, 0x0010003a, + 0x00000001, 0x0010000a, 0x00000001, 0x0700000f, 0x00100012, 0x00000001, 0x00100556, 0x00000002, + 0x00100556, 0x00000000, 0x09000037, 0x00100022, 0x00000004, 0x0010001a, 0x00000003, 0x0010000a, + 0x00000001, 0x0010001a, 0x00000001, 0x0700000f, 0x00100012, 0x00000001, 0x00100aa6, 0x00000002, + 0x00100aa6, 0x00000000, 0x09000037, 0x00100042, 0x00000004, 0x0010002a, 0x00000003, 0x0010000a, + 0x00000001, 0x0010002a, 0x00000001, 0x08000000, 0x00100012, 0x00000001, 0x8010003a, 0x00000041, + 0x00000000, 0x00004001, 0x3f800000, 0x09000032, 0x00100072, 0x00000001, 0x00100006, 0x00000001, + 0x00100246, 0x00000002, 0x00100246, 0x00000004, 0x08000000, 0x00100082, 0x00000001, 0x8010003a, + 0x00000041, 0x00000002, 0x00004001, 0x3f800000, 0x09000032, 0x00102072, 0x00000000, 0x00100ff6, + 0x00000001, 0x00100246, 0x00000000, 0x00100246, 0x00000001, 0x07000000, 0x00100012, 0x00000000, + 0x0010003a, 0x00000000, 0x0010003a, 0x00000002, 0x0a000032, 0x00102082, 0x00000000, 0x8010003a, + 0x00000041, 0x00000000, 0x0010003a, 0x00000002, 0x0010000a, 0x00000000, 0x0100003e, 0x54415453, + 0x00000074, 0x0000001a, 0x00000005, 0x00000000, 0x00000002, 0x0000000e, 0x00000000, 0x00000000, + 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_exceptional_blend_10[430] = { + 0x43425844, 0x5b763bc7, 0xa04a2226, 0x01dce3d1, 0xed9b4a05, 0x00000001, 0x000006b8, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x0000063c, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000002, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000002, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x000003b4, 0x00000040, 0x000000ed, 0x04000059, 0x00208e46, 0x00000000, 0x00000004, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000001, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x03001062, 0x00101032, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000005, 0x09000045, 0x001000f2, + 0x00000000, 0x00101046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, + 0x00100072, 0x00000000, 0x00100246, 0x00000000, 0x00208246, 0x00000000, 0x00000000, 0x08000038, + 0x001000f2, 0x00000001, 0x00100ff6, 0x00000000, 0x00208e46, 0x00000000, 0x00000001, 0x0a002032, + 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00208ff6, 0x00000000, 0x00000000, 0x00100e46, + 0x00000001, 0x08000000, 0x00100072, 0x00000001, 0x80100246, 0x00000041, 0x00000000, 0x00100ff6, + 0x00000000, 0x0b000032, 0x00100032, 0x00000002, 0x00101046, 0x00000001, 0x00208046, 0x00000000, + 0x00000003, 0x00208ae6, 0x00000000, 0x00000003, 0x09000045, 0x001000f2, 0x00000002, 0x00100046, + 0x00000002, 0x00107e46, 0x00000001, 0x00106000, 0x00000001, 0x08000000, 0x00100072, 0x00000003, + 0x80100246, 0x00000041, 0x00000002, 0x00100ff6, 0x00000002, 0x07000000, 0x00100072, 0x00000003, + 0x00100246, 0x00000003, 0x00100246, 0x00000003, 0x07000038, 0x00100082, 0x00000001, 0x0010003a, + 0x00000000, 0x0010003a, 0x00000002, 0x0a000032, 0x00100072, 0x00000001, 0x80100246, 0x00000041, + 0x00000003, 0x00100246, 0x00000001, 0x00100ff6, 0x00000001, 0x07000038, 0x00100082, 0x00000001, + 0x0010003a, 0x00000000, 0x00004001, 0x3f000000, 0x07000031, 0x00100072, 0x00000003, 0x00100246, + 0x00000000, 0x00100ff6, 0x00000001, 0x0700000f, 0x00100082, 0x00000001, 0x00100006, 0x00000002, + 0x00100006, 0x00000000, 0x09000037, 0x00100012, 0x00000004, 0x0010000a, 0x00000003, 0x0010003a, + 0x00000001, 0x0010000a, 0x00000001, 0x0700000f, 0x00100012, 0x00000001, 0x00100556, 0x00000002, + 0x00100556, 0x00000000, 0x09000037, 0x00100022, 0x00000004, 0x0010001a, 0x00000003, 0x0010000a, + 0x00000001, 0x0010001a, 0x00000001, 0x0700000f, 0x00100012, 0x00000001, 0x00100aa6, 0x00000002, + 0x00100aa6, 0x00000000, 0x09000037, 0x00100042, 0x00000004, 0x0010002a, 0x00000003, 0x0010000a, + 0x00000001, 0x0010002a, 0x00000001, 0x08000000, 0x00100012, 0x00000001, 0x8010003a, 0x00000041, + 0x00000000, 0x00004001, 0x3f800000, 0x09000032, 0x00100072, 0x00000001, 0x00100006, 0x00000001, + 0x00100246, 0x00000002, 0x00100246, 0x00000004, 0x08000000, 0x00100082, 0x00000001, 0x8010003a, + 0x00000041, 0x00000002, 0x00004001, 0x3f800000, 0x09000032, 0x00102072, 0x00000000, 0x00100ff6, + 0x00000001, 0x00100246, 0x00000000, 0x00100246, 0x00000001, 0x07000000, 0x00100012, 0x00000000, + 0x0010003a, 0x00000000, 0x0010003a, 0x00000002, 0x0a000032, 0x00102082, 0x00000000, 0x8010003a, + 0x00000041, 0x00000000, 0x0010003a, 0x00000002, 0x0010000a, 0x00000000, 0x0100003e, 0x54415453, + 0x00000074, 0x0000001a, 0x00000005, 0x00000000, 0x00000002, 0x0000000e, 0x00000000, 0x00000000, + 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_exceptional_blend_11[284] = { + 0x43425844, 0xb5fd5f87, 0x5eef857b, 0xa3d0d13a, 0xf65c919c, 0x00000001, 0x00000470, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x000003f4, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000002, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000002, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x0000016c, 0x00000040, 0x0000005b, 0x04000059, 0x00208e46, 0x00000000, 0x00000004, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000001, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x03001062, 0x00101032, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x09000045, 0x001000f2, + 0x00000000, 0x00101046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, + 0x00100012, 0x00000000, 0x0010003a, 0x00000000, 0x0020803a, 0x00000000, 0x00000001, 0x0a002032, + 0x00100012, 0x00000000, 0x0010003a, 0x00000000, 0x0020803a, 0x00000000, 0x00000000, 0x0010000a, + 0x00000000, 0x08000000, 0x00100012, 0x00000000, 0x8010000a, 0x00000041, 0x00000000, 0x00004001, + 0x3f800000, 0x0b000032, 0x00100062, 0x00000000, 0x00101106, 0x00000001, 0x00208106, 0x00000000, + 0x00000003, 0x00208ba6, 0x00000000, 0x00000003, 0x09000045, 0x001000f2, 0x00000001, 0x00100596, + 0x00000000, 0x00107e46, 0x00000001, 0x00106000, 0x00000001, 0x07000038, 0x001020f2, 0x00000000, + 0x00100006, 0x00000000, 0x00100e46, 0x00000001, 0x0100003e, 0x54415453, 0x00000074, 0x00000008, + 0x00000002, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000000, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_exceptional_blend_12[276] = { + 0x43425844, 0x8aa79ff3, 0xa0220437, 0x6186c7a6, 0x358ad839, 0x00000001, 0x00000450, 0x00000005, + 0x00000034, 0x000001f4, 0x0000024c, 0x00000280, 0x000003d4, 0x46454452, 0x000001b8, 0x00000001, + 0x000000d8, 0x00000005, 0x0000001c, 0xffff0400, 0x00008100, 0x00000185, 0x000000bc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000c3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x000000ca, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000cf, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x000000d4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x000000d4, 0x00000004, 0x000000f0, + 0x00000040, 0x00000000, 0x00000000, 0x00000150, 0x00000000, 0x00000010, 0x00000002, 0x0000015c, + 0x00000000, 0x0000016c, 0x00000010, 0x00000010, 0x00000002, 0x0000015c, 0x00000000, 0x00000176, + 0x00000020, 0x00000010, 0x00000000, 0x0000015c, 0x00000000, 0x0000017c, 0x00000030, 0x00000010, + 0x00000002, 0x0000015c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, + 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x0000014c, 0x00000040, 0x00000053, 0x04000059, 0x00208e46, 0x00000000, 0x00000004, + 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000001, 0x04001858, 0x00107000, + 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x03001062, 0x00101032, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x09000045, 0x001000f2, + 0x00000000, 0x00101046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, + 0x00100012, 0x00000000, 0x0010003a, 0x00000000, 0x0020803a, 0x00000000, 0x00000001, 0x0a002032, + 0x00100012, 0x00000000, 0x0010003a, 0x00000000, 0x0020803a, 0x00000000, 0x00000000, 0x0010000a, + 0x00000000, 0x0b000032, 0x00100062, 0x00000000, 0x00101106, 0x00000001, 0x00208106, 0x00000000, + 0x00000003, 0x00208ba6, 0x00000000, 0x00000003, 0x09000045, 0x001000f2, 0x00000001, 0x00100596, + 0x00000000, 0x00107e46, 0x00000001, 0x00106000, 0x00000001, 0x07000038, 0x001020f2, 0x00000000, + 0x00100006, 0x00000000, 0x00100e46, 0x00000001, 0x0100003e, 0x54415453, 0x00000074, 0x00000007, + 0x00000002, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static ProgramWithCachedVariableLocations pshader_exceptional_blend_arr[13] = { + { NULL, 0, }, + { pshader_exceptional_blend_1, 1340, }, + { pshader_exceptional_blend_2, 1444, }, + { pshader_exceptional_blend_3, 1424, }, + { pshader_exceptional_blend_4, 1424, }, + { pshader_exceptional_blend_5, 1176, }, + { pshader_exceptional_blend_6, 1236, }, + { pshader_exceptional_blend_7, 1496, }, + { pshader_exceptional_blend_8, 1372, }, + { pshader_exceptional_blend_9, 1720, }, + { pshader_exceptional_blend_10, 1720, }, + { pshader_exceptional_blend_11, 1136, }, + { pshader_exceptional_blend_12, 1104, }, +}; + +static DWORD pshader_filter_0[379] = { + 0x43425844, 0x24aad9c6, 0x43cc8801, 0x5ba2dc0b, 0xffe933e2, 0x00000001, 0x000005ec, 0x00000005, + 0x00000034, 0x000002d0, 0x00000328, 0x0000035c, 0x00000570, 0x46454452, 0x00000294, 0x00000002, + 0x00000100, 0x00000006, 0x0000001c, 0xffff0400, 0x00008100, 0x00000262, 0x000000dc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000e3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x000000ea, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000ef, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x000000f4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000f8, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x61726170, 0xababab00, 0x000000f4, + 0x00000004, 0x00000130, 0x00000040, 0x00000000, 0x00000000, 0x000000f8, 0x00000005, 0x000001c8, + 0x00000050, 0x00000000, 0x00000000, 0x00000190, 0x00000000, 0x00000010, 0x00000000, 0x0000019c, + 0x00000000, 0x000001ac, 0x00000010, 0x00000010, 0x00000000, 0x0000019c, 0x00000000, 0x000001b6, + 0x00000020, 0x00000010, 0x00000000, 0x0000019c, 0x00000000, 0x000001bc, 0x00000030, 0x00000010, + 0x00000000, 0x0000019c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0xababab00, 0x00000240, 0x00000000, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x00000247, + 0x00000010, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x0000024e, 0x00000020, 0x00000010, + 0x00000002, 0x0000019c, 0x00000000, 0x00000254, 0x00000030, 0x00000010, 0x00000000, 0x0000019c, + 0x00000000, 0x0000025b, 0x00000040, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x6d616c63, + 0x63003070, 0x706d616c, 0x6f630031, 0x00726f6c, 0x6f6c6f63, 0x74003272, 0x666f5f63, 0x694d0066, + 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, + 0x322e3920, 0x35392e39, 0x31332e32, 0xab003131, 0x4e475349, 0x00000050, 0x00000002, 0x00000008, + 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, + 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, 0x43584554, + 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, + 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, + 0x0000020c, 0x00000040, 0x00000083, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x04000059, + 0x00208e46, 0x00000001, 0x00000005, 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, + 0x00000001, 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, + 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, + 0x00000003, 0x08000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, 0x00208046, 0x00000001, + 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208046, 0x00000001, + 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208ae6, 0x00000001, + 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, + 0x00106000, 0x00000000, 0x08000038, 0x00100012, 0x00000000, 0x0010003a, 0x00000000, 0x0020802a, + 0x00000001, 0x00000004, 0x07000033, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x00004001, + 0x3f800000, 0x08000038, 0x001000f2, 0x00000000, 0x00100006, 0x00000000, 0x00208e46, 0x00000001, + 0x00000002, 0x08000034, 0x00100032, 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, + 0x00000001, 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, + 0x00000001, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000001, + 0x00106000, 0x00000001, 0x08000000, 0x00100012, 0x00000002, 0x8010003a, 0x00000041, 0x00000001, + 0x00004001, 0x3f800000, 0x09000032, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x00100006, + 0x00000002, 0x00100e46, 0x00000001, 0x0100003e, 0x54415453, 0x00000074, 0x0000000d, 0x00000003, + 0x00000000, 0x00000002, 0x00000009, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_filter_1[377] = { + 0x43425844, 0x1e4f7d74, 0xaaf944d6, 0xb5f0a484, 0xc246b059, 0x00000001, 0x000005e4, 0x00000005, + 0x00000034, 0x000002d0, 0x00000328, 0x0000035c, 0x00000568, 0x46454452, 0x00000294, 0x00000002, + 0x00000100, 0x00000006, 0x0000001c, 0xffff0400, 0x00008100, 0x00000262, 0x000000dc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000e3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x000000ea, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000ef, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x000000f4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000f8, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x61726170, 0xababab00, 0x000000f4, + 0x00000004, 0x00000130, 0x00000040, 0x00000000, 0x00000000, 0x000000f8, 0x00000005, 0x000001c8, + 0x00000050, 0x00000000, 0x00000000, 0x00000190, 0x00000000, 0x00000010, 0x00000000, 0x0000019c, + 0x00000000, 0x000001ac, 0x00000010, 0x00000010, 0x00000000, 0x0000019c, 0x00000000, 0x000001b6, + 0x00000020, 0x00000010, 0x00000000, 0x0000019c, 0x00000000, 0x000001bc, 0x00000030, 0x00000010, + 0x00000000, 0x0000019c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0xababab00, 0x00000240, 0x00000000, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x00000247, + 0x00000010, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x0000024e, 0x00000020, 0x00000010, + 0x00000002, 0x0000019c, 0x00000000, 0x00000254, 0x00000030, 0x00000010, 0x00000000, 0x0000019c, + 0x00000000, 0x0000025b, 0x00000040, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x6d616c63, + 0x63003070, 0x706d616c, 0x6f630031, 0x00726f6c, 0x6f6c6f63, 0x74003272, 0x666f5f63, 0x694d0066, + 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, + 0x322e3920, 0x35392e39, 0x31332e32, 0xab003131, 0x4e475349, 0x00000050, 0x00000002, 0x00000008, + 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, + 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, 0x43584554, + 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, + 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, + 0x00000204, 0x00000040, 0x00000081, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x04000059, + 0x00208e46, 0x00000001, 0x00000005, 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, + 0x00000001, 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, + 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, + 0x00000002, 0x08000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, 0x00208046, 0x00000001, + 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208046, 0x00000001, + 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208ae6, 0x00000001, + 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, + 0x00106000, 0x00000000, 0x08000038, 0x00100012, 0x00000000, 0x0010003a, 0x00000000, 0x0020802a, + 0x00000001, 0x00000004, 0x07000033, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x00004001, + 0x3f800000, 0x08000034, 0x00100062, 0x00000000, 0x00101106, 0x00000001, 0x00208106, 0x00000001, + 0x00000001, 0x08000033, 0x00100062, 0x00000000, 0x00100656, 0x00000000, 0x00208ba6, 0x00000001, + 0x00000001, 0x09000045, 0x001000f2, 0x00000001, 0x00100596, 0x00000000, 0x00107e46, 0x00000001, + 0x00106000, 0x00000001, 0x08000000, 0x00100022, 0x00000000, 0x8010003a, 0x00000041, 0x00000001, + 0x00004001, 0x3f800000, 0x08000038, 0x001000f2, 0x00000001, 0x00100556, 0x00000000, 0x00208e46, + 0x00000001, 0x00000002, 0x07000038, 0x001020f2, 0x00000000, 0x00100006, 0x00000000, 0x00100e46, + 0x00000001, 0x0100003e, 0x54415453, 0x00000074, 0x0000000d, 0x00000002, 0x00000000, 0x00000002, + 0x0000000a, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, +}; + +static DWORD pshader_filter_2[411] = { + 0x43425844, 0x434da1c1, 0xc6277d6b, 0xf3644d3f, 0x33d647fa, 0x00000001, 0x0000066c, 0x00000005, + 0x00000034, 0x0000031c, 0x00000374, 0x000003a8, 0x000005f0, 0x46454452, 0x000002e0, 0x00000002, + 0x0000014c, 0x00000008, 0x0000001c, 0xffff0400, 0x00008100, 0x000002ae, 0x0000011c, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000123, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x0000012a, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x00000131, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x00000136, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x0000013b, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000002, 0x00000001, 0x0000000d, 0x00000140, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000144, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x5f730031, 0x32786574, 0x78657400, 0x65740030, 0x74003178, 0x00327865, 0x00635350, + 0x61726170, 0xababab00, 0x00000140, 0x00000004, 0x0000017c, 0x00000040, 0x00000000, 0x00000000, + 0x00000144, 0x00000005, 0x00000214, 0x00000050, 0x00000000, 0x00000000, 0x000001dc, 0x00000000, + 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000001f8, 0x00000010, 0x00000010, 0x00000000, + 0x000001e8, 0x00000000, 0x00000202, 0x00000020, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, + 0x00000208, 0x00000030, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x6f6c6f63, 0x756d5f72, + 0xabab006c, 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, + 0x006c6163, 0x63736572, 0x31656c61, 0xababab00, 0x0000028c, 0x00000000, 0x00000010, 0x00000002, + 0x000001e8, 0x00000000, 0x00000293, 0x00000010, 0x00000010, 0x00000002, 0x000001e8, 0x00000000, + 0x0000029a, 0x00000020, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000002a0, 0x00000030, + 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000002a7, 0x00000040, 0x00000010, 0x00000002, + 0x000001e8, 0x00000000, 0x6d616c63, 0x63003070, 0x706d616c, 0x6f630031, 0x00726f6c, 0x6f6c6f63, + 0x74003272, 0x666f5f63, 0x694d0066, 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, + 0x20726564, 0x706d6f43, 0x72656c69, 0x322e3920, 0x35392e39, 0x31332e32, 0xab003131, 0x4e475349, + 0x00000050, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, + 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, + 0x7469736f, 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, + 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, + 0x65677261, 0xabab0074, 0x52444853, 0x00000240, 0x00000040, 0x00000090, 0x04000059, 0x00208e46, + 0x00000000, 0x00000001, 0x04000059, 0x00208e46, 0x00000001, 0x00000005, 0x0300005a, 0x00106000, + 0x00000000, 0x0300005a, 0x00106000, 0x00000001, 0x0300005a, 0x00106000, 0x00000002, 0x04001858, + 0x00107000, 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x04001858, + 0x00107000, 0x00000002, 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, 0x001020f2, + 0x00000000, 0x02000068, 0x00000003, 0x08000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, + 0x00208046, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, 0x00100012, 0x00000000, 0x0010003a, + 0x00000000, 0x0020802a, 0x00000001, 0x00000004, 0x07000033, 0x00100012, 0x00000000, 0x0010000a, + 0x00000000, 0x00004001, 0x3f800000, 0x05000036, 0x00100022, 0x00000000, 0x00004001, 0x3f000000, + 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000002, 0x00106000, + 0x00000002, 0x08000034, 0x00100032, 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, + 0x00000001, 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, + 0x00000001, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000001, + 0x00106000, 0x00000001, 0x08000000, 0x00100012, 0x00000002, 0x8010003a, 0x00000041, 0x00000001, + 0x00004001, 0x3f800000, 0x09000032, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x00100006, + 0x00000002, 0x00100e46, 0x00000001, 0x0100003e, 0x54415453, 0x00000074, 0x0000000e, 0x00000003, + 0x00000000, 0x00000002, 0x00000008, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_filter_3[409] = { + 0x43425844, 0x965f1059, 0xcdafe63f, 0x73c062f4, 0xcd63b2ea, 0x00000001, 0x00000664, 0x00000005, + 0x00000034, 0x0000031c, 0x00000374, 0x000003a8, 0x000005e8, 0x46454452, 0x000002e0, 0x00000002, + 0x0000014c, 0x00000008, 0x0000001c, 0xffff0400, 0x00008100, 0x000002ae, 0x0000011c, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000123, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x0000012a, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x00000131, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x00000136, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x0000013b, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000002, 0x00000001, 0x0000000d, 0x00000140, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000144, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x5f730031, 0x32786574, 0x78657400, 0x65740030, 0x74003178, 0x00327865, 0x00635350, + 0x61726170, 0xababab00, 0x00000140, 0x00000004, 0x0000017c, 0x00000040, 0x00000000, 0x00000000, + 0x00000144, 0x00000005, 0x00000214, 0x00000050, 0x00000000, 0x00000000, 0x000001dc, 0x00000000, + 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000001f8, 0x00000010, 0x00000010, 0x00000000, + 0x000001e8, 0x00000000, 0x00000202, 0x00000020, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, + 0x00000208, 0x00000030, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x6f6c6f63, 0x756d5f72, + 0xabab006c, 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, + 0x006c6163, 0x63736572, 0x31656c61, 0xababab00, 0x0000028c, 0x00000000, 0x00000010, 0x00000002, + 0x000001e8, 0x00000000, 0x00000293, 0x00000010, 0x00000010, 0x00000002, 0x000001e8, 0x00000000, + 0x0000029a, 0x00000020, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000002a0, 0x00000030, + 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000002a7, 0x00000040, 0x00000010, 0x00000002, + 0x000001e8, 0x00000000, 0x6d616c63, 0x63003070, 0x706d616c, 0x6f630031, 0x00726f6c, 0x6f6c6f63, + 0x74003272, 0x666f5f63, 0x694d0066, 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, + 0x20726564, 0x706d6f43, 0x72656c69, 0x322e3920, 0x35392e39, 0x31332e32, 0xab003131, 0x4e475349, + 0x00000050, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, + 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, + 0x7469736f, 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, + 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, + 0x65677261, 0xabab0074, 0x52444853, 0x00000238, 0x00000040, 0x0000008e, 0x04000059, 0x00208e46, + 0x00000000, 0x00000001, 0x04000059, 0x00208e46, 0x00000001, 0x00000005, 0x0300005a, 0x00106000, + 0x00000000, 0x0300005a, 0x00106000, 0x00000001, 0x0300005a, 0x00106000, 0x00000002, 0x04001858, + 0x00107000, 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x04001858, + 0x00107000, 0x00000002, 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, 0x001020f2, + 0x00000000, 0x02000068, 0x00000002, 0x08000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, + 0x00208046, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, 0x00100012, 0x00000000, 0x0010003a, + 0x00000000, 0x0020802a, 0x00000001, 0x00000004, 0x07000033, 0x00100012, 0x00000000, 0x0010000a, + 0x00000000, 0x00004001, 0x3f800000, 0x05000036, 0x00100022, 0x00000000, 0x00004001, 0x3f000000, + 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000002, 0x00106000, + 0x00000002, 0x08000034, 0x00100032, 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, + 0x00000001, 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, + 0x00000001, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000001, + 0x00106000, 0x00000001, 0x08000000, 0x00100012, 0x00000001, 0x8010003a, 0x00000041, 0x00000001, + 0x00004001, 0x3f800000, 0x07000038, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x00100006, + 0x00000001, 0x0100003e, 0x54415453, 0x00000074, 0x0000000e, 0x00000002, 0x00000000, 0x00000002, + 0x00000009, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, +}; + +static DWORD pshader_filter_4[402] = { + 0x43425844, 0x4c377bd9, 0xfb4c5258, 0xe793fa9d, 0xf685a588, 0x00000001, 0x00000648, 0x00000005, + 0x00000034, 0x000002d0, 0x00000328, 0x0000035c, 0x000005cc, 0x46454452, 0x00000294, 0x00000002, + 0x00000100, 0x00000006, 0x0000001c, 0xffff0400, 0x00008100, 0x00000262, 0x000000dc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000e3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x000000ea, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000ef, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x000000f4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000f8, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x61726170, 0xababab00, 0x000000f4, + 0x00000004, 0x00000130, 0x00000040, 0x00000000, 0x00000000, 0x000000f8, 0x00000005, 0x000001c8, + 0x00000050, 0x00000000, 0x00000000, 0x00000190, 0x00000000, 0x00000010, 0x00000000, 0x0000019c, + 0x00000000, 0x000001ac, 0x00000010, 0x00000010, 0x00000000, 0x0000019c, 0x00000000, 0x000001b6, + 0x00000020, 0x00000010, 0x00000000, 0x0000019c, 0x00000000, 0x000001bc, 0x00000030, 0x00000010, + 0x00000000, 0x0000019c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0xababab00, 0x00000240, 0x00000000, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x00000247, + 0x00000010, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x0000024e, 0x00000020, 0x00000010, + 0x00000002, 0x0000019c, 0x00000000, 0x00000254, 0x00000030, 0x00000010, 0x00000000, 0x0000019c, + 0x00000000, 0x0000025b, 0x00000040, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x6d616c63, + 0x63003070, 0x706d616c, 0x6f630031, 0x00726f6c, 0x6f6c6f63, 0x74003272, 0x666f5f63, 0x694d0066, + 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, + 0x322e3920, 0x35392e39, 0x31332e32, 0xab003131, 0x4e475349, 0x00000050, 0x00000002, 0x00000008, + 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, + 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, 0x43584554, + 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, + 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, + 0x00000268, 0x00000040, 0x0000009a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x04000059, + 0x00208e46, 0x00000001, 0x00000005, 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, + 0x00000001, 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, + 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, + 0x00000002, 0x08000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, 0x00208046, 0x00000001, + 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208046, 0x00000001, + 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208ae6, 0x00000001, + 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, + 0x00106000, 0x00000000, 0x08000000, 0x00100012, 0x00000000, 0x8010003a, 0x00000041, 0x00000000, + 0x00004001, 0x3f800000, 0x08000038, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0020802a, + 0x00000001, 0x00000004, 0x07000033, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x00004001, + 0x3f800000, 0x08000038, 0x001000e2, 0x00000000, 0x00100006, 0x00000000, 0x00208906, 0x00000001, + 0x00000002, 0x0b000032, 0x00100012, 0x00000000, 0x8020803a, 0x00000041, 0x00000001, 0x00000002, + 0x0010000a, 0x00000000, 0x00004001, 0x3f800000, 0x08000034, 0x00100032, 0x00000001, 0x00101046, + 0x00000001, 0x00208046, 0x00000001, 0x00000001, 0x08000033, 0x00100032, 0x00000001, 0x00100046, + 0x00000001, 0x00208ae6, 0x00000001, 0x00000001, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, + 0x00000001, 0x00107e46, 0x00000001, 0x00106000, 0x00000001, 0x07000038, 0x00100072, 0x00000001, + 0x00100006, 0x00000000, 0x00100246, 0x00000001, 0x09000032, 0x00102072, 0x00000000, 0x00100796, + 0x00000000, 0x00100ff6, 0x00000001, 0x00100246, 0x00000001, 0x05000036, 0x00102082, 0x00000000, + 0x0010003a, 0x00000001, 0x0100003e, 0x54415453, 0x00000074, 0x00000010, 0x00000002, 0x00000000, + 0x00000002, 0x0000000a, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, +}; + +static DWORD pshader_filter_5[377] = { + 0x43425844, 0x9ff592ef, 0xe7109a8c, 0xc01f276d, 0x73f691c7, 0x00000001, 0x000005e4, 0x00000005, + 0x00000034, 0x000002d0, 0x00000328, 0x0000035c, 0x00000568, 0x46454452, 0x00000294, 0x00000002, + 0x00000100, 0x00000006, 0x0000001c, 0xffff0400, 0x00008100, 0x00000262, 0x000000dc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000e3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x000000ea, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000ef, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x000000f4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000f8, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x61726170, 0xababab00, 0x000000f4, + 0x00000004, 0x00000130, 0x00000040, 0x00000000, 0x00000000, 0x000000f8, 0x00000005, 0x000001c8, + 0x00000050, 0x00000000, 0x00000000, 0x00000190, 0x00000000, 0x00000010, 0x00000000, 0x0000019c, + 0x00000000, 0x000001ac, 0x00000010, 0x00000010, 0x00000000, 0x0000019c, 0x00000000, 0x000001b6, + 0x00000020, 0x00000010, 0x00000000, 0x0000019c, 0x00000000, 0x000001bc, 0x00000030, 0x00000010, + 0x00000000, 0x0000019c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0xababab00, 0x00000240, 0x00000000, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x00000247, + 0x00000010, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x0000024e, 0x00000020, 0x00000010, + 0x00000002, 0x0000019c, 0x00000000, 0x00000254, 0x00000030, 0x00000010, 0x00000000, 0x0000019c, + 0x00000000, 0x0000025b, 0x00000040, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x6d616c63, + 0x63003070, 0x706d616c, 0x6f630031, 0x00726f6c, 0x6f6c6f63, 0x74003272, 0x666f5f63, 0x694d0066, + 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, + 0x322e3920, 0x35392e39, 0x31332e32, 0xab003131, 0x4e475349, 0x00000050, 0x00000002, 0x00000008, + 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, + 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, 0x43584554, + 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, + 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, + 0x00000204, 0x00000040, 0x00000081, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x04000059, + 0x00208e46, 0x00000001, 0x00000005, 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, + 0x00000001, 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, + 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, + 0x00000002, 0x08000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, 0x00208046, 0x00000001, + 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208046, 0x00000001, + 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208ae6, 0x00000001, + 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, + 0x00106000, 0x00000000, 0x08000000, 0x00100012, 0x00000000, 0x8010003a, 0x00000041, 0x00000000, + 0x00004001, 0x3f800000, 0x08000038, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0020802a, + 0x00000001, 0x00000004, 0x07000033, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x00004001, + 0x3f800000, 0x08000034, 0x00100062, 0x00000000, 0x00101106, 0x00000001, 0x00208106, 0x00000001, + 0x00000001, 0x08000033, 0x00100062, 0x00000000, 0x00100656, 0x00000000, 0x00208ba6, 0x00000001, + 0x00000001, 0x09000045, 0x001000f2, 0x00000001, 0x00100596, 0x00000000, 0x00107e46, 0x00000001, + 0x00106000, 0x00000001, 0x08000038, 0x001000f2, 0x00000001, 0x00100ff6, 0x00000001, 0x00208e46, + 0x00000001, 0x00000002, 0x07000038, 0x001020f2, 0x00000000, 0x00100006, 0x00000000, 0x00100e46, + 0x00000001, 0x0100003e, 0x54415453, 0x00000074, 0x0000000d, 0x00000002, 0x00000000, 0x00000002, + 0x0000000a, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, +}; + +static DWORD pshader_filter_6[423] = { + 0x43425844, 0x5360f80d, 0x54f4e830, 0xa8cabb2e, 0x51c8fc74, 0x00000001, 0x0000069c, 0x00000005, + 0x00000034, 0x0000031c, 0x00000374, 0x000003a8, 0x00000620, 0x46454452, 0x000002e0, 0x00000002, + 0x0000014c, 0x00000008, 0x0000001c, 0xffff0400, 0x00008100, 0x000002ae, 0x0000011c, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000123, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x0000012a, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x00000131, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x00000136, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x0000013b, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000002, 0x00000001, 0x0000000d, 0x00000140, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000144, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x5f730031, 0x32786574, 0x78657400, 0x65740030, 0x74003178, 0x00327865, 0x00635350, + 0x61726170, 0xababab00, 0x00000140, 0x00000004, 0x0000017c, 0x00000040, 0x00000000, 0x00000000, + 0x00000144, 0x00000005, 0x00000214, 0x00000050, 0x00000000, 0x00000000, 0x000001dc, 0x00000000, + 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000001f8, 0x00000010, 0x00000010, 0x00000000, + 0x000001e8, 0x00000000, 0x00000202, 0x00000020, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, + 0x00000208, 0x00000030, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x6f6c6f63, 0x756d5f72, + 0xabab006c, 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, + 0x006c6163, 0x63736572, 0x31656c61, 0xababab00, 0x0000028c, 0x00000000, 0x00000010, 0x00000002, + 0x000001e8, 0x00000000, 0x00000293, 0x00000010, 0x00000010, 0x00000002, 0x000001e8, 0x00000000, + 0x0000029a, 0x00000020, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000002a0, 0x00000030, + 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000002a7, 0x00000040, 0x00000010, 0x00000002, + 0x000001e8, 0x00000000, 0x6d616c63, 0x63003070, 0x706d616c, 0x6f630031, 0x00726f6c, 0x6f6c6f63, + 0x74003272, 0x666f5f63, 0x694d0066, 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, + 0x20726564, 0x706d6f43, 0x72656c69, 0x322e3920, 0x35392e39, 0x31332e32, 0xab003131, 0x4e475349, + 0x00000050, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, + 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, + 0x7469736f, 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, + 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, + 0x65677261, 0xabab0074, 0x52444853, 0x00000270, 0x00000040, 0x0000009c, 0x04000059, 0x00208e46, + 0x00000000, 0x00000001, 0x04000059, 0x00208e46, 0x00000001, 0x00000005, 0x0300005a, 0x00106000, + 0x00000000, 0x0300005a, 0x00106000, 0x00000001, 0x0300005a, 0x00106000, 0x00000002, 0x04001858, + 0x00107000, 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x04001858, + 0x00107000, 0x00000002, 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, 0x001020f2, + 0x00000000, 0x02000068, 0x00000002, 0x08000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, + 0x00208046, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, 0x00100012, 0x00000000, 0x0010003a, + 0x00000000, 0x0020802a, 0x00000001, 0x00000004, 0x07000033, 0x00100012, 0x00000000, 0x0010000a, + 0x00000000, 0x00004001, 0x3f800000, 0x05000036, 0x00100022, 0x00000000, 0x00004001, 0x3f000000, + 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000002, 0x00106000, + 0x00000002, 0x08000000, 0x00100082, 0x00000000, 0x8010003a, 0x00000041, 0x00000000, 0x00004001, + 0x3f800000, 0x08000034, 0x00100032, 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, + 0x00000001, 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, + 0x00000001, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000001, + 0x00106000, 0x00000001, 0x07000038, 0x00100072, 0x00000001, 0x00100ff6, 0x00000000, 0x00100246, + 0x00000001, 0x09000032, 0x00102072, 0x00000000, 0x00100246, 0x00000000, 0x00100ff6, 0x00000001, + 0x00100246, 0x00000001, 0x05000036, 0x00102082, 0x00000000, 0x0010003a, 0x00000001, 0x0100003e, + 0x54415453, 0x00000074, 0x00000010, 0x00000002, 0x00000000, 0x00000002, 0x00000009, 0x00000000, + 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_filter_7[401] = { + 0x43425844, 0x0439e6c7, 0xa22f2670, 0x44e3f549, 0xd957dde0, 0x00000001, 0x00000644, 0x00000005, + 0x00000034, 0x0000031c, 0x00000374, 0x000003a8, 0x000005c8, 0x46454452, 0x000002e0, 0x00000002, + 0x0000014c, 0x00000008, 0x0000001c, 0xffff0400, 0x00008100, 0x000002ae, 0x0000011c, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000123, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x0000012a, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x00000131, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x00000136, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x0000013b, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000002, 0x00000001, 0x0000000d, 0x00000140, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000144, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x5f730031, 0x32786574, 0x78657400, 0x65740030, 0x74003178, 0x00327865, 0x00635350, + 0x61726170, 0xababab00, 0x00000140, 0x00000004, 0x0000017c, 0x00000040, 0x00000000, 0x00000000, + 0x00000144, 0x00000005, 0x00000214, 0x00000050, 0x00000000, 0x00000000, 0x000001dc, 0x00000000, + 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000001f8, 0x00000010, 0x00000010, 0x00000000, + 0x000001e8, 0x00000000, 0x00000202, 0x00000020, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, + 0x00000208, 0x00000030, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x6f6c6f63, 0x756d5f72, + 0xabab006c, 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, + 0x006c6163, 0x63736572, 0x31656c61, 0xababab00, 0x0000028c, 0x00000000, 0x00000010, 0x00000002, + 0x000001e8, 0x00000000, 0x00000293, 0x00000010, 0x00000010, 0x00000002, 0x000001e8, 0x00000000, + 0x0000029a, 0x00000020, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000002a0, 0x00000030, + 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000002a7, 0x00000040, 0x00000010, 0x00000002, + 0x000001e8, 0x00000000, 0x6d616c63, 0x63003070, 0x706d616c, 0x6f630031, 0x00726f6c, 0x6f6c6f63, + 0x74003272, 0x666f5f63, 0x694d0066, 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, + 0x20726564, 0x706d6f43, 0x72656c69, 0x322e3920, 0x35392e39, 0x31332e32, 0xab003131, 0x4e475349, + 0x00000050, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, + 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, + 0x7469736f, 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, + 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, + 0x65677261, 0xabab0074, 0x52444853, 0x00000218, 0x00000040, 0x00000086, 0x04000059, 0x00208e46, + 0x00000000, 0x00000001, 0x04000059, 0x00208e46, 0x00000001, 0x00000005, 0x0300005a, 0x00106000, + 0x00000000, 0x0300005a, 0x00106000, 0x00000001, 0x0300005a, 0x00106000, 0x00000002, 0x04001858, + 0x00107000, 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x04001858, + 0x00107000, 0x00000002, 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, 0x001020f2, + 0x00000000, 0x02000068, 0x00000002, 0x08000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, + 0x00208046, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, 0x00100012, 0x00000000, 0x0010003a, + 0x00000000, 0x0020802a, 0x00000001, 0x00000004, 0x07000033, 0x00100012, 0x00000000, 0x0010000a, + 0x00000000, 0x00004001, 0x3f800000, 0x05000036, 0x00100022, 0x00000000, 0x00004001, 0x3f000000, + 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000002, 0x00106000, + 0x00000002, 0x08000034, 0x00100032, 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, + 0x00000001, 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, + 0x00000001, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000001, + 0x00106000, 0x00000001, 0x07000038, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x00100ff6, + 0x00000001, 0x0100003e, 0x54415453, 0x00000074, 0x0000000d, 0x00000002, 0x00000000, 0x00000002, + 0x00000008, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, +}; + +static DWORD pshader_filter_8[246] = { + 0x43425844, 0xd318033e, 0x780e8795, 0xb2e4d27b, 0x11bd4a8f, 0x00000001, 0x000003d8, 0x00000005, + 0x00000034, 0x000001c0, 0x00000218, 0x0000024c, 0x0000035c, 0x46454452, 0x00000184, 0x00000001, + 0x00000090, 0x00000003, 0x0000001c, 0xffff0400, 0x00008100, 0x00000153, 0x0000007c, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000083, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x00000088, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x74003178, + 0x00317865, 0x61726170, 0xababab00, 0x00000088, 0x00000005, 0x000000a8, 0x00000050, 0x00000000, + 0x00000000, 0x00000120, 0x00000000, 0x00000010, 0x00000000, 0x00000128, 0x00000000, 0x00000138, + 0x00000010, 0x00000010, 0x00000002, 0x00000128, 0x00000000, 0x0000013f, 0x00000020, 0x00000010, + 0x00000002, 0x00000128, 0x00000000, 0x00000145, 0x00000030, 0x00000010, 0x00000000, 0x00000128, + 0x00000000, 0x0000014c, 0x00000040, 0x00000010, 0x00000000, 0x00000128, 0x00000000, 0x6d616c63, + 0xab003070, 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6d616c63, 0x63003170, 0x726f6c6f, + 0x6c6f6300, 0x0032726f, 0x6f5f6374, 0x4d006666, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, + 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, + 0x4e475349, 0x00000050, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, + 0x00000000, 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, + 0x505f5653, 0x7469736f, 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, + 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, + 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000108, 0x00000040, 0x00000042, 0x04000059, + 0x00208e46, 0x00000001, 0x00000003, 0x0300005a, 0x00106000, 0x00000001, 0x04001858, 0x00107000, + 0x00000001, 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, + 0x02000068, 0x00000002, 0x08000034, 0x00100032, 0x00000000, 0x00101046, 0x00000001, 0x00208046, + 0x00000001, 0x00000001, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208ae6, + 0x00000001, 0x00000001, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, + 0x00000001, 0x00106000, 0x00000001, 0x09000000, 0x00100012, 0x00000001, 0x8020803a, 0x00000041, + 0x00000001, 0x00000002, 0x00004001, 0x3f800000, 0x0a000032, 0x001020f2, 0x00000000, 0x00100e46, + 0x00000000, 0x00100006, 0x00000001, 0x00208e46, 0x00000001, 0x00000002, 0x0100003e, 0x54415453, + 0x00000074, 0x00000006, 0x00000002, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000000, + 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_filter_9[177] = { + 0x43425844, 0x6be5959a, 0xfbf9f786, 0x3ad2a2c2, 0xed03ea11, 0x00000001, 0x000002c4, 0x00000005, + 0x00000034, 0x00000174, 0x000001cc, 0x00000200, 0x00000248, 0x46454452, 0x00000138, 0x00000001, + 0x00000044, 0x00000001, 0x0000001c, 0xffff0400, 0x00008100, 0x00000107, 0x0000003c, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x61726170, 0xababab00, + 0x0000003c, 0x00000005, 0x0000005c, 0x00000050, 0x00000000, 0x00000000, 0x000000d4, 0x00000000, + 0x00000010, 0x00000000, 0x000000dc, 0x00000000, 0x000000ec, 0x00000010, 0x00000010, 0x00000000, + 0x000000dc, 0x00000000, 0x000000f3, 0x00000020, 0x00000010, 0x00000002, 0x000000dc, 0x00000000, + 0x000000f9, 0x00000030, 0x00000010, 0x00000000, 0x000000dc, 0x00000000, 0x00000100, 0x00000040, + 0x00000010, 0x00000000, 0x000000dc, 0x00000000, 0x6d616c63, 0xab003070, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6d616c63, 0x63003170, 0x726f6c6f, 0x6c6f6300, 0x0032726f, 0x6f5f6374, + 0x4d006666, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, + 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x4e475349, 0x00000050, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000000f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, + 0x52444853, 0x00000040, 0x00000040, 0x00000010, 0x04000059, 0x00208e46, 0x00000001, 0x00000003, + 0x03000065, 0x001020f2, 0x00000000, 0x06000036, 0x001020f2, 0x00000000, 0x00208e46, 0x00000001, + 0x00000002, 0x0100003e, 0x54415453, 0x00000074, 0x00000002, 0x00000000, 0x00000000, 0x00000001, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, +}; + +static DWORD pshader_filter_10[411] = { + 0x43425844, 0x06c32e7c, 0xd1fa07e2, 0x2d208e5f, 0x5002e2cc, 0x00000001, 0x0000066c, 0x00000005, + 0x00000034, 0x0000031c, 0x00000374, 0x000003a8, 0x000005f0, 0x46454452, 0x000002e0, 0x00000002, + 0x0000014c, 0x00000008, 0x0000001c, 0xffff0400, 0x00008100, 0x000002ae, 0x0000011c, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000123, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x0000012a, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x00000131, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x00000136, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x0000013b, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000002, 0x00000001, 0x0000000d, 0x00000140, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000144, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x5f730031, 0x32786574, 0x78657400, 0x65740030, 0x74003178, 0x00327865, 0x00635350, + 0x61726170, 0xababab00, 0x00000140, 0x00000004, 0x0000017c, 0x00000040, 0x00000000, 0x00000000, + 0x00000144, 0x00000005, 0x00000214, 0x00000050, 0x00000000, 0x00000000, 0x000001dc, 0x00000000, + 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000001f8, 0x00000010, 0x00000010, 0x00000000, + 0x000001e8, 0x00000000, 0x00000202, 0x00000020, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, + 0x00000208, 0x00000030, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x6f6c6f63, 0x756d5f72, + 0xabab006c, 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, + 0x006c6163, 0x63736572, 0x31656c61, 0xababab00, 0x0000028c, 0x00000000, 0x00000010, 0x00000002, + 0x000001e8, 0x00000000, 0x00000293, 0x00000010, 0x00000010, 0x00000002, 0x000001e8, 0x00000000, + 0x0000029a, 0x00000020, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000002a0, 0x00000030, + 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000002a7, 0x00000040, 0x00000010, 0x00000002, + 0x000001e8, 0x00000000, 0x6d616c63, 0x63003070, 0x706d616c, 0x6f630031, 0x00726f6c, 0x6f6c6f63, + 0x74003272, 0x666f5f63, 0x694d0066, 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, + 0x20726564, 0x706d6f43, 0x72656c69, 0x322e3920, 0x35392e39, 0x31332e32, 0xab003131, 0x4e475349, + 0x00000050, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, + 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, + 0x7469736f, 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, + 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, + 0x65677261, 0xabab0074, 0x52444853, 0x00000240, 0x00000040, 0x00000090, 0x04000059, 0x00208e46, + 0x00000000, 0x00000001, 0x04000059, 0x00208e46, 0x00000001, 0x00000005, 0x0300005a, 0x00106000, + 0x00000000, 0x0300005a, 0x00106000, 0x00000001, 0x0300005a, 0x00106000, 0x00000002, 0x04001858, + 0x00107000, 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x04001858, + 0x00107000, 0x00000002, 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, 0x001020f2, + 0x00000000, 0x02000068, 0x00000003, 0x08000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, + 0x00208046, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, 0x00100012, 0x00000000, 0x0010003a, + 0x00000000, 0x0020802a, 0x00000001, 0x00000004, 0x07000033, 0x00100012, 0x00000000, 0x0010000a, + 0x00000000, 0x00004001, 0x3f800000, 0x05000036, 0x00100022, 0x00000000, 0x00004001, 0x3f000000, + 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000002, 0x00106000, + 0x00000002, 0x08000000, 0x00100012, 0x00000001, 0x8010003a, 0x00000041, 0x00000000, 0x00004001, + 0x3f800000, 0x08000034, 0x00100062, 0x00000001, 0x00101106, 0x00000001, 0x00208106, 0x00000001, + 0x00000001, 0x08000033, 0x00100062, 0x00000001, 0x00100656, 0x00000001, 0x00208ba6, 0x00000001, + 0x00000001, 0x09000045, 0x001000f2, 0x00000002, 0x00100596, 0x00000001, 0x00107e46, 0x00000001, + 0x00106000, 0x00000001, 0x09000032, 0x001020f2, 0x00000000, 0x00100e46, 0x00000002, 0x00100006, + 0x00000001, 0x00100e46, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, 0x0000000e, 0x00000003, + 0x00000000, 0x00000002, 0x00000008, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_filter_11[343] = { + 0x43425844, 0xba36eafb, 0x7eb5939c, 0xf32591ec, 0x30eeb32a, 0x00000001, 0x0000055c, 0x00000005, + 0x00000034, 0x000002d0, 0x00000328, 0x0000035c, 0x000004e0, 0x46454452, 0x00000294, 0x00000002, + 0x00000100, 0x00000006, 0x0000001c, 0xffff0400, 0x00008100, 0x00000262, 0x000000dc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000e3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x000000ea, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000ef, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000002, 0x00000001, 0x0000000d, 0x000000f4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000f8, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740032, 0x74003078, 0x00327865, 0x00635350, 0x61726170, 0xababab00, 0x000000f4, + 0x00000004, 0x00000130, 0x00000040, 0x00000000, 0x00000000, 0x000000f8, 0x00000005, 0x000001c8, + 0x00000050, 0x00000000, 0x00000000, 0x00000190, 0x00000000, 0x00000010, 0x00000000, 0x0000019c, + 0x00000000, 0x000001ac, 0x00000010, 0x00000010, 0x00000000, 0x0000019c, 0x00000000, 0x000001b6, + 0x00000020, 0x00000010, 0x00000000, 0x0000019c, 0x00000000, 0x000001bc, 0x00000030, 0x00000010, + 0x00000000, 0x0000019c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0xababab00, 0x00000240, 0x00000000, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x00000247, + 0x00000010, 0x00000010, 0x00000000, 0x0000019c, 0x00000000, 0x0000024e, 0x00000020, 0x00000010, + 0x00000000, 0x0000019c, 0x00000000, 0x00000254, 0x00000030, 0x00000010, 0x00000000, 0x0000019c, + 0x00000000, 0x0000025b, 0x00000040, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x6d616c63, + 0x63003070, 0x706d616c, 0x6f630031, 0x00726f6c, 0x6f6c6f63, 0x74003272, 0x666f5f63, 0x694d0066, + 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, + 0x322e3920, 0x35392e39, 0x31332e32, 0xab003131, 0x4e475349, 0x00000050, 0x00000002, 0x00000008, + 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, + 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, 0x43584554, + 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, + 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, + 0x0000017c, 0x00000040, 0x0000005f, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x04000059, + 0x00208e46, 0x00000001, 0x00000005, 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, + 0x00000002, 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000002, + 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, + 0x00000001, 0x08000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, 0x00208046, 0x00000001, + 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208046, 0x00000001, + 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208ae6, 0x00000001, + 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, + 0x00106000, 0x00000000, 0x08000038, 0x00100012, 0x00000000, 0x0010003a, 0x00000000, 0x0020802a, + 0x00000001, 0x00000004, 0x07000033, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x00004001, + 0x3f800000, 0x05000036, 0x00100022, 0x00000000, 0x00004001, 0x3f000000, 0x09000045, 0x001020f2, + 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000002, 0x00106000, 0x00000002, 0x0100003e, + 0x54415453, 0x00000074, 0x00000009, 0x00000001, 0x00000000, 0x00000002, 0x00000005, 0x00000000, + 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_filter_16[435] = { + 0x43425844, 0x6063564a, 0xa8def096, 0xcca0d8e9, 0xfad099ba, 0x00000001, 0x000006cc, 0x00000005, + 0x00000034, 0x000002d0, 0x00000328, 0x0000035c, 0x00000650, 0x46454452, 0x00000294, 0x00000002, + 0x00000100, 0x00000006, 0x0000001c, 0xffff0400, 0x00008100, 0x00000262, 0x000000dc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000e3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x000000ea, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000ef, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x000000f4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000f8, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x61726170, 0xababab00, 0x000000f4, + 0x00000004, 0x00000130, 0x00000040, 0x00000000, 0x00000000, 0x000000f8, 0x00000005, 0x000001c8, + 0x00000050, 0x00000000, 0x00000000, 0x00000190, 0x00000000, 0x00000010, 0x00000000, 0x0000019c, + 0x00000000, 0x000001ac, 0x00000010, 0x00000010, 0x00000000, 0x0000019c, 0x00000000, 0x000001b6, + 0x00000020, 0x00000010, 0x00000000, 0x0000019c, 0x00000000, 0x000001bc, 0x00000030, 0x00000010, + 0x00000000, 0x0000019c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0xababab00, 0x00000240, 0x00000000, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x00000247, + 0x00000010, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x0000024e, 0x00000020, 0x00000010, + 0x00000002, 0x0000019c, 0x00000000, 0x00000254, 0x00000030, 0x00000010, 0x00000002, 0x0000019c, + 0x00000000, 0x0000025b, 0x00000040, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x6d616c63, + 0x63003070, 0x706d616c, 0x6f630031, 0x00726f6c, 0x6f6c6f63, 0x74003272, 0x666f5f63, 0x694d0066, + 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, + 0x322e3920, 0x35392e39, 0x31332e32, 0xab003131, 0x4e475349, 0x00000050, 0x00000002, 0x00000008, + 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, + 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, 0x43584554, + 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, + 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, + 0x000002ec, 0x00000040, 0x000000bb, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x04000059, + 0x00208e46, 0x00000001, 0x00000005, 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, + 0x00000001, 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, + 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, + 0x00000003, 0x08000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, 0x00208046, 0x00000001, + 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208046, 0x00000001, + 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208ae6, 0x00000001, + 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, + 0x00106000, 0x00000000, 0x09000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, 0x80208046, + 0x00000041, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000000, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000000, 0x00100012, 0x00000000, 0x8010003a, + 0x00000041, 0x00000000, 0x0010003a, 0x00000001, 0x08000038, 0x00100012, 0x00000000, 0x0010000a, + 0x00000000, 0x0020802a, 0x00000001, 0x00000004, 0x05002036, 0x00100022, 0x00000000, 0x0010000a, + 0x00000000, 0x06002036, 0x00100012, 0x00000000, 0x8010000a, 0x00000041, 0x00000000, 0x08000038, + 0x001000f2, 0x00000001, 0x00100556, 0x00000000, 0x00208e46, 0x00000001, 0x00000003, 0x0a000032, + 0x001000f2, 0x00000000, 0x00100006, 0x00000000, 0x00208e46, 0x00000001, 0x00000002, 0x00100e46, + 0x00000001, 0x08000034, 0x00100032, 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, + 0x00000001, 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, + 0x00000001, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000001, + 0x00106000, 0x00000001, 0x08000000, 0x00100012, 0x00000002, 0x8010003a, 0x00000041, 0x00000001, + 0x00004001, 0x3f800000, 0x09000032, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x00100006, + 0x00000002, 0x00100e46, 0x00000001, 0x0100003e, 0x54415453, 0x00000074, 0x00000014, 0x00000003, + 0x00000000, 0x00000002, 0x0000000c, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_filter_17[433] = { + 0x43425844, 0x9d251e4d, 0x6df18823, 0x51817ea5, 0xa8eeefd8, 0x00000001, 0x000006c4, 0x00000005, + 0x00000034, 0x000002d0, 0x00000328, 0x0000035c, 0x00000648, 0x46454452, 0x00000294, 0x00000002, + 0x00000100, 0x00000006, 0x0000001c, 0xffff0400, 0x00008100, 0x00000262, 0x000000dc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000e3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x000000ea, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000ef, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x000000f4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000f8, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x61726170, 0xababab00, 0x000000f4, + 0x00000004, 0x00000130, 0x00000040, 0x00000000, 0x00000000, 0x000000f8, 0x00000005, 0x000001c8, + 0x00000050, 0x00000000, 0x00000000, 0x00000190, 0x00000000, 0x00000010, 0x00000000, 0x0000019c, + 0x00000000, 0x000001ac, 0x00000010, 0x00000010, 0x00000000, 0x0000019c, 0x00000000, 0x000001b6, + 0x00000020, 0x00000010, 0x00000000, 0x0000019c, 0x00000000, 0x000001bc, 0x00000030, 0x00000010, + 0x00000000, 0x0000019c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0xababab00, 0x00000240, 0x00000000, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x00000247, + 0x00000010, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x0000024e, 0x00000020, 0x00000010, + 0x00000002, 0x0000019c, 0x00000000, 0x00000254, 0x00000030, 0x00000010, 0x00000002, 0x0000019c, + 0x00000000, 0x0000025b, 0x00000040, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x6d616c63, + 0x63003070, 0x706d616c, 0x6f630031, 0x00726f6c, 0x6f6c6f63, 0x74003272, 0x666f5f63, 0x694d0066, + 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, + 0x322e3920, 0x35392e39, 0x31332e32, 0xab003131, 0x4e475349, 0x00000050, 0x00000002, 0x00000008, + 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, + 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, 0x43584554, + 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, + 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, + 0x000002e4, 0x00000040, 0x000000b9, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x04000059, + 0x00208e46, 0x00000001, 0x00000005, 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, + 0x00000001, 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, + 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, + 0x00000002, 0x08000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, 0x00208046, 0x00000001, + 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208046, 0x00000001, + 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208ae6, 0x00000001, + 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, + 0x00106000, 0x00000000, 0x09000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, 0x80208046, + 0x00000041, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000000, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000000, 0x00100012, 0x00000000, 0x8010003a, + 0x00000041, 0x00000000, 0x0010003a, 0x00000001, 0x08000038, 0x00100012, 0x00000000, 0x0010000a, + 0x00000000, 0x0020802a, 0x00000001, 0x00000004, 0x05002036, 0x00100022, 0x00000000, 0x0010000a, + 0x00000000, 0x06002036, 0x00100012, 0x00000000, 0x8010000a, 0x00000041, 0x00000000, 0x08000038, + 0x001000f2, 0x00000001, 0x00100556, 0x00000000, 0x00208e46, 0x00000001, 0x00000003, 0x0a000032, + 0x001000f2, 0x00000000, 0x00100006, 0x00000000, 0x00208e46, 0x00000001, 0x00000002, 0x00100e46, + 0x00000001, 0x08000034, 0x00100032, 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, + 0x00000001, 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, + 0x00000001, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000001, + 0x00106000, 0x00000001, 0x08000000, 0x00100012, 0x00000001, 0x8010003a, 0x00000041, 0x00000001, + 0x00004001, 0x3f800000, 0x07000038, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x00100006, + 0x00000001, 0x0100003e, 0x54415453, 0x00000074, 0x00000014, 0x00000002, 0x00000000, 0x00000002, + 0x0000000d, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, +}; + +static DWORD pshader_filter_18[455] = { + 0x43425844, 0x01fc38b9, 0x9e8809ca, 0x9767109e, 0x3100f672, 0x00000001, 0x0000071c, 0x00000005, + 0x00000034, 0x0000031c, 0x00000374, 0x000003a8, 0x000006a0, 0x46454452, 0x000002e0, 0x00000002, + 0x0000014c, 0x00000008, 0x0000001c, 0xffff0400, 0x00008100, 0x000002ae, 0x0000011c, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000123, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x0000012a, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x00000131, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x00000136, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x0000013b, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000002, 0x00000001, 0x0000000d, 0x00000140, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000144, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x5f730031, 0x32786574, 0x78657400, 0x65740030, 0x74003178, 0x00327865, 0x00635350, + 0x61726170, 0xababab00, 0x00000140, 0x00000004, 0x0000017c, 0x00000040, 0x00000000, 0x00000000, + 0x00000144, 0x00000005, 0x00000214, 0x00000050, 0x00000000, 0x00000000, 0x000001dc, 0x00000000, + 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000001f8, 0x00000010, 0x00000010, 0x00000000, + 0x000001e8, 0x00000000, 0x00000202, 0x00000020, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, + 0x00000208, 0x00000030, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x6f6c6f63, 0x756d5f72, + 0xabab006c, 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, + 0x006c6163, 0x63736572, 0x31656c61, 0xababab00, 0x0000028c, 0x00000000, 0x00000010, 0x00000002, + 0x000001e8, 0x00000000, 0x00000293, 0x00000010, 0x00000010, 0x00000002, 0x000001e8, 0x00000000, + 0x0000029a, 0x00000020, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000002a0, 0x00000030, + 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000002a7, 0x00000040, 0x00000010, 0x00000002, + 0x000001e8, 0x00000000, 0x6d616c63, 0x63003070, 0x706d616c, 0x6f630031, 0x00726f6c, 0x6f6c6f63, + 0x74003272, 0x666f5f63, 0x694d0066, 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, + 0x20726564, 0x706d6f43, 0x72656c69, 0x322e3920, 0x35392e39, 0x31332e32, 0xab003131, 0x4e475349, + 0x00000050, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, + 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, + 0x7469736f, 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, + 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, + 0x65677261, 0xabab0074, 0x52444853, 0x000002f0, 0x00000040, 0x000000bc, 0x04000059, 0x00208e46, + 0x00000000, 0x00000001, 0x04000059, 0x00208e46, 0x00000001, 0x00000005, 0x0300005a, 0x00106000, + 0x00000000, 0x0300005a, 0x00106000, 0x00000001, 0x0300005a, 0x00106000, 0x00000002, 0x04001858, + 0x00107000, 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x04001858, + 0x00107000, 0x00000002, 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, 0x001020f2, + 0x00000000, 0x02000068, 0x00000003, 0x08000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, + 0x00208046, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x09000000, 0x00100032, 0x00000000, 0x00101046, + 0x00000001, 0x80208046, 0x00000041, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000000, + 0x00100046, 0x00000000, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, + 0x00100046, 0x00000000, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, + 0x00100046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000000, 0x00100012, + 0x00000000, 0x8010003a, 0x00000041, 0x00000000, 0x0010003a, 0x00000001, 0x08000038, 0x00100012, + 0x00000000, 0x0010000a, 0x00000000, 0x0020802a, 0x00000001, 0x00000004, 0x09002032, 0x00100012, + 0x00000000, 0x0010000a, 0x00000000, 0x00004001, 0x3f000000, 0x00004001, 0x3f000000, 0x05000036, + 0x00100022, 0x00000000, 0x00004001, 0x3f000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, + 0x00000000, 0x00107e46, 0x00000002, 0x00106000, 0x00000002, 0x08000034, 0x00100032, 0x00000001, + 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000001, 0x08000033, 0x00100032, 0x00000001, + 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000001, 0x09000045, 0x001000f2, 0x00000001, + 0x00100046, 0x00000001, 0x00107e46, 0x00000001, 0x00106000, 0x00000001, 0x08000000, 0x00100012, + 0x00000002, 0x8010003a, 0x00000041, 0x00000001, 0x00004001, 0x3f800000, 0x09000032, 0x001020f2, + 0x00000000, 0x00100e46, 0x00000000, 0x00100006, 0x00000002, 0x00100e46, 0x00000001, 0x0100003e, + 0x54415453, 0x00000074, 0x00000013, 0x00000003, 0x00000000, 0x00000002, 0x0000000b, 0x00000000, + 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_filter_19[453] = { + 0x43425844, 0x93b178e0, 0xac5fae3d, 0x5854ccdb, 0x646aa2b1, 0x00000001, 0x00000714, 0x00000005, + 0x00000034, 0x0000031c, 0x00000374, 0x000003a8, 0x00000698, 0x46454452, 0x000002e0, 0x00000002, + 0x0000014c, 0x00000008, 0x0000001c, 0xffff0400, 0x00008100, 0x000002ae, 0x0000011c, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000123, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x0000012a, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x00000131, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x00000136, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x0000013b, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000002, 0x00000001, 0x0000000d, 0x00000140, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000144, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x5f730031, 0x32786574, 0x78657400, 0x65740030, 0x74003178, 0x00327865, 0x00635350, + 0x61726170, 0xababab00, 0x00000140, 0x00000004, 0x0000017c, 0x00000040, 0x00000000, 0x00000000, + 0x00000144, 0x00000005, 0x00000214, 0x00000050, 0x00000000, 0x00000000, 0x000001dc, 0x00000000, + 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000001f8, 0x00000010, 0x00000010, 0x00000000, + 0x000001e8, 0x00000000, 0x00000202, 0x00000020, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, + 0x00000208, 0x00000030, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x6f6c6f63, 0x756d5f72, + 0xabab006c, 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, + 0x006c6163, 0x63736572, 0x31656c61, 0xababab00, 0x0000028c, 0x00000000, 0x00000010, 0x00000002, + 0x000001e8, 0x00000000, 0x00000293, 0x00000010, 0x00000010, 0x00000002, 0x000001e8, 0x00000000, + 0x0000029a, 0x00000020, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000002a0, 0x00000030, + 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000002a7, 0x00000040, 0x00000010, 0x00000002, + 0x000001e8, 0x00000000, 0x6d616c63, 0x63003070, 0x706d616c, 0x6f630031, 0x00726f6c, 0x6f6c6f63, + 0x74003272, 0x666f5f63, 0x694d0066, 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, + 0x20726564, 0x706d6f43, 0x72656c69, 0x322e3920, 0x35392e39, 0x31332e32, 0xab003131, 0x4e475349, + 0x00000050, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, + 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, + 0x7469736f, 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, + 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, + 0x65677261, 0xabab0074, 0x52444853, 0x000002e8, 0x00000040, 0x000000ba, 0x04000059, 0x00208e46, + 0x00000000, 0x00000001, 0x04000059, 0x00208e46, 0x00000001, 0x00000005, 0x0300005a, 0x00106000, + 0x00000000, 0x0300005a, 0x00106000, 0x00000001, 0x0300005a, 0x00106000, 0x00000002, 0x04001858, + 0x00107000, 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x04001858, + 0x00107000, 0x00000002, 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, 0x001020f2, + 0x00000000, 0x02000068, 0x00000002, 0x08000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, + 0x00208046, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x09000000, 0x00100032, 0x00000000, 0x00101046, + 0x00000001, 0x80208046, 0x00000041, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000000, + 0x00100046, 0x00000000, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, + 0x00100046, 0x00000000, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, + 0x00100046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000000, 0x00100012, + 0x00000000, 0x8010003a, 0x00000041, 0x00000000, 0x0010003a, 0x00000001, 0x08000038, 0x00100012, + 0x00000000, 0x0010000a, 0x00000000, 0x0020802a, 0x00000001, 0x00000004, 0x09002032, 0x00100012, + 0x00000000, 0x0010000a, 0x00000000, 0x00004001, 0x3f000000, 0x00004001, 0x3f000000, 0x05000036, + 0x00100022, 0x00000000, 0x00004001, 0x3f000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, + 0x00000000, 0x00107e46, 0x00000002, 0x00106000, 0x00000002, 0x08000034, 0x00100032, 0x00000001, + 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000001, 0x08000033, 0x00100032, 0x00000001, + 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000001, 0x09000045, 0x001000f2, 0x00000001, + 0x00100046, 0x00000001, 0x00107e46, 0x00000001, 0x00106000, 0x00000001, 0x08000000, 0x00100012, + 0x00000001, 0x8010003a, 0x00000041, 0x00000001, 0x00004001, 0x3f800000, 0x07000038, 0x001020f2, + 0x00000000, 0x00100e46, 0x00000000, 0x00100006, 0x00000001, 0x0100003e, 0x54415453, 0x00000074, + 0x00000013, 0x00000002, 0x00000000, 0x00000002, 0x0000000c, 0x00000000, 0x00000000, 0x00000001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_filter_20[447] = { + 0x43425844, 0x9a125209, 0xf5c56096, 0xd7eccf22, 0x9fa5961c, 0x00000001, 0x000006fc, 0x00000005, + 0x00000034, 0x000002d0, 0x00000328, 0x0000035c, 0x00000680, 0x46454452, 0x00000294, 0x00000002, + 0x00000100, 0x00000006, 0x0000001c, 0xffff0400, 0x00008100, 0x00000262, 0x000000dc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000e3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x000000ea, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000ef, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x000000f4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000f8, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x61726170, 0xababab00, 0x000000f4, + 0x00000004, 0x00000130, 0x00000040, 0x00000000, 0x00000000, 0x000000f8, 0x00000005, 0x000001c8, + 0x00000050, 0x00000000, 0x00000000, 0x00000190, 0x00000000, 0x00000010, 0x00000000, 0x0000019c, + 0x00000000, 0x000001ac, 0x00000010, 0x00000010, 0x00000000, 0x0000019c, 0x00000000, 0x000001b6, + 0x00000020, 0x00000010, 0x00000000, 0x0000019c, 0x00000000, 0x000001bc, 0x00000030, 0x00000010, + 0x00000000, 0x0000019c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0xababab00, 0x00000240, 0x00000000, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x00000247, + 0x00000010, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x0000024e, 0x00000020, 0x00000010, + 0x00000002, 0x0000019c, 0x00000000, 0x00000254, 0x00000030, 0x00000010, 0x00000002, 0x0000019c, + 0x00000000, 0x0000025b, 0x00000040, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x6d616c63, + 0x63003070, 0x706d616c, 0x6f630031, 0x00726f6c, 0x6f6c6f63, 0x74003272, 0x666f5f63, 0x694d0066, + 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, + 0x322e3920, 0x35392e39, 0x31332e32, 0xab003131, 0x4e475349, 0x00000050, 0x00000002, 0x00000008, + 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, + 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, 0x43584554, + 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, + 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, + 0x0000031c, 0x00000040, 0x000000c7, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x04000059, + 0x00208e46, 0x00000001, 0x00000005, 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, + 0x00000001, 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, + 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, + 0x00000002, 0x08000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, 0x00208046, 0x00000001, + 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208046, 0x00000001, + 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208ae6, 0x00000001, + 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, + 0x00106000, 0x00000000, 0x09000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, 0x80208046, + 0x00000041, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000000, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000000, 0x00100012, 0x00000000, 0x8010003a, + 0x00000041, 0x00000000, 0x0010003a, 0x00000001, 0x08000038, 0x00100012, 0x00000000, 0x0010000a, + 0x00000000, 0x0020802a, 0x00000001, 0x00000004, 0x05002036, 0x00100022, 0x00000000, 0x0010000a, + 0x00000000, 0x06002036, 0x00100012, 0x00000000, 0x8010000a, 0x00000041, 0x00000000, 0x08000038, + 0x001000f2, 0x00000001, 0x00100556, 0x00000000, 0x00208e46, 0x00000001, 0x00000003, 0x0a000032, + 0x001000f2, 0x00000000, 0x00100006, 0x00000000, 0x00208e46, 0x00000001, 0x00000002, 0x00100e46, + 0x00000001, 0x08000000, 0x00100082, 0x00000000, 0x8010003a, 0x00000041, 0x00000000, 0x00004001, + 0x3f800000, 0x08000034, 0x00100032, 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, + 0x00000001, 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, + 0x00000001, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000001, + 0x00106000, 0x00000001, 0x07000038, 0x00100072, 0x00000001, 0x00100ff6, 0x00000000, 0x00100246, + 0x00000001, 0x09000032, 0x00102072, 0x00000000, 0x00100246, 0x00000000, 0x00100ff6, 0x00000001, + 0x00100246, 0x00000001, 0x05000036, 0x00102082, 0x00000000, 0x0010003a, 0x00000001, 0x0100003e, + 0x54415453, 0x00000074, 0x00000016, 0x00000002, 0x00000000, 0x00000002, 0x0000000d, 0x00000000, + 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_filter_21[425] = { + 0x43425844, 0x893ebdf3, 0x678513c8, 0xea77bccb, 0x915f5370, 0x00000001, 0x000006a4, 0x00000005, + 0x00000034, 0x000002d0, 0x00000328, 0x0000035c, 0x00000628, 0x46454452, 0x00000294, 0x00000002, + 0x00000100, 0x00000006, 0x0000001c, 0xffff0400, 0x00008100, 0x00000262, 0x000000dc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000e3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x000000ea, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000ef, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x000000f4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000f8, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x61726170, 0xababab00, 0x000000f4, + 0x00000004, 0x00000130, 0x00000040, 0x00000000, 0x00000000, 0x000000f8, 0x00000005, 0x000001c8, + 0x00000050, 0x00000000, 0x00000000, 0x00000190, 0x00000000, 0x00000010, 0x00000000, 0x0000019c, + 0x00000000, 0x000001ac, 0x00000010, 0x00000010, 0x00000000, 0x0000019c, 0x00000000, 0x000001b6, + 0x00000020, 0x00000010, 0x00000000, 0x0000019c, 0x00000000, 0x000001bc, 0x00000030, 0x00000010, + 0x00000000, 0x0000019c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0xababab00, 0x00000240, 0x00000000, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x00000247, + 0x00000010, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x0000024e, 0x00000020, 0x00000010, + 0x00000002, 0x0000019c, 0x00000000, 0x00000254, 0x00000030, 0x00000010, 0x00000002, 0x0000019c, + 0x00000000, 0x0000025b, 0x00000040, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x6d616c63, + 0x63003070, 0x706d616c, 0x6f630031, 0x00726f6c, 0x6f6c6f63, 0x74003272, 0x666f5f63, 0x694d0066, + 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, + 0x322e3920, 0x35392e39, 0x31332e32, 0xab003131, 0x4e475349, 0x00000050, 0x00000002, 0x00000008, + 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, + 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, 0x43584554, + 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, + 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, + 0x000002c4, 0x00000040, 0x000000b1, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x04000059, + 0x00208e46, 0x00000001, 0x00000005, 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, + 0x00000001, 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, + 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, + 0x00000002, 0x08000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, 0x00208046, 0x00000001, + 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208046, 0x00000001, + 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208ae6, 0x00000001, + 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, + 0x00106000, 0x00000000, 0x09000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, 0x80208046, + 0x00000041, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000000, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000000, 0x00100012, 0x00000000, 0x8010003a, + 0x00000041, 0x00000000, 0x0010003a, 0x00000001, 0x08000038, 0x00100012, 0x00000000, 0x0010000a, + 0x00000000, 0x0020802a, 0x00000001, 0x00000004, 0x05002036, 0x00100022, 0x00000000, 0x0010000a, + 0x00000000, 0x06002036, 0x00100012, 0x00000000, 0x8010000a, 0x00000041, 0x00000000, 0x08000038, + 0x001000f2, 0x00000001, 0x00100556, 0x00000000, 0x00208e46, 0x00000001, 0x00000003, 0x0a000032, + 0x001000f2, 0x00000000, 0x00100006, 0x00000000, 0x00208e46, 0x00000001, 0x00000002, 0x00100e46, + 0x00000001, 0x08000034, 0x00100032, 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, + 0x00000001, 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, + 0x00000001, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000001, + 0x00106000, 0x00000001, 0x07000038, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x00100ff6, + 0x00000001, 0x0100003e, 0x54415453, 0x00000074, 0x00000013, 0x00000002, 0x00000000, 0x00000002, + 0x0000000c, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, +}; + +static DWORD pshader_filter_22[467] = { + 0x43425844, 0x2b2ebefd, 0x99c6691a, 0xf5589278, 0x00bf4796, 0x00000001, 0x0000074c, 0x00000005, + 0x00000034, 0x0000031c, 0x00000374, 0x000003a8, 0x000006d0, 0x46454452, 0x000002e0, 0x00000002, + 0x0000014c, 0x00000008, 0x0000001c, 0xffff0400, 0x00008100, 0x000002ae, 0x0000011c, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000123, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x0000012a, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x00000131, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x00000136, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x0000013b, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000002, 0x00000001, 0x0000000d, 0x00000140, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000144, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x5f730031, 0x32786574, 0x78657400, 0x65740030, 0x74003178, 0x00327865, 0x00635350, + 0x61726170, 0xababab00, 0x00000140, 0x00000004, 0x0000017c, 0x00000040, 0x00000000, 0x00000000, + 0x00000144, 0x00000005, 0x00000214, 0x00000050, 0x00000000, 0x00000000, 0x000001dc, 0x00000000, + 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000001f8, 0x00000010, 0x00000010, 0x00000000, + 0x000001e8, 0x00000000, 0x00000202, 0x00000020, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, + 0x00000208, 0x00000030, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x6f6c6f63, 0x756d5f72, + 0xabab006c, 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, + 0x006c6163, 0x63736572, 0x31656c61, 0xababab00, 0x0000028c, 0x00000000, 0x00000010, 0x00000002, + 0x000001e8, 0x00000000, 0x00000293, 0x00000010, 0x00000010, 0x00000002, 0x000001e8, 0x00000000, + 0x0000029a, 0x00000020, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000002a0, 0x00000030, + 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000002a7, 0x00000040, 0x00000010, 0x00000002, + 0x000001e8, 0x00000000, 0x6d616c63, 0x63003070, 0x706d616c, 0x6f630031, 0x00726f6c, 0x6f6c6f63, + 0x74003272, 0x666f5f63, 0x694d0066, 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, + 0x20726564, 0x706d6f43, 0x72656c69, 0x322e3920, 0x35392e39, 0x31332e32, 0xab003131, 0x4e475349, + 0x00000050, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, + 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, + 0x7469736f, 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, + 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, + 0x65677261, 0xabab0074, 0x52444853, 0x00000320, 0x00000040, 0x000000c8, 0x04000059, 0x00208e46, + 0x00000000, 0x00000001, 0x04000059, 0x00208e46, 0x00000001, 0x00000005, 0x0300005a, 0x00106000, + 0x00000000, 0x0300005a, 0x00106000, 0x00000001, 0x0300005a, 0x00106000, 0x00000002, 0x04001858, + 0x00107000, 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x04001858, + 0x00107000, 0x00000002, 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, 0x001020f2, + 0x00000000, 0x02000068, 0x00000002, 0x08000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, + 0x00208046, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x09000000, 0x00100032, 0x00000000, 0x00101046, + 0x00000001, 0x80208046, 0x00000041, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000000, + 0x00100046, 0x00000000, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, + 0x00100046, 0x00000000, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, + 0x00100046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000000, 0x00100012, + 0x00000000, 0x8010003a, 0x00000041, 0x00000000, 0x0010003a, 0x00000001, 0x08000038, 0x00100012, + 0x00000000, 0x0010000a, 0x00000000, 0x0020802a, 0x00000001, 0x00000004, 0x09002032, 0x00100012, + 0x00000000, 0x0010000a, 0x00000000, 0x00004001, 0x3f000000, 0x00004001, 0x3f000000, 0x05000036, + 0x00100022, 0x00000000, 0x00004001, 0x3f000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, + 0x00000000, 0x00107e46, 0x00000002, 0x00106000, 0x00000002, 0x08000000, 0x00100082, 0x00000000, + 0x8010003a, 0x00000041, 0x00000000, 0x00004001, 0x3f800000, 0x08000034, 0x00100032, 0x00000001, + 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000001, 0x08000033, 0x00100032, 0x00000001, + 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000001, 0x09000045, 0x001000f2, 0x00000001, + 0x00100046, 0x00000001, 0x00107e46, 0x00000001, 0x00106000, 0x00000001, 0x07000038, 0x00100072, + 0x00000001, 0x00100ff6, 0x00000000, 0x00100246, 0x00000001, 0x09000032, 0x00102072, 0x00000000, + 0x00100246, 0x00000000, 0x00100ff6, 0x00000001, 0x00100246, 0x00000001, 0x05000036, 0x00102082, + 0x00000000, 0x0010003a, 0x00000001, 0x0100003e, 0x54415453, 0x00000074, 0x00000015, 0x00000002, + 0x00000000, 0x00000002, 0x0000000c, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_filter_23[445] = { + 0x43425844, 0xc733b29b, 0xcc301191, 0xb70dd0eb, 0xb530bacb, 0x00000001, 0x000006f4, 0x00000005, + 0x00000034, 0x0000031c, 0x00000374, 0x000003a8, 0x00000678, 0x46454452, 0x000002e0, 0x00000002, + 0x0000014c, 0x00000008, 0x0000001c, 0xffff0400, 0x00008100, 0x000002ae, 0x0000011c, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000123, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x0000012a, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x00000131, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x00000136, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x0000013b, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000002, 0x00000001, 0x0000000d, 0x00000140, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000144, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x5f730031, 0x32786574, 0x78657400, 0x65740030, 0x74003178, 0x00327865, 0x00635350, + 0x61726170, 0xababab00, 0x00000140, 0x00000004, 0x0000017c, 0x00000040, 0x00000000, 0x00000000, + 0x00000144, 0x00000005, 0x00000214, 0x00000050, 0x00000000, 0x00000000, 0x000001dc, 0x00000000, + 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000001f8, 0x00000010, 0x00000010, 0x00000000, + 0x000001e8, 0x00000000, 0x00000202, 0x00000020, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, + 0x00000208, 0x00000030, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x6f6c6f63, 0x756d5f72, + 0xabab006c, 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, + 0x006c6163, 0x63736572, 0x31656c61, 0xababab00, 0x0000028c, 0x00000000, 0x00000010, 0x00000002, + 0x000001e8, 0x00000000, 0x00000293, 0x00000010, 0x00000010, 0x00000002, 0x000001e8, 0x00000000, + 0x0000029a, 0x00000020, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000002a0, 0x00000030, + 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000002a7, 0x00000040, 0x00000010, 0x00000002, + 0x000001e8, 0x00000000, 0x6d616c63, 0x63003070, 0x706d616c, 0x6f630031, 0x00726f6c, 0x6f6c6f63, + 0x74003272, 0x666f5f63, 0x694d0066, 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, + 0x20726564, 0x706d6f43, 0x72656c69, 0x322e3920, 0x35392e39, 0x31332e32, 0xab003131, 0x4e475349, + 0x00000050, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, + 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, + 0x7469736f, 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, + 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, + 0x65677261, 0xabab0074, 0x52444853, 0x000002c8, 0x00000040, 0x000000b2, 0x04000059, 0x00208e46, + 0x00000000, 0x00000001, 0x04000059, 0x00208e46, 0x00000001, 0x00000005, 0x0300005a, 0x00106000, + 0x00000000, 0x0300005a, 0x00106000, 0x00000001, 0x0300005a, 0x00106000, 0x00000002, 0x04001858, + 0x00107000, 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x04001858, + 0x00107000, 0x00000002, 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, 0x001020f2, + 0x00000000, 0x02000068, 0x00000002, 0x08000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, + 0x00208046, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x09000000, 0x00100032, 0x00000000, 0x00101046, + 0x00000001, 0x80208046, 0x00000041, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000000, + 0x00100046, 0x00000000, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, + 0x00100046, 0x00000000, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, + 0x00100046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000000, 0x00100012, + 0x00000000, 0x8010003a, 0x00000041, 0x00000000, 0x0010003a, 0x00000001, 0x08000038, 0x00100012, + 0x00000000, 0x0010000a, 0x00000000, 0x0020802a, 0x00000001, 0x00000004, 0x09002032, 0x00100012, + 0x00000000, 0x0010000a, 0x00000000, 0x00004001, 0x3f000000, 0x00004001, 0x3f000000, 0x05000036, + 0x00100022, 0x00000000, 0x00004001, 0x3f000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, + 0x00000000, 0x00107e46, 0x00000002, 0x00106000, 0x00000002, 0x08000034, 0x00100032, 0x00000001, + 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000001, 0x08000033, 0x00100032, 0x00000001, + 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000001, 0x09000045, 0x001000f2, 0x00000001, + 0x00100046, 0x00000001, 0x00107e46, 0x00000001, 0x00106000, 0x00000001, 0x07000038, 0x001020f2, + 0x00000000, 0x00100e46, 0x00000000, 0x00100ff6, 0x00000001, 0x0100003e, 0x54415453, 0x00000074, + 0x00000012, 0x00000002, 0x00000000, 0x00000002, 0x0000000b, 0x00000000, 0x00000000, 0x00000001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_filter_24[435] = { + 0x43425844, 0x19fff495, 0xbd100eb6, 0x9012a014, 0xcb173d4f, 0x00000001, 0x000006cc, 0x00000005, + 0x00000034, 0x000002d0, 0x00000328, 0x0000035c, 0x00000650, 0x46454452, 0x00000294, 0x00000002, + 0x00000100, 0x00000006, 0x0000001c, 0xffff0400, 0x00008100, 0x00000262, 0x000000dc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000e3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x000000ea, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000ef, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x000000f4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000f8, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740031, 0x74003078, 0x00317865, 0x00635350, 0x61726170, 0xababab00, 0x000000f4, + 0x00000004, 0x00000130, 0x00000040, 0x00000000, 0x00000000, 0x000000f8, 0x00000005, 0x000001c8, + 0x00000050, 0x00000000, 0x00000000, 0x00000190, 0x00000000, 0x00000010, 0x00000000, 0x0000019c, + 0x00000000, 0x000001ac, 0x00000010, 0x00000010, 0x00000000, 0x0000019c, 0x00000000, 0x000001b6, + 0x00000020, 0x00000010, 0x00000000, 0x0000019c, 0x00000000, 0x000001bc, 0x00000030, 0x00000010, + 0x00000000, 0x0000019c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0xababab00, 0x00000240, 0x00000000, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x00000247, + 0x00000010, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x0000024e, 0x00000020, 0x00000010, + 0x00000002, 0x0000019c, 0x00000000, 0x00000254, 0x00000030, 0x00000010, 0x00000002, 0x0000019c, + 0x00000000, 0x0000025b, 0x00000040, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x6d616c63, + 0x63003070, 0x706d616c, 0x6f630031, 0x00726f6c, 0x6f6c6f63, 0x74003272, 0x666f5f63, 0x694d0066, + 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, + 0x322e3920, 0x35392e39, 0x31332e32, 0xab003131, 0x4e475349, 0x00000050, 0x00000002, 0x00000008, + 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, + 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, 0x43584554, + 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, + 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, + 0x000002ec, 0x00000040, 0x000000bb, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x04000059, + 0x00208e46, 0x00000001, 0x00000005, 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, + 0x00000001, 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, + 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, + 0x00000003, 0x08000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, 0x00208046, 0x00000001, + 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208046, 0x00000001, + 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208ae6, 0x00000001, + 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, + 0x00106000, 0x00000000, 0x09000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, 0x80208046, + 0x00000041, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000000, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000000, 0x00100012, 0x00000000, 0x8010003a, + 0x00000041, 0x00000000, 0x0010003a, 0x00000001, 0x08000038, 0x00100012, 0x00000000, 0x0010000a, + 0x00000000, 0x0020802a, 0x00000001, 0x00000004, 0x05002036, 0x00100022, 0x00000000, 0x0010000a, + 0x00000000, 0x06002036, 0x00100012, 0x00000000, 0x8010000a, 0x00000041, 0x00000000, 0x08000038, + 0x001000f2, 0x00000001, 0x00100556, 0x00000000, 0x00208e46, 0x00000001, 0x00000003, 0x0a000032, + 0x001000f2, 0x00000000, 0x00100006, 0x00000000, 0x00208e46, 0x00000001, 0x00000002, 0x00100e46, + 0x00000001, 0x08000000, 0x00100012, 0x00000001, 0x8010003a, 0x00000041, 0x00000000, 0x00004001, + 0x3f800000, 0x08000034, 0x00100062, 0x00000001, 0x00101106, 0x00000001, 0x00208106, 0x00000001, + 0x00000001, 0x08000033, 0x00100062, 0x00000001, 0x00100656, 0x00000001, 0x00208ba6, 0x00000001, + 0x00000001, 0x09000045, 0x001000f2, 0x00000002, 0x00100596, 0x00000001, 0x00107e46, 0x00000001, + 0x00106000, 0x00000001, 0x09000032, 0x001020f2, 0x00000000, 0x00100e46, 0x00000002, 0x00100006, + 0x00000001, 0x00100e46, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, 0x00000014, 0x00000003, + 0x00000000, 0x00000002, 0x0000000c, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_filter_25[367] = { + 0x43425844, 0x23e9ff30, 0xa49b9308, 0xc4b02a07, 0xfe240ca9, 0x00000001, 0x000005bc, 0x00000005, + 0x00000034, 0x00000284, 0x000002dc, 0x00000310, 0x00000540, 0x46454452, 0x00000248, 0x00000002, + 0x000000b4, 0x00000004, 0x0000001c, 0xffff0400, 0x00008100, 0x00000216, 0x0000009c, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000a3, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000a8, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000ac, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x74003078, + 0x00307865, 0x00635350, 0x61726170, 0xababab00, 0x000000a8, 0x00000004, 0x000000e4, 0x00000040, + 0x00000000, 0x00000000, 0x000000ac, 0x00000005, 0x0000017c, 0x00000050, 0x00000000, 0x00000000, + 0x00000144, 0x00000000, 0x00000010, 0x00000000, 0x00000150, 0x00000000, 0x00000160, 0x00000010, + 0x00000010, 0x00000000, 0x00000150, 0x00000000, 0x0000016a, 0x00000020, 0x00000010, 0x00000000, + 0x00000150, 0x00000000, 0x00000170, 0x00000030, 0x00000010, 0x00000000, 0x00000150, 0x00000000, + 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6f6c6f63, + 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, 0xababab00, 0x000001f4, 0x00000000, + 0x00000010, 0x00000002, 0x00000150, 0x00000000, 0x000001fb, 0x00000010, 0x00000010, 0x00000000, + 0x00000150, 0x00000000, 0x00000202, 0x00000020, 0x00000010, 0x00000002, 0x00000150, 0x00000000, + 0x00000208, 0x00000030, 0x00000010, 0x00000002, 0x00000150, 0x00000000, 0x0000020f, 0x00000040, + 0x00000010, 0x00000002, 0x00000150, 0x00000000, 0x6d616c63, 0x63003070, 0x706d616c, 0x6f630031, + 0x00726f6c, 0x6f6c6f63, 0x74003272, 0x666f5f63, 0x694d0066, 0x736f7263, 0x2074666f, 0x20295228, + 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, 0x322e3920, 0x35392e39, 0x31332e32, + 0xab003131, 0x4e475349, 0x00000050, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, + 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, + 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, + 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, + 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000228, 0x00000040, 0x0000008a, + 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x04000059, 0x00208e46, 0x00000001, 0x00000005, + 0x0300005a, 0x00106000, 0x00000000, 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x03001062, + 0x00101032, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x08000000, + 0x00100032, 0x00000000, 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000004, 0x08000034, + 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208046, 0x00000001, 0x00000000, 0x08000033, + 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, + 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, + 0x09000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, 0x80208046, 0x00000041, 0x00000001, + 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208046, 0x00000001, + 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208ae6, 0x00000001, + 0x00000000, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, + 0x00106000, 0x00000000, 0x08000000, 0x00100012, 0x00000000, 0x8010003a, 0x00000041, 0x00000000, + 0x0010003a, 0x00000001, 0x08000038, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0020802a, + 0x00000001, 0x00000004, 0x05002036, 0x00100022, 0x00000000, 0x0010000a, 0x00000000, 0x06002036, + 0x00100012, 0x00000000, 0x8010000a, 0x00000041, 0x00000000, 0x08000038, 0x001000f2, 0x00000001, + 0x00100556, 0x00000000, 0x00208e46, 0x00000001, 0x00000003, 0x0a000032, 0x001020f2, 0x00000000, + 0x00100006, 0x00000000, 0x00208e46, 0x00000001, 0x00000002, 0x00100e46, 0x00000001, 0x0100003e, + 0x54415453, 0x00000074, 0x0000000f, 0x00000002, 0x00000000, 0x00000002, 0x00000009, 0x00000000, + 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_filter_26[455] = { + 0x43425844, 0x77befa0f, 0xa8c6f51f, 0x871b10c5, 0x56e7a09b, 0x00000001, 0x0000071c, 0x00000005, + 0x00000034, 0x0000031c, 0x00000374, 0x000003a8, 0x000006a0, 0x46454452, 0x000002e0, 0x00000002, + 0x0000014c, 0x00000008, 0x0000001c, 0xffff0400, 0x00008100, 0x000002ae, 0x0000011c, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000123, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x0000012a, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x00000131, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x00000136, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000d, 0x0000013b, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000002, 0x00000001, 0x0000000d, 0x00000140, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000144, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x5f730031, 0x32786574, 0x78657400, 0x65740030, 0x74003178, 0x00327865, 0x00635350, + 0x61726170, 0xababab00, 0x00000140, 0x00000004, 0x0000017c, 0x00000040, 0x00000000, 0x00000000, + 0x00000144, 0x00000005, 0x00000214, 0x00000050, 0x00000000, 0x00000000, 0x000001dc, 0x00000000, + 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000001f8, 0x00000010, 0x00000010, 0x00000000, + 0x000001e8, 0x00000000, 0x00000202, 0x00000020, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, + 0x00000208, 0x00000030, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x6f6c6f63, 0x756d5f72, + 0xabab006c, 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, + 0x006c6163, 0x63736572, 0x31656c61, 0xababab00, 0x0000028c, 0x00000000, 0x00000010, 0x00000002, + 0x000001e8, 0x00000000, 0x00000293, 0x00000010, 0x00000010, 0x00000002, 0x000001e8, 0x00000000, + 0x0000029a, 0x00000020, 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000002a0, 0x00000030, + 0x00000010, 0x00000000, 0x000001e8, 0x00000000, 0x000002a7, 0x00000040, 0x00000010, 0x00000002, + 0x000001e8, 0x00000000, 0x6d616c63, 0x63003070, 0x706d616c, 0x6f630031, 0x00726f6c, 0x6f6c6f63, + 0x74003272, 0x666f5f63, 0x694d0066, 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, + 0x20726564, 0x706d6f43, 0x72656c69, 0x322e3920, 0x35392e39, 0x31332e32, 0xab003131, 0x4e475349, + 0x00000050, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, + 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, + 0x7469736f, 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, + 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, + 0x65677261, 0xabab0074, 0x52444853, 0x000002f0, 0x00000040, 0x000000bc, 0x04000059, 0x00208e46, + 0x00000000, 0x00000001, 0x04000059, 0x00208e46, 0x00000001, 0x00000005, 0x0300005a, 0x00106000, + 0x00000000, 0x0300005a, 0x00106000, 0x00000001, 0x0300005a, 0x00106000, 0x00000002, 0x04001858, + 0x00107000, 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x04001858, + 0x00107000, 0x00000002, 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, 0x001020f2, + 0x00000000, 0x02000068, 0x00000003, 0x08000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, + 0x00208046, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x09000000, 0x00100032, 0x00000000, 0x00101046, + 0x00000001, 0x80208046, 0x00000041, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000000, + 0x00100046, 0x00000000, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, + 0x00100046, 0x00000000, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, + 0x00100046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000000, 0x00100012, + 0x00000000, 0x8010003a, 0x00000041, 0x00000000, 0x0010003a, 0x00000001, 0x08000038, 0x00100012, + 0x00000000, 0x0010000a, 0x00000000, 0x0020802a, 0x00000001, 0x00000004, 0x09002032, 0x00100012, + 0x00000000, 0x0010000a, 0x00000000, 0x00004001, 0x3f000000, 0x00004001, 0x3f000000, 0x05000036, + 0x00100022, 0x00000000, 0x00004001, 0x3f000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, + 0x00000000, 0x00107e46, 0x00000002, 0x00106000, 0x00000002, 0x08000000, 0x00100012, 0x00000001, + 0x8010003a, 0x00000041, 0x00000000, 0x00004001, 0x3f800000, 0x08000034, 0x00100062, 0x00000001, + 0x00101106, 0x00000001, 0x00208106, 0x00000001, 0x00000001, 0x08000033, 0x00100062, 0x00000001, + 0x00100656, 0x00000001, 0x00208ba6, 0x00000001, 0x00000001, 0x09000045, 0x001000f2, 0x00000002, + 0x00100596, 0x00000001, 0x00107e46, 0x00000001, 0x00106000, 0x00000001, 0x09000032, 0x001020f2, + 0x00000000, 0x00100e46, 0x00000002, 0x00100006, 0x00000001, 0x00100e46, 0x00000000, 0x0100003e, + 0x54415453, 0x00000074, 0x00000013, 0x00000003, 0x00000000, 0x00000002, 0x0000000b, 0x00000000, + 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_filter_27[387] = { + 0x43425844, 0xf3f7a1fb, 0xbd22ef0c, 0x3d9cc820, 0xe4ffde46, 0x00000001, 0x0000060c, 0x00000005, + 0x00000034, 0x000002d0, 0x00000328, 0x0000035c, 0x00000590, 0x46454452, 0x00000294, 0x00000002, + 0x00000100, 0x00000006, 0x0000001c, 0xffff0400, 0x00008100, 0x00000262, 0x000000dc, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000e3, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x000000ea, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000ef, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000002, 0x00000001, 0x0000000d, 0x000000f4, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000f8, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x73003078, + 0x7865745f, 0x65740032, 0x74003078, 0x00327865, 0x00635350, 0x61726170, 0xababab00, 0x000000f4, + 0x00000004, 0x00000130, 0x00000040, 0x00000000, 0x00000000, 0x000000f8, 0x00000005, 0x000001c8, + 0x00000050, 0x00000000, 0x00000000, 0x00000190, 0x00000000, 0x00000010, 0x00000000, 0x0000019c, + 0x00000000, 0x000001ac, 0x00000010, 0x00000010, 0x00000000, 0x0000019c, 0x00000000, 0x000001b6, + 0x00000020, 0x00000010, 0x00000000, 0x0000019c, 0x00000000, 0x000001bc, 0x00000030, 0x00000010, + 0x00000000, 0x0000019c, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, + 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, + 0xababab00, 0x00000240, 0x00000000, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x00000247, + 0x00000010, 0x00000010, 0x00000000, 0x0000019c, 0x00000000, 0x0000024e, 0x00000020, 0x00000010, + 0x00000000, 0x0000019c, 0x00000000, 0x00000254, 0x00000030, 0x00000010, 0x00000000, 0x0000019c, + 0x00000000, 0x0000025b, 0x00000040, 0x00000010, 0x00000002, 0x0000019c, 0x00000000, 0x6d616c63, + 0x63003070, 0x706d616c, 0x6f630031, 0x00726f6c, 0x6f6c6f63, 0x74003272, 0x666f5f63, 0x694d0066, + 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, + 0x322e3920, 0x35392e39, 0x31332e32, 0xab003131, 0x4e475349, 0x00000050, 0x00000002, 0x00000008, + 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, + 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, 0x43584554, + 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, + 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, + 0x0000022c, 0x00000040, 0x0000008b, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x04000059, + 0x00208e46, 0x00000001, 0x00000005, 0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, + 0x00000002, 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000002, + 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, + 0x00000002, 0x08000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, 0x00208046, 0x00000001, + 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208046, 0x00000001, + 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00208ae6, 0x00000001, + 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, + 0x00106000, 0x00000000, 0x09000000, 0x00100032, 0x00000000, 0x00101046, 0x00000001, 0x80208046, + 0x00000041, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, 0x00000000, + 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000000, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000000, 0x00100012, 0x00000000, 0x8010003a, + 0x00000041, 0x00000000, 0x0010003a, 0x00000001, 0x08000038, 0x00100012, 0x00000000, 0x0010000a, + 0x00000000, 0x0020802a, 0x00000001, 0x00000004, 0x09002032, 0x00100012, 0x00000000, 0x0010000a, + 0x00000000, 0x00004001, 0x3f000000, 0x00004001, 0x3f000000, 0x05000036, 0x00100022, 0x00000000, + 0x00004001, 0x3f000000, 0x09000045, 0x001020f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, + 0x00000002, 0x00106000, 0x00000002, 0x0100003e, 0x54415453, 0x00000074, 0x0000000e, 0x00000002, + 0x00000000, 0x00000002, 0x00000008, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, +}; + +static ProgramWithCachedVariableLocations pshader_filter_arr[32] = { + { pshader_filter_0, 1516, }, + { pshader_filter_1, 1508, }, + { pshader_filter_2, 1644, }, + { pshader_filter_3, 1636, }, + { pshader_filter_4, 1608, }, + { pshader_filter_5, 1508, }, + { pshader_filter_6, 1692, }, + { pshader_filter_7, 1604, }, + { pshader_filter_8, 984, }, + { pshader_filter_9, 708, }, + { pshader_filter_10, 1644, }, + { pshader_filter_11, 1372, }, + { NULL, 0, }, + { NULL, 0, }, + { NULL, 0, }, + { NULL, 0, }, + { pshader_filter_16, 1740, }, + { pshader_filter_17, 1732, }, + { pshader_filter_18, 1820, }, + { pshader_filter_19, 1812, }, + { pshader_filter_20, 1788, }, + { pshader_filter_21, 1700, }, + { pshader_filter_22, 1868, }, + { pshader_filter_23, 1780, }, + { pshader_filter_24, 1740, }, + { pshader_filter_25, 1468, }, + { pshader_filter_26, 1820, }, + { pshader_filter_27, 1548, }, + { NULL, 0, }, + { NULL, 0, }, + { NULL, 0, }, + { NULL, 0, }, +}; + +static DWORD pshader_blur_2[320] = { + 0x43425844, 0x67a35e3a, 0x560d90ec, 0x256f19fd, 0x4a310ce8, 0x00000001, 0x00000500, 0x00000005, + 0x00000034, 0x00000238, 0x00000290, 0x000002c4, 0x00000484, 0x46454452, 0x000001fc, 0x00000002, + 0x000000b4, 0x00000004, 0x0000001c, 0xffff0400, 0x00008100, 0x000001c8, 0x0000009c, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000a3, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000a8, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000ac, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x74003078, + 0x00307865, 0x00635350, 0x61726170, 0xababab00, 0x000000a8, 0x00000004, 0x000000e4, 0x00000040, + 0x00000000, 0x00000000, 0x000000ac, 0x00000002, 0x0000017c, 0x000000a0, 0x00000000, 0x00000000, + 0x00000144, 0x00000000, 0x00000010, 0x00000000, 0x00000150, 0x00000000, 0x00000160, 0x00000010, + 0x00000010, 0x00000000, 0x00000150, 0x00000000, 0x0000016a, 0x00000020, 0x00000010, 0x00000000, + 0x00000150, 0x00000000, 0x00000170, 0x00000030, 0x00000010, 0x00000000, 0x00000150, 0x00000000, + 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6f6c6f63, + 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, 0xababab00, 0x000001ac, 0x00000000, + 0x00000010, 0x00000002, 0x00000150, 0x00000000, 0x000001b3, 0x00000010, 0x00000090, 0x00000002, + 0x000001b8, 0x00000000, 0x6d616c63, 0x74007670, 0xab007061, 0x00030001, 0x00040001, 0x00000009, + 0x00000000, 0x7263694d, 0x666f736f, 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, + 0x6c69706d, 0x39207265, 0x2e39322e, 0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x00000050, + 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, + 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, + 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, + 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, + 0xabab0074, 0x52444853, 0x000001b8, 0x00000040, 0x0000006e, 0x04000059, 0x00208e46, 0x00000000, + 0x00000001, 0x04000059, 0x00208e46, 0x00000001, 0x00000003, 0x0300005a, 0x00106000, 0x00000000, + 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, + 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x08000000, 0x00100032, 0x00000000, 0x00101046, + 0x00000001, 0x00208046, 0x00000001, 0x00000002, 0x08000034, 0x00100032, 0x00000000, 0x00100046, + 0x00000000, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, + 0x00000000, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, + 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, 0x001000f2, 0x00000000, + 0x00100e46, 0x00000000, 0x00208aa6, 0x00000001, 0x00000002, 0x08000000, 0x00100032, 0x00000001, + 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000001, 0x08000034, 0x00100032, 0x00000001, + 0x00100046, 0x00000001, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000001, + 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, + 0x00100046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0a000032, 0x001020f2, + 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, 0x00000001, 0x00000001, 0x00100e46, 0x00000000, + 0x0100003e, 0x54415453, 0x00000074, 0x0000000b, 0x00000002, 0x00000000, 0x00000002, 0x00000007, + 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_blur_3[363] = { + 0x43425844, 0xceb6aa80, 0x47281357, 0x6546706b, 0x9a86cc96, 0x00000001, 0x000005ac, 0x00000005, + 0x00000034, 0x00000238, 0x00000290, 0x000002c4, 0x00000530, 0x46454452, 0x000001fc, 0x00000002, + 0x000000b4, 0x00000004, 0x0000001c, 0xffff0400, 0x00008100, 0x000001c8, 0x0000009c, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000a3, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000a8, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000ac, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x74003078, + 0x00307865, 0x00635350, 0x61726170, 0xababab00, 0x000000a8, 0x00000004, 0x000000e4, 0x00000040, + 0x00000000, 0x00000000, 0x000000ac, 0x00000002, 0x0000017c, 0x000000a0, 0x00000000, 0x00000000, + 0x00000144, 0x00000000, 0x00000010, 0x00000000, 0x00000150, 0x00000000, 0x00000160, 0x00000010, + 0x00000010, 0x00000000, 0x00000150, 0x00000000, 0x0000016a, 0x00000020, 0x00000010, 0x00000000, + 0x00000150, 0x00000000, 0x00000170, 0x00000030, 0x00000010, 0x00000000, 0x00000150, 0x00000000, + 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6f6c6f63, + 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, 0xababab00, 0x000001ac, 0x00000000, + 0x00000010, 0x00000002, 0x00000150, 0x00000000, 0x000001b3, 0x00000010, 0x00000090, 0x00000002, + 0x000001b8, 0x00000000, 0x6d616c63, 0x74007670, 0xab007061, 0x00030001, 0x00040001, 0x00000009, + 0x00000000, 0x7263694d, 0x666f736f, 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, + 0x6c69706d, 0x39207265, 0x2e39322e, 0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x00000050, + 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, + 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, + 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, + 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, + 0xabab0074, 0x52444853, 0x00000264, 0x00000040, 0x00000099, 0x04000059, 0x00208e46, 0x00000000, + 0x00000001, 0x04000059, 0x00208e46, 0x00000001, 0x00000004, 0x0300005a, 0x00106000, 0x00000000, + 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, + 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x08000000, 0x00100032, 0x00000000, 0x00101046, + 0x00000001, 0x00208046, 0x00000001, 0x00000002, 0x08000034, 0x00100032, 0x00000000, 0x00100046, + 0x00000000, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, + 0x00000000, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, + 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, 0x001000f2, 0x00000000, + 0x00100e46, 0x00000000, 0x00208aa6, 0x00000001, 0x00000002, 0x08000000, 0x00100032, 0x00000001, + 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000001, 0x08000034, 0x00100032, 0x00000001, + 0x00100046, 0x00000001, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000001, + 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, + 0x00100046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0a000032, 0x001000f2, + 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, 0x00000001, 0x00000001, 0x00100e46, 0x00000000, + 0x08000000, 0x00100032, 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000003, + 0x08000034, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208046, 0x00000001, 0x00000000, + 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000000, + 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, + 0x00000000, 0x0a000032, 0x001020f2, 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, 0x00000001, + 0x00000003, 0x00100e46, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, 0x00000010, 0x00000002, + 0x00000000, 0x00000002, 0x0000000a, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_blur_4[406] = { + 0x43425844, 0x28bb4db6, 0x76164852, 0x9c2d5fab, 0x2f864c24, 0x00000001, 0x00000658, 0x00000005, + 0x00000034, 0x00000238, 0x00000290, 0x000002c4, 0x000005dc, 0x46454452, 0x000001fc, 0x00000002, + 0x000000b4, 0x00000004, 0x0000001c, 0xffff0400, 0x00008100, 0x000001c8, 0x0000009c, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000a3, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000a8, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000ac, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x74003078, + 0x00307865, 0x00635350, 0x61726170, 0xababab00, 0x000000a8, 0x00000004, 0x000000e4, 0x00000040, + 0x00000000, 0x00000000, 0x000000ac, 0x00000002, 0x0000017c, 0x000000a0, 0x00000000, 0x00000000, + 0x00000144, 0x00000000, 0x00000010, 0x00000000, 0x00000150, 0x00000000, 0x00000160, 0x00000010, + 0x00000010, 0x00000000, 0x00000150, 0x00000000, 0x0000016a, 0x00000020, 0x00000010, 0x00000000, + 0x00000150, 0x00000000, 0x00000170, 0x00000030, 0x00000010, 0x00000000, 0x00000150, 0x00000000, + 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6f6c6f63, + 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, 0xababab00, 0x000001ac, 0x00000000, + 0x00000010, 0x00000002, 0x00000150, 0x00000000, 0x000001b3, 0x00000010, 0x00000090, 0x00000002, + 0x000001b8, 0x00000000, 0x6d616c63, 0x74007670, 0xab007061, 0x00030001, 0x00040001, 0x00000009, + 0x00000000, 0x7263694d, 0x666f736f, 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, + 0x6c69706d, 0x39207265, 0x2e39322e, 0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x00000050, + 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, + 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, + 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, + 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, + 0xabab0074, 0x52444853, 0x00000310, 0x00000040, 0x000000c4, 0x04000059, 0x00208e46, 0x00000000, + 0x00000001, 0x04000059, 0x00208e46, 0x00000001, 0x00000005, 0x0300005a, 0x00106000, 0x00000000, + 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, + 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x08000000, 0x00100032, 0x00000000, 0x00101046, + 0x00000001, 0x00208046, 0x00000001, 0x00000002, 0x08000034, 0x00100032, 0x00000000, 0x00100046, + 0x00000000, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, + 0x00000000, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, + 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, 0x001000f2, 0x00000000, + 0x00100e46, 0x00000000, 0x00208aa6, 0x00000001, 0x00000002, 0x08000000, 0x00100032, 0x00000001, + 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000001, 0x08000034, 0x00100032, 0x00000001, + 0x00100046, 0x00000001, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000001, + 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, + 0x00100046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0a000032, 0x001000f2, + 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, 0x00000001, 0x00000001, 0x00100e46, 0x00000000, + 0x08000000, 0x00100032, 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000003, + 0x08000034, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208046, 0x00000001, 0x00000000, + 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000000, + 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, + 0x00000000, 0x0a000032, 0x001000f2, 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, 0x00000001, + 0x00000003, 0x00100e46, 0x00000000, 0x08000000, 0x00100032, 0x00000001, 0x00101046, 0x00000001, + 0x00208046, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000001, 0x00100046, 0x00000001, + 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, + 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0a000032, 0x001020f2, 0x00000000, 0x00100e46, + 0x00000001, 0x00208aa6, 0x00000001, 0x00000004, 0x00100e46, 0x00000000, 0x0100003e, 0x54415453, + 0x00000074, 0x00000015, 0x00000002, 0x00000000, 0x00000002, 0x0000000d, 0x00000000, 0x00000000, + 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000004, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_blur_5[449] = { + 0x43425844, 0x750da756, 0x7d011ff8, 0xac8d5660, 0x8246b36e, 0x00000001, 0x00000704, 0x00000005, + 0x00000034, 0x00000238, 0x00000290, 0x000002c4, 0x00000688, 0x46454452, 0x000001fc, 0x00000002, + 0x000000b4, 0x00000004, 0x0000001c, 0xffff0400, 0x00008100, 0x000001c8, 0x0000009c, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000a3, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000a8, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000ac, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x74003078, + 0x00307865, 0x00635350, 0x61726170, 0xababab00, 0x000000a8, 0x00000004, 0x000000e4, 0x00000040, + 0x00000000, 0x00000000, 0x000000ac, 0x00000002, 0x0000017c, 0x000000a0, 0x00000000, 0x00000000, + 0x00000144, 0x00000000, 0x00000010, 0x00000000, 0x00000150, 0x00000000, 0x00000160, 0x00000010, + 0x00000010, 0x00000000, 0x00000150, 0x00000000, 0x0000016a, 0x00000020, 0x00000010, 0x00000000, + 0x00000150, 0x00000000, 0x00000170, 0x00000030, 0x00000010, 0x00000000, 0x00000150, 0x00000000, + 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6f6c6f63, + 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, 0xababab00, 0x000001ac, 0x00000000, + 0x00000010, 0x00000002, 0x00000150, 0x00000000, 0x000001b3, 0x00000010, 0x00000090, 0x00000002, + 0x000001b8, 0x00000000, 0x6d616c63, 0x74007670, 0xab007061, 0x00030001, 0x00040001, 0x00000009, + 0x00000000, 0x7263694d, 0x666f736f, 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, + 0x6c69706d, 0x39207265, 0x2e39322e, 0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x00000050, + 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, + 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, + 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, + 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, + 0xabab0074, 0x52444853, 0x000003bc, 0x00000040, 0x000000ef, 0x04000059, 0x00208e46, 0x00000000, + 0x00000001, 0x04000059, 0x00208e46, 0x00000001, 0x00000006, 0x0300005a, 0x00106000, 0x00000000, + 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, + 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x08000000, 0x00100032, 0x00000000, 0x00101046, + 0x00000001, 0x00208046, 0x00000001, 0x00000002, 0x08000034, 0x00100032, 0x00000000, 0x00100046, + 0x00000000, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, + 0x00000000, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, + 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, 0x001000f2, 0x00000000, + 0x00100e46, 0x00000000, 0x00208aa6, 0x00000001, 0x00000002, 0x08000000, 0x00100032, 0x00000001, + 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000001, 0x08000034, 0x00100032, 0x00000001, + 0x00100046, 0x00000001, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000001, + 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, + 0x00100046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0a000032, 0x001000f2, + 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, 0x00000001, 0x00000001, 0x00100e46, 0x00000000, + 0x08000000, 0x00100032, 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000003, + 0x08000034, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208046, 0x00000001, 0x00000000, + 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000000, + 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, + 0x00000000, 0x0a000032, 0x001000f2, 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, 0x00000001, + 0x00000003, 0x00100e46, 0x00000000, 0x08000000, 0x00100032, 0x00000001, 0x00101046, 0x00000001, + 0x00208046, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000001, 0x00100046, 0x00000001, + 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, + 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0a000032, 0x001000f2, 0x00000000, 0x00100e46, + 0x00000001, 0x00208aa6, 0x00000001, 0x00000004, 0x00100e46, 0x00000000, 0x08000000, 0x00100032, + 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000005, 0x08000034, 0x00100032, + 0x00000001, 0x00100046, 0x00000001, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, + 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, + 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0a000032, + 0x001020f2, 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, 0x00000001, 0x00000005, 0x00100e46, + 0x00000000, 0x0100003e, 0x54415453, 0x00000074, 0x0000001a, 0x00000002, 0x00000000, 0x00000002, + 0x00000010, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, +}; + +static DWORD pshader_blur_6[492] = { + 0x43425844, 0xaa04fad9, 0xf1b31202, 0xbebf01fc, 0xc2f4f30e, 0x00000001, 0x000007b0, 0x00000005, + 0x00000034, 0x00000238, 0x00000290, 0x000002c4, 0x00000734, 0x46454452, 0x000001fc, 0x00000002, + 0x000000b4, 0x00000004, 0x0000001c, 0xffff0400, 0x00008100, 0x000001c8, 0x0000009c, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000a3, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000a8, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000ac, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x74003078, + 0x00307865, 0x00635350, 0x61726170, 0xababab00, 0x000000a8, 0x00000004, 0x000000e4, 0x00000040, + 0x00000000, 0x00000000, 0x000000ac, 0x00000002, 0x0000017c, 0x000000a0, 0x00000000, 0x00000000, + 0x00000144, 0x00000000, 0x00000010, 0x00000000, 0x00000150, 0x00000000, 0x00000160, 0x00000010, + 0x00000010, 0x00000000, 0x00000150, 0x00000000, 0x0000016a, 0x00000020, 0x00000010, 0x00000000, + 0x00000150, 0x00000000, 0x00000170, 0x00000030, 0x00000010, 0x00000000, 0x00000150, 0x00000000, + 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6f6c6f63, + 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, 0xababab00, 0x000001ac, 0x00000000, + 0x00000010, 0x00000002, 0x00000150, 0x00000000, 0x000001b3, 0x00000010, 0x00000090, 0x00000002, + 0x000001b8, 0x00000000, 0x6d616c63, 0x74007670, 0xab007061, 0x00030001, 0x00040001, 0x00000009, + 0x00000000, 0x7263694d, 0x666f736f, 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, + 0x6c69706d, 0x39207265, 0x2e39322e, 0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x00000050, + 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, + 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, + 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, + 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, + 0xabab0074, 0x52444853, 0x00000468, 0x00000040, 0x0000011a, 0x04000059, 0x00208e46, 0x00000000, + 0x00000001, 0x04000059, 0x00208e46, 0x00000001, 0x00000007, 0x0300005a, 0x00106000, 0x00000000, + 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, + 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x08000000, 0x00100032, 0x00000000, 0x00101046, + 0x00000001, 0x00208046, 0x00000001, 0x00000002, 0x08000034, 0x00100032, 0x00000000, 0x00100046, + 0x00000000, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, + 0x00000000, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, + 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, 0x001000f2, 0x00000000, + 0x00100e46, 0x00000000, 0x00208aa6, 0x00000001, 0x00000002, 0x08000000, 0x00100032, 0x00000001, + 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000001, 0x08000034, 0x00100032, 0x00000001, + 0x00100046, 0x00000001, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000001, + 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, + 0x00100046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0a000032, 0x001000f2, + 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, 0x00000001, 0x00000001, 0x00100e46, 0x00000000, + 0x08000000, 0x00100032, 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000003, + 0x08000034, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208046, 0x00000001, 0x00000000, + 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000000, + 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, + 0x00000000, 0x0a000032, 0x001000f2, 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, 0x00000001, + 0x00000003, 0x00100e46, 0x00000000, 0x08000000, 0x00100032, 0x00000001, 0x00101046, 0x00000001, + 0x00208046, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000001, 0x00100046, 0x00000001, + 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, + 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0a000032, 0x001000f2, 0x00000000, 0x00100e46, + 0x00000001, 0x00208aa6, 0x00000001, 0x00000004, 0x00100e46, 0x00000000, 0x08000000, 0x00100032, + 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000005, 0x08000034, 0x00100032, + 0x00000001, 0x00100046, 0x00000001, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, + 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, + 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0a000032, + 0x001000f2, 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, 0x00000001, 0x00000005, 0x00100e46, + 0x00000000, 0x08000000, 0x00100032, 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, + 0x00000006, 0x08000034, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208046, 0x00000001, + 0x00000000, 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, + 0x00000000, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000000, + 0x00106000, 0x00000000, 0x0a000032, 0x001020f2, 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, + 0x00000001, 0x00000006, 0x00100e46, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, 0x0000001f, + 0x00000002, 0x00000000, 0x00000002, 0x00000013, 0x00000000, 0x00000000, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000006, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_blur_7[535] = { + 0x43425844, 0xd887ebb4, 0xc4924177, 0xe04802c2, 0xf91cc99d, 0x00000001, 0x0000085c, 0x00000005, + 0x00000034, 0x00000238, 0x00000290, 0x000002c4, 0x000007e0, 0x46454452, 0x000001fc, 0x00000002, + 0x000000b4, 0x00000004, 0x0000001c, 0xffff0400, 0x00008100, 0x000001c8, 0x0000009c, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000a3, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000a8, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000ac, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x74003078, + 0x00307865, 0x00635350, 0x61726170, 0xababab00, 0x000000a8, 0x00000004, 0x000000e4, 0x00000040, + 0x00000000, 0x00000000, 0x000000ac, 0x00000002, 0x0000017c, 0x000000a0, 0x00000000, 0x00000000, + 0x00000144, 0x00000000, 0x00000010, 0x00000000, 0x00000150, 0x00000000, 0x00000160, 0x00000010, + 0x00000010, 0x00000000, 0x00000150, 0x00000000, 0x0000016a, 0x00000020, 0x00000010, 0x00000000, + 0x00000150, 0x00000000, 0x00000170, 0x00000030, 0x00000010, 0x00000000, 0x00000150, 0x00000000, + 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6f6c6f63, + 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, 0xababab00, 0x000001ac, 0x00000000, + 0x00000010, 0x00000002, 0x00000150, 0x00000000, 0x000001b3, 0x00000010, 0x00000090, 0x00000002, + 0x000001b8, 0x00000000, 0x6d616c63, 0x74007670, 0xab007061, 0x00030001, 0x00040001, 0x00000009, + 0x00000000, 0x7263694d, 0x666f736f, 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, + 0x6c69706d, 0x39207265, 0x2e39322e, 0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x00000050, + 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, + 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, + 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, + 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, + 0xabab0074, 0x52444853, 0x00000514, 0x00000040, 0x00000145, 0x04000059, 0x00208e46, 0x00000000, + 0x00000001, 0x04000059, 0x00208e46, 0x00000001, 0x00000008, 0x0300005a, 0x00106000, 0x00000000, + 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, + 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x08000000, 0x00100032, 0x00000000, 0x00101046, + 0x00000001, 0x00208046, 0x00000001, 0x00000002, 0x08000034, 0x00100032, 0x00000000, 0x00100046, + 0x00000000, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, + 0x00000000, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, + 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, 0x001000f2, 0x00000000, + 0x00100e46, 0x00000000, 0x00208aa6, 0x00000001, 0x00000002, 0x08000000, 0x00100032, 0x00000001, + 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000001, 0x08000034, 0x00100032, 0x00000001, + 0x00100046, 0x00000001, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000001, + 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, + 0x00100046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0a000032, 0x001000f2, + 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, 0x00000001, 0x00000001, 0x00100e46, 0x00000000, + 0x08000000, 0x00100032, 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000003, + 0x08000034, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208046, 0x00000001, 0x00000000, + 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000000, + 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, + 0x00000000, 0x0a000032, 0x001000f2, 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, 0x00000001, + 0x00000003, 0x00100e46, 0x00000000, 0x08000000, 0x00100032, 0x00000001, 0x00101046, 0x00000001, + 0x00208046, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000001, 0x00100046, 0x00000001, + 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, + 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0a000032, 0x001000f2, 0x00000000, 0x00100e46, + 0x00000001, 0x00208aa6, 0x00000001, 0x00000004, 0x00100e46, 0x00000000, 0x08000000, 0x00100032, + 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000005, 0x08000034, 0x00100032, + 0x00000001, 0x00100046, 0x00000001, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, + 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, + 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0a000032, + 0x001000f2, 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, 0x00000001, 0x00000005, 0x00100e46, + 0x00000000, 0x08000000, 0x00100032, 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, + 0x00000006, 0x08000034, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208046, 0x00000001, + 0x00000000, 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, + 0x00000000, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000000, + 0x00106000, 0x00000000, 0x0a000032, 0x001000f2, 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, + 0x00000001, 0x00000006, 0x00100e46, 0x00000000, 0x08000000, 0x00100032, 0x00000001, 0x00101046, + 0x00000001, 0x00208046, 0x00000001, 0x00000007, 0x08000034, 0x00100032, 0x00000001, 0x00100046, + 0x00000001, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000001, 0x00100046, + 0x00000001, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, + 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0a000032, 0x001020f2, 0x00000000, + 0x00100e46, 0x00000001, 0x00208aa6, 0x00000001, 0x00000007, 0x00100e46, 0x00000000, 0x0100003e, + 0x54415453, 0x00000074, 0x00000024, 0x00000002, 0x00000000, 0x00000002, 0x00000016, 0x00000000, + 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static DWORD pshader_blur_8[578] = { + 0x43425844, 0x27ab5347, 0x36a0e6bc, 0xb93d307d, 0xb1f00bc0, 0x00000001, 0x00000908, 0x00000005, + 0x00000034, 0x00000238, 0x00000290, 0x000002c4, 0x0000088c, 0x46454452, 0x000001fc, 0x00000002, + 0x000000b4, 0x00000004, 0x0000001c, 0xffff0400, 0x00008100, 0x000001c8, 0x0000009c, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000a3, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000a8, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000ac, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x74003078, + 0x00307865, 0x00635350, 0x61726170, 0xababab00, 0x000000a8, 0x00000004, 0x000000e4, 0x00000040, + 0x00000000, 0x00000000, 0x000000ac, 0x00000002, 0x0000017c, 0x000000a0, 0x00000000, 0x00000000, + 0x00000144, 0x00000000, 0x00000010, 0x00000000, 0x00000150, 0x00000000, 0x00000160, 0x00000010, + 0x00000010, 0x00000000, 0x00000150, 0x00000000, 0x0000016a, 0x00000020, 0x00000010, 0x00000000, + 0x00000150, 0x00000000, 0x00000170, 0x00000030, 0x00000010, 0x00000000, 0x00000150, 0x00000000, + 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6f6c6f63, + 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, 0xababab00, 0x000001ac, 0x00000000, + 0x00000010, 0x00000002, 0x00000150, 0x00000000, 0x000001b3, 0x00000010, 0x00000090, 0x00000002, + 0x000001b8, 0x00000000, 0x6d616c63, 0x74007670, 0xab007061, 0x00030001, 0x00040001, 0x00000009, + 0x00000000, 0x7263694d, 0x666f736f, 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, + 0x6c69706d, 0x39207265, 0x2e39322e, 0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x00000050, + 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, + 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, + 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, + 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, + 0xabab0074, 0x52444853, 0x000005c0, 0x00000040, 0x00000170, 0x04000059, 0x00208e46, 0x00000000, + 0x00000001, 0x04000059, 0x00208e46, 0x00000001, 0x00000009, 0x0300005a, 0x00106000, 0x00000000, + 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, + 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x08000000, 0x00100032, 0x00000000, 0x00101046, + 0x00000001, 0x00208046, 0x00000001, 0x00000002, 0x08000034, 0x00100032, 0x00000000, 0x00100046, + 0x00000000, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, + 0x00000000, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, + 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, 0x001000f2, 0x00000000, + 0x00100e46, 0x00000000, 0x00208aa6, 0x00000001, 0x00000002, 0x08000000, 0x00100032, 0x00000001, + 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000001, 0x08000034, 0x00100032, 0x00000001, + 0x00100046, 0x00000001, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000001, + 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, + 0x00100046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0a000032, 0x001000f2, + 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, 0x00000001, 0x00000001, 0x00100e46, 0x00000000, + 0x08000000, 0x00100032, 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000003, + 0x08000034, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208046, 0x00000001, 0x00000000, + 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000000, + 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, + 0x00000000, 0x0a000032, 0x001000f2, 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, 0x00000001, + 0x00000003, 0x00100e46, 0x00000000, 0x08000000, 0x00100032, 0x00000001, 0x00101046, 0x00000001, + 0x00208046, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000001, 0x00100046, 0x00000001, + 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, + 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0a000032, 0x001000f2, 0x00000000, 0x00100e46, + 0x00000001, 0x00208aa6, 0x00000001, 0x00000004, 0x00100e46, 0x00000000, 0x08000000, 0x00100032, + 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000005, 0x08000034, 0x00100032, + 0x00000001, 0x00100046, 0x00000001, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, + 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, + 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0a000032, + 0x001000f2, 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, 0x00000001, 0x00000005, 0x00100e46, + 0x00000000, 0x08000000, 0x00100032, 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, + 0x00000006, 0x08000034, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208046, 0x00000001, + 0x00000000, 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, + 0x00000000, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000000, + 0x00106000, 0x00000000, 0x0a000032, 0x001000f2, 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, + 0x00000001, 0x00000006, 0x00100e46, 0x00000000, 0x08000000, 0x00100032, 0x00000001, 0x00101046, + 0x00000001, 0x00208046, 0x00000001, 0x00000007, 0x08000034, 0x00100032, 0x00000001, 0x00100046, + 0x00000001, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000001, 0x00100046, + 0x00000001, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, + 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0a000032, 0x001000f2, 0x00000000, + 0x00100e46, 0x00000001, 0x00208aa6, 0x00000001, 0x00000007, 0x00100e46, 0x00000000, 0x08000000, + 0x00100032, 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000008, 0x08000034, + 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208046, 0x00000001, 0x00000000, 0x08000033, + 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, + 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, + 0x0a000032, 0x001020f2, 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, 0x00000001, 0x00000008, + 0x00100e46, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, 0x00000029, 0x00000002, 0x00000000, + 0x00000002, 0x00000019, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, +}; + +static DWORD pshader_blur_9[621] = { + 0x43425844, 0xab49c198, 0x28ead186, 0xcdcc1184, 0x605159a1, 0x00000001, 0x000009b4, 0x00000005, + 0x00000034, 0x00000238, 0x00000290, 0x000002c4, 0x00000938, 0x46454452, 0x000001fc, 0x00000002, + 0x000000b4, 0x00000004, 0x0000001c, 0xffff0400, 0x00008100, 0x000001c8, 0x0000009c, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000a3, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000a8, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000ac, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x74003078, + 0x00307865, 0x00635350, 0x61726170, 0xababab00, 0x000000a8, 0x00000004, 0x000000e4, 0x00000040, + 0x00000000, 0x00000000, 0x000000ac, 0x00000002, 0x0000017c, 0x000000a0, 0x00000000, 0x00000000, + 0x00000144, 0x00000000, 0x00000010, 0x00000000, 0x00000150, 0x00000000, 0x00000160, 0x00000010, + 0x00000010, 0x00000000, 0x00000150, 0x00000000, 0x0000016a, 0x00000020, 0x00000010, 0x00000000, + 0x00000150, 0x00000000, 0x00000170, 0x00000030, 0x00000010, 0x00000000, 0x00000150, 0x00000000, + 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6f6c6f63, + 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, 0xababab00, 0x000001ac, 0x00000000, + 0x00000010, 0x00000002, 0x00000150, 0x00000000, 0x000001b3, 0x00000010, 0x00000090, 0x00000002, + 0x000001b8, 0x00000000, 0x6d616c63, 0x74007670, 0xab007061, 0x00030001, 0x00040001, 0x00000009, + 0x00000000, 0x7263694d, 0x666f736f, 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, + 0x6c69706d, 0x39207265, 0x2e39322e, 0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x00000050, + 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, + 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, 0x7469736f, + 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, + 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, + 0xabab0074, 0x52444853, 0x0000066c, 0x00000040, 0x0000019b, 0x04000059, 0x00208e46, 0x00000000, + 0x00000001, 0x04000059, 0x00208e46, 0x00000001, 0x0000000a, 0x0300005a, 0x00106000, 0x00000000, + 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065, + 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x08000000, 0x00100032, 0x00000000, 0x00101046, + 0x00000001, 0x00208046, 0x00000001, 0x00000002, 0x08000034, 0x00100032, 0x00000000, 0x00100046, + 0x00000000, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000000, 0x00100046, + 0x00000000, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000000, 0x00100046, + 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000038, 0x001000f2, 0x00000000, + 0x00100e46, 0x00000000, 0x00208aa6, 0x00000001, 0x00000002, 0x08000000, 0x00100032, 0x00000001, + 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000001, 0x08000034, 0x00100032, 0x00000001, + 0x00100046, 0x00000001, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000001, + 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, + 0x00100046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0a000032, 0x001000f2, + 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, 0x00000001, 0x00000001, 0x00100e46, 0x00000000, + 0x08000000, 0x00100032, 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000003, + 0x08000034, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208046, 0x00000001, 0x00000000, + 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000000, + 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, + 0x00000000, 0x0a000032, 0x001000f2, 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, 0x00000001, + 0x00000003, 0x00100e46, 0x00000000, 0x08000000, 0x00100032, 0x00000001, 0x00101046, 0x00000001, + 0x00208046, 0x00000001, 0x00000004, 0x08000034, 0x00100032, 0x00000001, 0x00100046, 0x00000001, + 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, + 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0a000032, 0x001000f2, 0x00000000, 0x00100e46, + 0x00000001, 0x00208aa6, 0x00000001, 0x00000004, 0x00100e46, 0x00000000, 0x08000000, 0x00100032, + 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000005, 0x08000034, 0x00100032, + 0x00000001, 0x00100046, 0x00000001, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, + 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, + 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0a000032, + 0x001000f2, 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, 0x00000001, 0x00000005, 0x00100e46, + 0x00000000, 0x08000000, 0x00100032, 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, + 0x00000006, 0x08000034, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208046, 0x00000001, + 0x00000000, 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, + 0x00000000, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000000, + 0x00106000, 0x00000000, 0x0a000032, 0x001000f2, 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, + 0x00000001, 0x00000006, 0x00100e46, 0x00000000, 0x08000000, 0x00100032, 0x00000001, 0x00101046, + 0x00000001, 0x00208046, 0x00000001, 0x00000007, 0x08000034, 0x00100032, 0x00000001, 0x00100046, + 0x00000001, 0x00208046, 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000001, 0x00100046, + 0x00000001, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, + 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0a000032, 0x001000f2, 0x00000000, + 0x00100e46, 0x00000001, 0x00208aa6, 0x00000001, 0x00000007, 0x00100e46, 0x00000000, 0x08000000, + 0x00100032, 0x00000001, 0x00101046, 0x00000001, 0x00208046, 0x00000001, 0x00000008, 0x08000034, + 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208046, 0x00000001, 0x00000000, 0x08000033, + 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, 0x00000001, 0x00000000, 0x09000045, + 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, + 0x0a000032, 0x001000f2, 0x00000000, 0x00100e46, 0x00000001, 0x00208aa6, 0x00000001, 0x00000008, + 0x00100e46, 0x00000000, 0x08000000, 0x00100032, 0x00000001, 0x00101046, 0x00000001, 0x00208046, + 0x00000001, 0x00000009, 0x08000034, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208046, + 0x00000001, 0x00000000, 0x08000033, 0x00100032, 0x00000001, 0x00100046, 0x00000001, 0x00208ae6, + 0x00000001, 0x00000000, 0x09000045, 0x001000f2, 0x00000001, 0x00100046, 0x00000001, 0x00107e46, + 0x00000000, 0x00106000, 0x00000000, 0x0a000032, 0x001020f2, 0x00000000, 0x00100e46, 0x00000001, + 0x00208aa6, 0x00000001, 0x00000009, 0x00100e46, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, + 0x0000002e, 0x00000002, 0x00000000, 0x00000002, 0x0000001c, 0x00000000, 0x00000000, 0x00000001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000009, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static ProgramWithCachedVariableLocations pshader_blur_arr[10] = { + { NULL, 0, }, + { NULL, 0, }, + { pshader_blur_2, 1280, }, + { pshader_blur_3, 1452, }, + { pshader_blur_4, 1624, }, + { pshader_blur_5, 1796, }, + { pshader_blur_6, 1968, }, + { pshader_blur_7, 2140, }, + { pshader_blur_8, 2312, }, + { pshader_blur_9, 2484, }, +}; + +static DWORD pshader_color_matrix_0[308] = { + 0x43425844, 0x5b914181, 0xde722329, 0xe875a0ba, 0xa156b551, 0x00000001, 0x000004d0, 0x00000005, + 0x00000034, 0x0000021c, 0x00000274, 0x000002a8, 0x00000454, 0x46454452, 0x000001e0, 0x00000002, + 0x000000b4, 0x00000004, 0x0000001c, 0xffff0400, 0x00008100, 0x000001ac, 0x0000009c, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000a3, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000d, 0x000000a8, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x000000ac, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x65745f73, 0x74003078, + 0x00307865, 0x00635350, 0x61726170, 0xababab00, 0x000000a8, 0x00000004, 0x000000e4, 0x00000040, + 0x00000000, 0x00000000, 0x000000ac, 0x00000001, 0x0000017c, 0x00000050, 0x00000000, 0x00000000, + 0x00000144, 0x00000000, 0x00000010, 0x00000000, 0x00000150, 0x00000000, 0x00000160, 0x00000010, + 0x00000010, 0x00000000, 0x00000150, 0x00000000, 0x0000016a, 0x00000020, 0x00000010, 0x00000000, + 0x00000150, 0x00000000, 0x00000170, 0x00000030, 0x00000010, 0x00000000, 0x00000150, 0x00000000, + 0x6f6c6f63, 0x756d5f72, 0xabab006c, 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6f6c6f63, + 0x64615f72, 0x6f660064, 0x006c6163, 0x63736572, 0x31656c61, 0xababab00, 0x00000194, 0x00000000, + 0x00000050, 0x00000002, 0x0000019c, 0x00000000, 0x61746164, 0xababab00, 0x00030001, 0x00040001, + 0x00000005, 0x00000000, 0x7263694d, 0x666f736f, 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, + 0x6f432072, 0x6c69706d, 0x39207265, 0x2e39322e, 0x2e323539, 0x31313133, 0xababab00, 0x4e475349, + 0x00000050, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, + 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000030f, 0x505f5653, + 0x7469736f, 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, + 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, + 0x65677261, 0xabab0074, 0x52444853, 0x000001a4, 0x00000040, 0x00000069, 0x04000059, 0x00208e46, + 0x00000000, 0x00000001, 0x04000059, 0x00208e46, 0x00000001, 0x00000005, 0x0300005a, 0x00106000, + 0x00000000, 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x03001062, 0x00101032, 0x00000001, + 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x09000045, 0x001000f2, 0x00000000, + 0x00101046, 0x00000001, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x08000011, 0x00100012, + 0x00000001, 0x00208e46, 0x00000001, 0x00000000, 0x00100e46, 0x00000000, 0x0a000032, 0x00100012, + 0x00000001, 0x0020800a, 0x00000001, 0x00000004, 0x0010003a, 0x00000000, 0x0010000a, 0x00000001, + 0x08000011, 0x00100082, 0x00000001, 0x00208e46, 0x00000001, 0x00000001, 0x00100e46, 0x00000000, + 0x0a000032, 0x00100022, 0x00000001, 0x0020801a, 0x00000001, 0x00000004, 0x0010003a, 0x00000000, + 0x0010003a, 0x00000001, 0x08000011, 0x00100012, 0x00000000, 0x00208e46, 0x00000001, 0x00000002, + 0x00100e46, 0x00000000, 0x0a000032, 0x00100042, 0x00000001, 0x0020802a, 0x00000001, 0x00000004, + 0x0010003a, 0x00000000, 0x0010000a, 0x00000000, 0x08000038, 0x00102082, 0x00000000, 0x0010003a, + 0x00000000, 0x0020803a, 0x00000001, 0x00000003, 0x08000038, 0x00102072, 0x00000000, 0x00100246, + 0x00000001, 0x00208ff6, 0x00000001, 0x00000003, 0x0100003e, 0x54415453, 0x00000074, 0x0000000a, + 0x00000002, 0x00000000, 0x00000002, 0x00000005, 0x00000000, 0x00000000, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static ProgramWithCachedVariableLocations pshader_color_matrix_arr[1] = { + { pshader_color_matrix_0, 1232, }, +}; + +static DWORD pshader_manual_clear_0[171] = { + 0x43425844, 0xeb343b5a, 0xfec80b96, 0xf65a4d5b, 0xb96aacbe, 0x00000001, 0x000002ac, 0x00000005, + 0x00000034, 0x0000015c, 0x000001b4, 0x000001e8, 0x00000230, 0x46454452, 0x00000120, 0x00000001, + 0x00000040, 0x00000001, 0x0000001c, 0xffff0400, 0x00008100, 0x000000ed, 0x0000003c, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00635350, 0x0000003c, + 0x00000004, 0x00000058, 0x00000040, 0x00000000, 0x00000000, 0x000000b8, 0x00000000, 0x00000010, + 0x00000002, 0x000000c4, 0x00000000, 0x000000d4, 0x00000010, 0x00000010, 0x00000000, 0x000000c4, + 0x00000000, 0x000000de, 0x00000020, 0x00000010, 0x00000000, 0x000000c4, 0x00000000, 0x000000e4, + 0x00000030, 0x00000010, 0x00000000, 0x000000c4, 0x00000000, 0x6f6c6f63, 0x756d5f72, 0xabab006c, + 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6f6c6f63, 0x64615f72, 0x6f660064, 0x006c6163, + 0x63736572, 0x31656c61, 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, + 0x43207265, 0x69706d6f, 0x2072656c, 0x39322e39, 0x3235392e, 0x3131332e, 0xabab0031, 0x4e475349, + 0x00000050, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, + 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000000f, 0x505f5653, + 0x7469736f, 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, + 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, + 0x65677261, 0xabab0074, 0x52444853, 0x00000040, 0x00000040, 0x00000010, 0x04000059, 0x00208e46, + 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x06000036, 0x001020f2, 0x00000000, + 0x00208e46, 0x00000000, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, 0x00000002, 0x00000000, + 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, +}; + +static ProgramWithCachedVariableLocations pshader_manual_clear_arr[1] = { + { pshader_manual_clear_0, 684, }, +}; + +static DWORD vshader_vsd3d10_0[305] = { + 0x43425844, 0xbcb06f4b, 0x808953d6, 0x687571c0, 0x1b5b041c, 0x00000001, 0x000004c4, 0x00000005, + 0x00000034, 0x000001cc, 0x00000200, 0x00000258, 0x00000448, 0x46454452, 0x00000190, 0x00000001, + 0x00000044, 0x00000001, 0x0000001c, 0xfffe0400, 0x00008100, 0x0000015f, 0x0000003c, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x61726170, 0xababab00, + 0x0000003c, 0x00000008, 0x0000005c, 0x00000080, 0x00000000, 0x00000000, 0x0000011c, 0x00000000, + 0x00000010, 0x00000002, 0x00000124, 0x00000000, 0x00000134, 0x00000010, 0x00000010, 0x00000002, + 0x00000124, 0x00000000, 0x0000013b, 0x00000020, 0x00000010, 0x00000000, 0x00000124, 0x00000000, + 0x00000141, 0x00000030, 0x00000010, 0x00000002, 0x00000124, 0x00000000, 0x0000014a, 0x00000040, + 0x00000010, 0x00000002, 0x00000124, 0x00000000, 0x00000153, 0x00000050, 0x00000010, 0x00000002, + 0x00000124, 0x00000000, 0x00000157, 0x00000060, 0x00000010, 0x00000002, 0x00000124, 0x00000000, + 0x0000015b, 0x00000070, 0x00000010, 0x00000002, 0x00000124, 0x00000000, 0x6c726f77, 0xab003064, + 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6c726f77, 0x78003164, 0x66666f5f, 0x78657400, + 0x5f6e6567, 0x65740073, 0x6e656778, 0x7800745f, 0x79006433, 0x77006433, 0x4d006433, 0x6f726369, + 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, + 0x392e3932, 0x332e3235, 0x00313131, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x49534f50, 0x4e4f4954, 0xababab00, + 0x4e47534f, 0x00000050, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, + 0x00000000, 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000000f, + 0x505f5653, 0x7469736f, 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x52444853, 0x000001e8, + 0x00010040, 0x0000007a, 0x04000059, 0x00208e46, 0x00000000, 0x00000008, 0x0300005f, 0x001010f2, + 0x00000000, 0x04000067, 0x001020f2, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000001, + 0x02000068, 0x00000001, 0x08000011, 0x00100012, 0x00000000, 0x00101e46, 0x00000000, 0x00208e46, + 0x00000000, 0x00000001, 0x08000038, 0x00100072, 0x00000000, 0x00100006, 0x00000000, 0x00208246, + 0x00000000, 0x00000006, 0x08000011, 0x00100082, 0x00000000, 0x00101e46, 0x00000000, 0x00208e46, + 0x00000000, 0x00000000, 0x0a000032, 0x00100072, 0x00000000, 0x00100ff6, 0x00000000, 0x00208246, + 0x00000000, 0x00000005, 0x00100246, 0x00000000, 0x08000000, 0x00100072, 0x00000000, 0x00100246, + 0x00000000, 0x00208246, 0x00000000, 0x00000007, 0x0a00000e, 0x00100042, 0x00000000, 0x00004002, + 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x0010002a, 0x00000000, 0x07000038, 0x00102032, + 0x00000000, 0x00100aa6, 0x00000000, 0x00100046, 0x00000000, 0x06000036, 0x00102042, 0x00000000, + 0x0020802a, 0x00000000, 0x00000000, 0x05000036, 0x00102082, 0x00000000, 0x00004001, 0x3f800000, + 0x08000011, 0x00100012, 0x00000000, 0x00208e46, 0x00000000, 0x00000003, 0x00101e46, 0x00000000, + 0x08000011, 0x00100022, 0x00000000, 0x00208e46, 0x00000000, 0x00000004, 0x00101e46, 0x00000000, + 0x07000038, 0x00102032, 0x00000001, 0x00100aa6, 0x00000000, 0x00100046, 0x00000000, 0x05000036, + 0x00102082, 0x00000001, 0x0010002a, 0x00000000, 0x05000036, 0x00102042, 0x00000001, 0x00004001, + 0x3f800000, 0x0100003e, 0x54415453, 0x00000074, 0x0000000f, 0x00000001, 0x00000000, 0x00000003, + 0x00000009, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000004, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, +}; + +static DWORD vshader_vsd3d10_1[417] = { + 0x43425844, 0x79f68211, 0x83ecd840, 0x5fea9f88, 0xed27bac2, 0x00000001, 0x00000684, 0x00000005, + 0x00000034, 0x000001cc, 0x00000220, 0x00000278, 0x00000608, 0x46454452, 0x00000190, 0x00000001, + 0x00000044, 0x00000001, 0x0000001c, 0xfffe0400, 0x00008100, 0x0000015f, 0x0000003c, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x61726170, 0xababab00, + 0x0000003c, 0x00000008, 0x0000005c, 0x00000080, 0x00000000, 0x00000000, 0x0000011c, 0x00000000, + 0x00000010, 0x00000002, 0x00000124, 0x00000000, 0x00000134, 0x00000010, 0x00000010, 0x00000002, + 0x00000124, 0x00000000, 0x0000013b, 0x00000020, 0x00000010, 0x00000002, 0x00000124, 0x00000000, + 0x00000141, 0x00000030, 0x00000010, 0x00000002, 0x00000124, 0x00000000, 0x0000014a, 0x00000040, + 0x00000010, 0x00000002, 0x00000124, 0x00000000, 0x00000153, 0x00000050, 0x00000010, 0x00000002, + 0x00000124, 0x00000000, 0x00000157, 0x00000060, 0x00000010, 0x00000002, 0x00000124, 0x00000000, + 0x0000015b, 0x00000070, 0x00000010, 0x00000002, 0x00000124, 0x00000000, 0x6c726f77, 0xab003064, + 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6c726f77, 0x78003164, 0x66666f5f, 0x78657400, + 0x5f6e6567, 0x65740073, 0x6e656778, 0x7800745f, 0x79006433, 0x77006433, 0x4d006433, 0x6f726369, + 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, + 0x392e3932, 0x332e3235, 0x00313131, 0x4e475349, 0x0000004c, 0x00000002, 0x00000008, 0x00000038, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x00000041, 0x00000000, 0x00000000, + 0x00000002, 0x00000001, 0x0000070f, 0x49534f50, 0x4e4f4954, 0x58455400, 0x524f4f43, 0xabab0044, + 0x4e47534f, 0x00000050, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, + 0x00000000, 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000000f, + 0x505f5653, 0x7469736f, 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x52444853, 0x00000388, + 0x00010040, 0x000000e2, 0x04000059, 0x00208e46, 0x00000000, 0x00000008, 0x0300005f, 0x001010f2, + 0x00000000, 0x0300005f, 0x00101072, 0x00000001, 0x04000067, 0x001020f2, 0x00000000, 0x00000001, + 0x03000065, 0x001020f2, 0x00000001, 0x02000068, 0x00000003, 0x0500002b, 0x00100072, 0x00000000, + 0x00101496, 0x00000001, 0x0a000038, 0x00100072, 0x00000000, 0x00100246, 0x00000000, 0x00004002, + 0x3c800000, 0x3c800000, 0x3d000000, 0x00000000, 0x0800000f, 0x00100012, 0x00000001, 0x00100046, + 0x00000000, 0x00208046, 0x00000000, 0x00000002, 0x0800000f, 0x00100022, 0x00000001, 0x00100046, + 0x00000000, 0x00208ae6, 0x00000000, 0x00000002, 0x0800000f, 0x00100012, 0x00000002, 0x00100046, + 0x00000001, 0x00208046, 0x00000000, 0x00000000, 0x0800000f, 0x00100022, 0x00000002, 0x00100046, + 0x00000001, 0x00208046, 0x00000000, 0x00000001, 0x0700000f, 0x00100082, 0x00000000, 0x00100046, + 0x00000002, 0x00100046, 0x00000002, 0x0500004b, 0x00100082, 0x00000000, 0x0010003a, 0x00000000, + 0x0a000039, 0x00100012, 0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x0010003a, 0x00000000, 0x09000037, 0x00100082, 0x00000000, 0x0010000a, 0x00000001, 0x0010003a, + 0x00000000, 0x00004001, 0x3f800000, 0x0700000f, 0x00100012, 0x00000000, 0x00100046, 0x00000000, + 0x00100046, 0x00000000, 0x0500004b, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0700000e, + 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010003a, 0x00000000, 0x08000011, 0x00100012, + 0x00000001, 0x00101e46, 0x00000000, 0x00208e46, 0x00000000, 0x00000000, 0x08000011, 0x00100022, + 0x00000001, 0x00101e46, 0x00000000, 0x00208e46, 0x00000000, 0x00000001, 0x09000032, 0x00100032, + 0x00000000, 0x00100046, 0x00000002, 0x00100006, 0x00000000, 0x00100046, 0x00000001, 0x08000038, + 0x00100072, 0x00000001, 0x00100556, 0x00000000, 0x00208246, 0x00000000, 0x00000006, 0x0a000032, + 0x001000b2, 0x00000000, 0x00100006, 0x00000000, 0x00208846, 0x00000000, 0x00000005, 0x00100846, + 0x00000001, 0x08000000, 0x001000b2, 0x00000000, 0x00100c46, 0x00000000, 0x00208846, 0x00000000, + 0x00000007, 0x0a00000e, 0x00100082, 0x00000000, 0x00004002, 0x3f800000, 0x3f800000, 0x3f800000, + 0x3f800000, 0x0010003a, 0x00000000, 0x07000038, 0x00102032, 0x00000000, 0x00100ff6, 0x00000000, + 0x00100046, 0x00000000, 0x06000036, 0x00102042, 0x00000000, 0x0020802a, 0x00000000, 0x00000000, + 0x05000036, 0x00102082, 0x00000000, 0x00004001, 0x3f800000, 0x08000011, 0x00100012, 0x00000000, + 0x00208e46, 0x00000000, 0x00000003, 0x00101e46, 0x00000000, 0x08000011, 0x00100022, 0x00000000, + 0x00208e46, 0x00000000, 0x00000004, 0x00101e46, 0x00000000, 0x07000038, 0x00102072, 0x00000001, + 0x00100ff6, 0x00000000, 0x00100246, 0x00000000, 0x05000036, 0x00102082, 0x00000001, 0x0010003a, + 0x00000000, 0x0100003e, 0x54415453, 0x00000074, 0x0000001c, 0x00000003, 0x00000000, 0x00000004, + 0x00000013, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, + 0x00000001, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, +}; + +static DWORD vshader_vsd3d10_2[300] = { + 0x43425844, 0x50edc469, 0x3be0d512, 0xffa16ac1, 0x10a3602c, 0x00000001, 0x000004b0, 0x00000005, + 0x00000034, 0x000001cc, 0x00000220, 0x00000278, 0x00000434, 0x46454452, 0x00000190, 0x00000001, + 0x00000044, 0x00000001, 0x0000001c, 0xfffe0400, 0x00008100, 0x0000015f, 0x0000003c, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x61726170, 0xababab00, + 0x0000003c, 0x00000008, 0x0000005c, 0x00000080, 0x00000000, 0x00000000, 0x0000011c, 0x00000000, + 0x00000010, 0x00000002, 0x00000124, 0x00000000, 0x00000134, 0x00000010, 0x00000010, 0x00000002, + 0x00000124, 0x00000000, 0x0000013b, 0x00000020, 0x00000010, 0x00000000, 0x00000124, 0x00000000, + 0x00000141, 0x00000030, 0x00000010, 0x00000000, 0x00000124, 0x00000000, 0x0000014a, 0x00000040, + 0x00000010, 0x00000000, 0x00000124, 0x00000000, 0x00000153, 0x00000050, 0x00000010, 0x00000002, + 0x00000124, 0x00000000, 0x00000157, 0x00000060, 0x00000010, 0x00000002, 0x00000124, 0x00000000, + 0x0000015b, 0x00000070, 0x00000010, 0x00000002, 0x00000124, 0x00000000, 0x6c726f77, 0xab003064, + 0x00030001, 0x00040001, 0x00000000, 0x00000000, 0x6c726f77, 0x78003164, 0x66666f5f, 0x78657400, + 0x5f6e6567, 0x65740073, 0x6e656778, 0x7800745f, 0x79006433, 0x77006433, 0x4d006433, 0x6f726369, + 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, + 0x392e3932, 0x332e3235, 0x00313131, 0x4e475349, 0x0000004c, 0x00000002, 0x00000008, 0x00000038, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x00000041, 0x00000000, 0x00000000, + 0x00000003, 0x00000001, 0x0000030f, 0x49534f50, 0x4e4f4954, 0x58455400, 0x524f4f43, 0xabab0044, + 0x4e47534f, 0x00000050, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, + 0x00000000, 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000000f, + 0x505f5653, 0x7469736f, 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x52444853, 0x000001b4, + 0x00010040, 0x0000006d, 0x04000059, 0x00208e46, 0x00000000, 0x00000008, 0x0300005f, 0x001010f2, + 0x00000000, 0x0300005f, 0x00101032, 0x00000001, 0x04000067, 0x001020f2, 0x00000000, 0x00000001, + 0x03000065, 0x001020f2, 0x00000001, 0x02000068, 0x00000001, 0x08000011, 0x00100012, 0x00000000, + 0x00101e46, 0x00000000, 0x00208e46, 0x00000000, 0x00000001, 0x08000038, 0x00100072, 0x00000000, + 0x00100006, 0x00000000, 0x00208246, 0x00000000, 0x00000006, 0x08000011, 0x00100082, 0x00000000, + 0x00101e46, 0x00000000, 0x00208e46, 0x00000000, 0x00000000, 0x0a000032, 0x00100072, 0x00000000, + 0x00100ff6, 0x00000000, 0x00208246, 0x00000000, 0x00000005, 0x00100246, 0x00000000, 0x08000000, + 0x00100072, 0x00000000, 0x00100246, 0x00000000, 0x00208246, 0x00000000, 0x00000007, 0x0a00000e, + 0x00100042, 0x00000000, 0x00004002, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x0010002a, + 0x00000000, 0x07000038, 0x00102032, 0x00000000, 0x00100aa6, 0x00000000, 0x00100046, 0x00000000, + 0x06000036, 0x00102042, 0x00000000, 0x0020802a, 0x00000000, 0x00000000, 0x05000036, 0x00102082, + 0x00000000, 0x00004001, 0x3f800000, 0x07000038, 0x00102032, 0x00000001, 0x00100aa6, 0x00000000, + 0x00101046, 0x00000001, 0x05000036, 0x00102082, 0x00000001, 0x0010002a, 0x00000000, 0x05000036, + 0x00102042, 0x00000001, 0x00004001, 0x3f800000, 0x0100003e, 0x54415453, 0x00000074, 0x0000000d, + 0x00000001, 0x00000000, 0x00000004, 0x00000007, 0x00000000, 0x00000000, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static ProgramWithCachedVariableLocations vshader_vsd3d10_arr[3] = { + { vshader_vsd3d10_0, 1220, }, + { vshader_vsd3d10_1, 1668, }, + { vshader_vsd3d10_2, 1200, }, +}; + diff --git a/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d11.cpp b/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d11.cpp new file mode 100644 index 00000000..0c106b3f --- /dev/null +++ b/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d11.cpp @@ -0,0 +1,147 @@ +#include "stdafx.h" // 4J + +// gdraw_d3d11.cpp - author: Fabian Giesen - copyright 2011 RAD Game Tools +// +// This implements the Iggy graphics driver layer for D3D 11. + +// GDraw consists of several components that interact fairly loosely with each other; +// e.g. the resource management, drawing and filtering parts are all fairly independent +// of each other. If you want to modify some aspect of GDraw - say the texture allocation +// logic - your best bet is usually to just look for one of the related entry points, +// e.g. MakeTextureBegin, and take it from there. There's a bunch of code in this file, +// but none of it is really complicated. +// +// The one bit you might want to change that's not that localized is to integrate +// GDraw with an existing state caching system. The following bits all modify D3D state +// in some way: +// - The rendering helpers (set_viewport_raw, set_projection_raw, set_*_renderstate) +// - RenderTile*/TextureDrawBuffer* may change the active rendertarget and depth/stencil surface, +// as do D3D1X_(NoMoreGDrawThisFrame) and set_render_target +// - set_texture +// - set_renderstate and set_renderstate_full. These are the main places where render state changes occur; +// you should probably start here. +// - DrawIndexedTriangles sets the active vertex/index buffers and vertex declaration +// - Most of the functions in the "filter effects" section modify D3D state, mostly +// pixel shader constants and textures + +#define GDRAW_ASSERTS + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif + +// We temporarily disable this warning for the shared interface portions +#pragma warning (push) +#pragma warning (disable: 4201) // nonstandard extension used : nameless struct/union + +#include +#include // 4J changed to use monolithic version +#include "gdraw.h" +#include "iggy.h" +#include +#include + +#include "gdraw_d3d11.h" + +#pragma warning (pop) + +// Some macros to allow as much sharing between D3D10 and D3D11 code as possible. +#define D3D1X_(id) D3D11_##id +#define ID3D1X(id) ID3D11##id +#define gdraw_D3D1X_(id) gdraw_D3D11_##id +#define GDRAW_D3D1X_(id) GDRAW_D3D11_##id + +typedef ID3D11Device ID3D1XDevice; +typedef ID3D11DeviceContext ID3D1XContext; +typedef F32 ViewCoord; +typedef gdraw_d3d11_resourcetype gdraw_resourcetype; + +static void report_d3d_error(HRESULT hr, char *call, char *context); + +static void *map_buffer(ID3D1XContext *ctx, ID3D11Buffer *buf, bool discard) +{ + D3D11_MAPPED_SUBRESOURCE msr; + HRESULT hr = ctx->Map(buf, 0, discard ? D3D11_MAP_WRITE_DISCARD : D3D11_MAP_WRITE_NO_OVERWRITE, 0, &msr); + if (FAILED(hr)) { + report_d3d_error(hr, "Map", "of buffer"); + return NULL; + } else + return msr.pData; +} + +static void unmap_buffer(ID3D1XContext *ctx, ID3D11Buffer *buf) +{ + ctx->Unmap(buf, 0); +} + +static RADINLINE void set_pixel_shader(ID3D11DeviceContext *ctx, ID3D11PixelShader *shader) +{ + ctx->PSSetShader(shader, NULL, 0); +} + +static RADINLINE void set_vertex_shader(ID3D11DeviceContext *ctx, ID3D11VertexShader *shader) +{ + ctx->VSSetShader(shader, NULL, 0); +} + +static ID3D11BlendState *create_blend_state(ID3D11Device *dev, BOOL blend, D3D11_BLEND src, D3D11_BLEND dst) +{ + D3D11_BLEND_DESC desc = {}; + desc.RenderTarget[0].BlendEnable = blend; + desc.RenderTarget[0].SrcBlend = src; + desc.RenderTarget[0].DestBlend = dst; + desc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD; + desc.RenderTarget[0].SrcBlendAlpha = (src == D3D11_BLEND_DEST_COLOR ) ? D3D11_BLEND_DEST_ALPHA : src; + desc.RenderTarget[0].DestBlendAlpha = dst; + desc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD; + desc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL; + + ID3D11BlendState *res; + HRESULT hr = dev->CreateBlendState(&desc, &res); + if (FAILED(hr)) { + report_d3d_error(hr, "CreateBlendState", ""); + res = NULL; + } + + return res; +} + +#define GDRAW_SHADER_FILE "gdraw_d3d10_shaders.inl" +#include "gdraw_d3d1x_shared.inl" + +static void create_pixel_shader(ProgramWithCachedVariableLocations *p, ProgramWithCachedVariableLocations *src) +{ + *p = *src; + if(p->bytecode) { + HRESULT hr = gdraw->d3d_device->CreatePixelShader(p->bytecode, p->size, NULL, &p->pshader); + if (FAILED(hr)) { + report_d3d_error(hr, "CreatePixelShader", ""); + p->pshader = NULL; + return; + } + } +} + +static void create_vertex_shader(ProgramWithCachedVariableLocations *p, ProgramWithCachedVariableLocations *src) +{ + *p = *src; + if(p->bytecode) { + HRESULT hr = gdraw->d3d_device->CreateVertexShader(p->bytecode, p->size, NULL, &p->vshader); + if (FAILED(hr)) { + report_d3d_error(hr, "CreateVertexShader", ""); + p->vshader = NULL; + return; + } + } +} + +GDrawFunctions *gdraw_D3D11_CreateContext(ID3D11Device *dev, ID3D11DeviceContext *ctx, S32 w, S32 h) +{ + return create_context(dev, ctx, w, h); +} + +// 4J added - interface so we can set the viewport back to the one that Iggy last set up +void gdraw_D3D11_setViewport_4J() +{ + set_viewport(); +} \ No newline at end of file diff --git a/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d11.h b/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d11.h new file mode 100644 index 00000000..c8db492a --- /dev/null +++ b/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d11.h @@ -0,0 +1,137 @@ +#pragma once +// gdraw_d3d11.h - author: Fabian Giesen - copyright 2011 RAD Game Tools +// +// Interface for creating a D3D11 GDraw driver. + +#define IDOC +//idoc(parent,GDraw_d3d11) + +typedef enum gdraw_d3d11_resourcetype +{ + GDRAW_D3D11_RESOURCE_rendertarget, + GDRAW_D3D11_RESOURCE_texture, + GDRAW_D3D11_RESOURCE_vertexbuffer, + GDRAW_D3D11_RESOURCE_dynbuffer, // Streaming buffer for dynamic vertex/index data (handle count ignored) + + GDRAW_D3D11_RESOURCE__count, +} gdraw_d3d11_resourcetype; + +IDOC extern int gdraw_D3D11_SetResourceLimits(gdraw_d3d11_resourcetype type, S32 num_handles, S32 num_bytes); +/* This sets how large the memory pool for a given resource types is, and how many handles + GDraw should allocate for it. GDraw keeps track of allocations in each pool, and will free + old resources in a LRU manner to make space if one of the limits is about to be exceeded. + + Returns 1 if value successfully changed, 0 on error. + You need to call IggyPlayerFlushAll on all active Iggys before you do this to make + them flush their resources since changing the resource limits invalidates all handles. + You also need to call IggyFlushInstalledFonts if you have any installed fonts. +*/ + +IDOC extern GDrawFunctions * gdraw_D3D11_CreateContext(ID3D11Device *dev, ID3D11DeviceContext *ctx, S32 w, S32 h); +/* Creates a GDraw context for rendering using D3D. You need to pass in the D3D device, + the device context to use for rendering, and the width/height of render target textures. + + The width/height is used solely for sizing internal rendertargets. They will be + allocated to the larger of this size and the size of any rendered tiles (with padding). + In other words, you can pass in (0,0) and the rendertargets will be allocated to the + right size. However, if you draw multiple Iggy files or tiles of different sizes, + they might first be allocated too small; it's best to pass in the correct size initially + to avoid unnecessary allocation/deallocation of too-small rendertargets. + + There can only be one D3D GDraw context active at any one time. + + If initialization fails for some reason (the main reason would be an out of memory condition), + NULL is returned. Otherwise, you can pass the return value to IggySetGDraw. */ + +IDOC extern void gdraw_D3D11_DestroyContext(void); +/* Destroys the current GDraw context, if any. */ + +IDOC extern void gdraw_D3D11_SetErrorHandler(void (__cdecl *error_handler)(HRESULT hr)); +/* Sets the GDraw D3D error handler. + + This will get called with the respective D3D error code if GDraw encounters an error + that it can't handle by itself (e.g. running out of state objects). */ + +IDOC extern void gdraw_D3D11_SetRendertargetSize(S32 w, S32 h); +/* Changes the current render target size (and recreates all rendertargets if necessary). + This allows you to shrink the rendertargets if the new needed size is smaller + than it was previously. As with $gdraw_D3D11_CreateContext, the width and + height specified here are only minimums; GDraw will reallocate larger rendertargets + as needed. */ + +IDOC extern void gdraw_D3D11_SetTileOrigin(ID3D11RenderTargetView *main_rt, ID3D11DepthStencilView *main_ds, + ID3D11ShaderResourceView *non_msaa_rt, S32 x, S32 y); +/* This sets the main rendertarget and matching depth/stencil buffer that GDraw + should render to and the x/y position of the output location of the top-left + of the current tile (allowing you to finely-position content, or to do tiled + rendering). + + If your rendertarget uses multisampling, you also need to specify a shader + resource view for a non-MSAA rendertarget texture (identically sized to main_rt) + in non_msaa_rt. This is only used if the Flash content includes non-standard + blend modes which have to use a special blend shader, so you can leave it NULL + if you forbid such content. + + You need to call this before Iggy calls any rendering functions. */ + +IDOC extern void gdraw_D3D11_NoMoreGDrawThisFrame(void); +/* Tells GDraw that no more rendering operations will occur this frame. This triggers + some end-of-frame processing; most importantly, GDraw uses this call as a marker to + detect thrashing (and react accordingly), so please do not forget to call this + every frame! (As long as Iggy does any rendering, that is) */ + +IDOC extern void gdraw_D3D11_PreReset(void); +/* Call this before D3D device Reset(); it will free all default pool resources allocated + by GDraw. */ + +IDOC extern void gdraw_D3D11_PostReset(void); +/* Call after D3D device Reset(). */ + +IDOC extern void RADLINK gdraw_D3D11_BeginCustomDraw_4J(IggyCustomDrawCallbackRegion *Region, F32 mat[16]); +IDOC extern void RADLINK gdraw_D3D11_CalculateCustomDraw_4J(IggyCustomDrawCallbackRegion *Region, F32 mat[16]); +IDOC extern void RADLINK gdraw_D3D11_BeginCustomDraw(IggyCustomDrawCallbackRegion *Region, F32 mat[4][4]); +/* Call at the beginning of Iggy custom draw callback to clear any odd render states GDraw has + set on the D3D device, and to get the current 2D object-to-world transformation. */ + +IDOC extern void RADLINK gdraw_D3D11_EndCustomDraw(IggyCustomDrawCallbackRegion *Region); +/* Call at the end of Iggy custom draw callback so GDraw can restore its render states. */ + +IDOC extern void RADLINK gdraw_D3D11_GetResourceUsageStats(gdraw_d3d11_resourcetype type, S32 *handles_used, S32 *bytes_used); +/* D3D only: Get resource usage stats for last frame. + This can be used to get an estimate of how much graphics memory got used by GDraw + during the last frame. + + For the dynbuffer, this always returns 0 in handles_used and the *size of the largest + single allocation* in bytes_used. It needs to be sized so that this allocation fits; + make it smaller and it won't work, but if you make it much larger (say more than 2x + as big), it's just a waste of memory. That said, we still recommend to make it no + smaller than 64k, and the default is 256k. + + Caveat: This counts the number of bytes that GDraw knows about. 3D hardware usually + has its own management overhead, alignment requirements, allocation granularity + and so on. In short, this is not an accurate estimate of how much memory is actually + used by the GPU - it is a lower bound, though, and makes for a useful ballpark estimate. */ + +IDOC extern GDrawTexture *gdraw_D3D11_WrappedTextureCreate(ID3D11ShaderResourceView *tex_view); +/* Create a wrapped texture from a shader resource view. + A wrapped texture can be used to let Iggy draw using the contents of a texture + you create and manage on your own. For example, you might render to this texture, + or stream video into it. Wrapped textures take up a handle. They will never be + freed or otherwise modified by GDraw; nor will GDraw change any reference counts. + All this is up to the application. */ + +IDOC extern void gdraw_D3D11_WrappedTextureChange(GDrawTexture *tex, ID3D11ShaderResourceView *tex_view); +/* Switch an existing GDrawTexture * that represents a wrapped texture to use + a new underlying D3D view. For example, you might internally double-buffer + a dynamically updated texture. As above, GDraw will leave this texture alone + and not touch any reference counts. */ + +IDOC extern void gdraw_D3D11_WrappedTextureDestroy(GDrawTexture *tex); +/* Destroys the GDraw wrapper for a wrapped texture object. This will free up + a GDraw texture handle but not release the associated D3D texture; that is + up to you. */ + +GDrawTexture * RADLINK gdraw_D3D11_MakeTextureFromResource(U8 *resource_file, S32 length, IggyFileTextureRaw *texture); +void RADLINK gdraw_D3D11_DestroyTextureFromResource(GDrawTexture *tex); +// 4J added +extern void RADLINK gdraw_D3D11_setViewport_4J(); \ No newline at end of file diff --git a/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d1x_shared.inl b/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d1x_shared.inl new file mode 100644 index 00000000..1ab1f13f --- /dev/null +++ b/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d1x_shared.inl @@ -0,0 +1,2491 @@ +// gdraw_d3d1x_shared.inl - author: Fabian Giesen - copyright 2012 RAD Game Tools +// +// This file implements the part of the Iggy graphics driver layer shared between +// D3D10 and 11 (which is most of it). It heavily depends on a bunch of typedefs, +// #defines and utility functions that need to be set up correctly for the D3D version +// being targeted. This is a bit ugly, but much easier to maintain than the original +// solution, where we just kept two almost identical versions of this code. + +// That native handle type holds resource handles and a coarse description. +typedef union { + // handle that is a texture + struct { + ID3D1X(Texture2D) *d3d; + ID3D1X(ShaderResourceView) *d3d_view; + ID3D1X(RenderTargetView) *d3d_rtview; + U32 w, h; + } tex; + + // handle that is a vertex buffer + struct { + ID3D1X(Buffer) *verts; + ID3D1X(Buffer) *inds; + } vbuf; +} GDrawNativeHandle; + +#define GDRAW_NO_STREAMING_MIPGEN // This renderer doesn't use GDraw-internal mipmap generation +#include "gdraw_shared.inl" + +// max rendertarget stack depth. this depends on the extent to which you +// use filters and non-standard blend modes, and how nested they are. +#define MAX_RENDER_STACK_DEPTH 8 // Iggy is hardcoded to a limit of 16... probably 1-3 is realistic +#define AATEX_SAMPLER 7 // sampler that aa_tex gets set in +#define STENCIL_STATE_CACHE_SIZE 32 // number of distinct stencil states we cache DepthStencilStates for +#define QUAD_IB_COUNT 2048 // quad index buffer has indices for this many quads + +#define ASSERT_COUNT(a,b) ((a) == (b) ? (b) : -1) + +static GDrawFunctions gdraw_funcs; + +// render target state +typedef struct +{ + GDrawHandle *color_buffer; + S32 base_x, base_y, width, height; + U32 flags; + rrbool cached; +} GDrawFramebufferState; + +struct ProgramWithCachedVariableLocations +{ + DWORD *bytecode; + union { + DWORD size; + ID3D1X(PixelShader) *pshader; + ID3D1X(VertexShader) *vshader; + }; +}; + +struct DynBuffer +{ + ID3D1X(Buffer) *buffer; + U32 size; // size of buffer + U32 write_pos; // start of most recently allocated chunk + U32 alloc_pos; // end of most recently allocated chunk (=start of next allocation) +}; + +/////////////////////////////////////////////////////////////////////////////// +// +// GDraw data structure +// +// +// This is the primary rendering abstraction, which hides all +// the platform-specific rendering behavior from Iggy. It is +// full of platform-specific graphics state, and also general +// graphics state so that it doesn't have to callback into Iggy +// to get at that graphics state. + +typedef struct +{ + ID3D1XDevice *d3d_device; + ID3D1XContext *d3d_context; + + // fragment shaders + ProgramWithCachedVariableLocations fprog[GDRAW_TEXTURE__count][3]; + ProgramWithCachedVariableLocations exceptional_blend[GDRAW_BLENDSPECIAL__count]; + ProgramWithCachedVariableLocations filter_prog[2][16]; + ProgramWithCachedVariableLocations blur_prog[MAX_TAPS+1]; + ProgramWithCachedVariableLocations colormatrix; + ProgramWithCachedVariableLocations clear_ps; + + // vertex input layouts + ID3D1X(InputLayout) *inlayout[GDRAW_vformat__count]; + + // vertex shaders + ProgramWithCachedVariableLocations vert[GDRAW_vformat__count]; // [format] + + // render targets + GDrawHandleCache rendertargets; + GDrawHandle rendertarget_handles[MAX_RENDER_STACK_DEPTH]; // not -1, because we use +1 to initialize + + gswf_recti rt_valid[MAX_RENDER_STACK_DEPTH+1]; // valid rect for texture clamping + + // size of framebuffer-sized texture used for implementing blend modes + S32 frametex_width, frametex_height; + + // viewport setting (in pixels) for current frame + S32 vx,vy; + S32 fw,fh; // full width/height of virtual display + S32 tw,th; // actual width/height of current tile + S32 tpw,tph; // width/height of padded version of tile + + S32 tx0,ty0; + S32 tx0p,ty0p; + rrbool in_blur; + struct { + S32 x,y,w,h; + } cview; // current viewport + + F32 projection[4]; // scalex,scaley,transx,transy + F32 projmat[3][4]; + F32 xform_3d[3][4]; + rrbool use_3d; + + ID3D1X(RenderTargetView) *main_framebuffer; + ID3D1X(DepthStencilView) *depth_buffer[2]; // 0=main, 1=rendertarget + ID3D1X(ShaderResourceView) *main_resolve_target; + rrbool main_msaa; // does main framebuffer have MSAA enabled? + + ID3D1X(Texture2D) *rt_depth_buffer; + ID3D1X(Texture2D) *aa_tex; + ID3D1X(ShaderResourceView) *aa_tex_view; + ID3D1X(Buffer) *quad_ib; // canned quad indices + + // scale factor converting worldspace to viewspace <0,0>.. + F32 world_to_pixel[2]; + + // state objects + ID3D1X(RasterizerState) *raster_state[2]; // [msaa] + ID3D1X(SamplerState) *sampler_state[2][GDRAW_WRAP__count]; // [nearest][wrap] + ID3D1X(BlendState) *blend_state[GDRAW_BLEND__count]; + ID3D1X(BlendState) *blend_no_color_write; + ID3D1X(DepthStencilState) *depth_state[2][2]; // [set_id][test_id] + + // stencil state cache + // SOA so the keys are tightly packed in a few cache lines! + U32 stencil_cache_key[STENCIL_STATE_CACHE_SIZE]; + ID3D1X(DepthStencilState) *stencil_cache[STENCIL_STATE_CACHE_SIZE]; + U32 stencil_cache_lru[STENCIL_STATE_CACHE_SIZE]; + U32 stencil_cache_now; + + // constant buffers + ID3D1X(Buffer) *cb_vertex; + ID3D1X(Buffer) *cb_ps_common; + ID3D1X(Buffer) *cb_filter; + ID3D1X(Buffer) *cb_colormatrix; + ID3D1X(Buffer) *cb_blur; + + // streaming buffers for dynamic vertex/index data + DynBuffer dyn_vb; + DynBuffer dyn_ib; + + U32 dyn_maxalloc, last_dyn_maxalloc; + S32 max_quad_vert_count; + + // cached state + U32 scissor_state; // ~0 if unknown, otherwise 0 or 1 + S32 blend_mode; // -1 if unknown, otherwise GDRAW_BLEND_* + + // render-state stack described above for 'temporary' rendering + GDrawFramebufferState frame[MAX_RENDER_STACK_DEPTH]; + GDrawFramebufferState *cur; + + // texture and vertex buffer pools + GDrawHandleCache *texturecache; + GDrawHandleCache *vbufcache; + + // stat tracking + rrbool frame_done; + U64 frame_counter; + + // error handler + void (__cdecl *error_handler)(HRESULT hr); +} GDraw; + +static GDraw *gdraw; + +static const F32 four_zeros[4] = { 0 }; // used in several places + +//////////////////////////////////////////////////////////////////////// +// +// General resource management for both textures and vertex buffers +// + +template +static void safe_release(T *&p) +{ + if (p) { + p->Release(); + p = NULL; + } +} + +static void report_d3d_error(HRESULT hr, char *call, char *context) +{ + if (hr == E_OUTOFMEMORY) + IggyGDrawSendWarning(NULL, "GDraw D3D out of memory in %s%s", call, context); + else + IggyGDrawSendWarning(NULL, "GDraw D3D error in %s%s: 0x%08x", call, context, hr); +} + +static void unbind_resources(void) +{ + ID3D1XContext *d3d = gdraw->d3d_context; + + // unset active textures and vertex/index buffers, + // to make sure there are no dangling refs + static ID3D1X(ShaderResourceView) *no_views[3] = { 0 }; + ID3D1X(Buffer) *no_vb = NULL; + UINT no_offs = 0; + + d3d->PSSetShaderResources(0, 3, no_views); + d3d->IASetVertexBuffers(0, 1, &no_vb, &no_offs, &no_offs); + d3d->IASetIndexBuffer(NULL, DXGI_FORMAT_UNKNOWN, 0); +} + +static void api_free_resource(GDrawHandle *r) +{ + unbind_resources(); + if (r->state != GDRAW_HANDLE_STATE_user_owned) { + if (!r->cache->is_vertex) { + safe_release(r->handle.tex.d3d_view); + safe_release(r->handle.tex.d3d_rtview); + safe_release(r->handle.tex.d3d); + } else { + safe_release(r->handle.vbuf.verts); + safe_release(r->handle.vbuf.inds); + } + } +} + +static void RADLINK gdraw_UnlockHandles(GDrawStats * /*stats*/) +{ + gdraw_HandleCacheUnlockAll(gdraw->texturecache); + gdraw_HandleCacheUnlockAll(gdraw->vbufcache); +} + +//////////////////////////////////////////////////////////////////////// +// +// Dynamic buffer +// + +static void *start_write_dyn(DynBuffer *buf, U32 size) +{ + U8 *ptr = NULL; + + if (size > buf->size) { + IggyGDrawSendWarning(NULL, "GDraw dynamic vertex buffer usage of %d bytes in one call larger than buffer size %d", size, buf->size); + return NULL; + } + + // update statistics + gdraw->dyn_maxalloc = RR_MAX(gdraw->dyn_maxalloc, size); + + // invariant: current alloc_pos is in [0,size] + assert(buf->alloc_pos <= buf->size); + + // wrap around when less than "size" bytes left in buffer + buf->write_pos = ((buf->size - buf->alloc_pos) < size) ? 0 : buf->alloc_pos; + + // discard buffer whenever the current write position is 0; + // done this way so that if a DISCARD Map() were to fail, we would + // just keep retrying the next time around. + ptr = (U8 *) map_buffer(gdraw->d3d_context, buf->buffer, buf->write_pos == 0); + if (ptr) { + ptr += buf->write_pos; // we return pointer to write position in buffer + buf->alloc_pos = buf->write_pos + size; // bump alloc position + assert(buf->alloc_pos <= buf->size); // invariant again + } + // if map_buffer fails, it will have sent a warning + + return ptr; +} + +static U32 end_write_dyn(DynBuffer *buf) +{ + unmap_buffer(gdraw->d3d_context, buf->buffer); + return buf->write_pos; +} + +//////////////////////////////////////////////////////////////////////// +// +// Stencil state cache +// + +static void stencil_state_cache_clear() +{ + S32 i; + + for (i=0; i < STENCIL_STATE_CACHE_SIZE; ++i) { + gdraw->stencil_cache_key[i] = 0; + safe_release(gdraw->stencil_cache[i]); + gdraw->stencil_cache_lru[i] = 0; + } + + gdraw->stencil_cache_now = 0; +} + +static ID3D1X(DepthStencilState) *stencil_state_cache_lookup(rrbool set_id, rrbool test_id, U8 read_mask, U8 write_mask) +{ + D3D1X_(DEPTH_STENCIL_DESC) desc; + S32 i, best = 0; + U32 key = (set_id << 1) | test_id | (read_mask << 8) | (write_mask << 16); + U32 now, age, highest_age; + HRESULT hr; + + // for LRU + now = ++gdraw->stencil_cache_now; + + // do we have this in the cache? + for (i=0; i < STENCIL_STATE_CACHE_SIZE; ++i) { + if (gdraw->stencil_cache_key[i] == key) { + gdraw->stencil_cache_lru[i] = now; + return gdraw->stencil_cache[i]; + } + } + + // not in the cache, find the best slot to replace it with (LRU) + highest_age = 0; + for (i=0; i < STENCIL_STATE_CACHE_SIZE; ++i) { + if (!gdraw->stencil_cache[i]) { // unused slot! + best = i; + break; + } + + age = now - gdraw->stencil_cache_lru[i]; + if (age > highest_age) { + highest_age = age; + best = i; + } + } + + // release old depth/stencil state at that position and create new one + safe_release(gdraw->stencil_cache[best]); + + gdraw->depth_state[set_id][test_id]->GetDesc(&desc); // reference state + desc.StencilEnable = TRUE; + desc.StencilReadMask = read_mask; + desc.StencilWriteMask = write_mask; + desc.FrontFace.StencilFailOp = D3D1X_(STENCIL_OP_KEEP); + desc.FrontFace.StencilDepthFailOp = D3D1X_(STENCIL_OP_KEEP); + desc.FrontFace.StencilPassOp = D3D1X_(STENCIL_OP_REPLACE); + desc.FrontFace.StencilFunc = D3D1X_(COMPARISON_EQUAL); + desc.BackFace.StencilFailOp = D3D1X_(STENCIL_OP_KEEP); + desc.BackFace.StencilDepthFailOp = D3D1X_(STENCIL_OP_KEEP); + desc.BackFace.StencilPassOp = D3D1X_(STENCIL_OP_REPLACE); + desc.BackFace.StencilFunc = D3D1X_(COMPARISON_EQUAL); + + hr = gdraw->d3d_device->CreateDepthStencilState(&desc, &gdraw->stencil_cache[best]); + if (FAILED(hr)) + report_d3d_error(hr, "CreateDepthStencilState", ""); + + gdraw->stencil_cache_key[best] = key; + gdraw->stencil_cache_lru[best] = now; + return gdraw->stencil_cache[best]; +} + +//////////////////////////////////////////////////////////////////////// +// +// Texture creation/updating/deletion +// + +extern GDrawTexture *gdraw_D3D1X_(WrappedTextureCreate)(ID3D1X(ShaderResourceView) *tex_view) +{ + GDrawStats stats={0}; + GDrawHandle *p = gdraw_res_alloc_begin(gdraw->texturecache, 0, &stats); // it may need to free one item to give us a handle + p->handle.tex.d3d = NULL; + p->handle.tex.d3d_view = tex_view; + p->handle.tex.d3d_rtview = NULL; + p->handle.tex.w = 1; + p->handle.tex.h = 1; + gdraw_HandleCacheAllocateEnd(p, 0, NULL, GDRAW_HANDLE_STATE_user_owned); + return (GDrawTexture *) p; +} + +extern void gdraw_D3D1X_(WrappedTextureChange)(GDrawTexture *tex, ID3D1X(ShaderResourceView) *tex_view) +{ + GDrawHandle *p = (GDrawHandle *) tex; + p->handle.tex.d3d = NULL; + p->handle.tex.d3d_view = tex_view; +} + +extern void gdraw_D3D1X_(WrappedTextureDestroy)(GDrawTexture *tex) +{ + GDrawStats stats={0}; + gdraw_res_free((GDrawHandle *) tex, &stats); +} + +static void RADLINK gdraw_SetTextureUniqueID(GDrawTexture *tex, void *old_id, void *new_id) +{ + GDrawHandle *p = (GDrawHandle *) tex; + // if this is still the handle it's thought to be, change the owner; + // if the owner *doesn't* match, then they're changing a stale handle, so ignore + if (p->owner == old_id) + p->owner = new_id; +} + + +static rrbool RADLINK gdraw_MakeTextureBegin(void *owner, S32 width, S32 height, gdraw_texture_format format, U32 flags, GDraw_MakeTexture_ProcessingInfo *p, GDrawStats *stats) +{ + GDrawHandle *t = NULL; + DXGI_FORMAT dxgi_fmt; + S32 bpp, size = 0, nmips = 0; + + if (width >= 16384 || height >= 16384) { + IggyGDrawSendWarning(NULL, "GDraw texture size too large (%d x %d), dimension limit is 16384", width, height); + return false; + } + + if (format == GDRAW_TEXTURE_FORMAT_rgba32) { + dxgi_fmt = DXGI_FORMAT_R8G8B8A8_UNORM; + bpp = 4; + } else { + dxgi_fmt = DXGI_FORMAT_R8_UNORM; + bpp = 1; + } + + // compute estimated size of texture in video memory + do { + size += RR_MAX(width >> nmips, 1) * RR_MAX(height >> nmips, 1) * bpp; + ++nmips; + } while ((flags & GDRAW_MAKETEXTURE_FLAGS_mipmap) && ((width >> nmips) || (height >> nmips))); + + // try to allocate memory for the client to write to + p->texture_data = (U8 *) IggyGDrawMalloc(size); + if (!p->texture_data) { + IggyGDrawSendWarning(NULL, "GDraw out of memory to store texture data to pass to D3D for %d x %d texture", width, height); + return false; + } + + // allocate a handle and make room in the cache for this much data + t = gdraw_res_alloc_begin(gdraw->texturecache, size, stats); + if (!t) { + IggyGDrawFree(p->texture_data); + return false; + } + + t->handle.tex.w = width; + t->handle.tex.h = height; + t->handle.tex.d3d = NULL; + t->handle.tex.d3d_view = NULL; + t->handle.tex.d3d_rtview = NULL; + + p->texture_type = GDRAW_TEXTURE_TYPE_rgba; + p->p0 = t; + p->p1 = owner; + p->i0 = width; + p->i1 = height; + p->i2 = flags; + p->i3 = dxgi_fmt; + p->i4 = size; + p->i5 = nmips; + p->i6 = bpp; + + p->stride_in_bytes = width * bpp; + p->num_rows = height; + + return true; +} + +static rrbool RADLINK gdraw_MakeTextureMore(GDraw_MakeTexture_ProcessingInfo * /*p*/) +{ + return false; +} + +static GDrawTexture * RADLINK gdraw_MakeTextureEnd(GDraw_MakeTexture_ProcessingInfo *p, GDrawStats *stats) +{ + GDrawHandle *t = (GDrawHandle *) p->p0; + D3D1X_(SUBRESOURCE_DATA) mipdata[24]; + S32 i, w, h, nmips, bpp; + HRESULT hr = S_OK; + char *failed_call; + U8 *ptr; + + // generate mip maps and set up descriptors for them + assert(p->i5 <= 24); + ptr = p->texture_data; + w = p->i0; + h = p->i1; + nmips = p->i5; + bpp = p->i6; + + for (i=0; i < nmips; ++i) { + mipdata[i].pSysMem = ptr; + mipdata[i].SysMemPitch = RR_MAX(w >> i, 1) * bpp; + mipdata[i].SysMemSlicePitch = 0; + ptr += mipdata[i].SysMemPitch * RR_MAX(h >> i, 1); + + // create mip data by downsampling + if (i) + gdraw_Downsample((U8 *) mipdata[i].pSysMem, mipdata[i].SysMemPitch, w >> i, h >> i, + (U8 *) mipdata[i-1].pSysMem, mipdata[i-1].SysMemPitch, bpp); + } + + // actually create texture + D3D1X_(TEXTURE2D_DESC) desc = { w, h, nmips, 1, (DXGI_FORMAT) p->i3, { 1, 0 }, + (p->i2 & GDRAW_MAKETEXTURE_FLAGS_updatable) ? D3D1X_(USAGE_DEFAULT) : D3D1X_(USAGE_IMMUTABLE), + D3D1X_(BIND_SHADER_RESOURCE), 0, 0 }; + + failed_call = "CreateTexture2D"; + hr = gdraw->d3d_device->CreateTexture2D(&desc, mipdata, &t->handle.tex.d3d); + if (FAILED(hr)) goto done; + + // and create a corresponding shader resource view + failed_call = "CreateShaderResourceView"; + hr = gdraw->d3d_device->CreateShaderResourceView(t->handle.tex.d3d, NULL, &t->handle.tex.d3d_view); + +done: + if (!FAILED(hr)) { + gdraw_HandleCacheAllocateEnd(t, p->i4, p->p1, (p->i2 & GDRAW_MAKETEXTURE_FLAGS_never_flush) ? GDRAW_HANDLE_STATE_pinned : GDRAW_HANDLE_STATE_locked); + stats->nonzero_flags |= GDRAW_STATS_alloc_tex; + stats->alloc_tex += 1; + stats->alloc_tex_bytes += p->i4; + } else { + safe_release(t->handle.tex.d3d); + safe_release(t->handle.tex.d3d_view); + + gdraw_HandleCacheAllocateFail(t); + t = NULL; + report_d3d_error(hr, failed_call, " while creating texture"); + } + + IggyGDrawFree(p->texture_data); + return (GDrawTexture *) t; +} + +static rrbool RADLINK gdraw_UpdateTextureBegin(GDrawTexture *t, void *unique_id, GDrawStats * /*stats*/) +{ + return gdraw_HandleCacheLock((GDrawHandle *) t, unique_id); +} + +static void RADLINK gdraw_UpdateTextureRect(GDrawTexture *t, void * /*unique_id*/, S32 x, S32 y, S32 stride, S32 w, S32 h, U8 *samples, gdraw_texture_format /*format*/) +{ + GDrawHandle *s = (GDrawHandle *) t; + D3D1X_(BOX) box = { x, y, 0, x+w, y+h, 1 }; + + gdraw->d3d_context->UpdateSubresource(s->handle.tex.d3d, 0, &box, samples, stride, 0); +} + +static void RADLINK gdraw_UpdateTextureEnd(GDrawTexture *t, void * /*unique_id*/, GDrawStats * /*stats*/) +{ + gdraw_HandleCacheUnlock((GDrawHandle *) t); +} + +static void RADLINK gdraw_FreeTexture(GDrawTexture *tt, void *unique_id, GDrawStats *stats) +{ + GDrawHandle *t = (GDrawHandle *) tt; + assert(t != NULL); // @GDRAW_ASSERT + if (t->owner == unique_id || unique_id == NULL) { + if (t->cache == &gdraw->rendertargets) { + gdraw_HandleCacheUnlock(t); + // cache it by simply not freeing it + return; + } + + gdraw_res_free(t, stats); + } +} + +static rrbool RADLINK gdraw_TryToLockTexture(GDrawTexture *t, void *unique_id, GDrawStats * /*stats*/) +{ + return gdraw_HandleCacheLock((GDrawHandle *) t, unique_id); +} + +static void RADLINK gdraw_DescribeTexture(GDrawTexture *tex, GDraw_Texture_Description *desc) +{ + GDrawHandle *p = (GDrawHandle *) tex; + desc->width = p->handle.tex.w; + desc->height = p->handle.tex.h; + desc->size_in_bytes = p->bytes; +} + +static void RADLINK gdraw_SetAntialiasTexture(S32 width, U8 *rgba) +{ + HRESULT hr; + + safe_release(gdraw->aa_tex_view); + safe_release(gdraw->aa_tex); + + D3D1X_(TEXTURE2D_DESC) desc = { width, 1, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM, { 1, 0 }, D3D1X_(USAGE_IMMUTABLE), D3D1X_(BIND_SHADER_RESOURCE), 0, 0 }; + D3D1X_(SUBRESOURCE_DATA) data = { rgba, width*4, 0 }; + + hr = gdraw->d3d_device->CreateTexture2D(&desc, &data, &gdraw->aa_tex); + if (FAILED(hr)) { + report_d3d_error(hr, "CreateTexture2D", ""); + return; + } + + hr = gdraw->d3d_device->CreateShaderResourceView(gdraw->aa_tex, NULL, &gdraw->aa_tex_view); + if (FAILED(hr)) { + report_d3d_error(hr, "CreateShaderResourceView", " while creating texture"); + safe_release(gdraw->aa_tex); + return; + } +} + +//////////////////////////////////////////////////////////////////////// +// +// Vertex buffer creation/deletion +// + +static rrbool RADLINK gdraw_MakeVertexBufferBegin(void *unique_id, gdraw_vformat /*vformat*/, S32 vbuf_size, S32 ibuf_size, GDraw_MakeVertexBuffer_ProcessingInfo *p, GDrawStats *stats) +{ + // prepare staging buffers for the app to put data into + p->vertex_data = (U8 *) IggyGDrawMalloc(vbuf_size); + p->index_data = (U8 *) IggyGDrawMalloc(ibuf_size); + if (p->vertex_data && p->index_data) { + GDrawHandle *vb = gdraw_res_alloc_begin(gdraw->vbufcache, vbuf_size + ibuf_size, stats); + if (vb) { + vb->handle.vbuf.verts = NULL; + vb->handle.vbuf.inds = NULL; + + p->vertex_data_length = vbuf_size; + p->index_data_length = ibuf_size; + p->p0 = vb; + p->p1 = unique_id; + return true; + } + } + + if (p->vertex_data) + IggyGDrawFree(p->vertex_data); + if (p->index_data) + IggyGDrawFree(p->index_data); + + return false; +} + +static rrbool RADLINK gdraw_MakeVertexBufferMore(GDraw_MakeVertexBuffer_ProcessingInfo * /*p*/) +{ + assert(0); + return false; +} + +static GDrawVertexBuffer * RADLINK gdraw_MakeVertexBufferEnd(GDraw_MakeVertexBuffer_ProcessingInfo *p, GDrawStats * /*stats*/) +{ + GDrawHandle *vb = (GDrawHandle *) p->p0; + + HRESULT hr; + D3D1X_(BUFFER_DESC) vbdesc = { p->vertex_data_length, D3D1X_(USAGE_IMMUTABLE), D3D1X_(BIND_VERTEX_BUFFER), 0, 0 }; + D3D1X_(SUBRESOURCE_DATA) vbdata = { p->vertex_data, 0, 0 }; + + D3D1X_(BUFFER_DESC) ibdesc = { p->index_data_length, D3D1X_(USAGE_IMMUTABLE), D3D1X_(BIND_INDEX_BUFFER), 0, 0 }; + D3D1X_(SUBRESOURCE_DATA) ibdata = { p->index_data, 0, 0 }; + + hr = gdraw->d3d_device->CreateBuffer(&vbdesc, &vbdata, &vb->handle.vbuf.verts); + if (!FAILED(hr)) + hr = gdraw->d3d_device->CreateBuffer(&ibdesc, &ibdata, &vb->handle.vbuf.inds); + + if (FAILED(hr)) { + safe_release(vb->handle.vbuf.verts); + safe_release(vb->handle.vbuf.inds); + + gdraw_HandleCacheAllocateFail(vb); + vb = NULL; + + report_d3d_error(hr, "CreateBuffer", " creating vertex buffer"); + } else { + gdraw_HandleCacheAllocateEnd(vb, p->vertex_data_length + p->index_data_length, p->p1, GDRAW_HANDLE_STATE_locked); + } + + IggyGDrawFree(p->vertex_data); + IggyGDrawFree(p->index_data); + + return (GDrawVertexBuffer *) vb; +} + +static rrbool RADLINK gdraw_TryLockVertexBuffer(GDrawVertexBuffer *vb, void *unique_id, GDrawStats * /*stats*/) +{ + return gdraw_HandleCacheLock((GDrawHandle *) vb, unique_id); +} + +static void RADLINK gdraw_FreeVertexBuffer(GDrawVertexBuffer *vb, void *unique_id, GDrawStats *stats) +{ + GDrawHandle *h = (GDrawHandle *) vb; + assert(h != NULL); // @GDRAW_ASSERT + if (h->owner == unique_id) + gdraw_res_free(h, stats); +} + +static void RADLINK gdraw_DescribeVertexBuffer(GDrawVertexBuffer *vbuf, GDraw_VertexBuffer_Description *desc) +{ + GDrawHandle *p = (GDrawHandle *) vbuf; + desc->size_in_bytes = p->bytes; +} + +//////////////////////////////////////////////////////////////////////// +// +// Create/free (or cache) render targets +// + +static GDrawHandle *get_color_rendertarget(GDrawStats *stats) +{ + char *failed_call; + + // try to recycle LRU rendertarget + GDrawHandle *t = gdraw_HandleCacheGetLRU(&gdraw->rendertargets); + if (t) { + gdraw_HandleCacheLock(t, (void *) 1); + return t; + } + + // ran out of RTs, allocate a new one + S32 size = gdraw->frametex_width * gdraw->frametex_height * 4; + if (gdraw->rendertargets.bytes_free < size) { + IggyGDrawSendWarning(NULL, "GDraw rendertarget allocation failed: hit size limit of %d bytes", gdraw->rendertargets.total_bytes); + return NULL; + } + + t = gdraw_HandleCacheAllocateBegin(&gdraw->rendertargets); + if (!t) { + IggyGDrawSendWarning(NULL, "GDraw rendertarget allocation failed: hit handle limit"); + return t; + } + + D3D1X_(TEXTURE2D_DESC) desc = { gdraw->frametex_width, gdraw->frametex_height, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM, { 1, 0 }, + D3D1X_(USAGE_DEFAULT), D3D1X_(BIND_SHADER_RESOURCE) | D3D1X_(BIND_RENDER_TARGET), 0, 0 }; + + t->handle.tex.d3d = NULL; + t->handle.tex.d3d_view = NULL; + t->handle.tex.d3d_rtview = NULL; + + HRESULT hr = gdraw->d3d_device->CreateTexture2D(&desc, NULL, &t->handle.tex.d3d); + failed_call = "CreateTexture2D"; + if (!FAILED(hr)) { + hr = gdraw->d3d_device->CreateShaderResourceView(t->handle.tex.d3d, NULL, &t->handle.tex.d3d_view); + failed_call = "CreateTexture2D"; + } + if (!FAILED(hr)) { + hr = gdraw->d3d_device->CreateRenderTargetView(t->handle.tex.d3d, NULL, &t->handle.tex.d3d_rtview); + failed_call = "CreateRenderTargetView"; + } + + if (FAILED(hr)) { + safe_release(t->handle.tex.d3d); + safe_release(t->handle.tex.d3d_view); + safe_release(t->handle.tex.d3d_rtview); + gdraw_HandleCacheAllocateFail(t); + + report_d3d_error(hr, failed_call, " creating rendertarget"); + + return NULL; + } + + gdraw_HandleCacheAllocateEnd(t, size, (void *) 1, GDRAW_HANDLE_STATE_locked); + stats->nonzero_flags |= GDRAW_STATS_alloc_tex; + stats->alloc_tex += 1; + stats->alloc_tex_bytes += size; + + return t; +} + +static ID3D1X(DepthStencilView) *get_rendertarget_depthbuffer(GDrawStats *stats) +{ + if (!gdraw->depth_buffer[1]) { + char *failed_call; + assert(!gdraw->rt_depth_buffer); + + D3D1X_(TEXTURE2D_DESC) desc = { gdraw->frametex_width, gdraw->frametex_height, 1, 1, DXGI_FORMAT_D24_UNORM_S8_UINT, { 1, 0 }, + D3D1X_(USAGE_DEFAULT), D3D1X_(BIND_DEPTH_STENCIL), 0, 0 }; + + HRESULT hr = gdraw->d3d_device->CreateTexture2D(&desc, NULL, &gdraw->rt_depth_buffer); + failed_call = "CreateTexture2D"; + if (!FAILED(hr)) { + hr = gdraw->d3d_device->CreateDepthStencilView(gdraw->rt_depth_buffer, NULL, &gdraw->depth_buffer[1]); + failed_call = "CreateDepthStencilView while creating rendertarget"; + } + + if (FAILED(hr)) { + report_d3d_error(hr, failed_call, ""); + safe_release(gdraw->rt_depth_buffer); + safe_release(gdraw->depth_buffer[1]); + } else { + stats->nonzero_flags |= GDRAW_STATS_alloc_tex; + stats->alloc_tex += 1; + stats->alloc_tex_bytes += gdraw->frametex_width * gdraw->frametex_height * 4; + + gdraw->d3d_context->ClearDepthStencilView(gdraw->depth_buffer[1], D3D1X_(CLEAR_DEPTH) | D3D1X_(CLEAR_STENCIL), 1.0f, 0); + } + } + + return gdraw->depth_buffer[1]; +} + +static void flush_rendertargets(GDrawStats *stats) +{ + gdraw_res_flush(&gdraw->rendertargets, stats); + + safe_release(gdraw->depth_buffer[1]); + safe_release(gdraw->rt_depth_buffer); +} + +//////////////////////////////////////////////////////////////////////// +// +// Constant buffer layouts +// + +struct VertexVars +{ + F32 world[2][4]; + F32 x_off[4]; + F32 texgen_s[4]; + F32 texgen_t[4]; + F32 x3d[4]; + F32 y3d[4]; + F32 w3d[4]; +}; + +struct PixelCommonVars +{ + F32 color_mul[4]; + F32 color_add[4]; + F32 focal[4]; + F32 rescale1[4]; +}; + +struct PixelParaFilter +{ + F32 clamp0[4], clamp1[4]; + F32 color[4], color2[4]; + F32 tc_off[4]; +}; + +struct PixelParaBlur +{ + F32 clamp[4]; + F32 tap[9][4]; +}; + +struct PixelParaColorMatrix +{ + F32 data[5][4]; +}; + +//////////////////////////////////////////////////////////////////////// +// +// Rendering helpers +// + +static void disable_scissor(int force) +{ + if (force || gdraw->scissor_state) { + // disable scissor by setting whole viewport as scissor rect + S32 x = gdraw->cview.x; + S32 y = gdraw->cview.y; + D3D1X_(RECT) r = { x, y, x + gdraw->cview.w, y + gdraw->cview.h }; + + gdraw->d3d_context->RSSetScissorRects(1, &r); + gdraw->scissor_state = 0; + } +} + +static void set_viewport_raw(S32 x, S32 y, S32 w, S32 h) +{ + D3D1X_(VIEWPORT) vp = { (ViewCoord) x, (ViewCoord) y, (ViewCoord) w, (ViewCoord) h, 0.0f, 1.0f }; + gdraw->d3d_context->RSSetViewports(1, &vp); + gdraw->cview.x = x; + gdraw->cview.y = y; + gdraw->cview.w = w; + gdraw->cview.h = h; + + disable_scissor(1); +} + +static void set_projection_base(void) +{ + // x3d = < viewproj.x, 0, 0, 0 > + // y3d = < 0, viewproj.y, 0, 0 > + // w3d = < viewproj.z, viewproj.w, 1.0, 1.0 > + + memset(gdraw->projmat[0], 0, sizeof(gdraw->projmat)); + gdraw->projmat[0][0] = gdraw->projection[0]; + gdraw->projmat[1][1] = gdraw->projection[1]; + gdraw->projmat[2][0] = gdraw->projection[2]; + gdraw->projmat[2][1] = gdraw->projection[3]; + + gdraw->projmat[2][2] = 1.0; + gdraw->projmat[2][3] = 1.0; +} + +static void set_projection_raw(S32 x0, S32 x1, S32 y0, S32 y1) +{ + gdraw->projection[0] = 2.0f / (x1-x0); + gdraw->projection[1] = 2.0f / (y1-y0); + gdraw->projection[2] = (x1+x0)/(F32)(x0-x1); + gdraw->projection[3] = (y1+y0)/(F32)(y0-y1); + + set_projection_base(); +} + + +static void set_viewport(void) +{ + if (gdraw->in_blur) { + set_viewport_raw(0, 0, gdraw->tpw, gdraw->tph); + return; + } + + if (gdraw->cur == gdraw->frame) // if the rendering stack is empty + // render a tile-sized region to the user-request tile location + set_viewport_raw(gdraw->vx, gdraw->vy, gdraw->tw, gdraw->th); + else if (gdraw->cur->cached) + set_viewport_raw(0, 0, gdraw->cur->width, gdraw->cur->height); + else + // if on the render stack, draw a padded-tile-sized region at the origin + set_viewport_raw(0, 0, gdraw->tpw, gdraw->tph); +} + +static void set_projection(void) +{ + if (gdraw->in_blur) return; + if (gdraw->cur == gdraw->frame) // if the render stack is empty + set_projection_raw(gdraw->tx0, gdraw->tx0+gdraw->tw, gdraw->ty0+gdraw->th, gdraw->ty0); + else if (gdraw->cur->cached) + set_projection_raw(gdraw->cur->base_x, gdraw->cur->base_x+gdraw->cur->width, gdraw->cur->base_y, gdraw->cur->base_y+gdraw->cur->height); + else + set_projection_raw(gdraw->tx0p, gdraw->tx0p+gdraw->tpw, gdraw->ty0p+gdraw->tph, gdraw->ty0p); +} + +static void clear_renderstate(void) +{ + gdraw->d3d_context->ClearState(); +} + +static void set_common_renderstate() +{ + ID3D1XContext *d3d = gdraw->d3d_context; + S32 i; + + clear_renderstate(); + + // all the render states we never change while drawing + d3d->IASetPrimitiveTopology(D3D1X_(PRIMITIVE_TOPOLOGY_TRIANGLELIST)); + + d3d->PSSetShaderResources(7, 1, &gdraw->aa_tex_view); + d3d->PSSetSamplers(7, 1, &gdraw->sampler_state[0][GDRAW_WRAP_clamp]); + + // set a well-defined default sampler for all PS textures we use + for (i=0; i < 3; ++i) + d3d->PSSetSamplers(i, 1, &gdraw->sampler_state[0][GDRAW_WRAP_clamp]); + + // reset our state caching + gdraw->scissor_state = ~0u; + gdraw->blend_mode = -1; +} + +static void manual_clear(gswf_recti *r, GDrawStats *stats); +static void set_render_target(GDrawStats *stats); + +//////////////////////////////////////////////////////////////////////// +// +// Begin/end rendering of a tile and per-frame processing +// + +void gdraw_D3D1X_(SetRendertargetSize)(S32 w, S32 h) +{ + if (gdraw && (w != gdraw->frametex_width || h != gdraw->frametex_height)) { + GDrawStats stats = { 0 }; + gdraw->frametex_width = w; + gdraw->frametex_height = h; + flush_rendertargets(&stats); + } +} + +void gdraw_D3D1X_(SetTileOrigin)(ID3D1X(RenderTargetView) *main_rt, ID3D1X(DepthStencilView) *main_ds, ID3D1X(ShaderResourceView) *non_msaa_rt, S32 x, S32 y) +{ + D3D1X_(RENDER_TARGET_VIEW_DESC) desc; + + if (gdraw->frame_done) { + ++gdraw->frame_counter; + gdraw->frame_done = false; + } + + main_rt->GetDesc(&desc); + + gdraw->main_framebuffer = main_rt; + gdraw->main_resolve_target = non_msaa_rt; + gdraw->main_msaa = (desc.ViewDimension == D3D1X_(RTV_DIMENSION_TEXTURE2DMS)); + gdraw->depth_buffer[0] = main_ds; + + gdraw->vx = x; + gdraw->vy = y; +} + +static void RADLINK gdraw_SetViewSizeAndWorldScale(S32 w, S32 h, F32 scalex, F32 scaley) +{ + memset(gdraw->frame, 0, sizeof(gdraw->frame)); + gdraw->cur = gdraw->frame; + gdraw->fw = w; + gdraw->fh = h; + gdraw->tw = w; + gdraw->th = h; + gdraw->world_to_pixel[0] = scalex; + gdraw->world_to_pixel[1] = scaley; + set_viewport(); +} + +// must include anything necessary for texture creation/update +static void RADLINK gdraw_RenderingBegin(void) +{ +} +static void RADLINK gdraw_RenderingEnd(void) +{ +} + +static void RADLINK gdraw_RenderTileBegin(S32 x0, S32 y0, S32 x1, S32 y1, S32 pad, GDrawStats *stats) +{ + if (x0 == 0 && y0 == 0 && x1 == gdraw->fw && y1 == gdraw->fh) + pad = 0; + + gdraw->tx0 = x0; + gdraw->ty0 = y0; + gdraw->tw = x1-x0; + gdraw->th = y1-y0; + + // padded region + gdraw->tx0p = RR_MAX(x0 - pad, 0); + gdraw->ty0p = RR_MAX(y0 - pad, 0); + gdraw->tpw = RR_MIN(x1 + pad, gdraw->fw) - gdraw->tx0p; + gdraw->tph = RR_MIN(y1 + pad, gdraw->fh) - gdraw->ty0p; + + // make sure our rendertargets are large enough to contain the tile + if (gdraw->tpw > gdraw->frametex_width || gdraw->tph > gdraw->frametex_height) { + gdraw->frametex_width = RR_MAX(gdraw->tpw, gdraw->frametex_width); + gdraw->frametex_height = RR_MAX(gdraw->tph, gdraw->frametex_height); + + flush_rendertargets(stats); + } + assert(gdraw->tpw <= gdraw->frametex_width && gdraw->tph <= gdraw->frametex_height); + + // set up rendertargets we'll use + set_common_renderstate(); + gdraw->d3d_context->ClearDepthStencilView(gdraw->depth_buffer[0], D3D1X_(CLEAR_DEPTH) | D3D1X_(CLEAR_STENCIL), 1.0f, 0); + if (gdraw->depth_buffer[1]) + gdraw->d3d_context->ClearDepthStencilView(gdraw->depth_buffer[1], D3D1X_(CLEAR_DEPTH) | D3D1X_(CLEAR_STENCIL), 1.0f, 0); + + set_projection(); + set_viewport(); + set_render_target(stats); +} + +static void RADLINK gdraw_RenderTileEnd(GDrawStats * /*stats*/) +{ +} + +void gdraw_D3D1X_(NoMoreGDrawThisFrame)(void) +{ + clear_renderstate(); + gdraw->frame_done = true; + + gdraw->last_dyn_maxalloc = gdraw->dyn_maxalloc; + gdraw->dyn_maxalloc = 0; + + // reset dynamic buffer alloc position so they get DISCARDed + // next time around. + gdraw->dyn_vb.alloc_pos = 0; + gdraw->dyn_ib.alloc_pos = 0; + + GDrawFence now = { gdraw->frame_counter }; + gdraw_HandleCacheTick(gdraw->texturecache, now); + gdraw_HandleCacheTick(gdraw->vbufcache, now); +} + +#define MAX_DEPTH_VALUE (1 << 13) + +static void RADLINK gdraw_GetInfo(GDrawInfo *d) +{ + d->num_stencil_bits = 8; + d->max_id = MAX_DEPTH_VALUE-2; + // for floating point depth, just use mantissa, e.g. 16-20 bits + d->buffer_format = GDRAW_BFORMAT_vbib; + d->shared_depth_stencil = 1; + d->always_mipmap = 1; +#ifndef GDRAW_D3D11_LEVEL9 + d->max_texture_size = 8192; + d->conditional_nonpow2 = 0; +#else + d->max_texture_size = 2048; + d->conditional_nonpow2 = 1; +#endif +} + +//////////////////////////////////////////////////////////////////////// +// +// Enable/disable rendertargets in stack fashion +// + +static ID3D1X(RenderTargetView) *get_active_render_target() +{ + if (gdraw->cur->color_buffer) { + unbind_resources(); // to make sure this RT isn't accidentally set as a texture (avoid D3D warnings) + return gdraw->cur->color_buffer->handle.tex.d3d_rtview; + } else + return gdraw->main_framebuffer; +} + +static void set_render_target(GDrawStats *stats) +{ + ID3D1X(RenderTargetView) *target = get_active_render_target(); + if (target == gdraw->main_framebuffer) { + gdraw->d3d_context->OMSetRenderTargets(1, &target, gdraw->depth_buffer[0]); + gdraw->d3d_context->RSSetState(gdraw->raster_state[gdraw->main_msaa]); + } else { + ID3D1X(DepthStencilView) *depth = NULL; + if (gdraw->cur->flags & (GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_id | GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_stencil)) + depth = get_rendertarget_depthbuffer(stats); + + gdraw->d3d_context->OMSetRenderTargets(1, &target, depth); + gdraw->d3d_context->RSSetState(gdraw->raster_state[0]); + } + + stats->nonzero_flags |= GDRAW_STATS_rendtarg; + stats->rendertarget_changes += 1; +} + +static rrbool RADLINK gdraw_TextureDrawBufferBegin(gswf_recti *region, gdraw_texture_format /*format*/, U32 flags, void *owner, GDrawStats *stats) +{ + GDrawFramebufferState *n = gdraw->cur+1; + GDrawHandle *t = NULL; + if (gdraw->tw == 0 || gdraw->th == 0) { + IggyGDrawSendWarning(NULL, "GDraw warning: w=0,h=0 rendertarget"); + return false; + } + + if (n >= &gdraw->frame[MAX_RENDER_STACK_DEPTH]) { + assert(0); + IggyGDrawSendWarning(NULL, "GDraw rendertarget nesting exceeds MAX_RENDER_STACK_DEPTH"); + return false; + } + + if (owner) { + // nyi + } else { + t = get_color_rendertarget(stats); + if (!t) + return false; + } + + n->flags = flags; + n->color_buffer = t; + assert(n->color_buffer != NULL); // @GDRAW_ASSERT + + ++gdraw->cur; + gdraw->cur->cached = owner != NULL; + if (owner) { + gdraw->cur->base_x = region->x0; + gdraw->cur->base_y = region->y0; + gdraw->cur->width = region->x1 - region->x0; + gdraw->cur->height = region->y1 - region->y0; + } + + set_render_target(stats); + assert(gdraw->frametex_width >= gdraw->tw && gdraw->frametex_height >= gdraw->th); // @GDRAW_ASSERT + + S32 k = (S32) (t - gdraw->rendertargets.handle); + + if (region) { + gswf_recti r; + S32 ox, oy, pad = 2; // 2 pixels of border on all sides + // 1 pixel turns out to be not quite enough with the interpolator precision we get. + + if (gdraw->in_blur) + ox = oy = 0; + else + ox = gdraw->tx0p, oy = gdraw->ty0p; + + // clamp region to tile + S32 xt0 = RR_MAX(region->x0 - ox, 0); + S32 yt0 = RR_MAX(region->y0 - oy, 0); + S32 xt1 = RR_MIN(region->x1 - ox, gdraw->tpw); + S32 yt1 = RR_MIN(region->y1 - oy, gdraw->tph); + + // but the padding needs to clamp to render target bounds + r.x0 = RR_MAX(xt0 - pad, 0); + r.y0 = RR_MAX(yt0 - pad, 0); + r.x1 = RR_MIN(xt1 + pad, gdraw->frametex_width); + r.y1 = RR_MIN(yt1 + pad, gdraw->frametex_height); + + if (r.x1 <= r.x0 || r.y1 <= r.y0) { // region doesn't intersect with current tile + --gdraw->cur; + gdraw_FreeTexture((GDrawTexture *) t, 0, stats); + // note: don't send a warning since this will happen during regular tiled rendering + return false; + } + + manual_clear(&r, stats); + + gdraw->rt_valid[k].x0 = xt0; + gdraw->rt_valid[k].y0 = yt0; + gdraw->rt_valid[k].x1 = xt1; + gdraw->rt_valid[k].y1 = yt1; + } else { + gdraw->d3d_context->ClearRenderTargetView(gdraw->cur->color_buffer->handle.tex.d3d_rtview, four_zeros); + gdraw->rt_valid[k].x0 = 0; + gdraw->rt_valid[k].y0 = 0; + gdraw->rt_valid[k].x1 = gdraw->frametex_width; + gdraw->rt_valid[k].y1 = gdraw->frametex_height; + } + + if (!gdraw->in_blur) { + set_viewport(); + set_projection(); + } else { + set_viewport_raw(0, 0, gdraw->tpw, gdraw->tph); + set_projection_raw(0, gdraw->tpw, gdraw->tph, 0); + } + + return true; +} + +static GDrawTexture *RADLINK gdraw_TextureDrawBufferEnd(GDrawStats *stats) +{ + GDrawFramebufferState *n = gdraw->cur; + GDrawFramebufferState *m = --gdraw->cur; + if (gdraw->tw == 0 || gdraw->th == 0) return 0; + + if (n >= &gdraw->frame[MAX_RENDER_STACK_DEPTH]) + return 0; // already returned a warning in Begin + + assert(m >= gdraw->frame); // bug in Iggy -- unbalanced + + if (m != gdraw->frame) { + assert(m->color_buffer != NULL); // @GDRAW_ASSERT + } + assert(n->color_buffer != NULL); // @GDRAW_ASSERT + + // switch back to old render target + set_render_target(stats); + + // if we're at the root, set the viewport back + set_viewport(); + set_projection(); + + return (GDrawTexture *) n->color_buffer; +} + + +//////////////////////////////////////////////////////////////////////// +// +// Clear stencil/depth buffers +// +// Open question whether we'd be better off finding bounding boxes +// and only clearing those; it depends exactly how fast clearing works. +// + +static void RADLINK gdraw_ClearStencilBits(U32 /*bits*/) +{ + gdraw->d3d_context->ClearDepthStencilView(gdraw->depth_buffer[0], D3D1X_(CLEAR_STENCIL), 1.0f, 0); + if (gdraw->depth_buffer[1]) + gdraw->d3d_context->ClearDepthStencilView(gdraw->depth_buffer[1], D3D1X_(CLEAR_STENCIL), 1.0f, 0); +} + +// this only happens rarely (hopefully never) if we use the depth buffer, +// so we can just clear the whole thing +static void RADLINK gdraw_ClearID(void) +{ + gdraw->d3d_context->ClearDepthStencilView(gdraw->depth_buffer[0], D3D1X_(CLEAR_DEPTH), 1.0f, 0); + if (gdraw->depth_buffer[1]) + gdraw->d3d_context->ClearDepthStencilView(gdraw->depth_buffer[1], D3D1X_(CLEAR_DEPTH), 1.0f, 0); +} + +//////////////////////////////////////////////////////////////////////// +// +// Set all the render state from GDrawRenderState +// +// This also is responsible for getting the framebuffer into a texture +// if the read-modify-write blend operation can't be expressed with +// the native blend operators. (E.g. "screen") +// + +// convert an ID request to a value suitable for the depth buffer, +// assuming the depth buffer has been mappped to 0..1 +static F32 depth_from_id(S32 id) +{ + return 1.0f - ((F32) id + 1.0f) / MAX_DEPTH_VALUE; +} + +static void set_texture(S32 texunit, GDrawTexture *tex, rrbool nearest, S32 wrap) +{ + ID3D1XContext *d3d = gdraw->d3d_context; + + if (tex == NULL) { + ID3D1X(ShaderResourceView) *notex = NULL; + d3d->PSSetShaderResources(texunit, 1, ¬ex); + } else { + GDrawHandle *h = (GDrawHandle *) tex; + d3d->PSSetShaderResources(texunit, 1, &h->handle.tex.d3d_view); + d3d->PSSetSamplers(texunit, 1, &gdraw->sampler_state[nearest][wrap]); + } +} + +static void RADLINK gdraw_Set3DTransform(F32 *mat) +{ + if (mat == NULL) + gdraw->use_3d = 0; + else { + gdraw->use_3d = 1; + memcpy(gdraw->xform_3d, mat, sizeof(gdraw->xform_3d)); + } +} + +static int set_renderstate_full(S32 vertex_format, GDrawRenderState *r, GDrawStats * /* stats */, const F32 *rescale1) +{ + ID3D1XContext *d3d = gdraw->d3d_context; + + // set vertex shader + set_vertex_shader(d3d, gdraw->vert[vertex_format].vshader); + + // set vertex shader constants + if (VertexVars *vvars = (VertexVars *) map_buffer(gdraw->d3d_context, gdraw->cb_vertex, true)) { + F32 depth = depth_from_id(r->id); + if (!r->use_world_space) + gdraw_ObjectSpace(vvars->world[0], r->o2w, depth, 0.0f); + else + gdraw_WorldSpace(vvars->world[0], gdraw->world_to_pixel, depth, 0.0f); + + memcpy(&vvars->x_off, r->edge_matrix, 4*sizeof(F32)); + + if (r->texgen0_enabled) { + memcpy(&vvars->texgen_s, r->s0_texgen, 4*sizeof(F32)); + memcpy(&vvars->texgen_t, r->t0_texgen, 4*sizeof(F32)); + } + + if (gdraw->use_3d) + memcpy(vvars->x3d, gdraw->xform_3d, 12*sizeof(F32)); + else + memcpy(vvars->x3d, gdraw->projmat, 12*sizeof(F32)); + + unmap_buffer(gdraw->d3d_context, gdraw->cb_vertex); + + d3d->VSSetConstantBuffers(0, 1, &gdraw->cb_vertex); + } + + // set the blend mode + int blend_mode = r->blend_mode; + if (blend_mode != gdraw->blend_mode) { + gdraw->blend_mode = blend_mode; + d3d->OMSetBlendState(gdraw->blend_state[blend_mode], four_zeros, ~0u); + } + + // set the fragment program + if (blend_mode != GDRAW_BLEND_special) { + int which = r->tex0_mode; + assert(which >= 0 && which < sizeof(gdraw->fprog) / sizeof(*gdraw->fprog)); + + int additive = 0; + if (r->cxf_add) { + additive = 1; + if (r->cxf_add[3]) additive = 2; + } + + ID3D1X(PixelShader) *program = gdraw->fprog[which][additive].pshader; + if (r->stencil_set) { + // in stencil set mode, prefer not doing any shading at all + // but if alpha test is on, we need to make an exception + +#ifndef GDRAW_D3D11_LEVEL9 // level9 can't do NULL PS it seems + if (which != GDRAW_TEXTURE_alpha_test) + program = NULL; + else +#endif + { + gdraw->blend_mode = -1; + d3d->OMSetBlendState(gdraw->blend_no_color_write, four_zeros, ~0u); + } + } + + set_pixel_shader(d3d, program); + } else + set_pixel_shader(d3d, gdraw->exceptional_blend[r->special_blend].pshader); + + set_texture(0, r->tex[0], r->nearest0, r->wrap0); + + // pixel shader constants + if (PixelCommonVars *pvars = (PixelCommonVars *) map_buffer(gdraw->d3d_context, gdraw->cb_ps_common, true)) { + memcpy(pvars->color_mul, r->color, 4*sizeof(float)); + + if (r->cxf_add) { + pvars->color_add[0] = r->cxf_add[0] / 255.0f; + pvars->color_add[1] = r->cxf_add[1] / 255.0f; + pvars->color_add[2] = r->cxf_add[2] / 255.0f; + pvars->color_add[3] = r->cxf_add[3] / 255.0f; + } else + pvars->color_add[0] = pvars->color_add[1] = pvars->color_add[2] = pvars->color_add[3] = 0.0f; + + if (r->tex0_mode == GDRAW_TEXTURE_focal_gradient) memcpy(pvars->focal, r->focal_point, 4*sizeof(float)); + if (r->blend_mode == GDRAW_BLEND_special) memcpy(pvars->rescale1, rescale1, 4*sizeof(float)); + unmap_buffer(gdraw->d3d_context, gdraw->cb_ps_common); + d3d->PSSetConstantBuffers(0, 1, &gdraw->cb_ps_common); + } + + // Set pixel operation states + if (r->scissor) { + D3D1X_(RECT) s; + gdraw->scissor_state = 1; + if (gdraw->cur == gdraw->frame) { + s.left = r->scissor_rect.x0 + gdraw->vx - gdraw->tx0; + s.top = r->scissor_rect.y0 + gdraw->vy - gdraw->ty0; + s.right = r->scissor_rect.x1 + gdraw->vx - gdraw->tx0; + s.bottom = r->scissor_rect.y1 + gdraw->vy - gdraw->ty0; + } else { + s.left = r->scissor_rect.x0 - gdraw->tx0p; + s.top = r->scissor_rect.y0 - gdraw->ty0p; + s.right = r->scissor_rect.x1 - gdraw->tx0p; + s.bottom = r->scissor_rect.y1 - gdraw->ty0p; + } + d3d->RSSetScissorRects(1, &s); + } else if (r->scissor != gdraw->scissor_state) + disable_scissor(0); + + if (r->stencil_set | r->stencil_test) + d3d->OMSetDepthStencilState(stencil_state_cache_lookup(r->set_id, r->test_id, r->stencil_test, r->stencil_set), 255); + else + d3d->OMSetDepthStencilState(gdraw->depth_state[r->set_id][r->test_id], 0); + + return 1; +} + +static RADINLINE int set_renderstate(S32 vertex_format, GDrawRenderState *r, GDrawStats *stats) +{ + static const F32 unit_rescale[4] = { 1.0f, 1.0f, 0.0f, 0.0f }; + if (r->identical_state) { + // fast path: only need to change vertex shader, other state is the same + set_vertex_shader(gdraw->d3d_context, gdraw->vert[vertex_format].vshader); + return 1; + } else + return set_renderstate_full(vertex_format, r, stats, unit_rescale); +} + +//////////////////////////////////////////////////////////////////////// +// +// Vertex formats +// + +static D3D1X_(INPUT_ELEMENT_DESC) vformat_v2[] = { + { "POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D1X_(INPUT_PER_VERTEX_DATA), 0 }, +}; + +static D3D1X_(INPUT_ELEMENT_DESC) vformat_v2aa[] = { + { "POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D1X_(INPUT_PER_VERTEX_DATA), 0 }, + { "TEXCOORD", 0, DXGI_FORMAT_R16G16B16A16_SINT, 0, 8, D3D1X_(INPUT_PER_VERTEX_DATA), 0 }, +}; + +static D3D1X_(INPUT_ELEMENT_DESC) vformat_v2tc2[] = { + { "POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D1X_(INPUT_PER_VERTEX_DATA), 0 }, + { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 8, D3D1X_(INPUT_PER_VERTEX_DATA), 0 }, +}; + +static struct gdraw_vertex_format_desc { + D3D1X_(INPUT_ELEMENT_DESC) *desc; + U32 nelem; +} vformats[ASSERT_COUNT(GDRAW_vformat__basic_count, 3)] = { + vformat_v2, 1, // GDRAW_vformat_v2 + vformat_v2aa, 2, // GDRAW_vformat_v2aa + vformat_v2tc2, 2, // GDRAW_vforamt_v2tc2 +}; + +static int vertsize[GDRAW_vformat__basic_count] = { + 8, // GDRAW_vformat_v2 + 16, // GDRAW_vformat_v2aa + 16, // GDRAW_vformat_v2tc2 +}; + +//////////////////////////////////////////////////////////////////////// +// +// Draw triangles with a given renderstate +// + +static void tag_resources(void *r1, void *r2=NULL, void *r3=NULL, void *r4=NULL) +{ + U64 now = gdraw->frame_counter; + if (r1) ((GDrawHandle *) r1)->fence.value = now; + if (r2) ((GDrawHandle *) r2)->fence.value = now; + if (r3) ((GDrawHandle *) r3)->fence.value = now; + if (r4) ((GDrawHandle *) r4)->fence.value = now; +} + +static void RADLINK gdraw_DrawIndexedTriangles(GDrawRenderState *r, GDrawPrimitive *p, GDrawVertexBuffer *buf, GDrawStats *stats) +{ + ID3D1XContext *d3d = gdraw->d3d_context; + GDrawHandle *vb = (GDrawHandle *) buf; + int vfmt = p->vertex_format; + assert(vfmt >= 0 && vfmt < GDRAW_vformat__count); + + if (!set_renderstate(vfmt, r, stats)) + return; + + UINT stride = vertsize[vfmt]; + d3d->IASetInputLayout(gdraw->inlayout[vfmt]); + + if (vb) { + UINT offs = (UINT) (UINTa) p->vertices; + + d3d->IASetVertexBuffers(0, 1, &vb->handle.vbuf.verts, &stride, &offs); + d3d->IASetIndexBuffer(vb->handle.vbuf.inds, DXGI_FORMAT_R16_UINT, (UINT) (UINTa) p->indices); + d3d->DrawIndexed(p->num_indices, 0, 0); + } else if (p->indices) { + U32 vbytes = p->num_vertices * stride; + U32 ibytes = p->num_indices * 2; + + if (void *vbptr = start_write_dyn(&gdraw->dyn_vb, vbytes)) { + memcpy(vbptr, p->vertices, vbytes); + UINT vboffs = end_write_dyn(&gdraw->dyn_vb); + + if (void *ibptr = start_write_dyn(&gdraw->dyn_ib, ibytes)) { + memcpy(ibptr, p->indices, ibytes); + UINT iboffs = end_write_dyn(&gdraw->dyn_ib); + + d3d->IASetVertexBuffers(0, 1, &gdraw->dyn_vb.buffer, &stride, &vboffs); + d3d->IASetIndexBuffer(gdraw->dyn_ib.buffer, DXGI_FORMAT_R16_UINT, iboffs); + d3d->DrawIndexed(p->num_indices, 0, 0); + } + } + } else { // dynamic quads + assert(p->num_vertices % 4 == 0); + d3d->IASetIndexBuffer(gdraw->quad_ib, DXGI_FORMAT_R16_UINT, 0); + + if (gdraw->max_quad_vert_count) { + S32 pos = 0; + while (pos < p->num_vertices) { + S32 vert_count = RR_MIN(p->num_vertices - pos, gdraw->max_quad_vert_count); + UINT chunk_bytes = vert_count * stride; + + if (void *vbptr = start_write_dyn(&gdraw->dyn_vb, chunk_bytes)) { + memcpy(vbptr, (U8 *)p->vertices + pos*stride, chunk_bytes); + UINT offs = end_write_dyn(&gdraw->dyn_vb); + + d3d->IASetVertexBuffers(0, 1, &gdraw->dyn_vb.buffer, &stride, &offs); + d3d->DrawIndexed((vert_count >> 2) * 6, 0, 0); + } + pos += vert_count; + } + } + } + + tag_resources(vb, r->tex[0], r->tex[1]); + + stats->nonzero_flags |= GDRAW_STATS_batches; + stats->num_batches += 1; + stats->drawn_indices += p->num_indices; + stats->drawn_vertices += p->num_vertices; +} + +/////////////////////////////////////////////////////////////////////// +// +// Flash 8 filter effects +// + +static void *start_ps_constants(ID3D1X(Buffer) *buffer) +{ + return map_buffer(gdraw->d3d_context, buffer, true); +} + +static void end_ps_constants(ID3D1X(Buffer) *buffer) +{ + unmap_buffer(gdraw->d3d_context, buffer); + gdraw->d3d_context->PSSetConstantBuffers(1, 1, &buffer); +} + +static void set_pixel_constant(F32 *constant, F32 x, F32 y, F32 z, F32 w) +{ + constant[0] = x; + constant[1] = y; + constant[2] = z; + constant[3] = w; +} + +// caller sets up texture coordinates +static void do_screen_quad(gswf_recti *s, const F32 *tc, GDrawStats *stats) +{ + ID3D1XContext *d3d = gdraw->d3d_context; + F32 px0 = (F32) s->x0, py0 = (F32) s->y0, px1 = (F32) s->x1, py1 = (F32) s->y1; + + // generate vertex data + gswf_vertex_xyst *vert = (gswf_vertex_xyst *) start_write_dyn(&gdraw->dyn_vb, 4 * sizeof(gswf_vertex_xyst)); + if (!vert) + return; + + vert[0].x = px0; vert[0].y = py0; vert[0].s = tc[0]; vert[0].t = tc[1]; + vert[1].x = px1; vert[1].y = py0; vert[1].s = tc[2]; vert[1].t = tc[1]; + vert[2].x = px0; vert[2].y = py1; vert[2].s = tc[0]; vert[2].t = tc[3]; + vert[3].x = px1; vert[3].y = py1; vert[3].s = tc[2]; vert[3].t = tc[3]; + UINT offs = end_write_dyn(&gdraw->dyn_vb); + UINT stride = sizeof(gswf_vertex_xyst); + + if (VertexVars *vvars = (VertexVars *) map_buffer(gdraw->d3d_context, gdraw->cb_vertex, true)) { + gdraw_PixelSpace(vvars->world[0]); + memcpy(vvars->x3d, gdraw->projmat, 12*sizeof(F32)); + unmap_buffer(gdraw->d3d_context, gdraw->cb_vertex); + d3d->VSSetConstantBuffers(0, 1, &gdraw->cb_vertex); + + set_vertex_shader(d3d, gdraw->vert[GDRAW_vformat_v2tc2].vshader); + + d3d->IASetInputLayout(gdraw->inlayout[GDRAW_vformat_v2tc2]); + d3d->IASetVertexBuffers(0, 1, &gdraw->dyn_vb.buffer, &stride, &offs); + d3d->IASetPrimitiveTopology(D3D1X_(PRIMITIVE_TOPOLOGY_TRIANGLESTRIP)); + d3d->Draw(4, 0); + d3d->IASetPrimitiveTopology(D3D1X_(PRIMITIVE_TOPOLOGY_TRIANGLELIST)); + + stats->nonzero_flags |= GDRAW_STATS_batches; + stats->num_batches += 1; + stats->drawn_indices += 6; + stats->drawn_vertices += 4; + } +} + +static void manual_clear(gswf_recti *r, GDrawStats *stats) +{ + ID3D1XContext *d3d = gdraw->d3d_context; + + // go to known render state + d3d->OMSetBlendState(gdraw->blend_state[GDRAW_BLEND_none], four_zeros, ~0u); + d3d->OMSetDepthStencilState(gdraw->depth_state[0][0], 0); + gdraw->blend_mode = GDRAW_BLEND_none; + + set_viewport_raw(0, 0, gdraw->frametex_width, gdraw->frametex_height); + set_projection_raw(0, gdraw->frametex_width, gdraw->frametex_height, 0); + set_pixel_shader(d3d, gdraw->clear_ps.pshader); + + if (PixelCommonVars *pvars = (PixelCommonVars *) map_buffer(gdraw->d3d_context, gdraw->cb_ps_common, true)) { + memset(pvars, 0, sizeof(*pvars)); + unmap_buffer(gdraw->d3d_context, gdraw->cb_ps_common); + d3d->PSSetConstantBuffers(0, 1, &gdraw->cb_ps_common); + + do_screen_quad(r, four_zeros, stats); + } +} + +static void gdraw_DriverBlurPass(GDrawRenderState *r, int taps, float *data, gswf_recti *s, float *tc, float /*height_max*/, float *clamp, GDrawStats *gstats) +{ + set_texture(0, r->tex[0], false, GDRAW_WRAP_clamp); + + set_pixel_shader(gdraw->d3d_context, gdraw->blur_prog[taps].pshader); + PixelParaBlur *para = (PixelParaBlur *) start_ps_constants(gdraw->cb_blur); + memcpy(para->clamp, clamp, 4 * sizeof(float)); + memcpy(para->tap, data, taps * 4 * sizeof(float)); + end_ps_constants(gdraw->cb_blur); + + do_screen_quad(s, tc, gstats); + tag_resources(r->tex[0]); +} + +static void gdraw_Colormatrix(GDrawRenderState *r, gswf_recti *s, float *tc, GDrawStats *stats) +{ + if (!gdraw_TextureDrawBufferBegin(s, GDRAW_TEXTURE_FORMAT_rgba32, GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_color | GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_alpha, 0, stats)) + return; + + set_texture(0, r->tex[0], false, GDRAW_WRAP_clamp); + set_pixel_shader(gdraw->d3d_context, gdraw->colormatrix.pshader); + + PixelParaColorMatrix *para = (PixelParaColorMatrix *) start_ps_constants(gdraw->cb_colormatrix); + memcpy(para->data, r->shader_data, 5 * 4 * sizeof(float)); + end_ps_constants(gdraw->cb_colormatrix); + + do_screen_quad(s, tc, stats); + tag_resources(r->tex[0]); + r->tex[0] = gdraw_TextureDrawBufferEnd(stats); +} + +static gswf_recti *get_valid_rect(GDrawTexture *tex) +{ + GDrawHandle *h = (GDrawHandle *) tex; + S32 n = (S32) (h - gdraw->rendertargets.handle); + assert(n >= 0 && n <= MAX_RENDER_STACK_DEPTH+1); + return &gdraw->rt_valid[n]; +} + +static void set_clamp_constant(F32 *constant, GDrawTexture *tex) +{ + gswf_recti *s = get_valid_rect(tex); + // when we make the valid data, we make sure there is an extra empty pixel at the border + set_pixel_constant(constant, + (s->x0-0.5f) / gdraw->frametex_width, + (s->y0-0.5f) / gdraw->frametex_height, + (s->x1+0.5f) / gdraw->frametex_width, + (s->y1+0.5f) / gdraw->frametex_height); +} + +static void gdraw_Filter(GDrawRenderState *r, gswf_recti *s, float *tc, int isbevel, GDrawStats *stats) +{ + if (!gdraw_TextureDrawBufferBegin(s, GDRAW_TEXTURE_FORMAT_rgba32, GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_color | GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_alpha, NULL, stats)) + return; + + set_texture(0, r->tex[0], false, GDRAW_WRAP_clamp); + set_texture(1, r->tex[1], false, GDRAW_WRAP_clamp); + set_texture(2, r->tex[2], false, GDRAW_WRAP_clamp); + set_pixel_shader(gdraw->d3d_context, gdraw->filter_prog[isbevel][r->filter_mode].pshader); + + PixelParaFilter *para = (PixelParaFilter *) start_ps_constants(gdraw->cb_filter); + set_clamp_constant(para->clamp0, r->tex[0]); + set_clamp_constant(para->clamp1, r->tex[1]); + set_pixel_constant(para->color, r->shader_data[0], r->shader_data[1], r->shader_data[2], r->shader_data[3]); + set_pixel_constant(para->color2, r->shader_data[8], r->shader_data[9], r->shader_data[10], r->shader_data[11]); + set_pixel_constant(para->tc_off, -r->shader_data[4] / (F32)gdraw->frametex_width, -r->shader_data[5] / (F32)gdraw->frametex_height, r->shader_data[6], 0); + end_ps_constants(gdraw->cb_filter); + + do_screen_quad(s, tc, stats); + tag_resources(r->tex[0], r->tex[1], r->tex[2]); + r->tex[0] = gdraw_TextureDrawBufferEnd(stats); +} + +static void RADLINK gdraw_FilterQuad(GDrawRenderState *r, S32 x0, S32 y0, S32 x1, S32 y1, GDrawStats *stats) +{ + ID3D1XContext *d3d = gdraw->d3d_context; + F32 tc[4]; + gswf_recti s; + + // clip to tile boundaries + s.x0 = RR_MAX(x0, gdraw->tx0p); + s.y0 = RR_MAX(y0, gdraw->ty0p); + s.x1 = RR_MIN(x1, gdraw->tx0p + gdraw->tpw); + s.y1 = RR_MIN(y1, gdraw->ty0p + gdraw->tph); + if (s.x1 < s.x0 || s.y1 < s.y0) + return; + + tc[0] = (s.x0 - gdraw->tx0p) / (F32) gdraw->frametex_width; + tc[1] = (s.y0 - gdraw->ty0p) / (F32) gdraw->frametex_height; + tc[2] = (s.x1 - gdraw->tx0p) / (F32) gdraw->frametex_width; + tc[3] = (s.y1 - gdraw->ty0p) / (F32) gdraw->frametex_height; + + // clear to known render state + d3d->OMSetBlendState(gdraw->blend_state[GDRAW_BLEND_none], four_zeros, ~0u); + d3d->OMSetDepthStencilState(gdraw->depth_state[0][0], 0); + disable_scissor(0); + gdraw->blend_mode = GDRAW_BLEND_none; + + if (r->blend_mode == GDRAW_BLEND_filter) { + switch (r->filter) { + case GDRAW_FILTER_blur: { + GDrawBlurInfo b; + gswf_recti bounds = *get_valid_rect(r->tex[0]); + gdraw_ShiftRect(&s, &s, -gdraw->tx0p, -gdraw->ty0p); // blur uses physical rendertarget coordinates + + b.BlurPass = gdraw_DriverBlurPass; + b.w = gdraw->tpw; + b.h = gdraw->tph; + b.frametex_width = gdraw->frametex_width; + b.frametex_height = gdraw->frametex_height; + + // blur needs to draw with multiple passes, so set up special state + gdraw->in_blur = true; + + // do the blur + gdraw_Blur(&gdraw_funcs, &b, r, &s, &bounds, stats); + + // restore the normal state + gdraw->in_blur = false; + set_viewport(); + set_projection(); + break; + } + + case GDRAW_FILTER_colormatrix: + gdraw_Colormatrix(r, &s, tc, stats); + break; + + case GDRAW_FILTER_dropshadow: + gdraw_Filter(r, &s, tc, 0, stats); + break; + + case GDRAW_FILTER_bevel: + gdraw_Filter(r, &s, tc, 1, stats); + break; + + default: + assert(0); + } + } else { + GDrawHandle *blend_tex = NULL; + + // for crazy blend modes, we need to read back from the framebuffer + // and do the blending in the pixel shader. we do this with copies + // rather than trying to render-to-texture-all-along, because we want + // to be able to render over the user's existing framebuffer, which might + // not be a texture. note that this isn't optimal when MSAA is on! + F32 rescale1[4] = { 1.0f, 1.0f, 0.0f, 0.0f }; + if (r->blend_mode == GDRAW_BLEND_special) { + ID3D1XContext *d3d = gdraw->d3d_context; + ID3D1X(Resource) *cur_rt_rsrc; + get_active_render_target()->GetResource(&cur_rt_rsrc); + + if (gdraw->cur == gdraw->frame && gdraw->main_msaa) { + // source surface is main framebuffer and it uses MSAA. just resolve it first. + D3D1X_(SHADER_RESOURCE_VIEW_DESC) desc; + D3D1X_(TEXTURE2D_DESC) texdesc; + ID3D1X(Texture2D) *resolve_tex; + + gdraw->main_resolve_target->GetDesc(&desc); + gdraw->main_resolve_target->GetResource((ID3D1X(Resource) **) &resolve_tex); + resolve_tex->GetDesc(&texdesc); + d3d->ResolveSubresource(resolve_tex, 0, cur_rt_rsrc, 0, desc.Format); + resolve_tex->Release(); + + stats->nonzero_flags |= GDRAW_STATS_blits; + stats->num_blits += 1; + stats->num_blit_pixels += texdesc.Width * texdesc.Height; + + d3d->PSSetShaderResources(1, 1, &gdraw->main_resolve_target); + d3d->PSSetSamplers(1, 1, &gdraw->sampler_state[0][GDRAW_WRAP_clamp]); + + // calculate texture coordinate remapping + rescale1[0] = gdraw->frametex_width / (F32) texdesc.Width; + rescale1[1] = gdraw->frametex_height / (F32) texdesc.Height; + rescale1[2] = (gdraw->vx - gdraw->tx0 + gdraw->tx0p) / (F32) texdesc.Width; + rescale1[3] = (gdraw->vy - gdraw->ty0 + gdraw->ty0p) / (F32) texdesc.Height; + } else { + D3D1X_(BOX) box = { 0,0,0,0,0,1 }; + S32 dx = 0, dy = 0; + blend_tex = get_color_rendertarget(stats); + + if (gdraw->cur != gdraw->frame) + box.right=gdraw->tpw, box.bottom=gdraw->tph; + else { + box.left=gdraw->vx, box.top=gdraw->vy, box.right=gdraw->vx+gdraw->tw, box.bottom=gdraw->vy+gdraw->th; + dx = gdraw->tx0 - gdraw->tx0p; + dy = gdraw->ty0 - gdraw->ty0p; + } + + d3d->CopySubresourceRegion(blend_tex->handle.tex.d3d, 0, dx, dy, 0, + cur_rt_rsrc, 0, &box); + + stats->nonzero_flags |= GDRAW_STATS_blits; + stats->num_blits += 1; + stats->num_blit_pixels += (box.right - box.left) * (box.bottom - box.top); + + set_texture(1, (GDrawTexture *) blend_tex, false, GDRAW_WRAP_clamp); + } + + cur_rt_rsrc->Release(); + } + + if (!set_renderstate_full(GDRAW_vformat_v2tc2, r, stats, rescale1)) + return; + + do_screen_quad(&s, tc, stats); + tag_resources(r->tex[0], r->tex[1]); + if (blend_tex) + gdraw_FreeTexture((GDrawTexture *) blend_tex, 0, stats); + } +} + +/////////////////////////////////////////////////////////////////////// +// +// Shaders and state +// + +#include GDRAW_SHADER_FILE + +static void destroy_shader(ProgramWithCachedVariableLocations *p) +{ + if (p->pshader) { + p->pshader->Release(); + p->pshader = NULL; + } +} + +static ID3D1X(Buffer) *create_dynamic_buffer(U32 size, U32 bind) +{ + D3D1X_(BUFFER_DESC) desc = { size, D3D1X_(USAGE_DYNAMIC), bind, D3D1X_(CPU_ACCESS_WRITE), 0 }; + ID3D1X(Buffer) *buf = NULL; + HRESULT hr = gdraw->d3d_device->CreateBuffer(&desc, NULL, &buf); + if (FAILED(hr)) { + report_d3d_error(hr, "CreateBuffer", " creating dynamic vertex buffer"); + buf = NULL; + } + return buf; +} + +static void init_dyn_buffer(DynBuffer *buf, U32 size, U32 bind) +{ + buf->buffer = create_dynamic_buffer(size, bind); + buf->size = size; + buf->write_pos = 0; + buf->alloc_pos = 0; +} + +// These two functions are implemented by the D3D10- respectively D3D11-specific part. +static void create_pixel_shader(ProgramWithCachedVariableLocations *p, ProgramWithCachedVariableLocations *src); +static void create_vertex_shader(ProgramWithCachedVariableLocations *p, ProgramWithCachedVariableLocations *src); + +static void create_all_shaders_and_state(void) +{ + ID3D1X(Device) *d3d = gdraw->d3d_device; + HRESULT hr; + S32 i, j; + + for (i=0; i < GDRAW_TEXTURE__count*3; ++i) create_pixel_shader(&gdraw->fprog[0][i], pshader_basic_arr + i); + for (i=0; i < GDRAW_BLENDSPECIAL__count; ++i) create_pixel_shader(&gdraw->exceptional_blend[i], pshader_exceptional_blend_arr + i); + for (i=0; i < 32; ++i) create_pixel_shader(&gdraw->filter_prog[0][i], pshader_filter_arr + i); + for (i=0; i < MAX_TAPS+1; ++i) create_pixel_shader(&gdraw->blur_prog[i], pshader_blur_arr + i); + create_pixel_shader(&gdraw->colormatrix, pshader_color_matrix_arr); + create_pixel_shader(&gdraw->clear_ps, pshader_manual_clear_arr); + + for (i=0; i < GDRAW_vformat__basic_count; i++) { + ProgramWithCachedVariableLocations *vsh = vshader_vsd3d10_arr + i; + + create_vertex_shader(&gdraw->vert[i], vsh); + HRESULT hr = d3d->CreateInputLayout(vformats[i].desc, vformats[i].nelem, vsh->bytecode, vsh->size, &gdraw->inlayout[i]); + if (FAILED(hr)) { + report_d3d_error(hr, "CreateInputLayout", ""); + gdraw->inlayout[i] = NULL; + } + } + + // create rasterizer state setups + for (i=0; i < 2; ++i) { + D3D1X_(RASTERIZER_DESC) raster_desc = { D3D1X_(FILL_SOLID), D3D1X_(CULL_NONE), FALSE, 0, 0.0f, 0.0f, TRUE, TRUE, FALSE, FALSE }; + raster_desc.MultisampleEnable = i; + hr = d3d->CreateRasterizerState(&raster_desc, &gdraw->raster_state[i]); + if (FAILED(hr)) { + report_d3d_error(hr, "CreateRasterizerState", ""); + return; + } + } + + // create sampler state setups + static const D3D1X_(TEXTURE_ADDRESS_MODE) addrmode[ASSERT_COUNT(GDRAW_WRAP__count, 4)] = { + D3D1X_(TEXTURE_ADDRESS_CLAMP), // GDRAW_WRAP_clamp + D3D1X_(TEXTURE_ADDRESS_WRAP), // GDRAW_WRAP_repeat + D3D1X_(TEXTURE_ADDRESS_MIRROR), // GDRAW_WRAP_mirror + D3D1X_(TEXTURE_ADDRESS_CLAMP), // GDRAW_WRAP_clamp_to_border (unused for this renderer) + }; + + for (i=0; i < 2; ++i) { + for (j=0; j < GDRAW_WRAP__count; ++j) { + D3D1X_(SAMPLER_DESC) sampler_desc; + memset(&sampler_desc, 0, sizeof(sampler_desc)); + sampler_desc.Filter = i ? D3D1X_(FILTER_MIN_LINEAR_MAG_MIP_POINT) : D3D1X_(FILTER_MIN_MAG_MIP_LINEAR); + sampler_desc.AddressU = addrmode[j]; + sampler_desc.AddressV = addrmode[j]; + sampler_desc.AddressW = D3D1X_(TEXTURE_ADDRESS_CLAMP); + sampler_desc.MaxAnisotropy = 1; + sampler_desc.MaxLOD = D3D1X_(FLOAT32_MAX); + hr = d3d->CreateSamplerState(&sampler_desc, &gdraw->sampler_state[i][j]); + if (FAILED(hr)) { + report_d3d_error(hr, "CreateSamplerState", ""); + return; + } + } + } + + // create blend stage setups + static struct blendspec { + BOOL blend; + D3D1X_(BLEND) src; + D3D1X_(BLEND) dst; + } blends[ASSERT_COUNT(GDRAW_BLEND__count, 6)] = { + FALSE, D3D1X_(BLEND_ONE), D3D1X_(BLEND_ZERO), // GDRAW_BLEND_none + TRUE, D3D1X_(BLEND_ONE), D3D1X_(BLEND_INV_SRC_ALPHA), // GDRAW_BLEND_alpha + TRUE, D3D1X_(BLEND_DEST_COLOR), D3D1X_(BLEND_INV_SRC_ALPHA), // GDRAW_BLEND_multiply + TRUE, D3D1X_(BLEND_ONE), D3D1X_(BLEND_ONE), // GDRAW_BLEND_add + + FALSE, D3D1X_(BLEND_ONE), D3D1X_(BLEND_ZERO), // GDRAW_BLEND_filter + FALSE, D3D1X_(BLEND_ONE), D3D1X_(BLEND_ZERO), // GDRAW_BLEND_special + }; + + for (i=0; i < GDRAW_BLEND__count; ++i) { + gdraw->blend_state[i] = create_blend_state(d3d, blends[i].blend, blends[i].src, blends[i].dst); + if (!gdraw->blend_state[i]) + return; + } + + D3D1X_(BLEND_DESC) blend_desc; + memset(&blend_desc, 0, sizeof(blend_desc)); + hr = d3d->CreateBlendState(&blend_desc, &gdraw->blend_no_color_write); + if (FAILED(hr)) { + report_d3d_error(hr, "CreateBlendState", ""); + return; + } + + // create depth/stencil setups + for (i=0; i < 2; ++i) { + for (j=0; j < 2; ++j) { + D3D1X_(DEPTH_STENCIL_DESC) depth_desc; + memset(&depth_desc, 0, sizeof(depth_desc)); + + depth_desc.DepthEnable = (i || j); + depth_desc.DepthWriteMask = i ? D3D1X_(DEPTH_WRITE_MASK_ALL) : D3D1X_(DEPTH_WRITE_MASK_ZERO); + depth_desc.DepthFunc = j ? D3D1X_(COMPARISON_LESS) : D3D1X_(COMPARISON_ALWAYS); + depth_desc.StencilEnable = FALSE; + + hr = d3d->CreateDepthStencilState(&depth_desc, &gdraw->depth_state[i][j]); + if (FAILED(hr)) { + report_d3d_error(hr, "CreateDepthStencilState", ""); + return; + } + } + } + + // constant buffers + gdraw->cb_vertex = create_dynamic_buffer(sizeof(VertexVars), D3D1X_(BIND_CONSTANT_BUFFER)); + gdraw->cb_ps_common = create_dynamic_buffer(sizeof(PixelCommonVars), D3D1X_(BIND_CONSTANT_BUFFER)); + gdraw->cb_filter = create_dynamic_buffer(sizeof(PixelParaFilter), D3D1X_(BIND_CONSTANT_BUFFER)); + gdraw->cb_colormatrix = create_dynamic_buffer(sizeof(PixelParaColorMatrix), D3D1X_(BIND_CONSTANT_BUFFER)); + gdraw->cb_blur = create_dynamic_buffer(sizeof(PixelParaBlur), D3D1X_(BIND_CONSTANT_BUFFER)); + + // quad index buffer + assert(QUAD_IB_COUNT * 4 < 65535); // can't use more; we have 16-bit index buffers and 0xffff = primitive cut index + U16 *inds = (U16 *) IggyGDrawMalloc(QUAD_IB_COUNT * 6 * sizeof(U16)); + if (inds) { + D3D1X_(BUFFER_DESC) bufdesc = { }; + D3D1X_(SUBRESOURCE_DATA) data = { inds, 0, 0 }; + + bufdesc.ByteWidth = QUAD_IB_COUNT * 6 * sizeof(U16); + bufdesc.Usage = D3D1X_(USAGE_IMMUTABLE); + bufdesc.BindFlags = D3D1X_(BIND_INDEX_BUFFER); + + for (U16 i=0; i < QUAD_IB_COUNT; i++) { + inds[i*6 + 0] = i*4 + 0; + inds[i*6 + 1] = i*4 + 1; + inds[i*6 + 2] = i*4 + 2; + inds[i*6 + 3] = i*4 + 0; + inds[i*6 + 4] = i*4 + 2; + inds[i*6 + 5] = i*4 + 3; + } + + hr = gdraw->d3d_device->CreateBuffer(&bufdesc, &data, &gdraw->quad_ib); + if (FAILED(hr)) { + report_d3d_error(hr, "CreateBuffer", " for constants"); + gdraw->quad_ib = NULL; + } + IggyGDrawFree(inds); + } else + gdraw->quad_ib = NULL; +} + +static void destroy_all_shaders_and_state() +{ + S32 i; + + for (i=0; i < GDRAW_TEXTURE__count*3; ++i) destroy_shader(&gdraw->fprog[0][i]); + for (i=0; i < GDRAW_BLENDSPECIAL__count; ++i) destroy_shader(&gdraw->exceptional_blend[i]); + for (i=0; i < 32; ++i) destroy_shader(&gdraw->filter_prog[0][i]); + for (i=0; i < MAX_TAPS+1; ++i) destroy_shader(&gdraw->blur_prog[i]); + destroy_shader(&gdraw->colormatrix); + destroy_shader(&gdraw->clear_ps); + + for (i=0; i < GDRAW_vformat__basic_count; i++) { + safe_release(gdraw->inlayout[i]); + destroy_shader(&gdraw->vert[i]); + } + + for (i=0; i < 2; ++i) safe_release(gdraw->raster_state[i]); + for (i=0; i < GDRAW_WRAP__count*2; ++i) safe_release(gdraw->sampler_state[0][i]); + for (i=0; i < GDRAW_BLEND__count; ++i) safe_release(gdraw->blend_state[i]); + for (i=0; i < 2*2; ++i) safe_release(gdraw->depth_state[0][i]); + + safe_release(gdraw->blend_no_color_write); + + safe_release(gdraw->cb_vertex); + safe_release(gdraw->cb_ps_common); + safe_release(gdraw->cb_filter); + safe_release(gdraw->cb_colormatrix); + safe_release(gdraw->cb_blur); + + safe_release(gdraw->quad_ib); +} + +//////////////////////////////////////////////////////////////////////// +// +// Create and tear-down the state +// + +typedef struct +{ + S32 num_handles; + S32 num_bytes; +} GDrawResourceLimit; + +// These are the defaults limits used by GDraw unless the user specifies something else. +static GDrawResourceLimit gdraw_limits[GDRAW_D3D1X_(RESOURCE__count)] = { + MAX_RENDER_STACK_DEPTH + 1, 16*1024*1024, // RESOURCE_rendertarget + 500, 16*1024*1024, // RESOURCE_texture + 1000, 2*1024*1024, // RESOURCE_vertexbuffer + 0, 256*1024, // RESOURCE_dynbuffer +}; + +static GDrawHandleCache *make_handle_cache(gdraw_resourcetype type) +{ + S32 num_handles = gdraw_limits[type].num_handles; + S32 num_bytes = gdraw_limits[type].num_bytes; + GDrawHandleCache *cache = (GDrawHandleCache *) IggyGDrawMalloc(sizeof(GDrawHandleCache) + (num_handles - 1) * sizeof(GDrawHandle)); + if (cache) { + gdraw_HandleCacheInit(cache, num_handles, num_bytes); + cache->is_vertex = (type == GDRAW_D3D1X_(RESOURCE_vertexbuffer)); + } + + return cache; +} + +static void free_gdraw() +{ + if (!gdraw) return; + if (gdraw->texturecache) IggyGDrawFree(gdraw->texturecache); + if (gdraw->vbufcache) IggyGDrawFree(gdraw->vbufcache); + IggyGDrawFree(gdraw); + gdraw = NULL; +} + +static bool alloc_dynbuffer(U32 size) +{ + // specified input size is vertex buffer size. determine sensible size for the + // corresponding index buffer. iggy always uses 16-bit indices and has three + // primary types of geometry it sends: + // + // 1. filled polygons. these are triangulated simple polygons and thus have + // roughly as many triangles as they have vertices. they use either 8- or + // 16-byte vertex formats; this makes a worst case of 6 bytes of indices + // for every 8 bytes of vertex data. + // 2. strokes and edge antialiasing. they use a 16-byte vertex format and + // worst-case write a "double quadstrip" which has 4 triangles for every + // 3 vertices, which means 24 bytes of index data for every 48 bytes + // of vertex data. + // 3. textured quads. they use a 16-byte vertex format, have exactly 2 + // triangles for every 4 vertices, and use either a static index buffer + // (quad_ib) or a single triangle strip, so for our purposes they need no + // space to store indices at all. + // + // 1) argues for allocating index buffers at 3/4 the size of the corresponding + // vertex buffer, while 2) and 3) need 1/2 the size of the vertex buffer or less. + // 2) and 3) are the most common types of vertex data, while 1) is used only for + // morphed shapes and in certain cases when the RESOURCE_vertexbuffer pool is full. + // we just play it safe anyway and make sure we size the IB large enough to cover + // the worst case for 1). this is conservative, but it probably doesn't matter much. + U32 ibsize = (size * 3) / 4; + + init_dyn_buffer(&gdraw->dyn_vb, size, D3D1X_(BIND_VERTEX_BUFFER)); + init_dyn_buffer(&gdraw->dyn_ib, ibsize, D3D1X_(BIND_INDEX_BUFFER)); + + gdraw->max_quad_vert_count = RR_MIN(size / sizeof(gswf_vertex_xyst), QUAD_IB_COUNT * 4); + gdraw->max_quad_vert_count &= ~3; // must be multiple of four + + return gdraw->dyn_vb.buffer != NULL && gdraw->dyn_ib.buffer != NULL; +} + +int gdraw_D3D1X_(SetResourceLimits)(gdraw_resourcetype type, S32 num_handles, S32 num_bytes) +{ + GDrawStats stats={0}; + + if (type == GDRAW_D3D1X_(RESOURCE_rendertarget)) // RT count is small and space is preallocated + num_handles = MAX_RENDER_STACK_DEPTH + 1; + + assert(type >= GDRAW_D3D1X_(RESOURCE_rendertarget) && type < GDRAW_D3D1X_(RESOURCE__count)); + assert(num_handles >= 0); + assert(num_bytes >= 0); + + // nothing to do if the values are unchanged + if (gdraw_limits[type].num_handles == num_handles && + gdraw_limits[type].num_bytes == num_bytes) + return 1; + + gdraw_limits[type].num_handles = num_handles; + gdraw_limits[type].num_bytes = num_bytes; + + // if no gdraw context created, there's nothing to worry about + if (!gdraw) + return 1; + + // resize the appropriate pool + switch (type) { + case GDRAW_D3D1X_(RESOURCE_rendertarget): + flush_rendertargets(&stats); + gdraw_HandleCacheInit(&gdraw->rendertargets, num_handles, num_bytes); + return 1; + + case GDRAW_D3D1X_(RESOURCE_texture): + if (gdraw->texturecache) { + gdraw_res_flush(gdraw->texturecache, &stats); + IggyGDrawFree(gdraw->texturecache); + } + gdraw->texturecache = make_handle_cache(GDRAW_D3D1X_(RESOURCE_texture)); + return gdraw->texturecache != NULL; + + case GDRAW_D3D1X_(RESOURCE_vertexbuffer): + if (gdraw->vbufcache) { + gdraw_res_flush(gdraw->vbufcache, &stats); + IggyGDrawFree(gdraw->vbufcache); + } + gdraw->vbufcache = make_handle_cache(GDRAW_D3D1X_(RESOURCE_vertexbuffer)); + return gdraw->vbufcache != NULL; + + case GDRAW_D3D1X_(RESOURCE_dynbuffer): + unbind_resources(); + safe_release(gdraw->dyn_vb.buffer); + safe_release(gdraw->dyn_ib.buffer); + return alloc_dynbuffer(num_bytes); + + default: + return 0; + } +} + +static GDrawFunctions *create_context(ID3D1XDevice *dev, ID3D1XContext *ctx, S32 w, S32 h) +{ + gdraw = (GDraw *) IggyGDrawMalloc(sizeof(*gdraw)); + if (!gdraw) return NULL; + + memset(gdraw, 0, sizeof(*gdraw)); + + gdraw->frametex_width = w; + gdraw->frametex_height = h; + gdraw->d3d_device = dev; + gdraw->d3d_context = ctx; + + gdraw->texturecache = make_handle_cache(GDRAW_D3D1X_(RESOURCE_texture)); + gdraw->vbufcache = make_handle_cache(GDRAW_D3D1X_(RESOURCE_vertexbuffer)); + gdraw_HandleCacheInit(&gdraw->rendertargets, gdraw_limits[GDRAW_D3D1X_(RESOURCE_rendertarget)].num_handles, gdraw_limits[GDRAW_D3D1X_(RESOURCE_rendertarget)].num_bytes); + + if (!gdraw->texturecache || !gdraw->vbufcache || !alloc_dynbuffer(gdraw_limits[GDRAW_D3D1X_(RESOURCE_dynbuffer)].num_bytes)) { + free_gdraw(); + return NULL; + } + + create_all_shaders_and_state(); + + gdraw_funcs.SetViewSizeAndWorldScale = gdraw_SetViewSizeAndWorldScale; + gdraw_funcs.GetInfo = gdraw_GetInfo; + + gdraw_funcs.DescribeTexture = gdraw_DescribeTexture; + gdraw_funcs.DescribeVertexBuffer = gdraw_DescribeVertexBuffer; + + gdraw_funcs.RenderingBegin = gdraw_RenderingBegin; + gdraw_funcs.RenderingEnd = gdraw_RenderingEnd; + gdraw_funcs.RenderTileBegin = gdraw_RenderTileBegin; + gdraw_funcs.RenderTileEnd = gdraw_RenderTileEnd; + + gdraw_funcs.TextureDrawBufferBegin = gdraw_TextureDrawBufferBegin; + gdraw_funcs.TextureDrawBufferEnd = gdraw_TextureDrawBufferEnd; + + gdraw_funcs.DrawIndexedTriangles = gdraw_DrawIndexedTriangles; + gdraw_funcs.FilterQuad = gdraw_FilterQuad; + + gdraw_funcs.SetAntialiasTexture = gdraw_SetAntialiasTexture; + + gdraw_funcs.ClearStencilBits = gdraw_ClearStencilBits; + gdraw_funcs.ClearID = gdraw_ClearID; + + gdraw_funcs.MakeTextureBegin = gdraw_MakeTextureBegin; + gdraw_funcs.MakeTextureMore = gdraw_MakeTextureMore; + gdraw_funcs.MakeTextureEnd = gdraw_MakeTextureEnd; + + gdraw_funcs.UpdateTextureBegin = gdraw_UpdateTextureBegin; + gdraw_funcs.UpdateTextureRect = gdraw_UpdateTextureRect; + gdraw_funcs.UpdateTextureEnd = gdraw_UpdateTextureEnd; + + gdraw_funcs.FreeTexture = gdraw_FreeTexture; + gdraw_funcs.TryToLockTexture = gdraw_TryToLockTexture; + + gdraw_funcs.MakeTextureFromResource = (gdraw_make_texture_from_resource *) gdraw_D3D1X_(MakeTextureFromResource); + gdraw_funcs.FreeTextureFromResource = gdraw_D3D1X_(DestroyTextureFromResource); + + gdraw_funcs.MakeVertexBufferBegin = gdraw_MakeVertexBufferBegin; + gdraw_funcs.MakeVertexBufferMore = gdraw_MakeVertexBufferMore; + gdraw_funcs.MakeVertexBufferEnd = gdraw_MakeVertexBufferEnd; + gdraw_funcs.TryToLockVertexBuffer = gdraw_TryLockVertexBuffer; + gdraw_funcs.FreeVertexBuffer = gdraw_FreeVertexBuffer; + + gdraw_funcs.UnlockHandles = gdraw_UnlockHandles; + gdraw_funcs.SetTextureUniqueID = gdraw_SetTextureUniqueID; + + gdraw_funcs.Set3DTransform = gdraw_Set3DTransform; + + return &gdraw_funcs; +} + +void gdraw_D3D1X_(DestroyContext)(void) +{ + if (gdraw && gdraw->d3d_device) { + GDrawStats stats={0}; + clear_renderstate(); + stencil_state_cache_clear(); + destroy_all_shaders_and_state(); + safe_release(gdraw->aa_tex); + safe_release(gdraw->aa_tex_view); + safe_release(gdraw->dyn_vb.buffer); + safe_release(gdraw->dyn_ib.buffer); + + flush_rendertargets(&stats); + if (gdraw->texturecache) gdraw_res_flush(gdraw->texturecache, &stats); + if (gdraw->vbufcache) gdraw_res_flush(gdraw->vbufcache, &stats); + + gdraw->d3d_device = NULL; + } + + free_gdraw(); +} + +void gdraw_D3D1X_(SetErrorHandler)(void (__cdecl *error_handler)(HRESULT hr)) +{ + if (gdraw) + gdraw->error_handler = error_handler; +} + +void gdraw_D3D1X_(PreReset)(void) +{ + if (!gdraw) return; + + GDrawStats stats={0}; + flush_rendertargets(&stats); + + // we may end up resizing the frame buffer + gdraw->frametex_width = 0; + gdraw->frametex_height = 0; +} + +void gdraw_D3D1X_(PostReset)(void) +{ + // maybe re-create rendertargets right now? +} + +void RADLINK gdraw_D3D1X_(BeginCustomDraw)(IggyCustomDrawCallbackRegion * region, F32 mat[4][4]) +{ + clear_renderstate(); + gdraw_GetObjectSpaceMatrix(mat[0], region->o2w, gdraw->projection, 0, 0); +} + +void RADLINK gdraw_D3D1X_(BeginCustomDraw_4J)(IggyCustomDrawCallbackRegion * region, F32 mat[16]) +{ + clear_renderstate(); + gdraw_GetObjectSpaceMatrix(mat, region->o2w, gdraw->projection, 0, 0); +} + +void RADLINK gdraw_D3D1X_(CalculateCustomDraw_4J)(IggyCustomDrawCallbackRegion * region, F32 mat[16]) +{ + gdraw_GetObjectSpaceMatrix(mat, region->o2w, gdraw->projection, 0, 0); +} + +void RADLINK gdraw_D3D1X_(EndCustomDraw)(IggyCustomDrawCallbackRegion * /*region*/) +{ + GDrawStats stats={}; + set_common_renderstate(); + set_viewport(); + set_render_target(&stats); +} + +void RADLINK gdraw_D3D1X_(GetResourceUsageStats)(gdraw_resourcetype type, S32 *handles_used, S32 *bytes_used) +{ + GDrawHandleCache *cache; + + switch (type) { + case GDRAW_D3D1X_(RESOURCE_rendertarget): cache = &gdraw->rendertargets; break; + case GDRAW_D3D1X_(RESOURCE_texture): cache = gdraw->texturecache; break; + case GDRAW_D3D1X_(RESOURCE_vertexbuffer): cache = gdraw->vbufcache; break; + case GDRAW_D3D1X_(RESOURCE_dynbuffer): *handles_used = 0; *bytes_used = gdraw->last_dyn_maxalloc; return; + default: cache = NULL; break; + } + + *handles_used = *bytes_used = 0; + + if (cache) { + S32 i; + U64 frame = gdraw->frame_counter; + + for (i=0; i < cache->max_handles; ++i) + if (cache->handle[i].bytes && cache->handle[i].owner && cache->handle[i].fence.value == frame) { + *handles_used += 1; + *bytes_used += cache->handle[i].bytes; + } + } +} + +static S32 num_pixels(S32 w, S32 h, S32 mipmaps) +{ + S32 k, pixels=0; + for (k=0; k < mipmaps; ++k) { + pixels += w*h*2; + w = (w>>1); w += !w; + h = (h>>1); h += !h; + } + return pixels; +} + +GDrawTexture * RADLINK gdraw_D3D1X_(MakeTextureFromResource)(U8 *resource_file, S32 /*len*/, IggyFileTextureRaw *texture) +{ + char *failed_call=""; + U8 *free_data = 0; + GDrawTexture *t=0; + S32 width, height, mipmaps, size, blk; + ID3D1X(Texture2D) *tex=0; + ID3D1X(ShaderResourceView) *view=0; + + DXGI_FORMAT d3dfmt; + D3D1X_(SUBRESOURCE_DATA) mipdata[24] = { 0 }; + S32 k; + + HRESULT hr = S_OK; + + width = texture->w; + height = texture->h; + mipmaps = texture->mipmaps; + blk = 1; + + D3D1X_(TEXTURE2D_DESC) desc = { width, height, mipmaps, 1, DXGI_FORMAT_UNKNOWN, { 1, 0 }, + D3D1X_(USAGE_IMMUTABLE), D3D1X_(BIND_SHADER_RESOURCE), 0, 0 }; + + switch (texture->format) { + case IFT_FORMAT_rgba_8888 : size= 4; d3dfmt = DXGI_FORMAT_R8G8B8A8_UNORM; break; + case IFT_FORMAT_DXT1 : size= 8; d3dfmt = DXGI_FORMAT_BC1_UNORM; blk = 4; break; + case IFT_FORMAT_DXT3 : size=16; d3dfmt = DXGI_FORMAT_BC2_UNORM; blk = 4; break; + case IFT_FORMAT_DXT5 : size=16; d3dfmt = DXGI_FORMAT_BC3_UNORM; blk = 4; break; + default: { + IggyGDrawSendWarning(NULL, "GDraw .iggytex raw texture format %d not supported by hardware", texture->format); + goto done; + } + } + + desc.Format = d3dfmt; + + U8 *data = resource_file + texture->file_offset; + + if (texture->format == IFT_FORMAT_i_8 || texture->format == IFT_FORMAT_i_4) { + // convert from intensity to luma+alpha + S32 i; + S32 total_size = 2 * num_pixels(width,height,mipmaps); + + free_data = (U8 *) IggyGDrawMalloc(total_size); + if (!free_data) { + IggyGDrawSendWarning(NULL, "GDraw out of memory to store texture data to pass to D3D for %d x %d texture", width, height); + goto done; + } + + U8 *cur = free_data; + + for (k=0; k < mipmaps; ++k) { + S32 w = RR_MAX(width >> k, 1); + S32 h = RR_MAX(height >> k, 1); + for (i=0; i < w*h; ++i) { + cur[0] = cur[1] = *data++; + cur += 2; + } + } + data = free_data; + } + + for (k=0; k < mipmaps; ++k) { + S32 w = RR_MAX(width >> k, 1); + S32 h = RR_MAX(height >> k, 1); + S32 blkw = (w + blk-1) / blk; + S32 blkh = (h + blk-1) / blk; + + mipdata[k].pSysMem = data; + mipdata[k].SysMemPitch = blkw * size; + data += blkw * blkh * size; + } + + failed_call = "CreateTexture2D"; + hr = gdraw->d3d_device->CreateTexture2D(&desc, mipdata, &tex); + if (FAILED(hr)) goto done; + + failed_call = "CreateShaderResourceView for texture creation"; + hr = gdraw->d3d_device->CreateShaderResourceView(tex, NULL, &view); + if (FAILED(hr)) goto done; + + t = gdraw_D3D1X_(WrappedTextureCreate)(view); + +done: + if (FAILED(hr)) { + report_d3d_error(hr, failed_call, ""); + } + + if (free_data) + IggyGDrawFree(free_data); + + if (!t) { + if (view) + view->Release(); + if (tex) + tex->Release(); + } else { + ((GDrawHandle *) t)->handle.tex.d3d = tex; + } + return t; +} + +void RADLINK gdraw_D3D1X_(DestroyTextureFromResource)(GDrawTexture *tex) +{ + GDrawHandle *h = (GDrawHandle *) tex; + safe_release(h->handle.tex.d3d_view); + safe_release(h->handle.tex.d3d); + gdraw_D3D1X_(WrappedTextureDestroy)(tex); +} + diff --git a/Minecraft.Client/Durango/Iggy/gdraw/gdraw_shared.inl b/Minecraft.Client/Durango/Iggy/gdraw/gdraw_shared.inl new file mode 100644 index 00000000..a60fa520 --- /dev/null +++ b/Minecraft.Client/Durango/Iggy/gdraw/gdraw_shared.inl @@ -0,0 +1,2595 @@ +// gdraw_shared.inl - author: Sean Barrett - copyright 2010 RAD Game Tools +// +// This file implements some common code that can be shared across +// all the sample implementations of GDraw. + +#ifdef IGGY_DISABLE_GDRAW_ASSERT +#define assert(x) +#else +#include +#endif + +#ifndef GDRAW_MAYBE_UNUSED +#define GDRAW_MAYBE_UNUSED +#endif + +/////////////////////////////////////////////////////////////// +// +// GDrawHandleCache manages resource "handles" used by Iggy +// (i.e. these handles wrap the platform resource handles, +// and this file provides those wrappers and facilities for +// LRU tracking them). Moreover, for console platforms, we +// actually implement our own managed resource pools. +// +// This is the main state machine when GDRAW_MANAGE_MEM is defined: +// (which covers all console platforms) +// +// +------+ +--------+ | +// | Live |<------->| Locked | | +// +------+ +--------+ | +// / \ ^ | +// / \ \ | +// v v \ | +// +------+ +------+ +------+ | | +// | Dead |--->| Free |<---| User | | | +// +------+ +------+ +------+ | | +// ^ ^ ^ ^ | | +// \ / \ | | | +// \ / v | | | +// +--------+ +-------+ / | +// | Pinned |<--------| Alloc |/ | +// +--------+ +-------+ | +// +// "Free" handles are not in use and available for allocation. +// "Alloc" handles have been assigned by GDraw, but do not yet +// have a system resource backing them. Resources stay in +// this state until we know that for sure that we're going +// to be able to successfully complete creation, at which +// point the resource transitions to one of the regular states. +// "Live" handles correspond to resources that may be used +// for rendering. They are kept in LRU order. Old resources +// may be evicted to make space. +// "Locked" handles cover resources that are going to be used +// in the next draw command. Once a resource is marked locked, +// it may not be evicted until it's back to "Live". +// "Dead" handles describe resources that have been freed on the +// CPU side, but are still in use by the GPU. Their memory may +// only be reclaimed once the GPU is done with them, at which +// point they are moved to the "Free" list. Items on the "Dead" +// list appear ordered by the last time they were used by the +// GPU - "most stale" first. +// "Pinned" resources can be used in any draw call without getting +// locked first. They can never be LRU-freed, but their memory +// is still managed by GDraw. Currently this is only used for +// the Iggy font cache. +// "User" (user-owned) resources are exactly that. They act much like +// pinned resources, but their memory isn't managed by GDraw. +// When a user-owned resource is freed, we really need to free +// it immediately (instead of marking it as "dead"), which might +// necessitate stalling the CPU until the GPU is finished using +// that resource. Since we don't own the memory, delayed frees +// are not an option. +// +// Without GDRAW_MANAGE_MEM, there's no "Dead" resources, and all +// frees are performed immediately. + +typedef struct GDrawHandleCache GDrawHandleCache; +typedef struct GDrawHandle GDrawHandle; + +typedef struct +{ + U64 value; +} GDrawFence; + +typedef enum +{ + GDRAW_HANDLE_STATE_free = 0, + GDRAW_HANDLE_STATE_live, + GDRAW_HANDLE_STATE_locked, + GDRAW_HANDLE_STATE_dead, + GDRAW_HANDLE_STATE_pinned, + GDRAW_HANDLE_STATE_user_owned, + GDRAW_HANDLE_STATE_alloc, + GDRAW_HANDLE_STATE__count, + + // not an actual state! + GDRAW_HANDLE_STATE_sentinel = GDRAW_HANDLE_STATE__count, +} GDrawHandleState; + +struct GDrawHandle +{ + GDrawNativeHandle handle; // platform handle to a resource (variable size) + void * owner; // 4/8 // opaque handle used to allow freeing resources without calling back to owner + + GDrawHandleCache * cache; // 4/8 // which cache this handle came from + + GDrawHandle * next,*prev; // 8/16 // doubly-linked list + + #ifdef GDRAW_MANAGE_MEM + void * raw_ptr; // 4/8 // pointer to allocation - when you're managing memory manually + #ifdef GDRAW_CORRUPTION_CHECK + U32 cached_raw_value[4]; + rrbool has_check_value; + #endif + #endif + + GDrawFence fence; // 8 // (optional) platform fence for resource + // 4 + U32 bytes:28; // estimated storage cost to allow setting a loose limit + U32 state:4; // state the handle is in +}; + +// validate alignment to make sure structure will pack correctly +#ifdef __RAD64__ +RR_COMPILER_ASSERT((sizeof(GDrawHandle) & 7) == 0); +#else +RR_COMPILER_ASSERT((sizeof(GDrawHandle) & 3) == 0); +#endif + +struct GDrawHandleCache +{ + S32 bytes_free; + S32 total_bytes; + S32 max_handles; + U32 is_vertex : 1; // vertex buffers have different warning codes and generate discard callbacks + U32 is_thrashing : 1; + U32 did_defragment : 1; + // 30 unused bits + GDrawHandle state[GDRAW_HANDLE_STATE__count]; // sentinel nodes for all of the state lists + #ifdef GDRAW_MANAGE_MEM + struct gfx_allocator *alloc; + #endif + #ifdef GDRAW_MANAGE_MEM_TWOPOOL + struct gfx_allocator *alloc_other; + #endif + GDrawFence prev_frame_start, prev_frame_end; // fence value at start/end of previous frame, for thrashing detection + GDrawHandle handle[1]; // the rest of the handles must be stored right after this in the containing structure +}; + +#ifdef GDRAW_CORRUPTION_CHECK +// values for corruption checking +#define GDRAW_CORRUPTIONCHECK_renderbegin 0x10 +#define GDRAW_CORRUPTIONCHECK_renderend 0x20 +#define GDRAW_CORRUPTIONCHECK_nomoregdraw 0x30 +#define GDRAW_CORRUPTIONCHECK_maketexbegin 0x40 +#define GDRAW_CORRUPTIONCHECK_maketexend 0x50 + +#define GDRAW_CORRUPTIONCHECK_wrappedcreateend 0x60 +#define GDRAW_CORRUPTIONCHECK_wrappedcreatebegin 0x61 +#define GDRAW_CORRUPTIONCHECK_wrappeddestroyend 0x70 +#define GDRAW_CORRUPTIONCHECK_wrappeddestroybegin 0x71 + +#define GDRAW_CORRUPTIONCHECK_allochandle 0x80 +#define GDRAW_CORRUPTIONCHECK_allochandle_begin 0x81 +#define GDRAW_CORRUPTIONCHECK_allochandle_postreap 0x82 +#define GDRAW_CORRUPTIONCHECK_allochandle_postfree1 0x83 +#define GDRAW_CORRUPTIONCHECK_allochandle_postfree2 0x84 +#define GDRAW_CORRUPTIONCHECK_allochandle_postfree3 0x85 +#define GDRAW_CORRUPTIONCHECK_allochandle_postalloc1 0x86 +#define GDRAW_CORRUPTIONCHECK_allochandle_postalloc2 0x87 +#define GDRAW_CORRUPTIONCHECK_allochandle_postalloc3 0x88 +#define GDRAW_CORRUPTIONCHECK_allochandle_defrag 0x89 + +#define GDRAW_CORRUPTIONCHECK_freetex 0x90 + +static U32 *debug_raw_address(GDrawHandle *t, int choice) +{ + static int offset_table[4] = { 0x555555, 0xaaaaaa, 0x333333, 0x6e6e6e }; + U8 *base = (U8 *) t->raw_ptr; + int offset = offset_table[choice] & (t->bytes-1) & ~3; + return (U32 *) (base + offset); +} + +static void debug_check_overlap_one(GDrawHandle *t, U8 *ptr, S32 len) +{ + assert(len >= 0); + if (t->raw_ptr && t->raw_ptr != ptr) { + assert(t->raw_ptr < ptr || t->raw_ptr >= ptr+len); + } +} + +static void debug_check_overlap(GDrawHandleCache *c, U8 *ptr, S32 len) +{ + GDrawHandle *t = c->head; + while (t) { + debug_check_overlap_one(t, ptr, len); + t = t->next; + } + t = c->active; + while (t) { + debug_check_overlap_one(t, ptr, len); + t = t->next; + } +} + +static void debug_check_raw_values(GDrawHandleCache *c) +{ + GDrawHandle *t = c->head; + while (t) { + if (t->raw_ptr && t->has_check_value) { + int i; + for (i=0; i < 4; ++i) { + if (*debug_raw_address(t, i) != t->cached_raw_value[i]) { + //zlog("!Iggy texture corruption found\n"); + //zlog("t=%p, t->raw_ptr=%p\n", t, t->raw_ptr); + //zlog("Cached values: %08x %08x %08x %08x\n", t->cached_raw_value[0], t->cached_raw_value[1], t->cached_raw_value[2], t->cached_raw_value[3]); + //zlog("Current values: %08x %08x %08x %08x\n", *debug_raw_address(t,0), *debug_raw_address(t,1), *debug_raw_address(t,2), *debug_raw_address(t,3)); + assert(0); + } + } + #if 0 + GDrawHandle *s; + check_block_alloc(c->alloc, t->raw_ptr, 1); + s = c->head; + while (s != t) { + assert(s->raw_ptr != t->raw_ptr); + s = s->next; + } + s = c->active; + while (s != NULL) { + assert(s->raw_ptr != t->raw_ptr); + s = s->next; + } + #endif + } + t = t->next; + } + t = c->active; + while (t) { + if (t->raw_ptr && t->has_check_value) { + int i; + for (i=0; i < 4; ++i) { + if (*debug_raw_address(t, i) != t->cached_raw_value[i]) { + //zlog("!Iggy texture corruption found\n"); + //zlog("t=%p, t->raw_ptr=%p\n", t, t->raw_ptr); + //zlog("Cached values: %08x %08x %08x %08x\n", t->cached_raw_value[0], t->cached_raw_value[1], t->cached_raw_value[2], t->cached_raw_value[3]); + //zlog("Current values: %08x %08x %08x %08x\n", *debug_raw_address(t,0), *debug_raw_address(t,1), *debug_raw_address(t,2), *debug_raw_address(t,3)); + assert(0); + } + } + #if 0 + GDrawHandle *s; + check_block_alloc(c->alloc, t->raw_ptr, 1); + s = c->active; + while (s != t) { + assert(s->raw_ptr != t->raw_ptr); + s = s->next; + } + #endif + } + t = t->next; + } +} + +#ifndef GDRAW_CORRUPTION_MASK +#define GDRAW_CORRUPTION_MASK 0 +#endif +#define debug_check_raw_values_if(c,v) \ + if ((GDRAW_CORRUPTION_CHECK & ~GDRAW_CORRUPTION_MASK) == ((v) & ~GDRAW_CORRUPTION_MASK)) \ + debug_check_raw_values(c); \ + else + +static void debug_set_raw_value(GDrawHandle *t) +{ + if (t->raw_ptr) { + int i; + for (i=0; i < 4; ++i) + t->cached_raw_value[i] = *debug_raw_address(t, i); + t->has_check_value = true; + } +} + +static void debug_unset_raw_value(GDrawHandle *t) +{ + t->has_check_value = false; +} + +static void debug_check_value_is_unreferenced(GDrawHandleCache *c, void *ptr) +{ + GDrawHandle *t = c->head; + while (t) { + assert(t->raw_ptr != ptr); + t = t->next; + } + t = c->active; + while (t) { + assert(t->raw_ptr != ptr); + t = t->next; + } +} + +#else + +#define debug_check_overlap(c,p,len) +#define debug_set_raw_value(t) +#define debug_check_value_is_unreferenced(c,p) +#define debug_unset_raw_value(t) +#define debug_check_raw_values(c) +#define debug_check_raw_values_if(c,v) +#endif + +#ifdef SUPERDEBUG +static void check_lists(GDrawHandleCache *c) +{ + GDrawHandle *sentinel, *t; + U32 state; + + // for all lists, verify that they are consistent and + // properly linked + for (state = 0; state < GDRAW_HANDLE_STATE__count; state++) { + S32 count = 0; + sentinel = &c->state[state]; + + assert(!sentinel->cache); + assert(sentinel->state == GDRAW_HANDLE_STATE_sentinel); + for (t = sentinel->next; t != sentinel; t = t->next) { + count++; + assert(t->cache == c); + assert(t->state == state); + assert(t->prev->next == t); + assert(t->next->prev == t); + assert(count < 50000); + } + } + + // for dead list, additionally verify that it's in the right + // order (namely, sorted by ascending fence index) + sentinel = &c->state[GDRAW_HANDLE_STATE_dead]; + for (t = sentinel->next; t != sentinel; t = t->next) { + assert(t->prev == sentinel || t->fence.value >= t->prev->fence.value); + } +} + +#include + +static const char *gdraw_StateName(U32 state) +{ + switch (state) { + case GDRAW_HANDLE_STATE_free: return "free"; + case GDRAW_HANDLE_STATE_live: return "live"; + case GDRAW_HANDLE_STATE_locked: return "locked"; + case GDRAW_HANDLE_STATE_dead: return "dead"; + case GDRAW_HANDLE_STATE_pinned: return "pinned"; + case GDRAW_HANDLE_STATE_user_owned: return "user-owned"; + case GDRAW_HANDLE_STATE_alloc: return "alloc"; + case GDRAW_HANDLE_STATE_sentinel: return ""; + default: return "???"; + } +} + +#else +static RADINLINE void check_lists(GDrawHandleCache *c) +{ + RR_UNUSED_VARIABLE(c); +} +#endif + +static void gdraw_HandleTransitionInsertBefore(GDrawHandle *t, GDrawHandleState new_state, GDrawHandle *succ) +{ + check_lists(t->cache); + assert(t->state != GDRAW_HANDLE_STATE_sentinel); // sentinels should never get here! + assert(t->state != (U32) new_state); // code should never call "transition" if it's not transitioning! + // unlink from prev state + t->prev->next = t->next; + t->next->prev = t->prev; + // add to list for new state + t->next = succ; + t->prev = succ->prev; + t->prev->next = t; + t->next->prev = t; +#ifdef SUPERDEBUG + printf("GD %chandle %p %s->%s\n", t->cache->is_vertex ? 'v' : 't', t, gdraw_StateName(t->state), gdraw_StateName(new_state)); +#endif + t->state = new_state; + check_lists(t->cache); +} + +static RADINLINE void gdraw_HandleTransitionTo(GDrawHandle *t, GDrawHandleState new_state) +{ + gdraw_HandleTransitionInsertBefore(t, new_state, &t->cache->state[new_state]); +} + +#ifdef GDRAW_MANAGE_MEM_TWOPOOL +static rrbool gdraw_MigrateResource(GDrawHandle *t, GDrawStats *stats); +static void gdraw_res_free(GDrawHandle *t, GDrawStats *stats); +#endif + +static rrbool gdraw_HandleCacheLockStats(GDrawHandle *t, void *owner, GDrawStats *stats) +{ + RR_UNUSED_VARIABLE(stats); + + // if the GPU memory is owned by the user, then we never spontaneously + // free it, and we can always report true. moreover, Iggy doesn't bother + // keeping 'owner' consistent in this case, so we must check this before + // verifying t->owner. + if (t->state == GDRAW_HANDLE_STATE_user_owned) + return true; + + // if t->owner has changed, then Iggy is trying to lock an old version + // of this handle from before (the handle has already been recycled to + // point to a new resource) + if (t->owner != owner) + return false; + + // otherwise, it's a valid resource and we should lock it until the next + // unlock call + assert(t->state == GDRAW_HANDLE_STATE_live || t->state == GDRAW_HANDLE_STATE_locked || t->state == GDRAW_HANDLE_STATE_pinned); + if (t->state == GDRAW_HANDLE_STATE_live) { +#ifdef GDRAW_MANAGE_MEM_TWOPOOL + // if we defragmented this frame, we can't just make resources live; + // we need to migrate them to their new location. (which might fail + // if we don't have enough memory left in the new pool) + if (t->cache->did_defragment) { + if (!gdraw_MigrateResource(t, stats)) { + gdraw_res_free(t, stats); + return false; + } + } +#endif + gdraw_HandleTransitionTo(t, GDRAW_HANDLE_STATE_locked); + } + return true; +} + +static rrbool gdraw_HandleCacheLock(GDrawHandle *t, void *owner) +{ + return gdraw_HandleCacheLockStats(t, owner, NULL); +} + +static void gdraw_HandleCacheUnlock(GDrawHandle *t) +{ + assert(t->state == GDRAW_HANDLE_STATE_locked || t->state == GDRAW_HANDLE_STATE_pinned || t->state == GDRAW_HANDLE_STATE_user_owned); + if (t->state == GDRAW_HANDLE_STATE_locked) + gdraw_HandleTransitionTo(t, GDRAW_HANDLE_STATE_live); +} + +static void gdraw_HandleCacheUnlockAll(GDrawHandleCache *c) +{ + GDrawHandle *sentinel = &c->state[GDRAW_HANDLE_STATE_locked]; + while (sentinel->next != sentinel) + gdraw_HandleTransitionTo(sentinel->next, GDRAW_HANDLE_STATE_live); +} + +static void gdraw_HandleCacheInit(GDrawHandleCache *c, S32 num_handles, S32 bytes) +{ + S32 i; + assert(num_handles > 0); + c->max_handles = num_handles; + c->total_bytes = bytes; + c->bytes_free = c->total_bytes; + c->is_vertex = false; + c->is_thrashing = false; + c->did_defragment = false; + for (i=0; i < GDRAW_HANDLE_STATE__count; i++) { + c->state[i].owner = NULL; + c->state[i].cache = NULL; // should never follow cache link from sentinels! + c->state[i].next = c->state[i].prev = &c->state[i]; +#ifdef GDRAW_MANAGE_MEM + c->state[i].raw_ptr = NULL; +#endif + c->state[i].fence.value = 0; + c->state[i].bytes = 0; + c->state[i].state = GDRAW_HANDLE_STATE_sentinel; + } + for (i=0; i < num_handles; ++i) { + c->handle[i].cache = c; + c->handle[i].prev = (i == 0) ? &c->state[GDRAW_HANDLE_STATE_free] : &c->handle[i-1]; + c->handle[i].next = (i == num_handles - 1) ? &c->state[GDRAW_HANDLE_STATE_free] : &c->handle[i+1]; + c->handle[i].bytes = 0; + c->handle[i].state = GDRAW_HANDLE_STATE_free; +#ifdef GDRAW_MANAGE_MEM + c->handle[i].raw_ptr = NULL; +#endif + } + c->state[GDRAW_HANDLE_STATE_free].next = &c->handle[0]; + c->state[GDRAW_HANDLE_STATE_free].prev = &c->handle[num_handles - 1]; + c->prev_frame_start.value = 0; + c->prev_frame_end.value = 0; +#ifdef GDRAW_MANAGE_MEM + c->alloc = NULL; +#endif +#ifdef GDRAW_MANAGE_MEM_TWOPOOL + c->alloc_other = NULL; +#endif + check_lists(c); +} + +static GDrawHandle *gdraw_HandleCacheAllocateBegin(GDrawHandleCache *c) +{ + GDrawHandle *free_list = &c->state[GDRAW_HANDLE_STATE_free]; + GDrawHandle *t = NULL; + if (free_list->next != free_list) { + t = free_list->next; + gdraw_HandleTransitionTo(t, GDRAW_HANDLE_STATE_alloc); + t->bytes = 0; + t->owner = 0; +#ifdef GDRAW_MANAGE_MEM + t->raw_ptr = NULL; +#endif +#ifdef GDRAW_CORRUPTION_CHECK + t->has_check_value = false; +#endif + } + return t; +} + +static void gdraw_HandleCacheAllocateEnd(GDrawHandle *t, S32 bytes, void *owner, GDrawHandleState new_state) +{ + assert(t->cache); + assert(t->bytes == 0); + assert(t->owner == 0); + assert(t->state == GDRAW_HANDLE_STATE_alloc); + if (bytes == 0) + assert(new_state == GDRAW_HANDLE_STATE_user_owned); + else + assert(new_state == GDRAW_HANDLE_STATE_locked || new_state == GDRAW_HANDLE_STATE_pinned); + t->bytes = bytes; + t->owner = owner; + t->cache->bytes_free -= bytes; + + gdraw_HandleTransitionTo(t, new_state); +} + +static void gdraw_HandleCacheFree(GDrawHandle *t) +{ + GDrawHandleCache *c = t->cache; + assert(t->state != GDRAW_HANDLE_STATE_alloc && t->state != GDRAW_HANDLE_STATE_sentinel); + c->bytes_free += t->bytes; + t->bytes = 0; + t->owner = 0; +#ifdef GDRAW_MANAGE_MEM + t->raw_ptr = 0; +#endif +#ifdef GDRAW_CORRUPTION_CHECK + t->has_check_value = false; +#endif + gdraw_HandleTransitionTo(t, GDRAW_HANDLE_STATE_free); +} + +static void gdraw_HandleCacheAllocateFail(GDrawHandle *t) +{ + assert(t->state == GDRAW_HANDLE_STATE_alloc); + gdraw_HandleTransitionTo(t, GDRAW_HANDLE_STATE_free); +} + +static GDrawHandle *gdraw_HandleCacheGetLRU(GDrawHandleCache *c) +{ + // TransitionTo always inserts at the end, which means that the resources + // at the front of the LRU list are the oldest ones, since in-use resources + // will get appended on every transition from "locked" to "live". + GDrawHandle *sentinel = &c->state[GDRAW_HANDLE_STATE_live]; + return (sentinel->next != sentinel) ? sentinel->next : NULL; +} + +static void gdraw_HandleCacheTick(GDrawHandleCache *c, GDrawFence now) +{ + c->prev_frame_start = c->prev_frame_end; + c->prev_frame_end = now; + + // reset these flags every frame + c->is_thrashing = false; + c->did_defragment = false; +} + +#ifdef GDRAW_MANAGE_MEM + +static void gdraw_HandleCacheInsertDead(GDrawHandle *t) +{ + GDrawHandle *s, *sentinel; + + assert(t->state == GDRAW_HANDLE_STATE_live || t->state == GDRAW_HANDLE_STATE_locked || t->state == GDRAW_HANDLE_STATE_pinned); + + // figure out where t belongs in the dead list in "chronological order" + // do this by finding its (chronological) successor s + sentinel = &t->cache->state[GDRAW_HANDLE_STATE_dead]; + s = sentinel->next; + while (s != sentinel && s->fence.value <= t->fence.value) + s = s->next; + + // and then insert it there + gdraw_HandleTransitionInsertBefore(t, GDRAW_HANDLE_STATE_dead, s); +} + +#endif + +//////////////////////////////////////////////////////////////////////// +// +// Set transformation matrices +// + +// Our vertex shaders use this convention: +// world: our world matrices always look like this +// m00 m01 0 t0 +// m10 m11 0 t1 +// 0 0 0 d +// 0 0 0 1 +// +// we just store the first two rows and insert d +// in the first row, third column. our input position vectors are +// always (x,y,0,1) or (x,y,0,0), so we can still just use dp4 to +// compute final x/y. after that it's a single move to set the +// correct depth value. +// +// viewproj: our view-projection matrix is always just a 2D scale+translate, +// i.e. the matrix looks like this: +// +// p[0] 0 0 p[2] +// 0 p[1] 0 p[3] +// 0 0 1 0 +// 0 0 0 1 +// +// just store (p[0],p[1],p[2],p[3]) in a 4-component vector and the projection +// transform is a single multiply-add. +// +// The output is volatile since it's often in Write-Combined memory where we +// really don't want compiler reordering. + +static RADINLINE void gdraw_PixelSpace(volatile F32 * RADRESTRICT vvec) +{ + // 1:1 pixel mapping - just identity since our "view space" is pixels + vvec[0] = 1.0f; vvec[1] = 0.0f; vvec[2] = 0.0f; vvec[3] = 0.0f; + vvec[4] = 0.0f; vvec[5] = 1.0f; vvec[6] = 0.0f; vvec[7] = 0.0f; +} + +static RADINLINE void gdraw_WorldSpace(volatile F32 * RADRESTRICT vvec, F32 * RADRESTRICT world_to_pixel, F32 depth, F32 misc) +{ + // World->pixel space transform is just a scale + vvec[0] = world_to_pixel[0]; vvec[1] = 0.0f; vvec[2] = depth; vvec[3] = 0.0f; + vvec[4] = 0.0f; vvec[5] = world_to_pixel[1]; vvec[6] = misc; vvec[7] = 0.0f; +} + +static RADINLINE void gdraw_ObjectSpace(volatile F32 * RADRESTRICT vvec, gswf_matrix * RADRESTRICT xform, F32 depth, F32 misc) +{ + // Object->pixel transform is a 2D homogeneous matrix transform + F32 m00 = xform->m00; + F32 m01 = xform->m01; + F32 m10 = xform->m10; + F32 m11 = xform->m11; + F32 trans0 = xform->trans[0]; + F32 trans1 = xform->trans[1]; + + vvec[0] = m00; vvec[1] = m01; vvec[2] = depth; vvec[3] = trans0; + vvec[4] = m10; vvec[5] = m11; vvec[6] = misc; vvec[7] = trans1; +} + +static void gdraw_GetObjectSpaceMatrix(F32 * RADRESTRICT mat, gswf_matrix * RADRESTRICT xform, F32 * RADRESTRICT proj, F32 depth, int out_col_major) +{ + int row = out_col_major ? 1 : 4; + int col = out_col_major ? 4 : 1; + + F32 xs = proj[0]; + F32 ys = proj[1]; + + mat[0*row+0*col] = xform->m00 * xs; + mat[0*row+1*col] = xform->m01 * xs; + mat[0*row+2*col] = 0.0f; + mat[0*row+3*col] = xform->trans[0] * xs + proj[2]; + + mat[1*row+0*col] = xform->m10 * ys; + mat[1*row+1*col] = xform->m11 * ys; + mat[1*row+2*col] = 0.0f; + mat[1*row+3*col] = xform->trans[1] * ys + proj[3]; + + mat[2*row+0*col] = 0.0f; + mat[2*row+1*col] = 0.0f; + mat[2*row+2*col] = 0.0f; + mat[2*row+3*col] = depth; + + mat[3*row+0*col] = 0.0f; + mat[3*row+1*col] = 0.0f; + mat[3*row+2*col] = 0.0f; + mat[3*row+3*col] = 1.0f; +} + + +//////////////////////////////////////////////////////////////////////// +// +// Blurs +// +// symmetrically expand a rectangle by ex/ey pixels on both sides, then clamp to tile bounds +static void gdraw_ExpandRect(gswf_recti *out, gswf_recti const *in, S32 ex, S32 ey, S32 w, S32 h) +{ + out->x0 = RR_MAX(in->x0 - ex, 0); + out->y0 = RR_MAX(in->y0 - ey, 0); + out->x1 = RR_MIN(in->x1 + ex, w); + out->y1 = RR_MIN(in->y1 + ey, h); +} + +static void gdraw_ShiftRect(gswf_recti *out, gswf_recti const *in, S32 dx, S32 dy) +{ + out->x0 = in->x0 + dx; + out->y0 = in->y0 + dy; + out->x1 = in->x1 + dx; + out->y1 = in->y1 + dy; +} + +#define MAX_TAPS 9 // max # of bilinear samples in one 'convolution' step + +enum +{ + // basic shader family + VAR_tex0 = 0, + VAR_tex1, + VAR_cmul, + VAR_cadd, + VAR_focal, + + // filter family + VAR_filter_tex0 = 0, + VAR_filter_tex1, + VAR_filter_color, + VAR_filter_tc_off, + VAR_filter_tex2, + VAR_filter_clamp0, + VAR_filter_clamp1, + VAR_filter_color2, + MAX_VARS, + + // blur family + VAR_blur_tex0 = 0, + VAR_blur_tap, + VAR_blur_clampv, + + // color matrix family + VAR_colormatrix_tex0 = 0, + VAR_colormatrix_data, + + // ihud family + VAR_ihudv_worldview = 0, + VAR_ihudv_material, + VAR_ihudv_textmode, +}; + +typedef struct +{ + S32 w,h, frametex_width, frametex_height; + void (*BlurPass)(GDrawRenderState *r, int taps, float *data, gswf_recti *s, float *tc, float height_max, float *clampv, GDrawStats *gstats); +} GDrawBlurInfo; + +static GDrawTexture *gdraw_BlurPass(GDrawFunctions *g, GDrawBlurInfo *c, GDrawRenderState *r, int taps, float *data, gswf_recti *draw_bounds, gswf_recti *sample_bounds, GDrawStats *gstats) +{ + F32 tc[4]; + F32 clamp[4]; + F32 t=0; + F32 texel_scale_s = 1.0f / c->frametex_width; + F32 texel_scale_t = 1.0f / c->frametex_height; + S32 i; + for (i=0; i < taps; ++i) + t += data[4*i+2]; + assert(t >= 0.99f && t <= 1.01f); + + tc[0] = texel_scale_s * draw_bounds->x0; + tc[1] = texel_scale_t * draw_bounds->y0; + tc[2] = texel_scale_s * draw_bounds->x1; + tc[3] = texel_scale_t * draw_bounds->y1; + + // sample_bounds is (x0,y0) inclusive, (x1,y1) exclusive + // texel centers are offset by 0.5 from integer coordinates and we don't want to sample outside sample_bounds + clamp[0] = texel_scale_s * (sample_bounds->x0 + 0.5f); + clamp[1] = texel_scale_t * (sample_bounds->y0 + 0.5f); + clamp[2] = texel_scale_s * (sample_bounds->x1 - 0.5f); + clamp[3] = texel_scale_t * (sample_bounds->y1 - 0.5f); + + if (!g->TextureDrawBufferBegin(draw_bounds, GDRAW_TEXTURE_FORMAT_rgba32, GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_color | GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_alpha, 0, gstats)) + return r->tex[0]; + + c->BlurPass(r, taps, data, draw_bounds, tc, (F32) c->h / c->frametex_height, clamp, gstats); + return g->TextureDrawBufferEnd(gstats); +} + +static GDrawTexture *gdraw_BlurPassDownsample(GDrawFunctions *g, GDrawBlurInfo *c, GDrawRenderState *r, int taps, float *data, gswf_recti *draw_bounds, int axis, int divisor, int tex_w, int tex_h, gswf_recti *sample_bounds, GDrawStats *gstats) +{ + S32 i; + F32 t=0; + F32 tc[4]; + F32 clamp[4]; + F32 texel_scale_s = 1.0f / tex_w; + F32 texel_scale_t = 1.0f / tex_h; + gswf_recti z; + + for (i=0; i < taps; ++i) + t += data[4*i+2]; + assert(t >= 0.99f && t <= 1.01f); + + // following must be integer divides! + if (axis == 0) { + z.x0 = draw_bounds->x0 / divisor; + z.x1 = (draw_bounds->x1-1) / divisor + 1; + z.y0 = draw_bounds->y0; + z.y1 = draw_bounds->y1; + + tc[0] = ((z.x0 - 0.5f)*divisor+0.5f)*texel_scale_s; + tc[2] = ((z.x1 - 0.5f)*divisor+0.5f)*texel_scale_s; + tc[1] = z.y0*texel_scale_t; + tc[3] = z.y1*texel_scale_t; + } else { + z.x0 = draw_bounds->x0; + z.x1 = draw_bounds->x1; + z.y0 = draw_bounds->y0 / divisor; + z.y1 = (draw_bounds->y1-1) / divisor + 1; + + tc[0] = z.x0*texel_scale_s; + tc[2] = z.x1*texel_scale_s; + tc[1] = ((z.y0 - 0.5f)*divisor+0.5f)*texel_scale_t; + tc[3] = ((z.y1 - 0.5f)*divisor+0.5f)*texel_scale_t; + } + + if (!g->TextureDrawBufferBegin(&z, GDRAW_TEXTURE_FORMAT_rgba32, GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_color | GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_alpha, 0, gstats)) + return r->tex[0]; + + clamp[0] = texel_scale_s * (sample_bounds->x0 + 0.5f); + clamp[1] = texel_scale_t * (sample_bounds->y0 + 0.5f); + clamp[2] = texel_scale_s * (sample_bounds->x1 - 0.5f); + clamp[3] = texel_scale_t * (sample_bounds->y1 - 0.5f); + + assert(clamp[0] <= clamp[2]); + assert(clamp[1] <= clamp[3]); + + c->BlurPass(r, taps, data, &z, tc, (F32) c->h / c->frametex_height, clamp, gstats); + return g->TextureDrawBufferEnd(gstats); +} + +#define unmap(t,a,b) (((t)-(a))/(F32) ((b)-(a))) +#define linear_remap(t,a,b,c,d) ((c) + unmap(t,a,b)*((d)-(c))) + +static void gdraw_BlurAxis(S32 axis, GDrawFunctions *g, GDrawBlurInfo *c, GDrawRenderState *r, F32 blur_width, F32 texel, gswf_recti *draw_bounds, gswf_recti *sample_bounds, GDrawTexture *protect, GDrawStats *gstats) +{ + GDrawTexture *t; + F32 data[MAX_TAPS][4]; + S32 off_axis = 1-axis; + S32 w = ((S32) ceil((blur_width-1)/2))*2+1; // 1.2 => 3, 2.8 => 3, 3.2 => 5 + F32 edge_weight = 1 - (w - blur_width)/2; // 3 => 0 => 1; 1.2 => 1.8 => 0.9 => 0.1 + F32 inverse_weight = 1.0f / blur_width; + + w = ((w-1) >> 1) + 1; // 3 => 2, 5 => 3, 7 => 4 (number of texture samples) + + if (!r->tex[0]) + return; + + // horizontal filter + if (w > 1) { + if (w <= MAX_TAPS) { + // we have enough taps to just do it + // use 'w' taps + S32 i, expand; + + // just go through and place all the taps in the right place + + // if w is 2 (sample from -1,0,1) + // 0 => -0.5 + // 1 => 1 + + // if w is 3: + // 0 => -1.5 samples from -2,-1 + // 1 => 0.5 samples from 0,1 + // 2 => 2 samples from 2 + + // if w is 4: + // 0 => -2.5 samples from -3,-2 + // 1 => -0.5 samples from -1,0 + // 2 => 1.5 samples from 1,2 + // 3 => 3 samples from 3 + + for (i=0; i < w; ++i) { + // first texsample samples from -w+1 and -w+2, e.g. w=2 => -1,0,1 + data[i][axis] = (-w+1.5f + i*2)*texel; + data[i][off_axis] = 0; + data[i][2] = 2*inverse_weight; // 2 full-weight samples + data[i][3] = 0; + } + // now reweight the last one + data[i-1][axis] = (w-1)*texel; + data[i-1][2] = edge_weight*inverse_weight; + // now reweight the first one + // (ew*0 + 1*1)/(1+ew) = 1/(1+ew) + data[0][axis] = (-w + 1.0f + 1/(edge_weight+1)) * texel; + data[0][2] = (edge_weight+1)*inverse_weight; + + expand = w-1; + gdraw_ExpandRect(draw_bounds, draw_bounds, axis ? 0 : expand, axis ? expand : 0, c->w, c->h); + + t = gdraw_BlurPass(g, c, r, w, data[0], draw_bounds, sample_bounds, gstats); + if (r->tex[0] != protect && r->tex[0] != t) + g->FreeTexture(r->tex[0], 0, gstats); + r->tex[0] = t; + gdraw_ExpandRect(sample_bounds, draw_bounds, 1, 1, c->w, c->h); // for next pass + } else { + // @OPTIMIZE: for symmetrical blurs we can get a 2-wide blur in the *off* axis at the same + // time we get N-wide in the on axis, which could double our max width + S32 i, expand; + // @HACK: this is really a dumb way to do it, i kind of had a brain fart, you could get + // the exact same result by just doing the downsample the naive way and then the + // final sample uses texture samples spaced by a texel rather than spaced by two + // texels -- the current method is just as inefficient, it just puts the inefficiency + // in the way the downsampled texture is self-overlapping, so the downsampled texture + // is twice as larger as it should be. + + // we COULD be exact by generating a mipmap, then sampling some number of samples + // from the mipmap and some from the original, but that would require being polyphase. + // instead we just are approximate. the mipmap weights the edge pixels by one half + // and overlaps them by one sample, so then in phase two we sample N slightly-overlapping + // mipmap samples + // + // instead we do the following. + // divide the source data up into clusters that are K samples long. + // ...K0... ...K1... ...K2... ...K3... + // + // Suppose K[i] is the average of all the items in cluster i. + // + // We compute a downsampled texture where T[i] = K[i] + K[i+1]. + // + // Now, we sample N taps from adjacent elements of T, allowing the texture unit + // to bilerp. Suppose a given sample falls at coordinate i with sub-position p. + // Then tap #j will compute: + // T[i+j]*(1-p) + T[i+j+1]*p + // But tap #j+1 will compute: + // T[i+j+1]*(1-p) + T[i+j+2]*p + // so we end up computing: + // sum(T[i+j]) except for the end samples. + // + // So, how do we create these initial clusters? That's easy, we use K taps + // to sample 2K texels. + // + // What value of k do we use? Well, we're constrained to using MAX_TAPS + // on each pass. So at the high end, we're bounded by: + // K = MAX_TAPS + // S = MAX_TAPS (S is number of samples in second pass) + // S addresses S*2-1 texels of T, and each texel adds K more samples, + // so (ignoring the edges) we basically have w = K*S + + // if w == MAX_TAPS*MAX_TAPS, then k = MAX_TAPS + // if w == MAX_TAPS+1, then k = 2 + // + // suppose we have 3 taps, then we can sample 5 samples in one pass, so then our + // max coverage is 25 samples, or a filter width of 13. with 7 taps, we sample + // 13 samples in one pass, max coverage is 13*13 samples or (13*13-1)/2 width, + // which is ((2T-1)*(2T-1)-1)/2 or (4T^2 - 4T + 1 -1)/2 or 2T^2 - 2T or 2T*(T-1) + S32 w_mip = (S32) ceil(linear_remap(w, MAX_TAPS+1, MAX_TAPS*MAX_TAPS, 2, MAX_TAPS)); + S32 downsample = w_mip; + F32 sample_spacing = texel; + if (downsample < 2) downsample = 2; + if (w_mip > MAX_TAPS) { + // if w_mip > MAX_TAPS, then we ought to use more than one mipmap pass, but + // since that's a huge filter ( > 80 pixels) let's just try subsampling and + // see if it's good enough. + sample_spacing *= w_mip / MAX_TAPS; + w_mip = MAX_TAPS; + } else { + assert(w / downsample <= MAX_TAPS); + } + inverse_weight = 1.0f / (2*w_mip); + for (i=0; i < w_mip; ++i) { + data[i][axis] = (-w_mip+1 + i*2+0.5f)*sample_spacing; + data[i][off_axis] = 0; + data[i][2] = 2*inverse_weight; + data[i][3] = 0; + } + w = w*2 / w_mip; + + // @TODO: compute the correct bboxes for this size + // the downsampled texture samples from -w_mip+1 to w_mip + // the sample from within that samples w spots within that, + // or w/2 of those, but they're overlapping by 50%. + // so if a sample is a point i, it samples from the original + // from -w_mip+1 to w_mip + i*w_mip. + // So then the minimum is: -w_mip+1 + (w/2)*w_mip, and + // the maximum is w_mip + (w/2)*w_mip + expand = (((w+1)>>1)+1)*w_mip+1; + gdraw_ExpandRect(draw_bounds, draw_bounds, axis ? 0 : expand, axis ? expand : 0, c->w, c->h); + + t = gdraw_BlurPassDownsample(g, c, r, w_mip, data[0], draw_bounds, axis, downsample, c->frametex_width, c->frametex_height, sample_bounds, gstats); + if (r->tex[0] != protect && r->tex[0] != t) + g->FreeTexture(r->tex[0], 0, gstats); + r->tex[0] = t; + gdraw_ExpandRect(sample_bounds, draw_bounds, 1, 1, c->w, c->h); + if (!r->tex[0]) + return; + + // now do a regular blur pass sampling from that + // the raw texture now contains 'downsample' samples per texel + if (w > 2*MAX_TAPS) { + sample_spacing = texel * (w-1) / (2*MAX_TAPS-1); + w = 2*MAX_TAPS; + } else { + sample_spacing = texel; + } + //sample_spacing *= 1.0f/2; + assert(w >= 2 && w <= 2*MAX_TAPS); + + if (w & 1) { + // we just want to evenly weight even-spaced samples + inverse_weight = 1.0f / w; + + // just go through and place all the taps in the right place + + w = (w+1)>>1; + for (i=0; i < w; ++i) { + data[i][axis] = (-w+1.0f + 0.5f + i*2)*sample_spacing; + data[i][off_axis] = 0; + data[i][2] = 2*inverse_weight; // 2 full-weight samples + data[i][3] = 0; + } + + // fix up the last tap + + // the following test is always true, but we're testing it here + // explicitly so as to make VS2012's static analyzer not complain + if (i > 0) { + data[i-1][axis] = (-w+1.0f+(i-1)*2)*sample_spacing; + data[i-1][2] = inverse_weight; + } + } else { + // we just want to evenly weight even-spaced samples + inverse_weight = 1.0f / w; + + // just go through and place all the taps in the right place + w >>= 1; + for (i=0; i < w; ++i) { + data[i][axis] = (-w+1.0f + i*2)*sample_spacing; + data[i][off_axis] = 0; + data[i][2] = 2*inverse_weight; // 2 full-weight samples + data[i][3] = 0; + } + } + + t = gdraw_BlurPassDownsample(g, c, r, w, data[0], draw_bounds, axis, 1, + axis==0 ? c->frametex_width*downsample : c->frametex_width, + axis==1 ? c->frametex_height*downsample : c->frametex_height, sample_bounds, gstats); + if (r->tex[0] != protect && r->tex[0] != t) + g->FreeTexture(r->tex[0], 0, gstats); + r->tex[0] = t; + gdraw_ExpandRect(sample_bounds, draw_bounds, 1, 1, c->w, c->h); + } + } +} + +static void gdraw_Blur(GDrawFunctions *g, GDrawBlurInfo *c, GDrawRenderState *r, gswf_recti *draw_bounds, gswf_recti *sample_bounds, GDrawStats *gstats) +{ + S32 p; + GDrawTexture *protect = r->tex[0]; + gswf_recti sbounds; + + // compute texel offset size + F32 dx = 1.0f / c->frametex_width; + F32 dy = 1.0f / c->frametex_height; + + // blur = 1 => 1 tap + // blur = 1.2 => 3 taps (0.1, 1, 0.1) + // blur = 2.2 => 3 taps (0.6, 1, 0.6) + // blur = 2.8 => 3 taps (0.9, 1, 0.9) + // blur = 3 => 3 taps (1 , 1, 1 ) + // blur = 3.2 => 5 taps (0.1, 1, 1, 1, 0.1) + + //S32 w = ((S32) ceil((r->blur_x-1)/2))*2+1; // 1.2 => (1.2-1)/2 => 0.1 => 1.0 => 1 => 2 => 3 + //S32 h = ((S32) ceil((r->blur_y-1)/2))*2+1; // 3 => (3-1)/2 => 1.0 => 1 => 2 => 3 + + // gdraw puts 1 border pixel around everything when producing rendertargets and we use this + // so expand the input sample bounds accordingly + gdraw_ExpandRect(&sbounds, sample_bounds, 1, 1, c->w, c->h); + + for (p=0; p < r->blur_passes; ++p) { + #if 0 // @OPTIMIZE do the filter in one pass + if (w*h <= MAX_TAPS) { + } else + #endif + { + // do the filter separably + gdraw_BlurAxis(0,g,c,r,r->blur_x,dx, draw_bounds, &sbounds, protect, gstats); + gdraw_BlurAxis(1,g,c,r,r->blur_y,dy, draw_bounds, &sbounds, protect, gstats); + } + } +} + +#ifdef GDRAW_MANAGE_MEM + +static void make_pool_aligned(void **start, S32 *num_bytes, U32 alignment) +{ + UINTa addr_orig = (UINTa) *start; + UINTa addr_aligned = (addr_orig + alignment-1) & ~((UINTa) alignment - 1); + + if (addr_aligned != addr_orig) { + S32 diff = (S32) (addr_aligned - addr_orig); + if (*num_bytes < diff) { + *start = NULL; + *num_bytes = 0; + return; + } else { + *start = (void *)addr_aligned; + *num_bytes -= diff; + } + } +} + +// Very simple arena allocator +typedef struct +{ + U8 *begin; + U8 *current; + U8 *end; +} GDrawArena; + +static void gdraw_arena_init(GDrawArena *arena, void *start, U32 size) +{ + arena->begin = (U8 *)start; + arena->current = (U8 *)start; + arena->end = (U8 *)start + size; +} + +static GDRAW_MAYBE_UNUSED void gdraw_arena_reset(GDrawArena *arena) +{ + arena->current = arena->begin; +} + +static void *gdraw_arena_alloc(GDrawArena *arena, U32 size, U32 align) +{ + UINTa start_addr = ((UINTa)arena->current + align-1) & ~((UINTa) align - 1); + U8 *ptr = (U8 *)start_addr; + UINTa remaining = arena->end - arena->current; + UINTa total_size = (ptr - arena->current) + size; + if (remaining < total_size) // doesn't fit + return NULL; + + arena->current = ptr + size; + return ptr; +} + +// Allocator for graphics memory. +// Graphics memory is assumed to be write-combined and slow to read for the +// CPU, so we keep all heap management information separately in main memory. +// +// There's a constant management of about 1k (2k for 64bit) to create a heap, +// plus a per-block overhead. The maximum number of blocks the allocator can +// ever use is bounded by 2*max_allocs+1; since GDraw manages a limited +// amount of handles, max_allocs is a known value at heap creation time. +// +// The allocator uses a best-fit heuristic to minimize fragmentation. +// Currently, there are no size classes or other auxiliary data structures to +// speed up this process, since the number of free blocks at any point in time +// is assumed to be fairly low. +// +// The allocator maintains a number of invariants: +// - The free list and physical block list are proper double-linked lists. +// (i.e. block->next->prev == block->prev->next == block) +// - All allocated blocks are also kept in a hash table, indexed by their +// pointer (to allow free to locate the corresponding block_info quickly). +// There's a single-linked, NULL-terminated list of elements in each hash +// bucket. +// - The physical block list is ordered. It always contains all currently +// active blocks and spans the whole managed memory range. There are no +// gaps between blocks, and all blocks have nonzero size. +// - There are no two adjacent free blocks; if two such blocks would be created, +// they are coalesced immediately. +// - The maximum number of blocks that could ever be necessary is allocated +// on initialization. All block_infos not currently in use are kept in a +// single-linked, NULL-terminated list of unused blocks. Every block is either +// in the physical block list or the unused list, and the total number of +// blocks is constant. +// These invariants always hold before and after an allocation/free. + +#ifndef GFXALLOC_ASSERT +#define GFXALLOC_ASSERT(x) +#endif + +typedef struct gfx_block_info +{ + U8 *ptr; + gfx_block_info *prev, *next; // for free blocks this is the free list, for allocated blocks it's a (single-linked!) list of elements in the corresponding hash bucket + gfx_block_info *prev_phys, *next_phys; + U32 is_free : 1; + U32 is_unused : 1; + U32 size : 30; +} gfx_block_info; +// 24 bytes/block on 32bit, 48 bytes/block on 64bit. + +#define GFXALLOC_HASH_SIZE 256 + +typedef struct gfx_allocator +{ + U8 *mem_base; + U8 *mem_end; + U32 max_allocs; + U32 block_align; + U32 block_shift; + S32 actual_bytes_free; + +#ifdef GFXALLOC_CHECK + int num_blocks; + int num_unused; + int num_alloc; + int num_free; +#endif + + GDrawHandleCache *cache; + + gfx_block_info *unused_list; // next unused block_info (single-linked list) + gfx_block_info *hash[GFXALLOC_HASH_SIZE]; // allocated blocks + gfx_block_info blocks[1]; // first block is head of free list AND head of physical block list (sentinel) +} gfx_allocator; +// about 1k (32bit), 2k (64bit) with 256 hash buckets (the default). dominated by hash table. + +#ifdef GFXALLOC_CHECK +#define GFXALLOC_IF_CHECK(x) x +#else +#define GFXALLOC_IF_CHECK(x) +#endif + +static U32 gfxalloc_get_hash_code(gfx_allocator *alloc, void *ptr) +{ + U32 a = (U32) (((U8 *) ptr - alloc->mem_base) >> alloc->block_shift); + + // integer hash function by Bob Jenkins (http://burtleburtle.net/bob/hash/integer.html) + // I use this function because integer mults are slow on PPC and large literal constants + // take multiple instrs to set up on all RISC CPUs. + a -= (a<<6); + a ^= (a>>17); + a -= (a<<9); + a ^= (a<<4); + a -= (a<<3); + a ^= (a<<10); + a ^= (a>>15); + + return a & (GFXALLOC_HASH_SIZE - 1); +} + +#if defined(SUPERDEBUG) || defined(COMPLETE_DEBUG) +#include +#define MAX_REGIONS 8192 +typedef struct +{ + U32 begin,end; +} gfx_region; +static gfx_region region[MAX_REGIONS]; + +static int region_sort(const void *p, const void *q) +{ + U32 a = *(U32*)p; + U32 b = *(U32*)q; + if (a < b) return -1; + if (a > b) return 1; + return 0; +} + +static void gfxalloc_check1(gfx_allocator *alloc) +{ + assert(alloc->max_allocs*2+1 < MAX_REGIONS); + int i,n=0; + for (i=0; i < GFXALLOC_HASH_SIZE; ++i) { + gfx_block_info *b = alloc->hash[i]; + while (b) { + region[n].begin = (UINTa) b->ptr; + region[n].end = region[n].begin + b->size; + ++n; + b = b->next; + } + } + gfx_block_info *b = alloc->blocks[0].next; + while (b != &alloc->blocks[0]) { + region[n].begin = (UINTa) b->ptr; + region[n].end = region[n].begin + b->size; + ++n; + b = b->next; + } + qsort(region, n, sizeof(region[0]), region_sort); + for (i=0; i+1 < n; ++i) { + assert(region[i].end == region[i+1].begin); + } +} +#else +#define gfxalloc_check1(a) +#endif + +#ifdef COMPLETE_DEBUG +static void verify_against_blocks(int num_regions, void *vptr, S32 len) +{ + U32 *ptr = (U32 *) vptr; + // binary search for ptr amongst regions + S32 s=0,e=num_regions-1; + assert(len != 0); + while (s < e) { + S32 i = (s+e+1)>>1; + // invariant: b[s] <= ptr <= b[e] + if (region[i].begin <= (UINTa) ptr) + s = i; + else + e = i-1; + + // consider cases: + // s=0,e=1: i = 0, how do we get i to be 1? + } + // at this point, s >= e + assert(s < num_regions && region[s].begin == (UINTa) ptr && (UINTa) ptr+len <= region[s].end); +} + +static void debug_complete_check(gfx_allocator *alloc, void *ptr, S32 len, void *skip) +{ + GDrawHandleCache *c = alloc->cache; + assert(alloc->max_allocs*2+1 < MAX_REGIONS); + int i,n=0; + for (i=0; i < GFXALLOC_HASH_SIZE; ++i) { + gfx_block_info *b = alloc->hash[i]; + while (b) { + region[n].begin = (UINTa) b->ptr; + region[n].end = region[n].begin + b->size; + ++n; + b = b->next; + } + } + gfx_block_info *b = alloc->blocks[0].next; + while (b != &alloc->blocks[0]) { + region[n].begin = (UINTa) b->ptr; + region[n].end = region[n].begin + b->size; + ++n; + b = b->next; + } + for (i=0; i < n; ++i) + assert(region[i].end > region[i].begin); + qsort(region, n, sizeof(region[0]), region_sort); + for (i=0; i+1 < n; ++i) { + assert(region[i].end == region[i+1].begin); + } + + if (ptr) + verify_against_blocks(n, ptr, len); + + if (c) { + GDrawHandle *t = c->head; + while (t) { + if (t->raw_ptr && t->raw_ptr != skip) + verify_against_blocks(n, t->raw_ptr, t->bytes); + t = t->next; + } + t = c->active; + while (t) { + if (t->raw_ptr && t->raw_ptr != skip) + verify_against_blocks(n, t->raw_ptr, t->bytes); + t = t->next; + } + } +} +#else +#define debug_complete_check(a,p,len,s) +#endif + +#ifdef GFXALLOC_CHECK +static void gfxalloc_check2(gfx_allocator *alloc) +{ + int n=0; + gfx_block_info *b = alloc->unused_list; + while (b) { + ++n; + b = b->next; + } + GFXALLOC_ASSERT(n == alloc->num_unused); + b = alloc->blocks->next; + n = 0; + while (b != alloc->blocks) { + ++n; + b = b->next; + } + GFXALLOC_ASSERT(n == alloc->num_free); + GFXALLOC_ASSERT(alloc->num_blocks == alloc->num_unused + alloc->num_free + alloc->num_alloc); +} +#define gfxalloc_check(a) do { gfxalloc_check1(a); gfxalloc_check2(a); } while(0) +#else +#define gfxalloc_check2(a) +#define gfxalloc_check(a) +#endif + + + +static gfx_block_info *gfxalloc_pop_unused(gfx_allocator *alloc) +{ + GFXALLOC_ASSERT(alloc->unused_list != NULL); + GFXALLOC_ASSERT(alloc->unused_list->is_unused); + GFXALLOC_IF_CHECK(GFXALLOC_ASSERT(alloc->num_unused);) + + gfx_block_info *b = alloc->unused_list; + alloc->unused_list = b->next; + GFXALLOC_ASSERT(alloc->unused_list); + b->is_unused = 0; + GFXALLOC_IF_CHECK(--alloc->num_unused;) + return b; +} + +static void gfxalloc_push_unused(gfx_allocator *alloc, gfx_block_info *b) +{ + GFXALLOC_ASSERT(!b->is_unused); + b->is_unused = 1; + b->next = alloc->unused_list; + alloc->unused_list = b; + GFXALLOC_IF_CHECK(++alloc->num_unused); +} + +static void gfxalloc_add_free(gfx_allocator *alloc, gfx_block_info *b) +{ + gfx_block_info *head = alloc->blocks; + + b->is_free = 1; + b->next = head->next; + b->prev = head; + head->next->prev = b; + head->next = b; + GFXALLOC_IF_CHECK(++alloc->num_free;) +} + +static void gfxalloc_rem_free(gfx_allocator *alloc, gfx_block_info *b) +{ + RR_UNUSED_VARIABLE(alloc); + b->is_free = 0; + b->prev->next = b->next; + b->next->prev = b->prev; + GFXALLOC_IF_CHECK(--alloc->num_free;) +} + +static void gfxalloc_split_free(gfx_allocator *alloc, gfx_block_info *b, U32 pos) +{ + gfx_block_info *n = gfxalloc_pop_unused(alloc); + + GFXALLOC_ASSERT(b->is_free); + GFXALLOC_ASSERT(pos > 0 && pos < b->size); + + // set up new free block + n->ptr = b->ptr + pos; + n->prev_phys = b; + n->next_phys = b->next_phys; + n->next_phys->prev_phys = n; + n->size = b->size - pos; + assert(n->size != 0); + gfxalloc_add_free(alloc, n); + + // fix original block + b->next_phys = n; + b->size = pos; + assert(b->size != 0); + +debug_complete_check(alloc, n->ptr, n->size,0); +debug_complete_check(alloc, b->ptr, b->size,0); +} + +static gfx_allocator *gfxalloc_create(void *mem, U32 mem_size, U32 align, U32 max_allocs) +{ + gfx_allocator *a; + U32 i, max_blocks, size; + + if (!align || (align & (align - 1)) != 0) // align must be >0 and a power of 2 + return NULL; + + // for <= max_allocs live allocs, there's <= 2*max_allocs+1 blocks. worst case: + // [free][used][free] .... [free][used][free] + max_blocks = max_allocs * 2 + 1; + size = sizeof(gfx_allocator) + max_blocks * sizeof(gfx_block_info); + a = (gfx_allocator *) IggyGDrawMalloc(size); + if (!a) + return NULL; + + memset(a, 0, size); + + GFXALLOC_IF_CHECK(a->num_blocks = max_blocks;) + GFXALLOC_IF_CHECK(a->num_alloc = 0;) + GFXALLOC_IF_CHECK(a->num_free = 1;) + GFXALLOC_IF_CHECK(a->num_unused = max_blocks-1;) + + GFXALLOC_IF_CHECK(GFXALLOC_ASSERT(a->num_blocks == a->num_alloc + a->num_free + a->num_unused);) + GFXALLOC_IF_CHECK(GFXALLOC_ASSERT(a->num_free <= a->num_blocks+1);) + + a->actual_bytes_free = mem_size; + a->mem_base = (U8 *) mem; + a->mem_end = a->mem_base + mem_size; + a->max_allocs = max_allocs; + a->block_align = align; + a->block_shift = 0; + while ((1u << a->block_shift) < a->block_align) + a->block_shift++; + + // init sentinel block + a->blocks[0].prev = a->blocks[0].next = &a->blocks[1]; // point to free block + a->blocks[0].prev_phys = a->blocks[0].next_phys = &a->blocks[1]; // same + + // init first free block + a->blocks[1].ptr = a->mem_base; + a->blocks[1].prev = a->blocks[1].next = &a->blocks[0]; + a->blocks[1].prev_phys = a->blocks[1].next_phys = &a->blocks[0]; + a->blocks[1].is_free = 1; + a->blocks[1].size = mem_size; + + // init "unused" list + a->unused_list = a->blocks + 2; + for (i=2; i < max_blocks; i++) { + a->blocks[i].is_unused = 1; + a->blocks[i].next = a->blocks + (i + 1); + } + a->blocks[i].is_unused = 1; + + gfxalloc_check(a); + debug_complete_check(a, NULL, 0,0); + return a; +} + +static void *gfxalloc_alloc(gfx_allocator *alloc, U32 size_in_bytes) +{ + gfx_block_info *cur, *best = NULL; + U32 i, best_wasted = ~0u; + U32 size = size_in_bytes; +debug_complete_check(alloc, NULL, 0,0); +gfxalloc_check(alloc); + GFXALLOC_IF_CHECK(GFXALLOC_ASSERT(alloc->num_blocks == alloc->num_alloc + alloc->num_free + alloc->num_unused);) + GFXALLOC_IF_CHECK(GFXALLOC_ASSERT(alloc->num_free <= alloc->num_blocks+1);) + + + // round up to multiple of our block alignment + size = (size + alloc->block_align-1) & ~(alloc->block_align - 1); + assert(size >= size_in_bytes); + assert(size != 0); + + // find best fit among all free blocks. this is O(N)! + for (cur = alloc->blocks[0].next; cur != alloc->blocks; cur = cur->next) { + if (cur->size >= size) { + U32 wasted = cur->size - size; + if (wasted < best_wasted) { + best_wasted = wasted; + best = cur; + if (!wasted) break; // can't get better than perfect + } + } + } + + // return the best fit, if we found any suitable block + if (best) { +debug_check_overlap(alloc->cache, best->ptr, best->size); + // split off allocated part + if (size != best->size) + gfxalloc_split_free(alloc, best, size); +debug_complete_check(alloc, best->ptr, best->size,0); + + // remove from free list and add to allocated hash table + GFXALLOC_ASSERT(best->size == size); + gfxalloc_rem_free(alloc, best); + + i = gfxalloc_get_hash_code(alloc, best->ptr); + best->next = alloc->hash[i]; + alloc->hash[i] = best; + alloc->actual_bytes_free -= size; + GFXALLOC_ASSERT(alloc->actual_bytes_free >= 0); + + GFXALLOC_IF_CHECK(++alloc->num_alloc;) + GFXALLOC_IF_CHECK(GFXALLOC_ASSERT(alloc->num_blocks == alloc->num_alloc + alloc->num_free + alloc->num_unused);) + GFXALLOC_IF_CHECK(GFXALLOC_ASSERT(alloc->num_free <= alloc->num_blocks+1);) + +debug_complete_check(alloc, best->ptr, best->size,0); +gfxalloc_check(alloc); +debug_check_overlap(alloc->cache, best->ptr, best->size); + return best->ptr; + } else + return NULL; // not enough space! +} + +static void gfxalloc_free(gfx_allocator *alloc, void *ptr) +{ + GFXALLOC_IF_CHECK(GFXALLOC_ASSERT(alloc->num_blocks == alloc->num_alloc + alloc->num_free + alloc->num_unused);) + GFXALLOC_IF_CHECK(GFXALLOC_ASSERT(alloc->num_free <= alloc->num_blocks+1);) + + // find the block in the hash table + gfx_block_info *b, *t, **prevnext; + U32 i = gfxalloc_get_hash_code(alloc, ptr); + + prevnext = &alloc->hash[i]; + b = alloc->hash[i]; + + while (b) { + if (b->ptr == ptr) break; + prevnext = &b->next; + b = b->next; + } + + if (!b) { + GFXALLOC_ASSERT(0); // trying to free a non-allocated block + return; + } + +debug_complete_check(alloc, b->ptr, b->size, 0); + GFXALLOC_IF_CHECK(--alloc->num_alloc;) + + // remove it from the hash table + *prevnext = b->next; + + alloc->actual_bytes_free += b->size; + + // merge with previous block if it's free, else add it to free list + t = b->prev_phys; + if (t->is_free) { + t->size += b->size; + t->next_phys = b->next_phys; + t->next_phys->prev_phys = t; + gfxalloc_push_unused(alloc, b); + b = t; + } else + gfxalloc_add_free(alloc, b); + + // try to merge with next block + t = b->next_phys; + if (t->is_free) { + b->size += t->size; + b->next_phys = t->next_phys; + t->next_phys->prev_phys = b; + gfxalloc_rem_free(alloc, t); + gfxalloc_push_unused(alloc, t); + } +debug_complete_check(alloc, 0, 0, ptr); +gfxalloc_check(alloc); + GFXALLOC_IF_CHECK(GFXALLOC_ASSERT(alloc->num_blocks == alloc->num_alloc + alloc->num_free + alloc->num_unused);) + GFXALLOC_IF_CHECK(GFXALLOC_ASSERT(alloc->num_free <= alloc->num_blocks+1);) +} + +#ifdef GDRAW_MANAGE_MEM_TWOPOOL + +static rrbool gfxalloc_is_empty(gfx_allocator *alloc) +{ + gfx_block_info *first_free = alloc->blocks[0].next; + + // we want to check whether there's exactly one free block that + // covers the entire pool. + if (first_free == alloc->blocks) // 0 free blocks + return false; + + if (first_free->next != alloc->blocks) // >1 free block + return false; + + return first_free->ptr == alloc->mem_base && first_free->ptr + first_free->size == alloc->mem_end; +} + +static rrbool gfxalloc_mem_contains(gfx_allocator *alloc, void *ptr) +{ + return alloc->mem_base <= (U8*)ptr && (U8*)ptr < alloc->mem_end; +} + +#endif + +#ifdef GDRAW_DEBUG + +static void gfxalloc_dump(gfx_allocator *alloc) +{ + static const char *type[] = { + "allocated", + "free", + }; + + for (gfx_block_info *b = alloc->blocks[0].next_phys; b != alloc->blocks; b=b->next_phys) { + U8 *start = b->ptr; + U8 *end = b->ptr + b->size; + printf("%p-%p: %s (%d bytes)\n", start, end, type[b->is_free], b->size); + } +} + +#endif + +#endif + +#ifdef GDRAW_DEFRAGMENT + +#define GDRAW_DEFRAGMENT_may_overlap 1 // self-overlap for individual copies is OK + +// Defragmentation code for graphics memory. +// The platform implementation must provide a GPU memcpy function and handle all necessary +// synchronization. It must also adjust its resource descriptors to match the new addresses +// after defragmentation. + +static void gdraw_gpu_memcpy(GDrawHandleCache *c, void *dst, void *src, U32 num_bytes); + +static void gdraw_Defragment_memmove(GDrawHandleCache *c, U8 *dst, U8 *src, U32 num_bytes, U32 flags, GDrawStats *stats) +{ + if (dst == src) + return; + + assert(num_bytes != 0); + + stats->nonzero_flags |= GDRAW_STATS_defrag; + stats->defrag_objects += 1; + stats->defrag_bytes += num_bytes; + + if ((flags & GDRAW_DEFRAGMENT_may_overlap) || dst + num_bytes <= src || src + num_bytes <= dst) // no problematic overlap + gdraw_gpu_memcpy(c, dst, src, num_bytes); + else { + // need to copy in multiple chunks + U32 chunk_size, pos=0; + if (dst < src) + chunk_size = (U32) (src - dst); + else + chunk_size = (U32) (dst - src); + + while (pos < num_bytes) { + U32 amount = num_bytes - pos; + if (amount > chunk_size) amount = chunk_size; + gdraw_gpu_memcpy(c, dst + pos, src + pos, amount); + pos += amount; + } + } +} + +static rrbool gdraw_CanDefragment(GDrawHandleCache *c) +{ + // we can defragment (and extract some gain from it) if and only if there's more + // than one free block. since gfxalloc coalesces free blocks immediately and keeps + // them in a circular linked list, this is very easy to detect: just check if the + // "next" pointer of the first free block points to the sentinel. (this is only + // the case if there are 0 or 1 free blocks) + gfx_allocator *alloc = c->alloc; + return alloc->blocks[0].next->next != alloc->blocks; +} + +static void gdraw_DefragmentMain(GDrawHandleCache *c, U32 flags, GDrawStats *stats) +{ + gfx_allocator *alloc = c->alloc; + gfx_block_info *b, *n; + U8 *p; + S32 i; + + GFXALLOC_IF_CHECK(GFXALLOC_ASSERT(alloc->num_blocks == alloc->num_alloc + alloc->num_free + alloc->num_unused);) + GFXALLOC_IF_CHECK(GFXALLOC_ASSERT(alloc->num_free <= alloc->num_blocks+1);) + + // go over all allocated memory blocks and clear the "prev" pointer + // (unused for allocated blocks, we'll use it to store a back-pointer to the corresponding handle) + for (b = alloc->blocks[0].next_phys; b != alloc->blocks; b=b->next_phys) + if (!b->is_free) + b->prev = NULL; + + // go through all handles and store a pointer to the handle in the corresponding memory block + for (i=0; i < c->max_handles; i++) + if (c->handle[i].raw_ptr) { + assert(c->handle[i].bytes != 0); + for (b=alloc->hash[gfxalloc_get_hash_code(alloc, c->handle[i].raw_ptr)]; b; b=b->next) + if (b->ptr == c->handle[i].raw_ptr) { + void *block = &c->handle[i]; + b->prev = (gfx_block_info *) block; + break; + } + + GFXALLOC_ASSERT(b != NULL); // didn't find this block anywhere! + } + + // clear alloc hash table (we rebuild it during defrag) + memset(alloc->hash, 0, sizeof(alloc->hash)); + + // defragmentation proper: go over all blocks again, remove all free blocks from the physical + // block list and compact the remaining blocks together. + p = alloc->mem_base; + for (b = alloc->blocks[0].next_phys; b != alloc->blocks; b=n) { + n = b->next_phys; + + if (!b->is_free) { + U32 h; + + // move block if necessary + if (p != b->ptr) { + assert(b->size != 0); + gdraw_Defragment_memmove(c, p, b->ptr, b->size, flags, stats); + b->ptr = p; + assert(b->prev); + if (b->prev) + ((GDrawHandle *) b->prev)->raw_ptr = p; + } + + // re-insert into hash table + h = gfxalloc_get_hash_code(alloc, p); + b->next = alloc->hash[h]; + alloc->hash[h] = b; + + p += b->size; + } else { + // free block: remove it from the physical block list + b->prev_phys->next_phys = b->next_phys; + b->next_phys->prev_phys = b->prev_phys; + gfxalloc_rem_free(alloc, b); + gfxalloc_push_unused(alloc, b); + } + } + // the free list should be empty now + assert(alloc->blocks[0].next == &alloc->blocks[0]); + + // unless all memory is allocated, we now need to add a new block for the free space at the end + if (p != alloc->mem_end) { + b = gfxalloc_pop_unused(alloc); + + b->ptr = p; + b->prev_phys = alloc->blocks[0].prev_phys; + b->next_phys = &alloc->blocks[0]; + b->prev_phys->next_phys = b; + b->next_phys->prev_phys = b; + b->size = alloc->mem_end - p; + gfxalloc_add_free(alloc, b); + } + + GFXALLOC_IF_CHECK(GFXALLOC_ASSERT(alloc->num_blocks == alloc->num_alloc + alloc->num_free + alloc->num_unused);) + GFXALLOC_IF_CHECK(GFXALLOC_ASSERT(alloc->num_free <= alloc->num_blocks+1);) +} + +#endif + +#ifdef GDRAW_MANAGE_MEM_TWOPOOL + +// Defragmentation code for graphics memory, using two-pool strategy. +// +// The platform implementation must provide a GPU memcpy function and handle +// all necessary synchronization. It must also adjust its resource descriptors +// to match the new addresses after defragmentation. +// +// The high concept for two-pool is that we can't update the resource pools +// mid-frame; instead, while preparing for a frame, we need to produce a memory +// configuration that is suitable for rendering a whole frame at once (in +// contrast to our normal incremental strategy, where we can decide to +// defragment mid-frame if things are getting desperate). This is for tiled +// renderers. +// +// Two-pool works like this: +// - As the name suggests, each handle cache has two memory pools and corresponding backing +// allocators. The currently used allocator, "alloc", and a second allocator, "alloc_other". +// - Any resource used in a command buffer gets locked and *stays locked* until we're done +// preparing that command buffer (i.e. no unlocking after every draw as in the normal +// incremental memory management). +// - All allocations happen from "alloc", always. We mostly do our normal LRU cache freeing +// to make space when required. +// - We can still run out of space (no surprise) and get into a configuration where we have +// to defragment. This is the only tricky part, and where the second pool comes in. To +// defragment, we switch the roles of "alloc" and "alloc_other", and allocate new backing +// storage for all currently "locked" and "pinned" resources (i.e. everything we've used +// in the currently pending frame). +// - In general, we have the invariant that all resources we're using for batches we're +// working on must be in the "alloc" (fresh) pool, not in the "other" (stale) pool. +// Therefore, after a defragment/pool switch, any "live" resource (which means it's +// present in the stale pool) has to be copied to the "fresh" pool as it's getting +// locked to maintain this invariant. +// +// What this does is give us a guarantee that any given frame either only +// references resources in one pool (the common case), or does a defragment, in +// which case it looks like this: +// +// +------------------------------+ +// | | +// | | pool A is fresh (=alloc), pool B is stale (=alloc_other) +// | | all resources referenced in here are in pool A +// | | +// | | +// | | +// +------------------------------+ <-- defragment! pools flip roles here +// | | +// | | +// | | pool B is fresh (=alloc), pool A is stale (=alloc_other) +// | | all resources referenced in here are in pool B +// | | +// +------------------------------+ +// +// Now, at the end of the frame, we need to decide what to do with the +// resources that remain "live" (i.e. they're in the old pool but weren't +// referenced in the current frame so they didn't get copied). As of this +// writing, we simply free them, to maximize the amount of free memory in the +// new pool (and hopefully minimize the chance that we'll have to defragment +// again soon). It would also be possible to copy some of them though, assuming +// there's enough space. +// +// Freeing resources is an interesting case. When the CPU side of GDraw does a +// "free", we can't immediately reclaim the resource memory, since the GPU will +// generally still have outstanding commands that reference that resource. So +// our freed resources first enter the "Dead" state and only actually get freed +// once the GPU is done with them. What this means is that the list of +// resources in the "dead" state can end up holding references to both the +// fresh and the stale pool; the free implementation needs to be aware of this +// and return the memory to the right allocator. +// +// When we defragment, it's important to make sure that the pool we're flipping +// to is actually empty. What this means is that right before a defragment, we +// need to wait for all stale "dead" resources to actually become free. If the +// last defragment was several frames ago, this is fast - we haven't generated +// any new commands referencing the stale resources in several frames, so most +// likely they're all immediately free-able. By contrast, if we just +// defragmented last frame, this will be a slow operation since we need to wait +// for the GPU pipeline to drain - but if you're triggering defragments in +// several consecutive frames, you're thrashing the resource pools badly and +// are getting really bad performance anyway. + +static void gdraw_gpu_memcpy(GDrawHandleCache *c, void *dst, void *src, U32 num_bytes); +static void gdraw_gpu_wait_for_transfer_completion(); +static void gdraw_resource_moved(GDrawHandle *t); + +static rrbool gdraw_CanDefragment(GDrawHandleCache *c) +{ + // we can defragment (and extract some gain from it) if and only if there's more + // than one free block. since gfxalloc coalesces free blocks immediately and keeps + // them in a circular linked list, this is very easy to detect: just check if the + // "next" pointer of the first free block points to the sentinel. (this is only + // the case if there are 0 or 1 free blocks) + gfx_allocator *alloc = c->alloc; + if (!c->alloc_other) // if we don't have a second pool, we can't defrag at all. + return false; + return alloc->blocks[0].next->next != alloc->blocks; +} + +static rrbool gdraw_MigrateResource(GDrawHandle *t, GDrawStats *stats) +{ + GDrawHandleCache *c = t->cache; + void *ptr = NULL; + + assert(t->state == GDRAW_HANDLE_STATE_live || t->state == GDRAW_HANDLE_STATE_locked || t->state == GDRAW_HANDLE_STATE_pinned); + // anything we migrate should be in the "other" (old) pool + assert(gfxalloc_mem_contains(c->alloc_other, t->raw_ptr)); + + ptr = gfxalloc_alloc(c->alloc, t->bytes); + if (ptr) { + // update stats + stats->nonzero_flags |= GDRAW_STATS_defrag; + stats->defrag_objects += 1; + stats->defrag_bytes += t->bytes; + + // copy contents to new storage + gdraw_gpu_memcpy(c, ptr, t->raw_ptr, t->bytes); + + // free old storage + gfxalloc_free(c->alloc_other, t->raw_ptr); + + // adjust pointers to point to new location + t->raw_ptr = ptr; + gdraw_resource_moved(t); + + return true; + } else + return false; +} + +static rrbool gdraw_MigrateAllResources(GDrawHandle *sentinel, GDrawStats *stats) +{ + GDrawHandle *h; + for (h = sentinel->next; h != sentinel; h = h->next) { + if (!gdraw_MigrateResource(h, stats)) + return false; + } + return true; +} + +static rrbool gdraw_TwoPoolDefragmentMain(GDrawHandleCache *c, GDrawStats *stats) +{ + gfx_allocator *t; + + // swap allocators + t = c->alloc; + c->alloc = c->alloc_other; + c->alloc_other = t; + + // immediately migrate all currently pinned and locked resources + rrbool ok = true; + ok = ok && gdraw_MigrateAllResources(&c->state[GDRAW_HANDLE_STATE_pinned], stats); + ok = ok && gdraw_MigrateAllResources(&c->state[GDRAW_HANDLE_STATE_locked], stats); + + return ok; +} + +static rrbool gdraw_StateListIsEmpty(GDrawHandle *head) +{ + // a list is empty when the head sentinel is the only node + return head->next == head; +} + +static void gdraw_CheckAllPointersUpdated(GDrawHandle *head) +{ +#ifdef GDRAW_DEBUG + GDrawHandle *h; + for (h = head->next; h != head; h = h->next) { + assert(gfxalloc_mem_contains(h->cache->alloc, h->raw_ptr)); + } +#endif +} + +static void gdraw_PostDefragmentCleanup(GDrawHandleCache *c, GDrawStats *stats) +{ + // if we defragmented during this scene, this is the spot where + // we need to nuke all references to resources that weren't + // carried over into the new pool. + if (c->did_defragment) { + GDrawHandle *h; + + // alloc list should be empty at this point + assert(gdraw_StateListIsEmpty(&c->state[GDRAW_HANDLE_STATE_alloc])); + + // free all remaining live resources (these are the resources we didn't + // touch this frame, hence stale) + h = &c->state[GDRAW_HANDLE_STATE_live]; + while (!gdraw_StateListIsEmpty(h)) + gdraw_res_free(h->next, stats); + + // "live" is now empty, and we already checked that "alloc" was empty + // earlier. "dead" may hold objects on the old heap still (that were freed + // before we swapped allocators). "user owned" is not managed by us. + // that leaves "locked" and "pinned" resources, both of which better be + // only pointing into the new heap now! + gdraw_CheckAllPointersUpdated(&c->state[GDRAW_HANDLE_STATE_locked]); + gdraw_CheckAllPointersUpdated(&c->state[GDRAW_HANDLE_STATE_pinned]); + + gdraw_gpu_wait_for_transfer_completion(); + } +} + +#endif + +// Image processing code + +// Compute average of 4 RGBA8888 pixels passed as U32. +// Variables are named assuming the values are stored as big-endian, but all bytes +// are treated equally, so this code will work just fine on little-endian data. +static U32 gdraw_Avg4_rgba8888(U32 p0, U32 p1, U32 p2, U32 p3) +{ + U32 mask = 0x00ff00ff; + U32 bias = 0x00020002; + + U32 gasum = ((p0 >> 0) & mask) + ((p1 >> 0) & mask) + ((p2 >> 0) & mask) + ((p3 >> 0) & mask) + bias; + U32 rbsum = ((p0 >> 8) & mask) + ((p1 >> 8) & mask) + ((p2 >> 8) & mask) + ((p3 >> 8) & mask) + bias; + + return ((gasum >> 2) & mask) | ((rbsum << 6) & ~mask); +} + +// Compute average of 2 RGBA8888 pixels passed as U32 +static U32 gdraw_Avg2_rgba8888(U32 p0, U32 p1) +{ + return (p0 | p1) - (((p0 ^ p1) >> 1) & 0x7f7f7f7f); +} + +// 2:1 downsample in both horizontal and vertical direction, for one line. +// width is width of destination line. +static void gdraw_Downsample_2x2_line(U8 *dst, U8 *line0, U8 *line1, U32 width, U32 bpp) +{ + U32 x; + if (bpp == 4) { + U32 *in0 = (U32 *) line0; + U32 *in1 = (U32 *) line1; + U32 *out = (U32 *) dst; + for (x=0; x < width; x++, in0 += 2, in1 += 2) + *out++ = gdraw_Avg4_rgba8888(in0[0], in0[1], in1[0], in1[1]); + } else if (bpp == 1) { + for (x=0; x < width; x++, line0 += 2, line1 += 2) + *dst++ = (line0[0] + line0[1] + line1[0] + line1[1] + 2) / 4; + } else + RR_BREAK(); +} + +// 2:1 downsample in horizontal but not vertical direction. +static void gdraw_Downsample_2x1_line(U8 *dst, U8 *src, U32 width, U32 bpp) +{ + U32 x; + if (bpp == 4) { + U32 *in = (U32 *) src; + U32 *out = (U32 *) dst; + for (x=0; x < width; x++, in += 2) + *out++ = gdraw_Avg2_rgba8888(in[0], in[1]); + } else if (bpp == 1) { + for (x=0; x < width; x++, src += 2) + *dst++ = (src[0] + src[1] + 1) / 2; + } else + RR_BREAK(); +} + +// 2:1 downsample in vertical but not horizontal direction. +static void gdraw_Downsample_1x2(U8 *dst, S32 dstpitch, U8 *src, S32 srcpitch, U32 height, U32 bpp) +{ + U32 y; + if (bpp == 4) { + for (y=0; y < height; y++, dst += dstpitch, src += 2*srcpitch) + *((U32 *) dst) = gdraw_Avg2_rgba8888(*((U32 *) src), *((U32 *) (src + srcpitch))); + } else if (bpp == 1) { + for (y=0; y < height; y++, dst += dstpitch, src += 2*srcpitch) + *dst = (src[0] + src[srcpitch] + 1) / 2; + } else + RR_BREAK(); +} + +// 2:1 downsample (for mipmaps) +// dst: Pointer to destination buffer +// dstpitch: Pitch for destination buffer +// width: Width of *destination* image (i.e. downsampled version) +// height: Height of *destination* image (i.e. downsampled version) +// src: Pointer to source buffer +// srcpitch: Pitch of source buffer +// bpp: Bytes per pixel for image data +// +// can be used for in-place resizing if src==dst and dstpitch <= srcpitch! +static GDRAW_MAYBE_UNUSED void gdraw_Downsample(U8 *dst, S32 dstpitch, U32 width, U32 height, U8 *src, S32 srcpitch, U32 bpp) +{ + U32 y; + assert(bpp == 1 || bpp == 4); + + // @TODO gamma? + if (!height) // non-square texture, height was reduced to 1 in a previous step + gdraw_Downsample_2x1_line(dst, src, width, bpp); + else if (!width) // non-square texture, width was reduced to 1 in a previous step + gdraw_Downsample_1x2(dst, dstpitch, src, srcpitch, height, bpp); + else { + for (y=0; y < height; y++) { + gdraw_Downsample_2x2_line(dst, src, src + srcpitch, width, bpp); + dst += dstpitch; + src += 2*srcpitch; + } + } +} + +#ifndef GDRAW_NO_STREAMING_MIPGEN + +#define GDRAW_MAXMIPS 16 // maximum number of mipmaps supported. + +typedef struct GDrawMipmapContext { + U32 width; // width of the texture being mipmapped + U32 height; // height of the texture being mipmapped + U32 mipmaps; // number of mipmaps + U32 bpp; // bytes per pixel + + U32 partial_row; // bit N: is mipmap N currently storing a partial row? + U32 bheight; // height of the buffer at miplevel 0 + U8 *pixels[GDRAW_MAXMIPS]; + U32 pitch[GDRAW_MAXMIPS]; +} GDrawMipmapContext; + +static rrbool gdraw_MipmapBegin(GDrawMipmapContext *c, U32 width, U32 height, U32 mipmaps, U32 bpp, U8 *buffer, U32 buffer_size) +{ + U32 i; + U8 *p; + + if (mipmaps > GDRAW_MAXMIPS) + return false; + + c->width = width; + c->height = height; + c->mipmaps = mipmaps; + c->bpp = bpp; + c->partial_row = 0; + + // determine how many lines to buffer + // we try to use roughly 2/3rds of the buffer for the first miplevel (less than 3/4 since with our + // partial line buffers, we have extra buffer space for lower mip levels). + c->bheight = (2 * buffer_size) / (3 * width * bpp); + + // round down to next-smaller power of 2 (in case we need to swizzle; swizzling works on pow2-sized blocks) + while (c->bheight & (c->bheight-1)) // while not a power of 2... + c->bheight &= c->bheight - 1; // clear least significant bit set + + // then keep lowering the number of buffered lines until they fit (or we reach zero, i.e. it doesn't fit) + while (c->bheight) { + p = buffer; + for (i=0; i < c->mipmaps; i++) { + U32 mw = c->width >> i; + U32 bh = c->bheight >> i; + if (!mw) mw++; + if (!bh) mw *= 2, bh++; // need space for line of previous miplevel + + c->pixels[i] = p; + c->pitch[i] = mw * bpp; + p += c->pitch[i] * bh; + } + + // if it fits, we're done + if (p <= buffer + buffer_size) { + if (c->bheight > height) // buffer doesn't need to be larger than the image! + c->bheight = height; + return true; + } + + // need to try a smaller line buffer... + c->bheight >>= 1; + } + + // can't fit even one line into our buffer. ouch! + return false; +} + +// returns true if there was data generated for this miplevel, false otherwise. +static rrbool gdraw_MipmapAddLines(GDrawMipmapContext *c, U32 level) +{ + U32 bw,bh; + + assert(level > 0); // doesn't make sense to call this on level 0 + if (level == 0 || level >= c->mipmaps) + return false; // this level doesn't exist + + bw = c->width >> level; // buffer width at this level + bh = c->bheight >> level; // buffer height at this level + + if (bh) { // we can still do regular downsampling + gdraw_Downsample(c->pixels[level], c->pitch[level], bw, bh, c->pixels[level-1], c->pitch[level-1], c->bpp); + return true; + } else if (c->height >> level) { // need to buffer partial lines, but still doing vertical 2:1 downsampling + if ((c->partial_row ^= (1 << level)) & (1 << level)) { // no buffered partial row for this miplevel yet, make one + memcpy(c->pixels[level], c->pixels[level-1], bw * 2 * c->bpp); + return false; + } else { // have one buffered row, can generate output pixels + gdraw_Downsample_2x2_line(c->pixels[level], c->pixels[level], c->pixels[level-1], bw, c->bpp); + return true; + } + } else { // finish off with a chain of Nx1 miplevels + gdraw_Downsample_2x1_line(c->pixels[level], c->pixels[level-1], bw, c->bpp); + return true; + } +} + +#endif // GDRAW_NO_STREAMING_MIPGEN + +#ifdef GDRAW_CHECK_BLOCK +static void check_block_alloc(gfx_allocator *alloc, void *ptr, rrbool allocated) +{ + int i,n=0,m=0; + for (i=0; i < GFXALLOC_HASH_SIZE; ++i) { + gfx_block_info *b = alloc->hash[i]; + while (b) { + if (b->ptr == ptr) + ++n; + b = b->next; + } + } + gfx_block_info *b = alloc->blocks[0].next; + while (b != &alloc->blocks[0]) { + if (b->ptr == ptr) + ++m; + b = b->next; + } + if (allocated) + assert(n == 1 && m == 0); + else + assert(n == 0 && m == 1); +} +#else +#define check_block_alloc(a,p,f) +#endif + +#ifdef GDRAW_BUFFER_RING + +//////////////////////////////////////////////////////////////////////// +// +// Buffer ring +// + +// Implements a dynamic buffer backed by multiple physical buffers, with +// the usual append-only, DISCARD/NOOVERWRITE semantics. +// +// This can be used for dynamic vertex buffers, constant buffers, etc. +#define GDRAW_BUFRING_MAXSEGS 4 // max number of backing segments + +typedef struct gdraw_bufring_seg { + struct gdraw_bufring_seg *next; // next segment in ring + U8 *data; // pointer to the allocation + GDrawFence fence; // fence for this segment + U32 used; // number of bytes used +} gdraw_bufring_seg; + +typedef struct gdraw_bufring { + gdraw_bufring_seg *cur; // active ring segment + U32 seg_size; // size of one segment + U32 align; // alignment of segment allocations + gdraw_bufring_seg all_segs[GDRAW_BUFRING_MAXSEGS]; +} gdraw_bufring; + +// forwards +static GDrawFence put_fence(); +static void wait_on_fence(GDrawFence fence); + +static void gdraw_bufring_init(gdraw_bufring * RADRESTRICT ring, void *ptr, U32 size, U32 nsegs, U32 align) +{ + U32 i, seg_size; + + ring->seg_size = 0; + if (!ptr || nsegs < 1 || size < nsegs * align) // bail if no ring buffer memory or too small + return; + + if (nsegs > GDRAW_BUFRING_MAXSEGS) + nsegs = GDRAW_BUFRING_MAXSEGS; + + // align needs to be a positive power of two + assert(align >= 1 && (align & (align - 1)) == 0); + + // buffer really needs to be properly aligned + assert(((UINTa)ptr & (align - 1)) == 0); + + seg_size = (size / nsegs) & ~(align - 1); + for (i=0; i < nsegs; ++i) { + ring->all_segs[i].next = &ring->all_segs[(i + 1) % nsegs]; + ring->all_segs[i].data = (U8 *) ptr + i * seg_size; + ring->all_segs[i].fence.value = 0; + ring->all_segs[i].used = 0; + } + + ring->cur = ring->all_segs; + ring->seg_size = seg_size; + ring->align = align; +} + +static void gdraw_bufring_shutdown(gdraw_bufring * RADRESTRICT ring) +{ + ring->cur = NULL; + ring->seg_size = 0; +} + +static void *gdraw_bufring_alloc(gdraw_bufring * RADRESTRICT ring, U32 size, U32 align) +{ + U32 align_up; + gdraw_bufring_seg *seg; + + if (size > ring->seg_size) + return NULL; // nope, won't fit + + assert(align <= ring->align); + + // check if it fits in the active segment first + seg = ring->cur; + align_up = (seg->used + align - 1) & -align; + + if ((align_up + size) <= ring->seg_size) { + void *ptr = seg->data + align_up; + seg->used = align_up + size; + return ptr; + } + + // doesn't fit, we have to start a new ring segment. + seg->fence = put_fence(); + + // switch to the next segment, wait till GPU is done with it + seg = ring->cur = seg->next; + wait_on_fence(seg->fence); + + // allocate from the new segment. we assume that segment offsets + // satisfy the highest alignment requirements we ever ask for! + seg->used = size; + return seg->data; +} + +#endif + +//////////////////////////////////////////////////////////////////////// +// +// General resource manager +// + +#ifndef GDRAW_FENCE_FLUSH +#define GDRAW_FENCE_FLUSH() +#endif + +#ifdef GDRAW_MANAGE_MEM +// functions the platform must implement +#ifndef GDRAW_BUFFER_RING // avoid "redundant redeclaration" warning +static void wait_on_fence(GDrawFence fence); +#endif +static rrbool is_fence_pending(GDrawFence fence); +static void gdraw_defragment_cache(GDrawHandleCache *c, GDrawStats *stats); + +// functions we implement +static void gdraw_res_reap(GDrawHandleCache *c, GDrawStats *stats); +#endif + +// If GDRAW_MANAGE_MEM is not #defined, this needs to perform the +// actual free using whatever API we're targeting. +// +// If GDRAW_MANAGE_MEM is #defined, the shared code handles the +// memory management part, but you might still need to update +// your state caching. +static void api_free_resource(GDrawHandle *r); + +// Actually frees a resource and releases all allocated resources +static void gdraw_res_free(GDrawHandle *r, GDrawStats *stats) +{ + assert(r->state == GDRAW_HANDLE_STATE_live || r->state == GDRAW_HANDLE_STATE_locked || r->state == GDRAW_HANDLE_STATE_dead || + r->state == GDRAW_HANDLE_STATE_pinned || r->state == GDRAW_HANDLE_STATE_user_owned); + +#ifdef GDRAW_MANAGE_MEM + GDRAW_FENCE_FLUSH(); + + // make sure resource isn't in use before we actually free the memory + wait_on_fence(r->fence); + if (r->raw_ptr) { +#ifndef GDRAW_MANAGE_MEM_TWOPOOL + gfxalloc_free(r->cache->alloc, r->raw_ptr); +#else + GDrawHandleCache *c = r->cache; + if (gfxalloc_mem_contains(c->alloc, r->raw_ptr)) + gfxalloc_free(c->alloc, r->raw_ptr); + else { + assert(gfxalloc_mem_contains(c->alloc_other, r->raw_ptr)); + gfxalloc_free(c->alloc_other, r->raw_ptr); + } +#endif + } +#endif + + api_free_resource(r); + + stats->nonzero_flags |= GDRAW_STATS_frees; + stats->freed_objects += 1; + stats->freed_bytes += r->bytes; + + gdraw_HandleCacheFree(r); +} + +// Frees the LRU resource in the given cache. +static rrbool gdraw_res_free_lru(GDrawHandleCache *c, GDrawStats *stats) +{ + GDrawHandle *r = gdraw_HandleCacheGetLRU(c); + if (!r) return false; + + if (c->is_vertex && r->owner) // check for r->owner since it may already be killed (if player destroyed first) + IggyDiscardVertexBufferCallback(r->owner, r); + + // was it referenced since end of previous frame (=in this frame)? + // if some, we're thrashing; report it to the user, but only once per frame. + if (c->prev_frame_end.value < r->fence.value && !c->is_thrashing) { + IggyGDrawSendWarning(NULL, c->is_vertex ? "GDraw Thrashing vertex memory" : "GDraw Thrashing texture memory"); + c->is_thrashing = true; + } + + gdraw_res_free(r, stats); + return true; +} + +static void gdraw_res_flush(GDrawHandleCache *c, GDrawStats *stats) +{ + c->is_thrashing = true; // prevents warnings being generated from free_lru + gdraw_HandleCacheUnlockAll(c); + while (gdraw_res_free_lru(c, stats)) + ; +} + +static GDrawHandle *gdraw_res_alloc_outofmem(GDrawHandleCache *c, GDrawHandle *t, char const *failed_type) +{ + if (t) + gdraw_HandleCacheAllocateFail(t); + IggyGDrawSendWarning(NULL, c->is_vertex ? "GDraw Out of static vertex buffer %s" : "GDraw Out of texture %s", failed_type); + return NULL; +} + +#ifndef GDRAW_MANAGE_MEM + +static GDrawHandle *gdraw_res_alloc_begin(GDrawHandleCache *c, S32 size, GDrawStats *stats) +{ + GDrawHandle *t; + if (size > c->total_bytes) + gdraw_res_alloc_outofmem(c, NULL, "memory (single resource larger than entire pool)"); + else { + // given how much data we're going to allocate, throw out + // data until there's "room" (this basically lets us use + // managed memory and just bound our usage, without actually + // packing it and being exact) + while (c->bytes_free < size) { + if (!gdraw_res_free_lru(c, stats)) { + gdraw_res_alloc_outofmem(c, NULL, "memory"); + break; + } + } + } + + // now try to allocate a handle + t = gdraw_HandleCacheAllocateBegin(c); + if (!t) { + // it's possible we have no free handles, because all handles + // are in use without exceeding the max storage above--in that + // case, just free one texture to give us a free handle (ideally + // we'd trade off cost of regenerating) + if (gdraw_res_free_lru(c, stats)) { + t = gdraw_HandleCacheAllocateBegin(c); + if (t == NULL) { + gdraw_res_alloc_outofmem(c, NULL, "handles"); + } + } + } + return t; +} + +#else + +// Returns whether this resource holds pointers to one of the GDraw-managed +// pools. +static rrbool gdraw_res_is_managed(GDrawHandle *r) +{ + return r->state == GDRAW_HANDLE_STATE_live || + r->state == GDRAW_HANDLE_STATE_locked || + r->state == GDRAW_HANDLE_STATE_dead || + r->state == GDRAW_HANDLE_STATE_pinned; +} + +// "Reaps" dead resources. Even if the user requests that a +// resource be freed, it might still be in use in a pending +// command buffer. So we can't free the associated memory +// immediately; instead, we flag the resource as "dead" and +// periodically check whether we can actually free the +// pending memory of dead resources ("reap" them). +static void gdraw_res_reap(GDrawHandleCache *c, GDrawStats *stats) +{ + GDrawHandle *sentinel = &c->state[GDRAW_HANDLE_STATE_dead]; + GDrawHandle *t; + GDRAW_FENCE_FLUSH(); + + // reap all dead resources that aren't in use anymore + while ((t = sentinel->next) != sentinel && !is_fence_pending(t->fence)) + gdraw_res_free(t, stats); +} + +// "Kills" a resource. This means GDraw won't use it anymore +// (it's dead), but there might still be outstanding references +// to it in a pending command buffer, so we can't physically +// free the associated memory until that's all processed. +static void gdraw_res_kill(GDrawHandle *r, GDrawStats *stats) +{ + GDRAW_FENCE_FLUSH(); // dead list is sorted by fence index - make sure all fence values are current. + + r->owner = NULL; + gdraw_HandleCacheInsertDead(r); + gdraw_res_reap(r->cache, stats); +} + +static GDrawHandle *gdraw_res_alloc_begin(GDrawHandleCache *c, S32 size, GDrawStats *stats) +{ + GDrawHandle *t; + void *ptr = NULL; + + gdraw_res_reap(c, stats); // NB this also does GDRAW_FENCE_FLUSH(); + if (size > c->total_bytes) + return gdraw_res_alloc_outofmem(c, NULL, "memory (single resource larger than entire pool)"); + + // now try to allocate a handle + t = gdraw_HandleCacheAllocateBegin(c); + if (!t) { + // it's possible we have no free handles, because all handles + // are in use without exceeding the max storage above--in that + // case, just free one texture to give us a free handle (ideally + // we'd trade off cost of regenerating) + gdraw_res_free_lru(c, stats); + t = gdraw_HandleCacheAllocateBegin(c); + if (!t) + return gdraw_res_alloc_outofmem(c, NULL, "handles"); + } + + // try to allocate first + if (size) { + ptr = gfxalloc_alloc(c->alloc, size); + if (!ptr) { + // doesn't currently fit. try to free some allocations to get space to breathe. + S32 want_free = RR_MAX(size + (size / 2), GDRAW_MIN_FREE_AMOUNT); + if (want_free > c->total_bytes) + want_free = size; // okay, *really* big resource, just try to allocate its real size + + // always keep freeing textures until want_free bytes are free. + while (c->alloc->actual_bytes_free < want_free) { + if (!gdraw_res_free_lru(c, stats)) + return gdraw_res_alloc_outofmem(c, t, "memory"); + } + + // now, keep trying to allocate and free some more memory when it still doesn't fit + while (!(ptr = gfxalloc_alloc(c->alloc, size))) { + if (c->alloc->actual_bytes_free >= 3 * size || // if we should have enough free bytes to satisfy the request by now + (c->alloc->actual_bytes_free >= size && size * 2 >= c->total_bytes)) // or the resource is very big and the alloc doesn't fit + { + // before we actually consider defragmenting, we want to free all stale resources (not + // referenced in the previous 2 frames). and if that frees up enough memory so we don't have + // to defragment, all the better! + // also, never defragment twice in a frame, just assume we're thrashing when we get in that + // situation and free up as much as possible. + if (!c->did_defragment && + c->prev_frame_start.value <= c->handle->fence.value) { + + // defragment. + defrag: + if (gdraw_CanDefragment(c)) { // only try defrag if it has a chance of helping. + gdraw_defragment_cache(c, stats); + c->did_defragment = true; + } + ptr = gfxalloc_alloc(c->alloc, size); + if (!ptr) + return gdraw_res_alloc_outofmem(c, t, "memory (fragmentation)"); + break; + } + } + + // keep trying to free some more + if (!gdraw_res_free_lru(c, stats)) { + if (c->alloc->actual_bytes_free >= size) // nothing left to free but we should be good - defrag again, even if it's the second time in a frame + goto defrag; + + return gdraw_res_alloc_outofmem(c, t, "memory"); + } + } + } + } + + t->fence.value = 0; // hasn't been used yet + t->raw_ptr = ptr; + return t; +} + +#endif diff --git a/Minecraft.Client/Durango/Iggy/include/gdraw.h b/Minecraft.Client/Durango/Iggy/include/gdraw.h new file mode 100644 index 00000000..404a2642 --- /dev/null +++ b/Minecraft.Client/Durango/Iggy/include/gdraw.h @@ -0,0 +1,726 @@ +// gdraw.h - author: Sean Barrett - copyright 2009 RAD Game Tools +// +// This is the graphics rendering abstraction that Iggy is implemented +// on top of. + +#ifndef __RAD_INCLUDE_GDRAW_H__ +#define __RAD_INCLUDE_GDRAW_H__ + +#include "rrcore.h" + +#define IDOC + +RADDEFSTART + +//idoc(parent,GDrawAPI_Buffers) + +#ifndef IGGY_GDRAW_SHARED_TYPEDEF + + #define IGGY_GDRAW_SHARED_TYPEDEF + typedef struct GDrawFunctions GDrawFunctions; + + typedef struct GDrawTexture GDrawTexture; + +#endif//IGGY_GDRAW_SHARED_TYPEDEF + + + +IDOC typedef struct GDrawVertexBuffer GDrawVertexBuffer; +/* An opaque handle to an internal GDraw vertex buffer. */ + +//idoc(parent,GDrawAPI_Base) + +IDOC typedef struct gswf_recti +{ + S32 x0,y0; // Minimum corner of the rectangle + S32 x1,y1; // Maximum corner of the rectangle +} gswf_recti; +/* A 2D rectangle with integer coordinates specifying its minimum and maximum corners. */ + +IDOC typedef struct gswf_rectf +{ + F32 x0,y0; // Minimum corner of the rectangle + F32 x1,y1; // Maximum corner of the rectangle +} gswf_rectf; +/* A 2D rectangle with floating-point coordinates specifying its minimum and maximum corners. */ + +IDOC typedef struct gswf_matrix +{ + union { + F32 m[2][2]; // 2x2 transform matrix + struct { + F32 m00; // Alternate name for m[0][0], for coding convenience + F32 m01; // Alternate name for m[0][1], for coding convenience + F32 m10; // Alternate name for m[1][0], for coding convenience + F32 m11; // Alternate name for m[1][1], for coding convenience + }; + }; + F32 trans[2]; // 2D translation vector (the affine component of the matrix) +} gswf_matrix; +/* A 2D transform matrix plus a translation offset. */ + +#define GDRAW_STATS_batches 1 +#define GDRAW_STATS_blits 2 +#define GDRAW_STATS_alloc_tex 4 +#define GDRAW_STATS_frees 8 +#define GDRAW_STATS_defrag 16 +#define GDRAW_STATS_rendtarg 32 +#define GDRAW_STATS_clears 64 +IDOC typedef struct GDrawStats +{ + S16 nonzero_flags; // which of the fields below are non-zero + + U16 num_batches; // number of batches, e.g. DrawPrim, DrawPrimUP + U16 num_blits; // number of blit operations (resolve, msaa resolve, blend readback) + U16 freed_objects; // number of cached objects freed + U16 defrag_objects; // number of cached objects defragmented + U16 alloc_tex; // number of textures/buffers allocated + U16 rendertarget_changes; // number of rendertarget changes + U16 num_clears; + //0 mod 8 + + U32 drawn_indices; // number of indices drawn (3 times number of triangles) + U32 drawn_vertices; // number of unique vertices referenced + U32 num_blit_pixels;// number of pixels in blit operations + U32 alloc_tex_bytes;// number of bytes in textures/buffers allocated + U32 freed_bytes; // number of bytes in freed cached objects + U32 defrag_bytes; // number of bytes in defragmented cached objects + U32 cleared_pixels; // number of pixels cleared by clear operation + U32 reserved; + //0 mod 8 +} GDrawStats; +/* A structure with statistics information to show in resource browser/Telemetry */ + +//////////////////////////////////////////////////////////// +// +// Queries +// +//idoc(parent,GDrawAPI_Queries) + +IDOC typedef enum gdraw_bformat +{ + GDRAW_BFORMAT_vbib, // Platform uses vertex and index buffers + GDRAW_BFORMAT_wii_dlist, // Platform uses Wii-style display lists + GDRAW_BFORMAT_vbib_single_format, // Platform uses vertex and index buffers, but doesn't support multiple vertex formats in a single VB + + GDRAW_BFORMAT__count, +} gdraw_bformat; +/* Specifies what data format GDraw expects in MakeVertexBuffer_* and DrawIndexedTriangles. + + Most supported platforms prefer Vertex and Index buffers so that's what we use, + but this format turns out to be somewhat awkward for Wii, so we use the native + graphics processor display list format on that platform. */ + +IDOC typedef struct GDrawInfo +{ + S32 num_stencil_bits; // number of (possibly emulated) stencil buffer bits + U32 max_id; // number of unique values that can be easily encoded in zbuffer + U32 max_texture_size; // edge length of largest square texture supported by hardware + U32 buffer_format; // one of $gdraw_bformat + rrbool shared_depth_stencil; // does 0'th framebuffer share depth & stencil with others? (on GL it can't?) + rrbool always_mipmap; // if GDraw can generate mipmaps nearly for free, then set this flag + rrbool conditional_nonpow2; // non-pow2 textures supported, but only using clamp and without mipmaps + rrbool has_rendertargets; // if true, then there is no rendertarget stack support + rrbool no_nonpow2; // non-pow2 textures aren't supported at all +} GDrawInfo; // must be a multiple of 8 +/* $GDrawInfo contains the information that Iggy needs to know about + what a GDraw implementation supports and what limits it places on + certain important values. */ + +IDOC typedef void RADLINK gdraw_get_info(GDrawInfo *d); +/* Iggy queries this at the beginning of rendering to get information + about the viewport and the device capabilities. */ + +//////////////////////////////////////////////////////////// +// +// Drawing State +// +//idoc(parent,GDrawAPI_DrawingState) + +IDOC typedef enum gdraw_blend +{ + GDRAW_BLEND_none, // Directly copy + GDRAW_BLEND_alpha, // Use the source alpha channel to modulate its contribution + GDRAW_BLEND_multiply, // Multiply colors componentwise + GDRAW_BLEND_add, // Add the source and destination together + + GDRAW_BLEND_filter, // Uses a secondary $gdraw_filter specification to determine how to blend + GDRAW_BLEND_special, // Uses a secondary $gdraw_blendspecial specification to determine how to blend + + GDRAW_BLEND__count, +} gdraw_blend; +/* Identifier indicating the type of blending operation to use when rendering.*/ + +IDOC typedef enum gdraw_blendspecial +{ + GDRAW_BLENDSPECIAL_layer, // s + GDRAW_BLENDSPECIAL_multiply, // s*d + GDRAW_BLENDSPECIAL_screen, // sa*da - (da-d)*(sa-s) + GDRAW_BLENDSPECIAL_lighten, // max(sa*d,s*da) + GDRAW_BLENDSPECIAL_darken, // min(sa*d,s*da) + GDRAW_BLENDSPECIAL_add, // min(d+s,1.0) + GDRAW_BLENDSPECIAL_subtract, // max(d-s,0.0) + GDRAW_BLENDSPECIAL_difference, // abs(sa*d-s*da) + GDRAW_BLENDSPECIAL_invert, // sa*(da-d) + GDRAW_BLENDSPECIAL_overlay, // d < da/2.0 ? (2.0*s*d) : (sa*da - 2.0*(da-d)*(sa-s)) + GDRAW_BLENDSPECIAL_hardlight, // s < sa/2.0 ? (2.0*s*d) : (sa*da - 2.0*(da-d)*(sa-s)) + + // these do extra-special math on the output alpha + GDRAW_BLENDSPECIAL_erase, // d*(1.0-sa) + GDRAW_BLENDSPECIAL_alpha_special, // d*sa + + GDRAW_BLENDSPECIAL__count, +} gdraw_blendspecial; +/* Specifies a type of "special" blend mode, which is defined as one + that has to read from the framebuffer to compute its effect. + + These modes are only used with a 1-to-1 textured quad containing + the exact output data in premultiplied alpha. They all need to + read from the framebuffer to compute their effect, so a GDraw + implementation will usually need a custom path to handle that. + Users will not warn in advance whether you're going to need this + operation, so implementations either need to always render to a + texture in case it happens, or copy the framebuffer to a texture + when it does. + + Note that $(gdraw_blendspecial::GDRAW_BLENDSPECIAL_erase) and + $(gdraw_blendspecial::GDRAW_BLENDSPECIAL_alpha_special) are unique + among $gdraw_blendspecial modes in that they may not actually need + to be implemented with the destination input as a texture if + the destination buffer doesn't have an alpha channel. */ + +// (@OPTIMIZE: the last filter in each chain could be combined with +// the final blend, although only worth doing if the final blend is +// ALPHA/ADD/MULTIPLY--it's usually ALPHA though so worth doing!) +IDOC typedef enum gdraw_filter +{ + GDRAW_FILTER_blur, // Blurs the source image + GDRAW_FILTER_colormatrix, // Transform RGB pixel values by a matrix + GDRAW_FILTER_bevel, // Bevels the source image + GDRAW_FILTER_dropshadow, // Adds a dropshadow underneath the source image + + GDRAW_FILTER__count, +} gdraw_filter; +/* Specifies a type of post-processing graphics filter. + + These modes are only used to implement filter effects, and will + always be blending from a temporary buffer to another temporary + buffer with no blending, so in general they should not require + any additional input. +*/ + +IDOC typedef enum gdraw_texture +{ + GDRAW_TEXTURE_none, // No texture applied + GDRAW_TEXTURE_normal, // Texture is bitmap or linear gradient + GDRAW_TEXTURE_alpha, // Texture is an alpha-only font bitmap + GDRAW_TEXTURE_radial, // Texture is a radial gradient + GDRAW_TEXTURE_focal_gradient, // Texture is a "focal" radial gradient + GDRAW_TEXTURE_alpha_test, // Texture is an alpha-only font bitmap, alpha test for alpha >= 0.5 + + GDRAW_TEXTURE__count, +} gdraw_texture; +/* Specifies how to apply a texture while rendering. */ + +IDOC typedef enum gdraw_wrap +{ + GDRAW_WRAP_clamp, // Texture coordinates clamped to edges + GDRAW_WRAP_repeat, // Texture repeats periodically + GDRAW_WRAP_mirror, // Repeat periodically, mirror on odd repetititions + GDRAW_WRAP_clamp_to_border, // only used internally by some GDraws + + GDRAW_WRAP__count, +} gdraw_wrap; +/* Specifies what to do with texture coordinates outside [0,1]. */ + +typedef struct GDrawRenderState +{ + S32 id; // Object "identifier" used for high-quality AA mode + U32 test_id:1; // Whether to test zbuffer == id + U32 set_id:1; // Whether to set zbuffer == id + U32 use_world_space:1; // Whether primitive is defined in object space or world space + U32 scissor:1; // Whether rendering will be clipped to $(GDrawRenderState::scissor_rect) + U32 identical_state:1; // Whether state is identical to the one used for the previous draw call + U32 unused:27; + //aligned 0 mod 8 + + U8 texgen0_enabled; // Whether to use texgen for tex0 + U8 tex0_mode; // One of $gdraw_texture + U8 wrap0; // One of $gdraw_wrap + U8 nearest0; // Whether to sample texture 0 nearest neighbor + + U8 blend_mode; // One of $gdraw_blend + U8 special_blend; // One of $gdraw_blendspecial (used only if $(GDrawRenderState::blend_mode) == $(gdraw_blend::GDRAW_BLEND_special) + U8 filter; // One of $gdraw_filter (used only if $(GDrawRenderState::blend_mode) == $(gdraw_blend::GDRAW_BLEND_filter) + U8 filter_mode; // Used to select the right compositing operation for the $(gdraw_filter::GDRAW_FILTER_bevel) and $(gdraw_filter::GDRAW_FILTER_dropshadow) modes + //aligned 0 mod 8 + U8 stencil_test; // Only draw if these stencil bits are "set" + U8 stencil_set; // "Set" these stencil bits (note that actual implementation initializes stencil to 1, and "set" makes them 0) + + U8 reserved[2]; // Currently unused (used to make padding to 4/8-byte boundary for following pointer explicit) + S32 blur_passes; // For filters that include blurring, this is the number of box filter passes to run + //align 0 mod 8 + + S16 *cxf_add; // Color transform addition (discourage additive alpha!) + + GDrawTexture *tex[3]; // One or more textures to apply -- need 3 for gradient dropshadow. + //0 mod 8 + F32 *edge_matrix; // Screen to object space matrix (for edge antialiasing) + gswf_matrix *o2w; // Object-to-world matrix + + // --- Everything below this point must be manually initialized + + //0 mod 8 + F32 color[4]; // Color of the object + + //0 mod 8 + gswf_recti scissor_rect; // The rectangle to which rendering will be clipped if $(GDrawRenderState::scissor) is set + //0 mod 8 + // --- Everything below this point might be uninitialized if it's not used for this particular render state + + F32 s0_texgen[4]; // "s" (x) row of texgen matrix + F32 t0_texgen[4]; // "t" (y) row of texgen matrix + //0 mod 8 + F32 focal_point[4]; // Data used for $(gdraw_texgen_mode::GDRAW_TEXTURE_focal_gradient) + //0 mod 8 + F32 blur_x,blur_y; // The size of the box filter, where '1' is the identity and 2 adds half a pixel on each side + //0 mod 8 + F32 shader_data[20]; // Various data that depends on filter (e.g. drop shadow direction, color) +} GDrawRenderState; +/* Encapsulation of the entire drawing state that affects a rendering command. */ + +IDOC typedef void RADLINK gdraw_set_view_size_and_world_scale(S32 w, S32 h, F32 x_world_to_pixel, F32 y_world_to_pixel); +/* Sets the size of the rendering viewport and the world to pixel scaling. + + Iggy calls this function with the full size that the viewport would + be if it were rendered untiled, even if it will eventually be + rendered as a collection of smaller tiles. + + The world scale is used to compensate non-square pixel aspect ratios + when rendering wide lines. Both scale factors are 1 unless Iggy is + running on a display with non-square pixels. */ + +typedef void RADLINK gdraw_set_3d_transform(F32 *mat); /* mat[3][4] */ + +IDOC typedef void RADLINK gdraw_render_tile_begin(S32 tx0, S32 ty0, S32 tx1, S32 ty1, S32 pad, GDrawStats *stats); +/* Begins rendering of a sub-region of the rendered image. */ + +IDOC typedef void RADLINK gdraw_render_tile_end(GDrawStats *stats); +/* Ends rendering of a sub-region of the rendered image. */ + +IDOC typedef void RADLINK gdraw_rendering_begin(void); +/* Begins rendering; takes control of the graphics API. */ + +IDOC typedef void RADLINK gdraw_rendering_end(void); +/* Ends rendering; gives up control of the graphics API. */ + + +//////////////////////////////////////////////////////////// +// +// Drawing +// +//idoc(parent,GDrawAPI_Drawing) + +IDOC typedef void RADLINK gdraw_clear_stencil_bits(U32 bits); +/* Clears the 'bits' parts of the stencil value in the entire framebuffer to the default value. */ + +IDOC typedef void RADLINK gdraw_clear_id(void); +/* Clears the 'id' buffer, which is typically the z-buffer but can also be the stencil buffer. */ + +IDOC typedef void RADLINK gdraw_filter_quad(GDrawRenderState *r, S32 x0, S32 y0, S32 x1, S32 y1, GDrawStats *stats); +/* Draws a special quad in viewport-relative pixel space. + + May be normal, may be displaced by filters, etc. and require multiple passes, + may apply special blending (and require extra resolves/rendertargets) + for filter/blend., + + The x0,y0,x1,y1 always describes the "input" box. */ + +IDOC typedef struct GDrawPrimitive +{ + F32 *vertices; // Pointer to an array of $gswf_vertex_xy, $gswf_vertex_xyst, or $gswf_vertex_xyoffs + U16 *indices; // Pointer to an array of 16-bit indices into $(GDrawPrimitive::vertices) + + S32 num_vertices; // Count of elements in $(GDrawPrimitive::vertices) + S32 num_indices; // Count of elements in $(GDrawPrimitive::indices) + + S32 vertex_format; // One of $gdraw_vformat, specifying the type of element in $(GDrawPrimitive::vertices) + + U32 uniform_count; + F32 *uniforms; + + U8 drawprim_mode; +} GDrawPrimitive; +/* Specifies the vertex and index data necessary to draw a batch of graphics primitives. */ + +IDOC typedef void RADLINK gdraw_draw_indexed_triangles(GDrawRenderState *r, GDrawPrimitive *prim, GDrawVertexBuffer *buf, GDrawStats *stats); +/* Draws a collection of indexed triangles, ignoring special filters or blend modes. + + If buf is NULL, then the pointers in 'prim' are machine pointers, and + you need to make a copy of the data (note currently all triangles + implementing strokes (wide lines) go this path). + + If buf is non-NULL, then use the appropriate vertex buffer, and the + pointers in prim are actually offsets from the beginning of the + vertex buffer -- i.e. offset = (char*) prim->whatever - (char*) NULL; + (note there are separate spaces for vertices and indices; e.g. the + first mesh in a given vertex buffer will normally have a 0 offset + for the vertices and a 0 offset for the indices) +*/ + +IDOC typedef void RADLINK gdraw_set_antialias_texture(S32 width, U8 *rgba); +/* Specifies the 1D texture data to be used for the antialiasing gradients. + + 'rgba' specifies the pixel values in rgba byte order. This will only be called + once during initialization. */ + +//////////////////////////////////////////////////////////// +// +// Texture and Vertex Buffers +// +//idoc(parent,GDrawAPI_Buffers) + +IDOC typedef enum gdraw_texture_format +{ + // Platform-independent formats + GDRAW_TEXTURE_FORMAT_rgba32, // 32bpp RGBA data in platform-preferred byte order (returned by $gdraw_make_texture_begin as $gdraw_texture_type) + GDRAW_TEXTURE_FORMAT_font, // Alpha-only data with at least 4 bits/pixel. Data is submitted as 8 bits/pixel, conversion (if necessary) done by GDraw. + + // First platform-specific format index (for reference) + GDRAW_TEXTURE_FORMAT__platform = 16, + + // In the future, we will support platform-specific formats and add them to this list. +} gdraw_texture_format; +/* Describes the format of a texture submitted to GDraw. */ + +IDOC typedef enum gdraw_texture_type +{ + GDRAW_TEXTURE_TYPE_rgba, // Raw 4-channel packed texels, in OpenGL-standard order + GDRAW_TEXTURE_TYPE_bgra, // Raw 4-channel packed texels, in Direct3D-standard order + GDRAW_TEXTURE_TYPE_argb, // Raw 4-channel packed texels, in Flash native order + + GDRAW_TEXTURE_TYPE__count, +} gdraw_texture_type; +/* Describes the channel layout of a RGBA texture submitted to GDraw. */ + +IDOC typedef struct GDraw_MakeTexture_ProcessingInfo +{ + U8 *texture_data; // Pointer to the texture image bits + S32 num_rows; // Number of rows to upload in the current chunk + S32 stride_in_bytes; // Distance between a given pixel and the first pixel in the next row + S32 texture_type; // One of $gdraw_texture_type + + U32 temp_buffer_bytes; // Size of temp buffer in bytes + U8 *temp_buffer; // Temp buffer for GDraw to work in (used during mipmap creation) + + void *p0,*p1,*p2,*p3,*p4,*p5,*p6,*p7; // Pointers for GDraw to store data across "passes" (never touched by Iggy) + U32 i0, i1, i2, i3, i4, i5, i6, i7; // Integers for GDraw to store data across "passes" (never touched by Iggy) +} GDraw_MakeTexture_ProcessingInfo; +/* $GDraw_MakeTexture_ProcessingInfo is used when building a texture. */ + +IDOC typedef struct GDraw_Texture_Description { + S32 width; // Width of the texture in pixels + S32 height; // Height of the texture in pixels + U32 size_in_bytes; // Size of the texture in bytes +} GDraw_Texture_Description; +/* $GDraw_Texture_Description contains information about a texture. */ + +IDOC typedef U32 gdraw_maketexture_flags; +#define GDRAW_MAKETEXTURE_FLAGS_mipmap 1 IDOC // Generates mip-maps for the texture +#define GDRAW_MAKETEXTURE_FLAGS_updatable 2 IDOC // Set if the texture might be updated subsequent to its initial submission +#define GDRAW_MAKETEXTURE_FLAGS_never_flush 4 IDOC // Set to request that the texture never be flushed from the GDraw cache + +/* Flags that control the submission and management of GDraw textures. */ + +IDOC typedef void RADLINK gdraw_set_texture_unique_id(GDrawTexture *tex, void *old_unique_id, void *new_unique_id); +/* Changes unique id of a texture, only used for TextureSubstitution */ + +IDOC typedef rrbool RADLINK gdraw_make_texture_begin(void *unique_id, + S32 width, S32 height, gdraw_texture_format format, gdraw_maketexture_flags flags, + GDraw_MakeTexture_ProcessingInfo *output_info, GDrawStats *stats); +/* Begins specifying a new texture. + + $:unique_id Unique value specified by Iggy that you can use to identify a reference to the same texture even if its handle has been discarded + $:return Error code if there was a problem, IGGY_RESULT_OK otherwise +*/ + +IDOC typedef rrbool RADLINK gdraw_make_texture_more(GDraw_MakeTexture_ProcessingInfo *info); +/* Continues specifying a new texture. + + $:info The same handle initially passed to $gdraw_make_texture_begin + $:return True if specification can continue, false if specification must be aborted +*/ + +IDOC typedef GDrawTexture * RADLINK gdraw_make_texture_end(GDraw_MakeTexture_ProcessingInfo *info, GDrawStats *stats); +/* Ends specification of a new texture. + + $:info The same handle initially passed to $gdraw_make_texture_begin + $:return Handle for the newly created texture, or NULL if an error occured +*/ + +IDOC typedef rrbool RADLINK gdraw_update_texture_begin(GDrawTexture *tex, void *unique_id, GDrawStats *stats); +/* Begins updating a previously submitted texture. + + $:unique_id Must be the same value initially passed to $gdraw_make_texture_begin + $:return True on success, false otherwise and the texture must be recreated +*/ + +IDOC typedef void RADLINK gdraw_update_texture_rect(GDrawTexture *tex, void *unique_id, S32 x, S32 y, S32 stride, S32 w, S32 h, U8 *data, gdraw_texture_format format); +/* Updates a rectangle in a previously submitted texture. + + $:format Must be the $gdraw_texture_format that was originally passed to $gdraw_make_texture_begin for this texture. +*/ + +IDOC typedef void RADLINK gdraw_update_texture_end(GDrawTexture *tex, void *unique_id, GDrawStats *stats); +/* Ends an update to a previously submitted texture. + + $:unique_id Must be the same value initially passed to $gdraw_make_texture_begin (and hence $gdraw_update_texture_begin) +*/ + +IDOC typedef void RADLINK gdraw_describe_texture(GDrawTexture *tex, GDraw_Texture_Description *desc); +/* Returns a texture description for a given GDraw texture. */ + +IDOC typedef GDrawTexture * RADLINK gdraw_make_texture_from_resource(U8 *resource_file, S32 file_len, void *texture); +/* Loads a texture from a resource file and returns a wrapped pointer. */ + +IDOC typedef void RADLINK gdraw_free_texture_from_resource(GDrawTexture *tex); +/* Frees a texture created with gdraw_make_texture_from_resource. */ + + +IDOC typedef struct gswf_vertex_xy +{ + F32 x,y; // Position of the vertex +} gswf_vertex_xy; +/* A 2D point with floating-point position. */ + +IDOC typedef struct gswf_vertex_xyoffs +{ + F32 x,y; // Position of the vertex + + S16 aa; // Stroke/aa texcoord + S16 dx, dy; // Vector offset from the position, used for anti-aliasing (signed 11.5 fixed point) + S16 unused; +} gswf_vertex_xyoffs; +/* A 2D point with floating-point position, additional integer parameter, and integer anti-aliasing offset vector. */ + +IDOC typedef struct gswf_vertex_xyst +{ + F32 x,y; // Position of the vertex + F32 s,t; // Explicit texture coordinates for rectangles +} gswf_vertex_xyst; +/* A 2D point with floating-point position and texture coordinates. */ + +typedef int gdraw_verify_size_xy [sizeof(gswf_vertex_xy ) == 8 ? 1 : -1]; +typedef int gdraw_verify_size_xyoffs[sizeof(gswf_vertex_xyoffs) == 16 ? 1 : -1]; +typedef int gdraw_verify_size_xyst [sizeof(gswf_vertex_xyst ) == 16 ? 1 : -1]; + +IDOC typedef enum gdraw_vformat +{ + GDRAW_vformat_v2, // Indicates vertices of type $gswf_vertex_xy (8 bytes per vertex) + GDRAW_vformat_v2aa, // Indicates vertices of type $gswf_vertex_xyoffs (16 bytes per vertex) + GDRAW_vformat_v2tc2, // Indicates vertices of type $gswf_vertex_xyst (16 bytes per vertex) + + GDRAW_vformat__basic_count, + GDRAW_vformat_ihud1 = GDRAW_vformat__basic_count, // primary format for ihud, currently v2tc2mat4 (20 bytes per vertex) + + GDRAW_vformat__count, + GDRAW_vformat_mixed, // Special value that denotes a VB containing data in multiple vertex formats. Never used when drawing! +} gdraw_vformat; +/* Identifies one of the vertex data types. */ + +IDOC typedef struct GDraw_MakeVertexBuffer_ProcessingInfo +{ + U8 *vertex_data; // location to write vertex data + U8 *index_data; // location to write index data + + S32 vertex_data_length; // size of buffer to write vertex data + S32 index_data_length; // size of buffer to write index data + + void *p0,*p1,*p2,*p3,*p4,*p5,*p6,*p7; // Pointers for GDraw to store data across "passes" (never touched by Iggy) + U32 i0, i1, i2, i3, i4, i5, i6, i7; // Integers for GDraw to store data across "passes" (never touched by Iggy) +} GDraw_MakeVertexBuffer_ProcessingInfo; +/* $GDraw_MakeVertexBuffer_ProcessingInfo is used when building a vertex buffer. */ + +IDOC typedef struct GDraw_VertexBuffer_Description { + S32 size_in_bytes; // Size of the vertex buffer in bytes +} GDraw_VertexBuffer_Description; +/* $GDraw_VertexBuffer_Description contains information about a vertex buffer. */ + +IDOC typedef rrbool RADLINK gdraw_make_vertex_buffer_begin(void *unique_id, gdraw_vformat vformat, S32 vdata_len_in_bytes, S32 idata_len_in_bytes, GDraw_MakeVertexBuffer_ProcessingInfo *info, GDrawStats *stats); +/* Begins specifying a new vertex buffer. + + $:unique_id Unique value that identifies this texture, across potentially multiple flushes and re-creations of its $GDrawTexture handle in GDraw + $:vformat One of $gdraw_vformat, denoting the format of the vertex data submitted + $:return false if there was a problem, true if ok +*/ + +IDOC typedef rrbool RADLINK gdraw_make_vertex_buffer_more(GDraw_MakeVertexBuffer_ProcessingInfo *info); +/* Continues specifying a new vertex buffer. + + $:info The same handle initially passed to $gdraw_make_vertex_buffer_begin + $:return True if specification can continue, false if specification must be aborted +*/ + +IDOC typedef GDrawVertexBuffer * RADLINK gdraw_make_vertex_buffer_end(GDraw_MakeVertexBuffer_ProcessingInfo *info, GDrawStats *stats); +/* Ends specification of a new vertex buffer. + + $:info The same handle initially passed to $gdraw_make_texture_begin + $:return Handle for the newly created vertex buffer +*/ + +IDOC typedef void RADLINK gdraw_describe_vertex_buffer(GDrawVertexBuffer *buffer, GDraw_VertexBuffer_Description *desc); +/* Returns a description for a given GDrawVertexBuffer */ + + +IDOC typedef rrbool RADLINK gdraw_try_to_lock_texture(GDrawTexture *tex, void *unique_id, GDrawStats *stats); +/* Tells GDraw that a $GDrawTexture is going to be referenced. + + $:unique_id Must be the same value initially passed to $gdraw_make_texture_begin +*/ + +IDOC typedef rrbool RADLINK gdraw_try_to_lock_vertex_buffer(GDrawVertexBuffer *vb, void *unique_id, GDrawStats *stats); +/* Tells GDraw that a $GDrawVertexBuffer is going to be referenced. + + $:unique_id Must be the same value initially passed to $gdraw_make_vertex_buffer_begin +*/ + +IDOC typedef void RADLINK gdraw_unlock_handles(GDrawStats *stats); +/* Indicates that the user of GDraw will not try to reference anything without locking it again. + + Note that although a call to $gdraw_unlock_handles indicates that + all $GDrawTexture and $GDrawVertexBuffer handles that have had a + "unique_id" specified will no longer be referenced by the user of + GDraw, it does not affect those $GDrawTexture handles that were + created by $gdraw_start_texture_draw_buffer with a unique_id of 0. +*/ + +IDOC typedef void RADLINK gdraw_free_vertex_buffer(GDrawVertexBuffer *vb, void *unique_id, GDrawStats *stats); +/* Free a vertex buffer and invalidate the handle + + $:unique_id Must be the same value initially passed to $gdraw_make_vertex_buffer_begin +*/ + +IDOC typedef void RADLINK gdraw_free_texture(GDrawTexture *t, void *unique_id, GDrawStats *stats); +/* Free a texture and invalidate the handle. + + $:unique_id Must be the same value initially passed to $gdraw_make_texture_begin, or 0 for a texture created by $gdraw_end_texture_draw_buffer +*/ + +//////////////////////////////////////////////////////////// +// +// Render targets +// +//idoc(parent,GDrawAPI_Targets) + +IDOC typedef U32 gdraw_texturedrawbuffer_flags; +#define GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_color 1 IDOC // Tells GDraw that you will need the color channel when rendering a texture +#define GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_alpha 2 IDOC // Tells GDraw that you will need the alpha channel when rendering a texture +#define GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_stencil 4 IDOC // Tells GDraw that you will need the stencil channel when rendering a texture +#define GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_id 8 IDOC // Tells GDraw that you will need the id channel when rendering a texture + +/* Flags that control rendering to a texture. */ + +IDOC typedef rrbool RADLINK gdraw_texture_draw_buffer_begin(gswf_recti *region, gdraw_texture_format format, gdraw_texturedrawbuffer_flags flags, void *unique_id, GDrawStats *stats); +/* Starts rendering all GDraw commands to a new texture. + + Creates a rendertarget with destination alpha, initializes to all 0s and prepares to render into it +*/ + + +IDOC typedef GDrawTexture * RADLINK gdraw_texture_draw_buffer_end(GDrawStats *stats); +/* Ends rendering GDraw commands to a texture, and returns the texture created. + + You can get the size of the resulting texture with $gdraw_query_texture_size. +*/ + +//////////////////////////////////////////////////////////// +// +// Masking +// +//idoc(parent,GDrawAPI_Masking) + +IDOC typedef void RADLINK gdraw_draw_mask_begin(gswf_recti *region, S32 mask_bit, GDrawStats *stats); +/* Start a masking operation on the given region for the specified mask bit. + + For most drivers, no special preparation is necessary to start masking, so this is a no-op. +*/ + +IDOC typedef void RADLINK gdraw_draw_mask_end(gswf_recti *region, S32 mask_bit, GDrawStats *stats); +/* End a masking operation on the given region for the specified mask bit. + + For most drivers, no special preparation is necessary to end masking, so this is a no-op. +*/ + +//////////////////////////////////////////////////////////// +// +// GDraw API Function table +// +//idoc(parent,GDrawAPI_Base) + +IDOC struct GDrawFunctions +{ + // queries + gdraw_get_info *GetInfo; + + // drawing state + gdraw_set_view_size_and_world_scale * SetViewSizeAndWorldScale; + gdraw_render_tile_begin * RenderTileBegin; + gdraw_render_tile_end * RenderTileEnd; + gdraw_set_antialias_texture * SetAntialiasTexture; + + // drawing + gdraw_clear_stencil_bits * ClearStencilBits; + gdraw_clear_id * ClearID; + gdraw_filter_quad * FilterQuad; + gdraw_draw_indexed_triangles * DrawIndexedTriangles; + gdraw_make_texture_begin * MakeTextureBegin; + gdraw_make_texture_more * MakeTextureMore; + gdraw_make_texture_end * MakeTextureEnd; + gdraw_make_vertex_buffer_begin * MakeVertexBufferBegin; + gdraw_make_vertex_buffer_more * MakeVertexBufferMore; + gdraw_make_vertex_buffer_end * MakeVertexBufferEnd; + gdraw_try_to_lock_texture * TryToLockTexture; + gdraw_try_to_lock_vertex_buffer * TryToLockVertexBuffer; + gdraw_unlock_handles * UnlockHandles; + gdraw_free_texture * FreeTexture; + gdraw_free_vertex_buffer * FreeVertexBuffer; + gdraw_update_texture_begin * UpdateTextureBegin; + gdraw_update_texture_rect * UpdateTextureRect; + gdraw_update_texture_end * UpdateTextureEnd; + + // rendertargets + gdraw_texture_draw_buffer_begin * TextureDrawBufferBegin; + gdraw_texture_draw_buffer_end * TextureDrawBufferEnd; + + gdraw_describe_texture * DescribeTexture; + gdraw_describe_vertex_buffer * DescribeVertexBuffer; + + // new functions are always added at the end, so these have no structure + gdraw_set_texture_unique_id * SetTextureUniqueID; + + gdraw_draw_mask_begin * DrawMaskBegin; + gdraw_draw_mask_end * DrawMaskEnd; + + gdraw_rendering_begin * RenderingBegin; + gdraw_rendering_end * RenderingEnd; + + gdraw_make_texture_from_resource * MakeTextureFromResource; + gdraw_free_texture_from_resource * FreeTextureFromResource; + + gdraw_set_3d_transform * Set3DTransform; +}; +/* The function interface called by Iggy to render graphics on all + platforms. + + So that Iggy can integrate with the widest possible variety of + rendering scenarios, all of its renderer-specific drawing calls + go through this table of function pointers. This allows you + to dynamically configure which of RAD's supplied drawing layers + you wish to use, or to integrate it directly into your own + renderer by implementing your own versions of the drawing + functions Iggy requires. +*/ + +RADDEFEND + +#endif diff --git a/Minecraft.Client/Durango/Iggy/include/iggy.h b/Minecraft.Client/Durango/Iggy/include/iggy.h new file mode 100644 index 00000000..56638a32 --- /dev/null +++ b/Minecraft.Client/Durango/Iggy/include/iggy.h @@ -0,0 +1,1295 @@ +// Iggy -- Copyright 2008-2013 RAD Game Tools + +#ifndef __RAD_INCLUDE_IGGY_H__ +#define __RAD_INCLUDE_IGGY_H__ + +#include // size_t + +#define IggyVersion "1.2.30" +#define IggyFlashVersion "9,1,2,30" + +#include "rrcore.h" // base data types, macros + +RADDEFSTART + +#ifndef IGGY_GDRAW_SHARED_TYPEDEF + + #define IGGY_GDRAW_SHARED_TYPEDEF + + typedef struct GDrawFunctions GDrawFunctions; + typedef struct GDrawTexture GDrawTexture; + +#endif//IGGY_GDRAW_SHARED_TYPEDEF + +#define IDOCN // Used by documentation generation system + +//////////////////////////////////////////////////////////// +// +// Basic Operations +// + +typedef enum IggyResult +{ + IGGY_RESULT_SUCCESS = 0, + + IGGY_RESULT_Warning_None = 0, + + IGGY_RESULT_Warning_Misc = 100, + IGGY_RESULT_Warning_GDraw = 101, + IGGY_RESULT_Warning_ProgramFlow = 102, + IGGY_RESULT_Warning_Actionscript = 103, + IGGY_RESULT_Warning_Graphics = 104, + IGGY_RESULT_Warning_Font = 105, + IGGY_RESULT_Warning_Timeline = 106, + IGGY_RESULT_Warning_Library = 107, + IGGY_RESULT_Warning_ValuePath = 108, + IGGY_RESULT_Warning_Audio = 109, + + IGGY_RESULT_Warning_CannotSustainFrameRate = 201, // During a call to $IggyPlayerReadyToTick, Iggy detected that its rendering of a Flash file was not keeping up with the frame rate requested. + IGGY_RESULT_Warning_ThrewException = 202, + + IGGY_RESULT_Error_Threshhold = 400, + + IGGY_RESULT_Error_Misc = 400, // an uncategorized error + IGGY_RESULT_Error_GDraw = 401, // an error occured in GDraw + IGGY_RESULT_Error_ProgramFlow = 402, // an error occured with the user's program flow through the Iggy API (e.g. reentrancy issues) + IGGY_RESULT_Error_Actionscript = 403, // an error occurred in Actionscript processing + IGGY_RESULT_Error_Graphics = 404, + IGGY_RESULT_Error_Font = 405, + IGGY_RESULT_Error_Create = 406, + IGGY_RESULT_Error_Library = 407, + IGGY_RESULT_Error_ValuePath = 408, // an error occurred while processing a ValuePath + IGGY_RESULT_Error_Audio = 409, + + IGGY_RESULT_Error_Internal = 499, + + IGGY_RESULT_Error_InvalidIggy = 501, + IGGY_RESULT_Error_InvalidArgument = 502, + IGGY_RESULT_Error_InvalidEntity = 503, + IGGY_RESULT_Error_UndefinedEntity = 504, + + IGGY_RESULT_Error_OutOfMemory = 1001, // Iggy ran out of memory while processing the SWF. The Iggy player is now invalid and you cannot do anything further with it (except read AS3 variables). Should this happen, you'll want to $IggyPlayerDestroy and reopen the $Iggy. +} IggyResult; + +typedef enum IggyDatatype +{ + IGGY_DATATYPE__invalid_request, // Set only when there is an error + + IGGY_DATATYPE_undefined, // Undefined data type + IGGY_DATATYPE_null, // No data type + IGGY_DATATYPE_boolean, // Data of type rrbool + + IGGY_DATATYPE_number, // Data of type F64 + IGGY_DATATYPE_string_UTF8, // Data of type $IggyStringUTF8 + IGGY_DATATYPE_string_UTF16, // Data of type $IggyStringUTF16 + IGGY_DATATYPE_fastname, // Only used when calling functions (avoids a copy operation) + IGGY_DATATYPE_valuepath, // Only used when calling functions + IGGY_DATATYPE_valueref, // Only used when calling functions + + // the following datatypes can be queried, but cannot appear + // as function arguments + + IGGY_DATATYPE_array, // Data of type Array in AS3 (appears in datatype query, never as arguments) + IGGY_DATATYPE_object, // Data of type Object (or a subclass) in AS3 (appears in datatype query, never as arguments) + IGGY_DATATYPE_displayobj, // Data of type DisplayObject (or a subclass) in AS3 (only appears in callbacks) + + IGGY_DATATYPE_xml, // Data of type XML or XMLList in AS3 (appears in datatype query, never as arguments) + + // the following datatypes also exists, but you can't access any data + // from within them. we give you the exact type for e.g. debugging + IGGY_DATATYPE_namespace, // Data of type Namespace in AS3 (appears in datatype query, never as arguments) + IGGY_DATATYPE_qname, // Data of type QName in AS3 (appears in datatype query, never as arguments) + IGGY_DATATYPE_function, // Data of type Function in AS3 (appears in datatype query, never as arguments) + IGGY_DATATYPE_class, // Data of type Class in AS3 (appears in datatype query, never as arguments) +} IggyDatatype; +/* Describes an AS3 datatype visible through iggy interface. */ + +#ifdef __RADWIN__ +#include +IDOCN typedef wchar_t IggyUTF16; +#else +typedef unsigned short IggyUTF16; +#endif + +typedef struct IggyStringUTF16 +{ + IggyUTF16 *string; // Null-terminated, UTF16-encoded characters + S32 length; // Count of 16-bit characters in string, not including the null terminator +} IggyStringUTF16; + +typedef struct IggyStringUTF8 +{ + char *string; // Null-terminated, UTF8-encoded characters + S32 length; // Count of 8-bit bytes in string, not including the null terminator +} IggyStringUTF8; + +typedef UINTa IggyName; +typedef struct IggyValuePath IggyValuePath; +typedef void *IggyValueRef; +typedef UINTa IggyTempRef; + +typedef struct IggyDataValue +{ + S32 type; // an $IggyDatatype which determines which of the union members is valid. + #ifdef __RAD64__ + S32 padding; + #endif + IggyTempRef temp_ref; // An opaque temporary reference which you can efficiently turn into an $IggyValueRef; this is written by Iggy on callbacks but never read by Iggy + union { + IggyStringUTF16 string16; // A UTF16 string, valid if type = $(IggyDatatype::IGGY_DATATYPE_string_UTF16) + IggyStringUTF8 string8; // A UTF8 string, valid if type = $(IggyDatatype::IGGY_DATATYPE_string_UTF8) + F64 number; // A 64-bit floating point number (a double); valid if type = $(IggyDatatype::IGGY_DATATYPE_number) + rrbool boolval; // A boolean value, valid if type = $(IggyDatatype::IGGY_DATATYPE_boolean) + IggyName fastname; // A fast name, valid if type = $(IggyDatatype::IGGY_DATATYPE_fastname); this is only an "in" type; Iggy will never define these itself + void * userdata; // A userdata pointer from a DisplayObject, valid if type = $(IggyDatatype::IGGY_DATATYPE_displayobj) + IggyValuePath * valuepath;// A path to an object in the AS3 VM, valid if type = $(IggyDatatype::IGGY_DATATYPE_valuepath); this is only an "in" type--Iggy will never output this + IggyValueRef valueref; // An IggyValueRef, valid if type = $(IggyDatatype::IGGY_DATATYPE_valueref); this is only an "in" type--Iggy will never output this + }; +} IggyDataValue; + +typedef struct IggyExternalFunctionCallUTF16 +{ + IggyStringUTF16 function_name; // The name of the function + S32 num_arguments; // The number of arguments that must be passed to the function + S32 padding; + IggyDataValue arguments[1]; // The argument types, assumed to contain num_arguments elements +} IggyExternalFunctionCallUTF16; + +typedef struct IggyExternalFunctionCallUTF8 +{ + IggyStringUTF8 function_name; // The name of the function + S32 num_arguments; // The number of arguments that must be passed to the function + S32 padding; + IggyDataValue arguments[1]; // The argument types, assumed to contain num_arguments elements +} IggyExternalFunctionCallUTF8; + +typedef void * RADLINK Iggy_AllocateFunction(void *alloc_callback_user_data, size_t size_requested, size_t *size_returned); +typedef void RADLINK Iggy_DeallocateFunction(void *alloc_callback_user_data, void *ptr); + +typedef struct IggyAllocator +{ + void *user_callback_data; + Iggy_AllocateFunction *mem_alloc; + Iggy_DeallocateFunction *mem_free; + #ifndef __RAD64__ + void *struct_padding; // pad to 8-byte boundary + #endif +} IggyAllocator; + +RADEXPFUNC void RADEXPLINK IggyInit(IggyAllocator *allocator); +RADEXPFUNC void RADEXPLINK IggyShutdown(void); + +typedef enum IggyConfigureBoolName +{ + IGGY_CONFIGURE_BOOL_StartupExceptionsAreWarnings, // if true, ActionScript exceptions thrown during startup will not prevent Iggy from being created (default false) + IGGY_CONFIGURE_BOOL_IgnoreFlashVersion, + IGGY_CONFIGURE_BOOL_NeverDelayGotoProcessing, + IGGY_CONFIGURE_BOOL_SuppressAntialiasingOnAllBitmaps, + IGGY_CONFIGURE_BOOL_SuppressAntialiasingOn9SliceBitmaps, +} IggyConfigureBoolName; + +RADEXPFUNC void RADEXPLINK IggyConfigureBool(IggyConfigureBoolName prop, rrbool value); + +typedef enum +{ + IGGY_VERSION_1_0_21 = 1, // behavior from 1.0.21 and earlier + IGGY_VERSION_1_0_24 = 3, // behavior from 1.0.24 and earlier + IGGY_VERSION_1_1_1 = 5, // behavior from 1.1.1 and earlier + IGGY_VERSION_1_1_8 = 7, // behavior from 1.1.8 and earlier + IGGY_VERSION_1_2_28 = 9, // behavior from 1.2.28 and earlier + IGGY_VERSION_default=0x7fffffff, // default (current) Iggy behavior +} IggyVersionNumber; + +typedef enum +{ + IGGY_VERSIONED_BEHAVIOR_movieclip_gotoand=128, // This changes the behavior of AS3 gotoAndPlay and gotoAndStop. Valid values: IGGY_VERSION_1_0_21, IGGY_VERSION_default + IGGY_VERSIONED_BEHAVIOR_textfield_position=129, // This changes the behavior of textfield positioning as reported by AS3 getBounds/getRect and width/height. Values with different behavior: IGGY_VERSION_1_0_24, IGGY_VERSION_default. + IGGY_VERSIONED_BEHAVIOR_bitmap_smoothing=130, + IGGY_VERSIONED_BEHAVIOR_textfield_autoscroll=131, // This makes textfield autoscrolling behave specially: Valid values: IGGY_VERSION_1_1_8, IGGY_VERSION_default + IGGY_VERSIONED_BEHAVIOR_fast_text_effects=132, // This fixes the behavior of fast text effects to be in the correct direction; Valid values: IGGY_VERSION_1_2_28, IGGY_VERSION_default +} IggyVersionedBehaviorName; + +RADEXPFUNC void RADEXPLINK IggyConfigureVersionedBehavior(IggyVersionedBehaviorName prop, IggyVersionNumber value); + +typedef enum IggyTelemetryAmount +{ + IGGY_TELEMETRY_normal, // Normal amount for users debugging applications using Iggy + IGGY_TELEMETRY_internal, // Shows more internal details, useful when optimizing Iggy itself +} IggyTelemetryAmount; + +RADEXPFUNC void RADEXPLINK IggyUseTmLite(void * context, IggyTelemetryAmount amount); +RADEXPFUNC void RADEXPLINK IggyUseTelemetry(void * context, IggyTelemetryAmount amount); + +//////////////////////////////////////////////////////////// +// +// Translation +// + + +typedef struct +{ + IggyUTF16 *object_name; /* null-terminated Textfield.name value at the time the text is set */ + rrbool autosize; /* true if the autosize value is non-zero at the time the text is set */ + F32 width; /* the objectspace width of the textfield at the time the text is set */ + F32 height; /* the objectspace height of the textfield at the time the text is set */ + rrbool is_html_text; /* whether the provided text is going through Textfield.htmlText or Textfield.text */ +} IggyTextfieldInfo; + +typedef void RADLINK Iggy_TranslationFreeFunction(void *callback_data, void *data, S32 length); +typedef rrbool RADLINK Iggy_TranslateFunctionUTF16(void *callback_data, IggyStringUTF16 *src, IggyStringUTF16 *dest); +typedef rrbool RADLINK Iggy_TranslateFunctionUTF8(void *callback_data, IggyStringUTF8 *src, IggyStringUTF8 *dest); +typedef rrbool RADLINK Iggy_TextfieldTranslateFunctionUTF16(void *callback_data, IggyStringUTF16 *src, IggyStringUTF16 *dest, IggyTextfieldInfo *textfield); +typedef rrbool RADLINK Iggy_TextfieldTranslateFunctionUTF8(void *callback_data, IggyStringUTF8 *src, IggyStringUTF8 *dest, IggyTextfieldInfo *textfield); + +RADEXPFUNC void RADEXPLINK IggySetLoadtimeTranslationFunction(Iggy_TranslateFunctionUTF16 *func, void *callback_data, Iggy_TranslationFreeFunction *freefunc, void *free_callback_data); +RADEXPFUNC void RADEXPLINK IggySetLoadtimeTranslationFunctionUTF16(Iggy_TranslateFunctionUTF16 *func, void *callback_data, Iggy_TranslationFreeFunction *freefunc, void *free_callback_data); +RADEXPFUNC void RADEXPLINK IggySetLoadtimeTranslationFunctionUTF8(Iggy_TranslateFunctionUTF8 *func, void *callback_data, Iggy_TranslationFreeFunction *freefunc, void *free_callback_data); +RADEXPFUNC void RADEXPLINK IggySetRuntimeTranslationFunction(Iggy_TranslateFunctionUTF16 *func, void *callback_data, Iggy_TranslationFreeFunction *freefunc, void *free_callback_data); +RADEXPFUNC void RADEXPLINK IggySetRuntimeTranslationFunctionUTF16(Iggy_TranslateFunctionUTF16 *func, void *callback_data, Iggy_TranslationFreeFunction *freefunc, void *free_callback_data); +RADEXPFUNC void RADEXPLINK IggySetRuntimeTranslationFunctionUTF8(Iggy_TranslateFunctionUTF8 *func, void *callback_data, Iggy_TranslationFreeFunction *freefunc, void *free_callback_data); +RADEXPFUNC void RADEXPLINK IggySetTextfieldTranslationFunctionUTF16(Iggy_TextfieldTranslateFunctionUTF16 *func, void *callback_data, Iggy_TranslationFreeFunction *freefunc, void *free_callback_data); +RADEXPFUNC void RADEXPLINK IggySetTextfieldTranslationFunctionUTF8(Iggy_TextfieldTranslateFunctionUTF8 *func, void *callback_data, Iggy_TranslationFreeFunction *freefunc, void *free_callback_data); + +typedef enum +{ + IGGY_LANG_default, + IGGY_LANG_ja, + IGGY_LANG_ja_flash, // more strictly matches Flash +} IggyLanguageCode; + +RADEXPFUNC void RADEXPLINK IggySetLanguage(IggyLanguageCode lang); + +//////////////////////////////////////////////////////////// +// +// Playback +// + +typedef struct Iggy Iggy; +typedef S32 IggyLibrary; + +typedef void RADLINK Iggy_TraceFunctionUTF16(void *user_callback_data, Iggy *player, IggyUTF16 const *utf16_string, S32 length_in_16bit_chars); +typedef void RADLINK Iggy_TraceFunctionUTF8(void *user_callback_data, Iggy *player, char const *utf8_string, S32 length_in_bytes); +typedef void RADLINK Iggy_WarningFunction(void *user_callback_data, Iggy *player, IggyResult error_code, char const *error_message); + +typedef struct +{ + S32 total_storage_in_bytes; // the total memory to use for the AS3 heap and garbage collector + S32 stack_size_in_bytes; // size of the stack used for AS3 expression evaluation and function activation records + S32 young_heap_size_in_bytes; // size of the heap from which initial allocations are made + S32 old_heap_size_in_bytes; // this parameter is not supported yet + S32 remembered_set_size_in_bytes; // storage used to keep track of pointers from old heap to young heap + S32 greylist_size_in_bytes; // storage used to keep track of partially-garbage collected objects on the old heap + S32 rootstack_size_in_bytes; // size of the stack used for exposing temporaries to the garbage collector + S32 padding; +} IggyPlayerGCSizes; + +typedef struct +{ + IggyAllocator allocator; + IggyPlayerGCSizes gc; + char *filename; + char *user_name; + rrbool load_in_place; + rrbool did_load_in_place; +} IggyPlayerConfig; + +RADEXPFUNC Iggy * RADEXPLINK IggyPlayerCreateFromFileAndPlay( + char const * filename, + IggyPlayerConfig const*config); + +RADEXPFUNC Iggy * RADEXPLINK IggyPlayerCreateFromMemory( + void const * data, + U32 data_size_in_bytes, + IggyPlayerConfig *config); + +#define IGGY_INVALID_LIBRARY -1 + +RADEXPFUNC IggyLibrary RADEXPLINK IggyLibraryCreateFromMemory( + char const * url_utf8_null_terminated, + void const * data, + U32 data_size_in_bytes, + IggyPlayerConfig *config); + +RADEXPFUNC IggyLibrary RADEXPLINK IggyLibraryCreateFromMemoryUTF16( + IggyUTF16 const * url_utf16_null_terminated, + void const * data, + U32 data_size_in_bytes, + IggyPlayerConfig *config); + +RADEXPFUNC void RADEXPLINK IggyPlayerDestroy(Iggy *player); +RADEXPFUNC void RADEXPLINK IggyLibraryDestroy(IggyLibrary lib); +RADEXPFUNC void RADEXPLINK IggySetWarningCallback(Iggy_WarningFunction *error, void *user_callback_data); +RADEXPFUNC void RADEXPLINK IggySetTraceCallbackUTF8(Iggy_TraceFunctionUTF8 *trace_utf8, void *user_callback_data); +RADEXPFUNC void RADEXPLINK IggySetTraceCallbackUTF16(Iggy_TraceFunctionUTF16 *trace_utf16, void *user_callback_data); + +typedef struct IggyProperties +{ + S32 movie_width_in_pixels; // the width of the "document" specified in the SWF file + S32 movie_height_in_pixels; // the height of the "document" specified in the SWF file + + F32 movie_frame_rate_current_in_fps; // the current frame rate Iggy is trying to achieve for the file + F32 movie_frame_rate_from_file_in_fps; // the frame rate specified in the SWF file + + S32 frames_passed; // the number of times Tick() has been called + S32 swf_major_version_number; // the major SWF version number of the file, currently always 9 + + F64 time_passed_in_seconds; // the total time passed since starting the file + F64 seconds_since_last_tick; // the number of seconds that have ocurred + F64 seconds_per_drawn_frame; // 1/render fps, updated on $IggyPlayerDrawTilesStart +} IggyProperties; + +RADEXPFUNC IggyProperties * RADEXPLINK IggyPlayerProperties(Iggy *player); + +typedef enum +{ + IGGY_PAUSE_continue_audio, + IGGY_PAUSE_pause_audio, + IGGY_PAUSE_stop_audio +} IggyAudioPauseMode; + +RADEXPFUNC void * RADEXPLINK IggyPlayerGetUserdata(Iggy *player); +RADEXPFUNC void RADEXPLINK IggyPlayerSetUserdata(Iggy *player, void *userdata); + +RADEXPFUNC void RADEXPLINK IggyPlayerInitializeAndTickRS(Iggy *player); +RADEXPFUNC rrbool RADEXPLINK IggyPlayerReadyToTick(Iggy *player); +RADEXPFUNC void RADEXPLINK IggyPlayerTickRS(Iggy *player); +RADEXPFUNC void RADEXPLINK IggyPlayerPause(Iggy *player, IggyAudioPauseMode pause_audio); +RADEXPFUNC void RADEXPLINK IggyPlayerPlay(Iggy *player); +RADEXPFUNC void RADEXPLINK IggyPlayerSetFrameRate(Iggy *player, F32 frame_rate_in_fps); +RADEXPFUNC void RADEXPLINK IggyPlayerGotoFrameRS(Iggy *f, S32 frame, rrbool stop); + +#ifndef __RAD_HIGGYEXP_ +#define __RAD_HIGGYEXP_ +typedef void * HIGGYEXP; +/* An IggyExplorer context, it represents a connection to Iggy Explorer. */ +#endif + +#ifndef __RAD_HIGGYPERFMON_ +#define __RAD_HIGGYPERFMON_ +typedef void * HIGGYPERFMON; +/* An IggyPerfMon context */ +#endif + + +IDOCN typedef void RADLINK iggyexp_detach_callback(void *ptr); + +IDOCN typedef struct +{ + U64 tick_ticks; + U64 draw_ticks; +} IggyPerfmonStats; + +IDOCN typedef struct +{ + void (RADLINK *get_stats)(Iggy* swf, IggyPerfmonStats* pdest); + const char* (RADLINK *get_display_name)(Iggy* swf); +} IggyForPerfmonFunctions; + +// This is used by both Iggy Explorer and Perfmon +IDOCN typedef struct +{ + rrbool (RADLINK *connection_valid)(Iggy* swf, HIGGYEXP iggyexp); // Iggy queries this to check if Iggy Explorer is still connected + S32 (RADLINK *poll_command)(Iggy* swf, HIGGYEXP iggyexp, U8 **buffer); // stores command in *buffer, returns number of bytes + void (RADLINK *send_command)(Iggy* swf, HIGGYEXP iggyexp, U8 command, void *buffer, S32 len); // writes a command with a payload of buffer:len + S32 (RADLINK *get_storage)(Iggy* swf, HIGGYEXP iggyexp, U8 **buffer); // returns temporary storage Iggy can use for assembling commands + rrbool (RADLINK *attach)(Iggy* swf, HIGGYEXP iggyexp, iggyexp_detach_callback *cb, void *cbdata, IggyForPerfmonFunctions* pmf); // an Iggy file is trying to attach itself to this connection (one at a time) + rrbool (RADLINK *detach)(Iggy* swf, HIGGYEXP iggyexp); // the current Iggy file should be detached (generate callback) + void (RADLINK *draw_tile_hook)(Iggy* swf, HIGGYEXP iggyexp, GDrawFunctions* iggy_gdraw); // only used by perfmon +} IggyExpFunctions; + +RADEXPFUNC void RADEXPLINK IggyInstallPerfmon(void *perfmon_context); + +RADEXPFUNC void RADEXPLINK IggyUseExplorer(Iggy *swf, void *context); +IDOCN RADEXPFUNC void RADEXPLINK IggyPlayerSendFrameToExplorer(Iggy *f); + +//////////////////////////////////////////////////////////// +// +// Fonts +// + +typedef struct +{ + F32 ascent; + F32 descent; + F32 line_gap; + F32 average_glyph_width_for_tab_stops; // for embedded fonts, Iggy uses width of 'g' + F32 largest_glyph_bbox_y1; +} IggyFontMetrics; + +typedef struct +{ + F32 x0,y0, x1,y1; // bounding box + F32 advance; // distance to move origin after this character +} IggyGlyphMetrics; + +typedef enum { + IGGY_VERTEX_move = 1, + IGGY_VERTEX_line = 2, + IGGY_VERTEX_curve = 3, +} IggyShapeVertexType; + +typedef struct +{ + F32 x,y; // if IGGY_VERTEX_move, point to start a new loop; if IGGY_VERTEX_line/curve, endpoint of segment + F32 cx,cy; // if IGGY_VERTEX_curve, control point on segment; ignored otherwise + U8 type; // value from $IggyShapeVertexType + + S8 padding; // ignore + U16 f0; // set to 1 + U16 f1; // set to 0 + U16 line; // ignore +} IggyShapeVertex; + +typedef struct +{ + IggyShapeVertex * vertices; + S32 num_vertices; + void * user_context_for_free; // you can use this to store data to access on the corresponding free call +} IggyVectorShape; + +typedef struct +{ + U8 *pixels_one_per_byte; // pixels from the top left, 0 is transparent and 255 is opaque + S32 width_in_pixels; // this is the actual width of the bitmap data + S32 height_in_pixels; // this is the actual height of the bitmap data + S32 stride_in_bytes; // the distance from one row to the next + S32 oversample; // this is the amount of oversampling (0 or 1 = not oversample, 2 = 2x oversampled, 4 = 4x oversampled) + rrbool point_sample; // if true, the bitmap will be drawn with point sampling; if false, it will be drawn with bilinear + S32 top_left_x; // the offset of the top left corner from the character origin + S32 top_left_y; // the offset of the top left corner from the character origin + F32 pixel_scale_correct; // the pixel_scale at which this character should be displayed at width_in_pixels + F32 pixel_scale_min; // the smallest pixel_scale to allow using this character (scaled down) + F32 pixel_scale_max; // the largest pixels cale to allow using this character (scaled up) + void * user_context_for_free; // you can use this to store data to access on the corresponding free call +} IggyBitmapCharacter; + +typedef IggyFontMetrics * RADLINK IggyFontGetFontMetrics(void *user_context, IggyFontMetrics *metrics); + +#define IGGY_GLYPH_INVALID -1 +typedef S32 RADLINK IggyFontGetCodepointGlyph(void *user_context, U32 codepoint); +typedef IggyGlyphMetrics * RADLINK IggyFontGetGlyphMetrics(void *user_context, S32 glyph, IggyGlyphMetrics *metrics); +typedef rrbool RADLINK IggyFontIsGlyphEmpty(void *user_context, S32 glyph); +typedef F32 RADLINK IggyFontGetKerningForGlyphPair(void *user_context, S32 first_glyph, S32 second_glyph); + +typedef void RADLINK IggyVectorFontGetGlyphShape(void *user_context, S32 glyph, IggyVectorShape *shape); +typedef void RADLINK IggyVectorFontFreeGlyphShape(void *user_context, S32 glyph, IggyVectorShape *shape); + +typedef rrbool RADLINK IggyBitmapFontCanProvideBitmap(void *user_context, S32 glyph, F32 pixel_scale); +typedef rrbool RADLINK IggyBitmapFontGetGlyphBitmap(void *user_context, S32 glyph, F32 pixel_scale, IggyBitmapCharacter *bitmap); +typedef void RADLINK IggyBitmapFontFreeGlyphBitmap(void *user_context, S32 glyph, F32 pixel_scale, IggyBitmapCharacter *bitmap); + + +typedef struct +{ + IggyFontGetFontMetrics *get_font_metrics; + + IggyFontGetCodepointGlyph *get_glyph_for_codepoint; + IggyFontGetGlyphMetrics *get_glyph_metrics; + IggyFontIsGlyphEmpty *is_empty; + IggyFontGetKerningForGlyphPair *get_kerning; + + IggyVectorFontGetGlyphShape *get_shape; + IggyVectorFontFreeGlyphShape *free_shape; + + S32 num_glyphs; + + void *userdata; +} IggyVectorFontProvider; + +typedef struct +{ + IggyFontGetFontMetrics *get_font_metrics; + + IggyFontGetCodepointGlyph *get_glyph_for_codepoint; + IggyFontGetGlyphMetrics *get_glyph_metrics; + IggyFontIsGlyphEmpty *is_empty; + IggyFontGetKerningForGlyphPair *get_kerning; + + IggyBitmapFontCanProvideBitmap *can_bitmap; + IggyBitmapFontGetGlyphBitmap *get_bitmap; + IggyBitmapFontFreeGlyphBitmap *free_bitmap; + + S32 num_glyphs; + + void *userdata; +} IggyBitmapFontProvider; + +typedef struct +{ + IggyBitmapFontCanProvideBitmap *can_bitmap; + IggyBitmapFontGetGlyphBitmap *get_bitmap; + IggyBitmapFontFreeGlyphBitmap *free_bitmap; + void *userdata; +} IggyBitmapFontOverride; + +RADEXPFUNC void RADEXPLINK IggySetInstalledFontMaxCount(S32 num); +RADEXPFUNC void RADEXPLINK IggySetIndirectFontMaxCount(S32 num); + +#define IGGY_FONTFLAG_none 0 +#define IGGY_FONTFLAG_bold 1 +#define IGGY_FONTFLAG_italic 2 +#define IGGY_FONTFLAG_all (~0U) // indirection only + +#define IGGY_TTC_INDEX_none 0 + +RADEXPFUNC void RADEXPLINK IggyFontInstallTruetypeUTF8(const void *truetype_storage, S32 ttc_index, const char *fontname, S32 namelen_in_bytes, U32 fontflags); +RADEXPFUNC void RADEXPLINK IggyFontInstallTruetypeUTF16(const void *truetype_storage, S32 ttc_index, const U16 *fontname, S32 namelen_in_16bit_quantities, U32 fontflags); +RADEXPFUNC void RADEXPLINK IggyFontInstallTruetypeFallbackCodepointUTF8(const char *fontname, S32 len, U32 fontflags, S32 fallback_codepoint); +RADEXPFUNC void RADEXPLINK IggyFontInstallTruetypeFallbackCodepointUTF16(const U16 *fontname, S32 len, U32 fontflags, S32 fallback_codepoint); +RADEXPFUNC void RADEXPLINK IggyFontInstallVectorUTF8(const IggyVectorFontProvider *vfp, const char *fontname, S32 namelen_in_bytes, U32 fontflags); +RADEXPFUNC void RADEXPLINK IggyFontInstallVectorUTF16(const IggyVectorFontProvider *vfp, const U16 *fontname, S32 namelen_in_16bit_quantities, U32 fontflags); +RADEXPFUNC void RADEXPLINK IggyFontInstallBitmapUTF8(const IggyBitmapFontProvider *bmf, const char *fontname, S32 namelen_in_bytes, U32 fontflags); +RADEXPFUNC void RADEXPLINK IggyFontInstallBitmapUTF16(const IggyBitmapFontProvider *bmf, const U16 *fontname, S32 namelen_in_16bit_quantities, U32 fontflags); +RADEXPFUNC void RADEXPLINK IggyFontInstallBitmapOverrideUTF8(const IggyBitmapFontOverride *bmf, const char *fontname, S32 namelen_in_bytes, U32 fontflags); +RADEXPFUNC void RADEXPLINK IggyFontInstallBitmapOverrideUTF16(const IggyBitmapFontOverride *bmf, const U16 *fontname, S32 namelen_in_16bit_quantities, U32 fontflags); + +RADEXPFUNC void RADEXPLINK IggyFontRemoveUTF8(const char *fontname, S32 namelen_in_bytes, U32 fontflags); +RADEXPFUNC void RADEXPLINK IggyFontRemoveUTF16(const U16 *fontname, S32 namelen_in_16bit_quantities, U32 fontflags); + +RADEXPFUNC void RADEXPLINK IggyFontSetIndirectUTF8(const char *request_name, S32 request_namelen, U32 request_flags, const char *result_name, S32 result_namelen, U32 result_flags); +RADEXPFUNC void RADEXPLINK IggyFontSetIndirectUTF16(const U16 *request_name, S32 request_namelen, U32 request_flags, const U16 *result_name, S32 result_namelen, U32 result_flags); + +RADEXPFUNC void RADEXPLINK IggyFontSetFallbackFontUTF8(const char *fontname, S32 fontname_len, U32 fontflags); +RADEXPFUNC void RADEXPLINK IggyFontSetFallbackFontUTF16(const U16 *fontname, S32 fontname_len, U32 fontflags); + +//////////////////////////////////////////////////////////// +// +// Audio +// + +struct _RadSoundSystem; +IDOCN typedef S32 (*IGGYSND_OPEN_FUNC)(struct _RadSoundSystem* i_SoundSystem, U32 i_MinBufferSizeInMs, U32 i_Frequency, U32 i_ChannelCount, U32 i_MaxLockSize, U32 i_Flags); + +IDOCN RADEXPFUNC void RADEXPLINK IggyAudioSetDriver(IGGYSND_OPEN_FUNC driver_open, U32 flags); + +// These functions cause Iggy to use a specific audio API, most of which +// are only actually defined on one target platform. Probably, you'll just +// want to call IggyAudioUseDefault. + +IDOCN RADEXPFUNC void RADEXPLINK IggyAudioUseDirectSound(void); +IDOCN RADEXPFUNC void RADEXPLINK IggyAudioUseWaveOut(void); +IDOCN RADEXPFUNC void RADEXPLINK IggyAudioUseXAudio2(void); +IDOCN RADEXPFUNC void RADEXPLINK IggyAudioUseLibAudio(void); +IDOCN RADEXPFUNC void RADEXPLINK IggyAudioUseAX(void); +IDOCN RADEXPFUNC void RADEXPLINK IggyAudioUseCoreAudio(void); + +RADEXPFUNC void RADEXPLINK IggyAudioUseDefault(void); + +#ifndef __RAD_DEFINE_IGGYMP3__ +#define __RAD_DEFINE_IGGYMP3__ +IDOCN typedef struct IggyMP3Interface IggyMP3Interface; +IDOCN typedef rrbool IggyGetMP3Decoder(IggyMP3Interface *decoder); +#endif + +#ifdef __RADNT__ + RADEXPFUNC void RADEXPLINK IggyAudioInstallMP3Decoder(void); + RADEXPFUNC void RADEXPLINK IggySetDLLDirectory(char *path); + RADEXPFUNC void RADEXPLINK IggySetDLLDirectoryW(wchar_t *path); +#else + // this is overkill for non-DLL implementations, which could call into Iggy + // directly, but it means everything goes through the same indirection internally + IDOCN RADEXPFUNC IggyGetMP3Decoder* RADEXPLINK IggyAudioGetMP3Decoder(void); + IDOCN RADEXPFUNC void RADEXPLINK IggyAudioInstallMP3DecoderExplicit(IggyGetMP3Decoder *init); + + #define IggyAudioInstallMP3Decoder() \ + IggyAudioInstallMP3DecoderExplicit(IggyAudioGetMP3Decoder()) IDOCN +#endif + +RADEXPFUNC rrbool RADEXPLINK IggyAudioSetMaxBufferTime(S32 ms); +RADEXPFUNC void RADEXPLINK IggyAudioSetLatency(S32 ms); +RADEXPFUNC void RADEXPLINK IggyPlayerSetAudioVolume(Iggy *iggy, F32 attenuation); + +#define IGGY_AUDIODEVICE_default 0 +#define IGGY_AUDIODEVICE_primary 1 +#define IGGY_AUDIODEVICE_secondary 2 + +IDOCN RADEXPFUNC void RADEXPLINK IggyPlayerSetAudioDevice(Iggy *iggy, S32 device); + + +//////////////////////////////////////////////////////////// +// +// Rendering +// + +typedef struct IggyCustomDrawCallbackRegion +{ + IggyUTF16 *name; // the name of the DisplayObject being substituted + F32 x0, y0, x1, y1; // the bounding box of the original DisplayObject, in object space + F32 rgba_mul[4]; // any multiplicative color effect specified for the DisplayObject or its parents + F32 rgba_add[4]; // any additive color effect specified for the DisplayObject or its parents + S32 scissor_x0, scissor_y0, scissor_x1, scissor_y1; // optional scissor rect box + U8 scissor_enable; // if non-zero, clip to the scissor rect + U8 stencil_func_mask; // D3DRS_STENCILMASK or equivalent + U8 stencil_func_ref; // D3DRS_STENCILREF or equivalent + U8 stencil_write_mask; // if non-zero, D3DRS_STENCILWRITEMASK or equivalent + struct gswf_matrix *o2w; // Iggy object-to-world matrix (used internally) +} IggyCustomDrawCallbackRegion; + +typedef void RADLINK Iggy_CustomDrawCallback(void *user_callback_data, Iggy *player, IggyCustomDrawCallbackRegion *Region); +typedef GDrawTexture* RADLINK Iggy_TextureSubstitutionCreateCallback(void *user_callback_data, IggyUTF16 *texture_name, S32 *width, S32 *height, void **destroy_callback_data); +typedef void RADLINK Iggy_TextureSubstitutionDestroyCallback(void *user_callback_data, void *destroy_callback_data, GDrawTexture *handle); +typedef GDrawTexture* RADLINK Iggy_TextureSubstitutionCreateCallbackUTF8(void *user_callback_data, char *texture_name, S32 *width, S32 *height, void **destroy_callback_data); + +RADEXPFUNC void RADEXPLINK IggySetCustomDrawCallback(Iggy_CustomDrawCallback *custom_draw, void *user_callback_data); +RADEXPFUNC void RADEXPLINK IggySetTextureSubstitutionCallbacks(Iggy_TextureSubstitutionCreateCallback *texture_create, Iggy_TextureSubstitutionDestroyCallback *texture_destroy, void *user_callback_data); +RADEXPFUNC void RADEXPLINK IggySetTextureSubstitutionCallbacksUTF8(Iggy_TextureSubstitutionCreateCallbackUTF8 *texture_create, Iggy_TextureSubstitutionDestroyCallback *texture_destroy, void *user_callback_data); + +typedef enum { + IGGY_FLUSH_no_callback, // do not generate the $Iggy_TextureSubstitutionDestroyCallback + IGGY_FLUSH_destroy_callback, // do generate the $Iggy_TextureSubstitutionDestroyCallback +} IggyTextureSubstitutionFlushMode; + +RADEXPFUNC void RADEXPLINK IggyTextureSubstitutionFlush(GDrawTexture *handle, IggyTextureSubstitutionFlushMode do_destroy_callback); +RADEXPFUNC void RADEXPLINK IggyTextureSubstitutionFlushAll(IggyTextureSubstitutionFlushMode do_destroy_callback); + +RADEXPFUNC void RADEXPLINK IggySetGDraw(GDrawFunctions *gdraw); +RADEXPFUNC void RADEXPLINK IggyPlayerGetBackgroundColor(Iggy *player, F32 output_color[3]); + +typedef enum +{ + IGGY_ROTATION_0_degrees = 0, + IGGY_ROTATION_90_degrees_counterclockwise = 1, + IGGY_ROTATION_180_degrees = 2, + IGGY_ROTATION_90_degrees_clockwise = 3, +} Iggy90DegreeRotation; + +RADEXPFUNC void RADEXPLINK IggyPlayerSetDisplaySize(Iggy *f, S32 w, S32 h); +RADEXPFUNC void RADEXPLINK IggyPlayerSetPixelShape(Iggy *swf, F32 pixel_x, F32 pixel_y); +RADEXPFUNC void RADEXPLINK IggyPlayerSetStageRotation(Iggy *f, Iggy90DegreeRotation rot); +RADEXPFUNC void RADEXPLINK IggyPlayerDraw(Iggy *f); +RADEXPFUNC void RADEXPLINK IggyPlayerSetStageSize(Iggy *f, S32 w, S32 h); +RADEXPFUNC void RADEXPLINK IggyPlayerSetFaux3DStage(Iggy *f, F32 *top_left, F32 *top_right, F32 *bottom_left, F32 *bottom_right, F32 depth_scale); +RADEXPFUNC void RADEXPLINK IggyPlayerForceMipmaps(Iggy *f, rrbool force_mipmaps); + +RADEXPFUNC void RADEXPLINK IggyPlayerDrawTile(Iggy *f, S32 x0, S32 y0, S32 x1, S32 y1, S32 padding); +RADEXPFUNC void RADEXPLINK IggyPlayerDrawTilesStart(Iggy *f); +RADEXPFUNC void RADEXPLINK IggyPlayerDrawTilesEnd(Iggy *f); +RADEXPFUNC void RADEXPLINK IggyPlayerSetRootTransform(Iggy *f, F32 mat[4], F32 tx, F32 ty); +RADEXPFUNC void RADEXPLINK IggyPlayerFlushAll(Iggy *player); +RADEXPFUNC void RADEXPLINK IggyLibraryFlushAll(IggyLibrary h); +RADEXPFUNC void RADEXPLINK IggySetTextCursorPixelWidth(S32 width); +RADEXPFUNC void RADEXPLINK IggyForceBitmapSmoothing(rrbool force_on); +RADEXPFUNC void RADEXPLINK IggyFlushInstalledFonts(void); +RADEXPFUNC void RADEXPLINK IggyFastTextFilterEffects(rrbool enable); + +typedef enum IggyAntialiasing +{ + IGGY_ANTIALIASING_FontsOnly = 2, // Anti-aliasing of bitmapped fonts only + IGGY_ANTIALIASING_FontsAndLinesOnly = 4, // Anti-aliasing of fonts and lines, but nothing else + IGGY_ANTIALIASING_PrettyGood = 8, // High-quality anti-aliasing on everything, but no rendertargets required + IGGY_ANTIALIASING_Good = 10, // High-quality anti-aliasing on everything (on platforms where GDraw doesn't support rendertargets, such as the Wii, this behaves the same as PrettyGood) +} IggyAntialiasing; + +RADEXPFUNC void RADEXPLINK IggyPlayerSetAntialiasing(Iggy *f, IggyAntialiasing antialias_mode); + +RADEXPFUNC void RADEXPLINK IggyPlayerSetBitmapFontCaching( + Iggy *f, + S32 tex_w, + S32 tex_h, + S32 max_char_pix_width, + S32 max_char_pix_height); + +RADEXPFUNC void RADEXPLINK IggySetFontCachingCalculationBuffer( + S32 max_chars, + void *optional_temp_buffer, + S32 optional_temp_buffer_size_in_bytes); + +typedef struct IggyGeneric IggyGeneric; + +RADEXPFUNC IggyGeneric * RADEXPLINK IggyPlayerGetGeneric(Iggy *player); +RADEXPFUNC IggyGeneric * RADEXPLINK IggyLibraryGetGeneric(IggyLibrary lib); + +// each texture metadata block contains one of these, where +// texture_info is an array of per-format data +IDOCN typedef struct +{ + U16 num_textures; + U16 load_alignment_log2; + U32 texture_file_size; + void *texture_info; +} IggyTextureResourceMetadata; + +RADEXPFUNC void RADEXPLINK IggyGenericInstallResourceFile(IggyGeneric *g, void *data, S32 data_length, rrbool *can_free_now); +RADEXPFUNC IggyTextureResourceMetadata *RADEXPLINK IggyGenericGetTextureResourceMetadata(IggyGeneric *f); +RADEXPFUNC void RADEXPLINK IggyGenericSetTextureFromResource(IggyGeneric *f, U16 id, GDrawTexture *handle); + +// this is the encoding for the "raw" texture type, which doesn't +// depend on any platform headers +typedef enum +{ + IFT_FORMAT_rgba_8888, + IFT_FORMAT_rgba_4444_LE, + IFT_FORMAT_rgba_5551_LE, + IFT_FORMAT_la_88, + IFT_FORMAT_la_44, + IFT_FORMAT_i_8, + IFT_FORMAT_i_4, + IFT_FORMAT_l_8, + IFT_FORMAT_l_4, + IFT_FORMAT_DXT1, + IFT_FORMAT_DXT3, + IFT_FORMAT_DXT5, +} IggyFileTexture_Format; + +typedef struct +{ + U32 file_offset; + U8 format; + U8 mipmaps; + U16 w,h; + U16 swf_id; +} IggyFileTextureRaw; + +IDOCN typedef struct +{ + U32 file_offset; + U16 swf_id; + U16 padding; + struct { + U32 data[13]; + } texture; +} IggyFileTexture360; + +IDOCN typedef struct +{ + U32 file_offset; + U16 swf_id; + U8 format; + U8 padding; + struct { + U32 data[6]; + } texture; +} IggyFileTexturePS3; + +IDOCN typedef struct +{ + U32 file_offset1; + U32 file_offset2; + U16 swf_id; + U8 format; + U8 padding; + struct { + U32 data1[39]; + } texture; +} IggyFileTextureWiiu; + +IDOCN typedef struct +{ + U32 file_offset; + U16 swf_id; + U8 format; + U8 padding; + struct { + U32 data[8]; + } texture; +} IggyFileTexturePS4; + +IDOCN typedef struct +{ + U32 file_offset; + U16 swf_id; + U8 format; + U8 padding; + struct { + U32 format; + U32 type; + U16 width; + U16 height; + U8 mip_count; + U8 pad[3]; + } texture; +} IggyFileTexturePSP2; + +//////////////////////////////////////////////////////////// +// +// AS3 +// + +typedef rrbool RADLINK Iggy_AS3ExternalFunctionUTF8(void *user_callback_data, Iggy *player, IggyExternalFunctionCallUTF8 *call); +typedef rrbool RADLINK Iggy_AS3ExternalFunctionUTF16(void *user_callback_data, Iggy *player, IggyExternalFunctionCallUTF16 *call); + +RADEXPFUNC void RADEXPLINK IggySetAS3ExternalFunctionCallbackUTF8(Iggy_AS3ExternalFunctionUTF8 *as3_external_function_utf8, void *user_callback_data); +RADEXPFUNC void RADEXPLINK IggySetAS3ExternalFunctionCallbackUTF16(Iggy_AS3ExternalFunctionUTF16 *as3_external_function_utf16, void *user_callback_data); +RADEXPFUNC IggyName RADEXPLINK IggyPlayerCreateFastName(Iggy *f, IggyUTF16 const *name, S32 len); +RADEXPFUNC IggyName RADEXPLINK IggyPlayerCreateFastNameUTF8(Iggy *f, char const *name, S32 len); +RADEXPFUNC IggyResult RADEXPLINK IggyPlayerCallFunctionRS(Iggy *player, IggyDataValue *result, IggyName function, S32 numargs, IggyDataValue *args); +RADEXPFUNC IggyResult RADEXPLINK IggyPlayerCallMethodRS(Iggy *f, IggyDataValue *result, IggyValuePath *target, IggyName methodname, S32 numargs, IggyDataValue *args); +RADEXPFUNC void RADEXPLINK IggyPlayerGarbageCollect(Iggy *player, S32 strength); + +#define IGGY_GC_MINIMAL 0 +#define IGGY_GC_NORMAL 30 +#define IGGY_GC_MAXIMAL 100 + +typedef struct +{ + U32 young_heap_size; // the size of the young heap is the smaller of this number and the size the young heap was originally allocated when the Iggy was created + U32 base_old_amount; // the base number of words to process on each minor cycle, default 200 + F32 old_heap_fraction; // the fraction 0..1 (default 0.125) of the outstanding allocations from the last major GC cycle to traverse during one GC cycle + F32 new_allocation_multiplier; // a number from 1..infinity (default 2) which is the amount of the allocations in the last cycle to traverse + F32 sweep_multiplier; // a positive number (default 2) which weights the amount of data swept vs marked +} IggyGarbageCollectorControl; + +typedef enum +{ + IGGY_GC_EVENT_tenure, + IGGY_GC_EVENT_mark_increment, + IGGY_GC_EVENT_mark_roots, + IGGY_GC_EVENT_sweep_finalize, + IGGY_GC_EVENT_sweep_increment, + IGGY_GC_WARNING_greylist_overflow, // the grey list overflowed, increase the size of $(IggyPlayerGCSizes::greylist_size_in_bytes). + IGGY_GC_WARNING_remembered_overflow, // the remembered set overflowed, increase the size of $(IggyPlayerGCSizes::remembered_set_size_in_bytes). +} IggyGarbageCollectionEvent; + +typedef struct +{ + U64 event_time_in_microseconds; + U64 total_marked_bytes; // total bytes ever marked by the GC + U64 total_swept_bytes; // total bytes ever swept by the GC + U64 total_allocated_bytes; // total bytes ever allocated from the old heap + U64 total_gc_time_in_microseconds; // total time spent in GC while notify callback was active + + char *name; + + IggyGarbageCollectionEvent event; // the type of garbage collection event that was just performed + + U32 increment_processing_bytes; // the number of bytes that were processed in that event + + U32 last_slice_tenured_bytes; // the number of bytes that were tenured from young-to-old heap since the previous GC step + U32 last_slice_old_allocation_bytes; // the number of bytes that were tenured or were directly allocated from the old heap since the previous GC step + + U32 heap_used_bytes; // the number of bytes in use in the old heap (the young heap is empty) + U32 heap_size_bytes; // the number of bytes allocated for the old heap + + U32 onstage_display_objects; // the number of on-stage display objects (MovieClips, TextFields, Shapes, etc) visited during tenuring only + U32 offstage_display_objects; // the number of off-stage display objects visited during tenuring only +} IggyGarbageCollectionInfo; + +typedef void RADLINK Iggy_GarbageCollectionCallback(Iggy *player, IggyGarbageCollectionInfo *info); +RADEXPFUNC void RADEXPLINK IggyPlayerConfigureGCBehavior(Iggy *player, Iggy_GarbageCollectionCallback *notify_callack, IggyGarbageCollectorControl *control); +RADEXPFUNC void RADEXPLINK IggyPlayerQueryGCSizes(Iggy *player, IggyPlayerGCSizes *sizes); + +RADEXPFUNC rrbool RADEXPLINK IggyPlayerGetValid(Iggy *f); + +IDOCN struct IggyValuePath +{ + Iggy *f; + IggyValuePath *parent; + //align 0 mod 8 + IggyName name; + IggyValueRef ref; + //align 0 mod 8 + S32 index; + S32 type; + //align 0 mod 8 +}; + +typedef enum +{ + IGGY_ValueRef, + IGGY_ValueRef_Weak, +} IggyValueRefType; + +RADEXPFUNC rrbool RADEXPLINK IggyValueRefCheck(IggyValueRef ref); +RADEXPFUNC void RADEXPLINK IggyValueRefFree(Iggy *p, IggyValueRef ref); +RADEXPFUNC IggyValueRef RADEXPLINK IggyValueRefFromPath(IggyValuePath *var, IggyValueRefType reftype); +RADEXPFUNC rrbool RADEXPLINK IggyIsValueRefSameObjectAsTempRef(IggyValueRef value_ref, IggyTempRef temp_ref); +RADEXPFUNC rrbool RADEXPLINK IggyIsValueRefSameObjectAsValuePath(IggyValueRef value_ref, IggyValuePath *path, IggyName sub_name, char const *sub_name_utf8); +RADEXPFUNC void RADEXPLINK IggySetValueRefLimit(Iggy *f, S32 max_value_refs); +RADEXPFUNC S32 RADEXPLINK IggyDebugGetNumValueRef(Iggy *f); +RADEXPFUNC IggyValueRef RADEXPLINK IggyValueRefCreateArray(Iggy *f, S32 num_slots); +RADEXPFUNC IggyValueRef RADEXPLINK IggyValueRefCreateEmptyObject(Iggy *f); +RADEXPFUNC IggyValueRef RADEXPLINK IggyValueRefFromTempRef(Iggy *f, IggyTempRef temp_ref, IggyValueRefType reftype); + +RADEXPFUNC IggyValuePath * RADEXPLINK IggyPlayerRootPath(Iggy *f); +RADEXPFUNC IggyValuePath * RADEXPLINK IggyPlayerCallbackResultPath(Iggy *f); +RADEXPFUNC rrbool RADEXPLINK IggyValuePathMakeNameRef(IggyValuePath *result, IggyValuePath *parent, char const *text_utf8); +RADEXPFUNC void RADEXPLINK IggyValuePathFromRef(IggyValuePath *result, Iggy *iggy, IggyValueRef ref); + +RADEXPFUNC void RADEXPLINK IggyValuePathMakeNameRefFast(IggyValuePath *result, IggyValuePath *parent, IggyName name); +RADEXPFUNC void RADEXPLINK IggyValuePathMakeArrayRef(IggyValuePath *result, IggyValuePath *array_path, int array_index); + +RADEXPFUNC void RADEXPLINK IggyValuePathSetParent(IggyValuePath *result, IggyValuePath *new_parent); +RADEXPFUNC void RADEXPLINK IggyValuePathSetArrayIndex(IggyValuePath *result, int new_index); + +RADEXPFUNC void RADEXPLINK IggyValuePathSetName(IggyValuePath *result, IggyName name); +RADEXPFUNC IggyResult RADEXPLINK IggyValueGetTypeRS(IggyValuePath *var, IggyName sub_name, char const *sub_name_utf8, IggyDatatype *result); + +RADEXPFUNC IggyResult RADEXPLINK IggyValueGetF64RS(IggyValuePath *var, IggyName sub_name, char const *sub_name_utf8, F64 *result); +RADEXPFUNC IggyResult RADEXPLINK IggyValueGetF32RS(IggyValuePath *var, IggyName sub_name, char const *sub_name_utf8, F32 *result); +RADEXPFUNC IggyResult RADEXPLINK IggyValueGetS32RS(IggyValuePath *var, IggyName sub_name, char const *sub_name_utf8, S32 *result); +RADEXPFUNC IggyResult RADEXPLINK IggyValueGetU32RS(IggyValuePath *var, IggyName sub_name, char const *sub_name_utf8, U32 *result); +RADEXPFUNC IggyResult RADEXPLINK IggyValueGetStringUTF8RS(IggyValuePath *var, IggyName sub_name, char const *sub_name_utf8, S32 max_result_len, char *utf8_result, S32 *result_len); +RADEXPFUNC IggyResult RADEXPLINK IggyValueGetStringUTF16RS(IggyValuePath *var, IggyName sub_name, char const *sub_name_utf8, S32 max_result_len, IggyUTF16 *utf16_result, S32 *result_len); +RADEXPFUNC IggyResult RADEXPLINK IggyValueGetBooleanRS(IggyValuePath *var, IggyName sub_name, char const *sub_name_utf8, rrbool *result); +RADEXPFUNC IggyResult RADEXPLINK IggyValueGetArrayLengthRS(IggyValuePath *var, IggyName sub_name, char const *sub_name_utf8, S32 *result); + +RADEXPFUNC rrbool RADEXPLINK IggyValueSetF64RS(IggyValuePath *var, IggyName sub_name, char const *sub_name_utf8, F64 value); +RADEXPFUNC rrbool RADEXPLINK IggyValueSetF32RS(IggyValuePath *var, IggyName sub_name, char const *sub_name_utf8, F32 value); +RADEXPFUNC rrbool RADEXPLINK IggyValueSetS32RS(IggyValuePath *var, IggyName sub_name, char const *sub_name_utf8, S32 value); +RADEXPFUNC rrbool RADEXPLINK IggyValueSetU32RS(IggyValuePath *var, IggyName sub_name, char const *sub_name_utf8, U32 value); +RADEXPFUNC rrbool RADEXPLINK IggyValueSetStringUTF8RS(IggyValuePath *var, IggyName sub_name, char const *sub_name_utf8, char const *utf8_string, S32 stringlen); +RADEXPFUNC rrbool RADEXPLINK IggyValueSetStringUTF16RS(IggyValuePath *var, IggyName sub_name, char const *sub_name_utf8, IggyUTF16 const *utf16_string, S32 stringlen); +RADEXPFUNC rrbool RADEXPLINK IggyValueSetBooleanRS(IggyValuePath *var, IggyName sub_name, char const *sub_name_utf8, rrbool value); +RADEXPFUNC rrbool RADEXPLINK IggyValueSetValueRefRS(IggyValuePath *var, IggyName sub_name, char const *sub_name_utf8, IggyValueRef value_ref); + +RADEXPFUNC rrbool RADEXPLINK IggyValueSetUserDataRS(IggyValuePath *result, void const *userdata); +RADEXPFUNC IggyResult RADEXPLINK IggyValueGetUserDataRS(IggyValuePath *result, void **userdata); + + +//////////////////////////////////////////////////////////// +// +// Input Events +// + +typedef enum IggyEventType +{ + IGGY_EVENTTYPE_None, + IGGY_EVENTTYPE_MouseLeftDown, + IGGY_EVENTTYPE_MouseLeftUp, + IGGY_EVENTTYPE_MouseRightDown, + IGGY_EVENTTYPE_MouseRightUp, + IGGY_EVENTTYPE_MouseMiddleDown, + IGGY_EVENTTYPE_MouseMiddleUp, + IGGY_EVENTTYPE_MouseMove, + IGGY_EVENTTYPE_MouseWheel, + IGGY_EVENTTYPE_KeyUp, + IGGY_EVENTTYPE_KeyDown, + IGGY_EVENTTYPE_Char, + IGGY_EVENTTYPE_Activate, + IGGY_EVENTTYPE_Deactivate, + IGGY_EVENTTYPE_Resize, + IGGY_EVENTTYPE_MouseLeave, + IGGY_EVENTTYPE_FocusLost, +} IggyEventType; + +typedef enum IggyKeyloc +{ + IGGY_KEYLOC_Standard = 0, // For keys that have no variants + // TODO(casey): Shouldn't these work for ALT and CONTROL too? The code in D3DTEST looks like it only handles VK_SHIFT... + IGGY_KEYLOC_Left = 1, // Specifies the left-hand-side key for keys with left/right variants (such as $(IggyKeycode::IGGY_KEYCODE_SHIFT), $(IggyKeycode::IGGY_KEYCODE_ALTERNATE), etc.) */ + IGGY_KEYLOC_Right = 2, // Specifies the right-hand-side key for keys with left/right variants (such as $(IggyKeycode::IGGY_KEYCODE_SHIFT), $(IggyKeycode::IGGY_KEYCODE_ALTERNATE), etc.) */ + IGGY_KEYLOC_Numpad = 3, // TODO(casey): Is this ever used? +} IggyKeyloc; + +typedef enum IggyKeyevent +{ + IGGY_KEYEVENT_Up = IGGY_EVENTTYPE_KeyUp, + IGGY_KEYEVENT_Down = IGGY_EVENTTYPE_KeyDown, +} IggyKeyevent; + +typedef enum IggyMousebutton +{ + IGGY_MOUSEBUTTON_LeftDown = IGGY_EVENTTYPE_MouseLeftDown, + IGGY_MOUSEBUTTON_LeftUp = IGGY_EVENTTYPE_MouseLeftUp, + IGGY_MOUSEBUTTON_RightDown = IGGY_EVENTTYPE_MouseRightDown, + IGGY_MOUSEBUTTON_RightUp = IGGY_EVENTTYPE_MouseRightUp, + IGGY_MOUSEBUTTON_MiddleDown = IGGY_EVENTTYPE_MouseMiddleDown, + IGGY_MOUSEBUTTON_MiddleUp = IGGY_EVENTTYPE_MouseMiddleUp, +} IggyMousebutton; + +typedef enum IggyActivestate +{ + IGGY_ACTIVESTATE_Activated = IGGY_EVENTTYPE_Activate, + IGGY_ACTIVESTATE_Deactivated = IGGY_EVENTTYPE_Deactivate, +} IggyActivestate; + +typedef enum IggyKeycode +{ + IGGY_KEYCODE_A = 65, + IGGY_KEYCODE_B = 66, + IGGY_KEYCODE_C = 67, + IGGY_KEYCODE_D = 68, + IGGY_KEYCODE_E = 69, + IGGY_KEYCODE_F = 70, + IGGY_KEYCODE_G = 71, + IGGY_KEYCODE_H = 72, + IGGY_KEYCODE_I = 73, + IGGY_KEYCODE_J = 74, + IGGY_KEYCODE_K = 75, + IGGY_KEYCODE_L = 76, + IGGY_KEYCODE_M = 77, + IGGY_KEYCODE_N = 78, + IGGY_KEYCODE_O = 79, + IGGY_KEYCODE_P = 80, + IGGY_KEYCODE_Q = 81, + IGGY_KEYCODE_R = 82, + IGGY_KEYCODE_S = 83, + IGGY_KEYCODE_T = 84, + IGGY_KEYCODE_U = 85, + IGGY_KEYCODE_V = 86, + IGGY_KEYCODE_W = 87, + IGGY_KEYCODE_X = 88, + IGGY_KEYCODE_Y = 89, + IGGY_KEYCODE_Z = 90, + + IGGY_KEYCODE_0 = 48, + IGGY_KEYCODE_1 = 49, + IGGY_KEYCODE_2 = 50, + IGGY_KEYCODE_3 = 51, + IGGY_KEYCODE_4 = 52, + IGGY_KEYCODE_5 = 53, + IGGY_KEYCODE_6 = 54, + IGGY_KEYCODE_7 = 55, + IGGY_KEYCODE_8 = 56, + IGGY_KEYCODE_9 = 57, + + IGGY_KEYCODE_F1 = 112, + IGGY_KEYCODE_F2 = 113, + IGGY_KEYCODE_F3 = 114, + IGGY_KEYCODE_F4 = 115, + IGGY_KEYCODE_F5 = 116, + IGGY_KEYCODE_F6 = 117, + IGGY_KEYCODE_F7 = 118, + IGGY_KEYCODE_F8 = 119, + IGGY_KEYCODE_F9 = 120, + IGGY_KEYCODE_F10 = 121, + IGGY_KEYCODE_F11 = 122, + IGGY_KEYCODE_F12 = 123, + IGGY_KEYCODE_F13 = 124, + IGGY_KEYCODE_F14 = 125, + IGGY_KEYCODE_F15 = 126, + + IGGY_KEYCODE_COMMAND = 15, + IGGY_KEYCODE_SHIFT = 16, + IGGY_KEYCODE_CONTROL = 17, + IGGY_KEYCODE_ALTERNATE = 18, + + IGGY_KEYCODE_BACKQUOTE = 192, + IGGY_KEYCODE_BACKSLASH = 220, + IGGY_KEYCODE_BACKSPACE = 8, + IGGY_KEYCODE_CAPS_LOCK = 20, + IGGY_KEYCODE_COMMA = 188, + IGGY_KEYCODE_DELETE = 46, + IGGY_KEYCODE_DOWN = 40, + IGGY_KEYCODE_END = 35, + IGGY_KEYCODE_ENTER = 13, + IGGY_KEYCODE_EQUAL = 187, + IGGY_KEYCODE_ESCAPE = 27, + IGGY_KEYCODE_HOME = 36, + IGGY_KEYCODE_INSERT = 45, + IGGY_KEYCODE_LEFT = 37, + IGGY_KEYCODE_LEFTBRACKET = 219, + IGGY_KEYCODE_MINUS = 189, + IGGY_KEYCODE_NUMPAD = 21, + IGGY_KEYCODE_NUMPAD_0 = 96, + IGGY_KEYCODE_NUMPAD_1 = 97, + IGGY_KEYCODE_NUMPAD_2 = 98, + IGGY_KEYCODE_NUMPAD_3 = 99, + IGGY_KEYCODE_NUMPAD_4 = 100, + IGGY_KEYCODE_NUMPAD_5 = 101, + IGGY_KEYCODE_NUMPAD_6 = 102, + IGGY_KEYCODE_NUMPAD_7 = 103, + IGGY_KEYCODE_NUMPAD_8 = 104, + IGGY_KEYCODE_NUMPAD_9 = 105, + IGGY_KEYCODE_NUMPAD_ADD = 107, + IGGY_KEYCODE_NUMPAD_DECIMAL = 110, + IGGY_KEYCODE_NUMPAD_DIVIDE = 111, + IGGY_KEYCODE_NUMPAD_ENTER = 108, + IGGY_KEYCODE_NUMPAD_MULTIPLY = 106, + IGGY_KEYCODE_NUMPAD_SUBTRACT = 109, + IGGY_KEYCODE_PAGE_DOWN = 34, + IGGY_KEYCODE_PAGE_UP = 33, + IGGY_KEYCODE_PERIOD = 190, + IGGY_KEYCODE_QUOTE = 222, + IGGY_KEYCODE_RIGHT = 39, + IGGY_KEYCODE_RIGHTBRACKET = 221, + IGGY_KEYCODE_SEMICOLON = 186, + IGGY_KEYCODE_SLASH = 191, + IGGY_KEYCODE_SPACE = 32, + IGGY_KEYCODE_TAB = 9, + IGGY_KEYCODE_UP = 38, +} IggyKeycode; + +typedef enum IggyEventFlag +{ + IGGY_EVENTFLAG_PreventDispatchToObject = 0x1, + IGGY_EVENTFLAG_PreventFocusTabbing = 0x2, + IGGY_EVENTFLAG_PreventDefault = 0x4, + IGGY_EVENTFLAG_RanAtLeastOneHandler = 0x8, +} IggyEventFlag; + +typedef struct IggyEvent +{ + S32 type; // an $IggyEventType + U32 flags; + S32 x,y; // mouse position at time of event + S32 keycode,keyloc; // keyboard inputs +} IggyEvent; + +typedef enum IggyFocusChange +{ + IGGY_FOCUS_CHANGE_None, // The keyboard focus didn't change + IGGY_FOCUS_CHANGE_TookFocus, // The keyboard focus changed to something in this Iggy + IGGY_FOCUS_CHANGE_LostFocus, // The keyboard focus was lost from this Iggy +} IggyFocusChange; + +typedef struct IggyEventResult +{ + U32 new_flags; + S32 focus_change; // an $IggyFocusChange that indicates how the focus (may have) changed in response to the event + S32 focus_direction; // +} IggyEventResult; + +RADEXPFUNC void RADEXPLINK IggyMakeEventNone(IggyEvent *event); + +RADEXPFUNC void RADEXPLINK IggyMakeEventResize(IggyEvent *event); +RADEXPFUNC void RADEXPLINK IggyMakeEventActivate(IggyEvent *event, IggyActivestate event_type); +RADEXPFUNC void RADEXPLINK IggyMakeEventMouseLeave(IggyEvent *event); +RADEXPFUNC void RADEXPLINK IggyMakeEventMouseMove(IggyEvent *event, S32 x, S32 y); +RADEXPFUNC void RADEXPLINK IggyMakeEventMouseButton(IggyEvent *event, IggyMousebutton event_type); +RADEXPFUNC void RADEXPLINK IggyMakeEventMouseWheel(IggyEvent *event, S16 mousewheel_delta); +RADEXPFUNC void RADEXPLINK IggyMakeEventKey(IggyEvent *event, IggyKeyevent event_type, IggyKeycode keycode, IggyKeyloc keyloc); +RADEXPFUNC void RADEXPLINK IggyMakeEventChar(IggyEvent *event, S32 charcode); +RADEXPFUNC void RADEXPLINK IggyMakeEventFocusLost(IggyEvent *event); +RADEXPFUNC void RADEXPLINK IggyMakeEventFocusGained(IggyEvent *event, S32 focus_direction); +RADEXPFUNC rrbool RADEXPLINK IggyPlayerDispatchEventRS(Iggy *player, IggyEvent *event, IggyEventResult *result); +RADEXPFUNC void RADEXPLINK IggyPlayerSetShiftState(Iggy *f, rrbool shift, rrbool control, rrbool alt, rrbool command); +RADEXPFUNC void RADEXPLINK IggySetDoubleClickTime(S32 time_in_ms_from_first_down_to_second_up); +RADEXPFUNC void RADEXPLINK IggySetTextCursorFlash(U32 cycle_time_in_ms, U32 visible_time_in_ms); + +RADEXPFUNC rrbool RADEXPLINK IggyPlayerHasFocusedEditableTextfield(Iggy *f); +RADEXPFUNC rrbool RADEXPLINK IggyPlayerPasteUTF16(Iggy *f, U16 *string, S32 stringlen); +RADEXPFUNC rrbool RADEXPLINK IggyPlayerPasteUTF8(Iggy *f, char *string, S32 stringlen); +RADEXPFUNC rrbool RADEXPLINK IggyPlayerCut(Iggy *f); + +#define IGGY_PLAYER_COPY_no_focused_textfield -1 +#define IGGY_PLAYER_COPY_textfield_has_no_selection 0 +RADEXPFUNC S32 RADEXPLINK IggyPlayerCopyUTF16(Iggy *f, U16 *buffer, S32 bufferlen); +RADEXPFUNC S32 RADEXPLINK IggyPlayerCopyUTF8(Iggy *f, char *buffer, S32 bufferlen); + + +//////////////////////////////////////////////////////////// +// +// IME +// + +#ifdef __RADNT__ +#define IGGY_IME_SUPPORT +#endif + +RADEXPFUNC void RADEXPLINK IggyPlayerSetIMEFontUTF8(Iggy *f, const char *font_name_utf8, S32 namelen_in_bytes); +RADEXPFUNC void RADEXPLINK IggyPlayerSetIMEFontUTF16(Iggy *f, const IggyUTF16 *font_name_utf16, S32 namelen_in_2byte_words); + +#ifdef IGGY_IME_SUPPORT + +#define IGGY_IME_MAX_CANDIDATE_LENGTH 256 // matches def in ImeUi.cpp, so no overflow checks needed when copying out. + +IDOCN typedef enum { + IGGY_IME_COMPOSITION_STYLE_NONE, + IGGY_IME_COMPOSITION_STYLE_UNDERLINE_DOTTED, + IGGY_IME_COMPOSITION_STYLE_UNDERLINE_DOTTED_THICK, + IGGY_IME_COMPOSITION_STYLE_UNDERLINE_SOLID, + IGGY_IME_COMPOSITION_STYLE_UNDERLINE_SOLID_THICK, +} IggyIMECompositionDrawStyle; + +IDOCN typedef enum { + IGGY_IME_COMPOSITION_CLAUSE_NORMAL, + IGGY_IME_COMPOSITION_CLAUSE_START, +} IggyIMECompositionClauseState; + +IDOCN typedef struct +{ + IggyUTF16 str[IGGY_IME_MAX_CANDIDATE_LENGTH]; + IggyIMECompositionDrawStyle char_style[IGGY_IME_MAX_CANDIDATE_LENGTH]; + IggyIMECompositionClauseState clause_state[IGGY_IME_MAX_CANDIDATE_LENGTH]; + S32 cursor_pos; + rrbool display_block_cursor; + int candicate_clause_start_pos; + int candicate_clause_end_pos; // inclusive +} IggyIMECompostitionStringState; + +IDOCN RADEXPFUNC void RADEXPLINK IggyIMEWin32SetCompositionState(Iggy* f, IggyIMECompostitionStringState* s); + +IDOCN RADEXPFUNC void RADEXPLINK IggyIMEGetTextExtents(Iggy* f, U32* pdw, U32* pdh, const IggyUTF16* str, U32 text_height); +IDOCN RADEXPFUNC void RADEXPLINK IggyIMEDrawString(Iggy* f, S32 px, S32 py, const IggyUTF16* str, U32 text_height, const U8 rgba[4]); + +IDOCN RADEXPFUNC void RADEXPLINK IggyIMEWin32GetCandidatePosition(Iggy* f, F32* pdx, F32* pdy, F32* pdcomp_str_height); +IDOCN RADEXPFUNC void* RADEXPLINK IggyIMEGetFocusedTextfield(Iggy* f); +IDOCN RADEXPFUNC void RADEXPLINK IggyIMEDrawRect(S32 x0, S32 y0, S32 x1, S32 y1, const U8 rgb[3]); + +#endif + +//////////////////////////////////////////////////////////// +// +// Input focus handling +// + +typedef void *IggyFocusHandle; + +#define IGGY_FOCUS_NULL 0 + +typedef struct +{ + IggyFocusHandle object; // unique identifier of Iggy object + F32 x0, y0, x1, y1; // bounding box of displayed shape +} IggyFocusableObject; + +RADEXPFUNC rrbool RADEXPLINK IggyPlayerGetFocusableObjects(Iggy *f, IggyFocusHandle *current_focus, + IggyFocusableObject *objs, S32 max_obj, S32 *num_obj); +RADEXPFUNC void RADEXPLINK IggyPlayerSetFocusRS(Iggy *f, IggyFocusHandle object, int focus_key_char); + +//////////////////////////////////////////////////////////// +// +// GDraw helper functions accessors +// + +RADEXPFUNC void * RADEXPLINK IggyGDrawMalloc(SINTa size); +#define IggyGDrawMalloc(size) IggyGDrawMallocAnnotated(size, __FILE__, __LINE__) IDOCN +IDOCN RADEXPFUNC void * RADEXPLINK IggyGDrawMallocAnnotated(SINTa size, const char *file, int line); + +RADEXPFUNC void RADEXPLINK IggyGDrawFree(void *ptr); +RADEXPFUNC void RADEXPLINK IggyGDrawSendWarning(Iggy *f, char const *message, ...); +RADEXPFUNC void RADEXPLINK IggyWaitOnFence(void *id, U32 fence); +RADEXPFUNC void RADEXPLINK IggyDiscardVertexBufferCallback(void *owner, void *vertex_buffer); +RADEXPFUNC void RADEXPLINK IggyPlayerDebugEnableFilters(Iggy *f, rrbool enable); +RADEXPFUNC void RADEXPLINK IggyPlayerDebugSetTime(Iggy *f, F64 time); + +IDOCN RADEXPFUNC void RADEXPLINK IggyPlayerDebugBatchStartFrame(void); +IDOCN RADEXPFUNC void RADEXPLINK IggyPlayerDebugBatchInit(void); +IDOCN RADEXPFUNC void RADEXPLINK IggyPlayerDebugBatchMove(S32 dir); +IDOCN RADEXPFUNC void RADEXPLINK IggyPlayerDebugBatchSplit(void); +IDOCN RADEXPFUNC void RADEXPLINK IggyPlayerDebugBatchChooseEnd(S32 end); + +//////////////////////////////////////////////////////////// +// +// debugging +// + +IDOCN RADEXPFUNC void RADEXPLINK IggyPlayerDebugUpdateReadyToTickWithFakeRender(Iggy *f); +IDOCN RADEXPFUNC void RADEXPLINK IggyDebugBreakOnAS3Exception(void); + + +typedef struct +{ + S32 size; + char *source_file; + S32 source_line; + char *iggy_file; + char *info; +} IggyLeakResultData; + +typedef void RADLINK IggyLeakResultCallback(IggyLeakResultData *data); + +typedef struct +{ + char *subcategory; + S32 subcategory_stringlen; + + S32 static_allocation_count; // number of non-freeable allocations for this subcategory + S32 static_allocation_bytes; // bytes of non-freeable allocations for this subcategory + + S32 dynamic_allocation_count; // number of freeable allocations for this subcategory + S32 dynamic_allocation_bytes; // estimated bytes of freeable allocations for this subcategory +} IggyMemoryUseInfo; + +RADEXPFUNC rrbool RADEXPLINK IggyDebugGetMemoryUseInfo(Iggy *player, IggyLibrary lib, char const *category_string, S32 category_stringlen, S32 iteration, IggyMemoryUseInfo *data); +RADEXPFUNC void RADEXPLINK IggyDebugSetLeakResultCallback(IggyLeakResultCallback *leak_result_func); + +IDOCN RADEXPFUNC void RADEXPLINK iggy_sync_check_todisk(char *filename_or_null, U32 flags); +IDOCN RADEXPFUNC void RADEXPLINK iggy_sync_check_fromdisk(char *filename_or_null, U32 flags); +IDOCN RADEXPFUNC void RADEXPLINK iggy_sync_check_end(void); +#define IGGY_SYNCCHECK_readytotick 1U IDOCN + +RADDEFEND + +#endif diff --git a/Minecraft.Client/Durango/Iggy/include/iggyexpruntime.h b/Minecraft.Client/Durango/Iggy/include/iggyexpruntime.h new file mode 100644 index 00000000..1f1a90a1 --- /dev/null +++ b/Minecraft.Client/Durango/Iggy/include/iggyexpruntime.h @@ -0,0 +1,49 @@ +#ifndef __RAD_INCLUDE_IGGYEXPRUNTIME_H__ +#define __RAD_INCLUDE_IGGYEXPRUNTIME_H__ + +#include "rrCore.h" + +#define IDOC + +RADDEFSTART + +#ifndef __RAD_HIGGYEXP_ +#define __RAD_HIGGYEXP_ +typedef void * HIGGYEXP; +#endif + +//idoc(parent,IggyExpRuntime_API) + +#define IGGYEXP_MIN_STORAGE 1024 IDOC +/* The minimum-sized block you must provide to $IggyExpCreate */ + +IDOC RADEXPFUNC HIGGYEXP RADEXPLINK IggyExpCreate(char *ip_address, S32 port, void *storage, S32 storage_size_in_bytes); +/* Opens a connection to $IggyExplorer and returns an $HIGGYEXP wrapping the connection. + + $:ip_address The address of the machine running Iggy Explorer (can be numeric with dots, or textual, including "localhost") + $:port The port number on which Iggy Explorer is listening for a network connection (the default is 9190) + $:storage A small block of storage that needed to store the $HIGGYEXP, must be at least $IGGYEXP_MIN_STORAGE + $:storage_size_in_bytes The size of the block pointer to by storage + +Returns a NULL HIGGYEXP if the IP address/hostname can't be resolved, or no Iggy Explorer +can be contacted at the specified address/port. Otherwise returns a non-NULL $HIGGYEXP +which you can pass to $IggyUseExplorer. */ + +IDOC RADEXPFUNC void RADEXPLINK IggyExpDestroy(HIGGYEXP p); +/* Closes and destroys a connection to $IggyExplorer */ + +IDOC RADEXPFUNC rrbool RADEXPLINK IggyExpCheckValidity(HIGGYEXP p); +/* Checks if the connection represented by an $HIGGYEXP is still valid, i.e. +still connected to $IggyExplorer. + +Returns true if the connection is still valid; returns false if it is not valid. + +This might happen if someone closes Iggy Explorer, Iggy Explorer crashes, or +the network fails. You can this to poll and detect these conditions and do +something in response, such as trying to open a new connection. + +An invalid $HIGGYEXP must still be shutdown with $IggyExpDestroy. */ + +RADDEFEND + +#endif//__RAD_INCLUDE_IGGYEXPRUNTIME_H__ \ No newline at end of file diff --git a/Minecraft.Client/Durango/Iggy/include/iggyperfmon.h b/Minecraft.Client/Durango/Iggy/include/iggyperfmon.h new file mode 100644 index 00000000..85b84b60 --- /dev/null +++ b/Minecraft.Client/Durango/Iggy/include/iggyperfmon.h @@ -0,0 +1,89 @@ +// $$COPYRIGHT$$ + +#ifndef __RAD_INCLUDE_IGGYPERFMON_H__ +#define __RAD_INCLUDE_IGGYPERFMON_H__ + +#include "rrCore.h" + +#define IDOC + +RADDEFSTART + +#ifndef __RAD_HIGGYPERFMON_ +#define __RAD_HIGGYPERFMON_ +typedef void * HIGGYPERFMON; +#endif + +//idoc(parent,IggyPerfmon_API) + +typedef void * RADLINK iggyperfmon_malloc(void *handle, U32 size); +typedef void RADLINK iggyperfmon_free(void *handle, void *ptr); + +IDOC RADEXPFUNC HIGGYPERFMON RADEXPLINK IggyPerfmonCreate(iggyperfmon_malloc *perf_malloc, iggyperfmon_free *perf_free, void *callback_handle); +/* Creates an IggyPerfmon. + +You must supply allocator functions. The amount allocated depends on the complexity +of the Iggys being profiled. */ + +typedef struct Iggy Iggy; +typedef struct GDrawFunctions GDrawFunctions; + +IDOC typedef union { + U32 bits; + struct { + U32 dpad_up :1; + U32 dpad_down :1; + U32 dpad_left :1; + U32 dpad_right :1; + U32 button_up :1; // XBox Y, PS3 tri + U32 button_down :1; // XBox A, PS3 X + U32 button_left :1; // XBox X, PS3 square + U32 button_right :1; // XBox B, PS3 circle + U32 shoulder_left_hi :1; // LB/L1 + U32 shoulder_right_hi :1; // RB/R1 + U32 trigger_left_low :1; + U32 trigger_right_low :1; + } field; +} IggyPerfmonPad; + +#define IggyPerfmonPadFromXInputStatePointer(pad, xis) \ + (pad).bits = 0, \ + (pad).field.dpad_up = 0 != ((xis)->Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_UP), \ + (pad).field.dpad_down = 0 != ((xis)->Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_DOWN), \ + (pad).field.dpad_left = 0 != ((xis)->Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_LEFT), \ + (pad).field.dpad_right = 0 != ((xis)->Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_RIGHT), \ + (pad).field.button_up = 0 != ((xis)->Gamepad.wButtons & XINPUT_GAMEPAD_Y), \ + (pad).field.button_down = 0 != ((xis)->Gamepad.wButtons & XINPUT_GAMEPAD_A), \ + (pad).field.button_left = 0 != ((xis)->Gamepad.wButtons & XINPUT_GAMEPAD_X), \ + (pad).field.button_right = 0 != ((xis)->Gamepad.wButtons & XINPUT_GAMEPAD_B), \ + (pad).field.shoulder_left_hi = 0 != ((xis)->Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_SHOULDER), \ + (pad).field.shoulder_right_hi = 0 != ((xis)->Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_SHOULDER), \ + (pad).field.trigger_left_low = 0 != ((xis)->Gamepad.bLeftTrigger >= XINPUT_GAMEPAD_TRIGGER_THRESHOLD), \ + (pad).field.trigger_right_low = 0 != ((xis)->Gamepad.bRightTrigger >= XINPUT_GAMEPAD_TRIGGER_THRESHOLD) + +// All positions in window coords +IDOC RADEXPFUNC void RADEXPLINK IggyPerfmonTickAndDraw(HIGGYPERFMON p, GDrawFunctions* gdraw_funcs, + const IggyPerfmonPad* pad, + int pm_tile_ul_x, int pm_tile_ul_y, int pm_tile_lr_x, int pm_tile_lr_y); +/* Draw and tick an IggyPerfmon. + +$:p A perfmon context previously created with IggyPerfmonCreate +$:gdraw_functions The same GDraw handle used for rendering Iggy +$:pad An abstracted gamepad state structure. iggyperfmon.h +includes an example that initializes the abstract gamepad from a 360 controller +as defined by XInput; this will work on both Windows and the Xbox 360. +$:pm_tile_ul_x The left coordinate of the rectangle where the perfmon display should be drawn +$:pm_tile_ul_y The top coordinate of the rectangle where the perfmon display should be drawn +$:pm_tile_lr_x The right coordinate of the rectangle where the perfmon display should be drawn +$:pm_tile_lr_y The bottom coordinate of the rectangle where the perfmon display should be drawn + +You should only call this function when you want Iggy Perfmon to be visible. +See $IggyPerfmon for more information. */ + +IDOC RADEXPFUNC void RADEXPLINK IggyPerfmonDestroy(HIGGYPERFMON p, GDrawFunctions* iggy_draw); +/* Closes and destroys an IggyPerfmon */ + + +RADDEFEND + +#endif//__RAD_INCLUDE_IGGYPERFMON_H__ \ No newline at end of file diff --git a/Minecraft.Client/Durango/Iggy/include/rrCore.h b/Minecraft.Client/Durango/Iggy/include/rrCore.h new file mode 100644 index 00000000..e88b5f8c --- /dev/null +++ b/Minecraft.Client/Durango/Iggy/include/rrCore.h @@ -0,0 +1,2322 @@ +/// ======================================================================== +// (C) Copyright 1994- 2014 RAD Game Tools, Inc. Global types header file +// ======================================================================== + +#ifndef __RADRR_COREH__ +#define __RADRR_COREH__ +#define RADCOPYRIGHT "Copyright (C) 1994-2014, RAD Game Tools, Inc." + +// __RAD16__ means 16 bit code (Win16) +// __RAD32__ means 32 bit code (DOS, Win386, Win32s, Mac AND Win64) +// __RAD64__ means 64 bit code (x64) + +// Note oddness - __RAD32__ essentially means "at *least* 32-bit code". +// So, on 64-bit systems, both __RAD32__ and __RAD64__ will be defined. + +// __RADDOS__ means DOS code (16 or 32 bit) +// __RADWIN__ means Windows API (Win16, Win386, Win32s, Win64, Xbox, Xenon) +// __RADWINEXT__ means Windows 386 extender (Win386) +// __RADNT__ means Win32 or Win64 code +// __RADWINRTAPI__ means Windows RT API (Win 8, Win Phone, ARM, Durango) +// __RADMAC__ means Macintosh +// __RADCARBON__ means Carbon +// __RADMACH__ means MachO +// __RADXBOX__ means the XBox console +// __RADXENON__ means the Xenon console +// __RADDURANGO__ or __RADXBOXONE__ means Xbox One +// __RADNGC__ means the Nintendo GameCube +// __RADWII__ means the Nintendo Wii +// __RADWIIU__ means the Nintendo Wii U +// __RADNDS__ means the Nintendo DS +// __RADTWL__ means the Nintendo DSi (__RADNDS__ also defined) +// __RAD3DS__ means the Nintendo 3DS +// __RADPS2__ means the Sony PlayStation 2 +// __RADPSP__ means the Sony PlayStation Portable +// __RADPS3__ means the Sony PlayStation 3 +// __RADPS4__ means the Sony PlayStation 4 +// __RADANDROID__ means Android NDK +// __RADNACL__ means Native Client SDK +// __RADNTBUILDLINUX__ means building Linux on NT +// __RADLINUX__ means actually building on Linux (most likely with GCC) +// __RADPSP2__ means NGP +// __RADBSD__ means a BSD-style UNIX (OS X, FreeBSD, OpenBSD, NetBSD) +// __RADPOSIX__ means POSIX-compliant +// __RADQNX__ means QNX +// __RADIPHONE__ means iphone +// __RADIPHONESIM__ means iphone simulator + +// __RADX86__ means Intel x86 +// __RADMMX__ means Intel x86 MMX instructions are allowed +// __RADX64__ means Intel/AMD x64 (NOT IA64=Itanium) +// __RAD68K__ means 68K +// __RADPPC__ means PowerPC +// __RADMIPS__ means Mips (only R5900 right now) +// __RADARM__ mean ARM processors + +// __RADLITTLEENDIAN__ means processor is little-endian (x86) +// __RADBIGENDIAN__ means processor is big-endian (680x0, PPC) + +// __RADNOVARARGMACROS__ means #defines can't use ... + + #ifdef WINAPI_FAMILY + // If this is #defined, we might be in a Windows Store App. But + // VC++ by default #defines this to a symbolic name, not an integer + // value, and those names are defined in "winapifamily.h". So if + // WINAPI_FAMILY is #defined, #include the header so we can parse it. + #include + #define RAD_WINAPI_IS_APP (!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) + #else + #define RAD_WINAPI_IS_APP 0 + #endif + + #ifndef __RADRES__ + // Theoretically, this is to pad structs on platforms that don't support pragma pack or do it poorly. (PS3, PS2) + // In general it is assumed that your padding is set via pragma, so this is just a struct. + #define RADSTRUCT struct + + #ifdef __GNUC_MINOR__ + // make a combined GCC version for testing : + + #define __RAD_GCC_VERSION__ (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100 \ + + __GNUC_PATCHLEVEL__) + + /* Test for GCC > 3.2.0 */ + // #if GCC_VERSION > 30200 + #endif + + #if defined(__RADX32__) + + #define __RADX86__ + #define __RADMMX__ + #define __RAD32__ + #define __RADLITTLEENDIAN__ + #define RADINLINE inline + #define RADRESTRICT __restrict + + // known platforms under the RAD generic build type + #if defined(_WIN32) || defined(_Windows) || defined(WIN32) || defined(__WINDOWS__) || defined(_WINDOWS) + #define __RADNT__ + #define __RADWIN__ + #elif (defined(__MWERKS__) && !defined(__INTEL__)) || defined(__MRC__) || defined(THINK_C) || defined(powerc) || defined(macintosh) || defined(__powerc) || defined(__APPLE__) || defined(__MACH__) + #define __RADMAC__ + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + #elif defined(__linux__) + #define __RADLINUX__ + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + #endif + +#elif defined(ANDROID) + #define __RADANDROID__ + #define __RAD32__ + #define __RADLITTLEENDIAN__ + #ifdef __i386__ + #define __RADX86__ + #else + #define __RADARM__ + #endif + #define RADINLINE inline + #define RADRESTRICT __restrict + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + +#elif defined(__QNX__) + #define __RAD32__ + #define __RADQNX__ + +#ifdef __arm__ + #define __RADARM__ +#elif defined __i386__ + #define __RADX86__ +#else + #error Unknown processor +#endif + #define __RADLITTLEENDIAN__ + #define RADINLINE inline + #define RADRESTRICT __restrict + + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) +#elif defined(__linux__) && defined(__arm__) //This should pull in Raspberry Pi as well + + #define __RAD32__ + #define __RADLINUX__ + #define __RADARM__ + #define __RADLITTLEENDIAN__ + #define RADINLINE inline + #define RADRESTRICT __restrict + + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + +#elif defined(__native_client__) + #define __RADNACL__ + #define __RAD32__ + #define __RADLITTLEENDIAN__ + #define __RADX86__ + #define RADINLINE inline + #define RADRESTRICT __restrict + + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + + #elif defined(_DURANGO) || defined(_SEKRIT) || defined(_SEKRIT1) || defined(_XBOX_ONE) + + #define __RADDURANGO__ 1 + #define __RADXBOXONE__ 1 + #if !defined(__RADSEKRIT__) // keep sekrit around for a bit for compat + #define __RADSEKRIT__ 1 + #endif + + #define __RADWIN__ + #define __RAD32__ + #define __RAD64__ + #define __RADX64__ + #define __RADMMX__ + #define __RADX86__ + #define __RAD64REGS__ + #define __RADLITTLEENDIAN__ + #define RADINLINE __inline + #define RADRESTRICT __restrict + #define __RADWINRTAPI__ + + #elif defined(__ORBIS__) + + #define __RADPS4__ + #if !defined(__RADSEKRIT2__) // keep sekrit2 around for a bit for compat + #define __RADSEKRIT2__ 1 + #endif + #define __RAD32__ + #define __RAD64__ + #define __RADX64__ + #define __RADMMX__ + #define __RADX86__ + #define __RAD64REGS__ + #define __RADLITTLEENDIAN__ + #define RADINLINE inline + #define RADRESTRICT __restrict + + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + + #elif defined(WINAPI_FAMILY) && RAD_WINAPI_IS_APP + + #define __RADWINRTAPI__ + #define __RADWIN__ + #define RADINLINE __inline + #define RADRESTRICT __restrict + + #if defined(_M_IX86) // WinRT on x86 + + #define __RAD32__ + #define __RADX86__ + #define __RADMMX__ + #define __RADLITTLEENDIAN__ + + #elif defined(_M_X64) // WinRT on x64 + #define __RAD32__ + #define __RAD64__ + #define __RADX86__ + #define __RADX64__ + #define __RADMMX__ + #define __RAD64REGS__ + #define __RADLITTLEENDIAN__ + + #elif defined(_M_ARM) // WinRT on ARM + + #define __RAD32__ + #define __RADARM__ + #define __RADLITTLEENDIAN__ + + #else + + #error Unrecognized WinRT platform! + + #endif + + #elif defined(_WIN64) + + #define __RADWIN__ + #define __RADNT__ + // See note at top for why both __RAD32__ and __RAD64__ are defined. + #define __RAD32__ + #define __RAD64__ + #define __RADX64__ + #define __RADMMX__ + #define __RADX86__ + #define __RAD64REGS__ + #define __RADLITTLEENDIAN__ + #define RADINLINE __inline + #define RADRESTRICT __restrict + + #elif defined(GENERIC_ARM) + + #define __RAD32__ + #define __RADARM__ + #define __RADLITTLEENDIAN__ + #define __RADFIXEDPOINT__ + #define RADINLINE inline + #if (defined(__GCC__) || defined(__GNUC__)) + #define RADRESTRICT __restrict + #else + #define RADRESTRICT // __restrict not supported on cw + #endif + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + + #elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it + + #define __RADWIIU__ + #define __RAD32__ + #define __RADPPC__ + #define __RADBIGENDIAN__ + #define RADINLINE inline + #define RADRESTRICT __restrict + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + + + #elif defined(HOLLYWOOD_REV) || defined(REVOLUTION) + + #define __RADWII__ + #define __RAD32__ + #define __RADPPC__ + #define __RADBIGENDIAN__ + #define RADINLINE inline + #define RADRESTRICT __restrict + + #elif defined(NN_PLATFORM_CTR) + + #define __RAD3DS__ + #define __RAD32__ + #define __RADARM__ + #define __RADLITTLEENDIAN__ + #define RADINLINE inline + #define RADRESTRICT + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + + #elif defined(GEKKO) + + #define __RADNGC__ + #define __RAD32__ + #define __RADPPC__ + #define __RADBIGENDIAN__ + #define RADINLINE inline + #define RADRESTRICT // __restrict not supported on cw + + #elif defined(SDK_ARM9) || defined(SDK_TWL) || (defined(__arm) && defined(__MWERKS__)) + + #define __RADNDS__ + #define __RAD32__ + #define __RADARM__ + #define __RADLITTLEENDIAN__ + #define __RADFIXEDPOINT__ + #define RADINLINE inline + #if (defined(__GCC__) || defined(__GNUC__)) + #define RADRESTRICT __restrict + #else + #define RADRESTRICT // __restrict not supported on cw + #endif + + #if defined(SDK_TWL) + #define __RADTWL__ + #endif + + #elif defined(R5900) + + #define __RADPS2__ + #define __RAD32__ + #define __RADMIPS__ + #define __RADLITTLEENDIAN__ + #define RADINLINE inline + #define RADRESTRICT __restrict + #define __RAD64REGS__ + #define U128 u_long128 + + #if !defined(__MWERKS__) + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + #endif + + #elif defined(__psp__) + + #define __RADPSP__ + #define __RAD32__ + #define __RADMIPS__ + #define __RADLITTLEENDIAN__ + #define RADINLINE inline + #define RADRESTRICT __restrict + + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + + #elif defined(__psp2__) + + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + + #define __RADPSP2__ + #define __RAD32__ + #define __RADARM__ + #define __RADLITTLEENDIAN__ + #define RADINLINE inline + #define RADRESTRICT __restrict + + // need packed attribute for struct with snc? + #elif defined(__CELLOS_LV2__) + + // CB change : 10-29-10 : RAD64REGS on PPU but NOT SPU + + #ifdef __SPU__ + #define __RADSPU__ + #define __RAD32__ + #define __RADCELL__ + #define __RADBIGENDIAN__ + #define RADINLINE inline + #define RADRESTRICT __restrict + #else + #define __RAD64REGS__ + #define __RADPS3__ + #define __RADPPC__ + #define __RAD32__ + #define __RADCELL__ + #define __RADBIGENDIAN__ + #define RADINLINE inline + #define RADRESTRICT __restrict + #define __RADALTIVEC__ + #endif + + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + + #ifndef __LP32__ + #error "PS3 32bit ABI support only" + #endif + #elif (defined(__MWERKS__) && !defined(__INTEL__)) || defined(__MRC__) || defined(THINK_C) || defined(powerc) || defined(macintosh) || defined(__powerc) || defined(__APPLE__) || defined(__MACH__) + #ifdef __APPLE__ + #include "TargetConditionals.h" + #endif + + #if ((defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) || (defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR)) + + // iPhone/iPad/iOS + #define __RADIPHONE__ + #define __RADMACAPI__ + + #define __RAD32__ + #if defined(__x86_64__) + #define __RAD64__ + #endif + + #define __RADLITTLEENDIAN__ + #define RADINLINE inline + #define RADRESTRICT __restrict + #define __RADMACH__ + + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + + #if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR + #if defined( __x86_64__) + #define __RADX64__ + #else + #define __RADX86__ + #endif + #define __RADIPHONESIM__ + #elif defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE + #define __RADARM__ + #endif + #else + + // An actual MacOSX machine + #define __RADMAC__ + #define __RADMACAPI__ + + #if defined(powerc) || defined(__powerc) || defined(__ppc__) + #define __RADPPC__ + #define __RADBIGENDIAN__ + #define __RADALTIVEC__ + #define RADRESTRICT + #elif defined(__i386__) + #define __RADX86__ + #define __RADMMX__ + #define __RADLITTLEENDIAN__ + #define RADRESTRICT __restrict + #elif defined(__x86_64__) + #define __RAD32__ + #define __RAD64__ + #define __RADX86__ + #define __RADX64__ + #define __RAD64REGS__ + #define __RADMMX__ + #define __RADLITTLEENDIAN__ + #define RADRESTRICT __restrict + #else + #define __RAD68K__ + #define __RADBIGENDIAN__ + #define __RADALTIVEC__ + #define RADRESTRICT + #endif + + #define __RAD32__ + + #if defined(__MWERKS__) + #if (defined(__cplusplus) || ! __option(only_std_keywords)) + #define RADINLINE inline + #endif + #ifdef __MACH__ + #define __RADMACH__ + #endif + #elif defined(__MRC__) + #if defined(__cplusplus) + #define RADINLINE inline + #endif + #elif defined(__GNUC__) || defined(__GNUG__) || defined(__MACH__) + #define RADINLINE inline + #define __RADMACH__ + + #undef RADRESTRICT /* could have been defined above... */ + #define RADRESTRICT __restrict + + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + #endif + + #ifdef __RADX86__ + #ifndef __RADCARBON__ + #define __RADCARBON__ + #endif + #endif + + #ifdef TARGET_API_MAC_CARBON + #if TARGET_API_MAC_CARBON + #ifndef __RADCARBON__ + #define __RADCARBON__ + #endif + #endif + #endif + #endif + #elif defined(__linux__) + + #define __RADLINUX__ + #define __RADMMX__ + #define __RADLITTLEENDIAN__ + #define __RADX86__ + #ifdef __x86_64 + #define __RAD32__ + #define __RAD64__ + #define __RADX64__ + #define __RAD64REGS__ + #else + #define __RAD32__ + #endif + #define RADINLINE inline + #define RADRESTRICT __restrict + + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + + #else + + #if _MSC_VER >= 1400 + #undef RADRESTRICT + #define RADRESTRICT __restrict + #else + #define RADRESTRICT + #define __RADNOVARARGMACROS__ + #endif + + #if defined(_XENON) || ( defined(_XBOX_VER) && (_XBOX_VER == 200) ) + // Remember that Xenon also defines _XBOX + #define __RADPPC__ + #define __RADBIGENDIAN__ + #define __RADALTIVEC__ + #else + #define __RADX86__ + #define __RADMMX__ + #define __RADLITTLEENDIAN__ + #endif + + #ifdef __MWERKS__ + #define _WIN32 + #endif + + #ifdef __DOS__ + #define __RADDOS__ + #define S64_DEFINED // turn off these types + #define U64_DEFINED + #define S64 double //should error + #define U64 double //should error + #define __RADNOVARARGMACROS__ + #endif + + #ifdef __386__ + #define __RAD32__ + #endif + + #ifdef _Windows //For Borland + #ifdef __WIN32__ + #define WIN32 + #else + #define __WINDOWS__ + #endif + #endif + + #ifdef _WINDOWS //For MS + #ifndef _WIN32 + #define __WINDOWS__ + #endif + #endif + + #ifdef _WIN32 + #if defined(_XENON) || ( defined(_XBOX_VER) && (_XBOX_VER == 200) ) + // Remember that Xenon also defines _XBOX + #define __RADXENON__ + #define __RAD64REGS__ + #elif defined(_XBOX) + #define __RADXBOX__ + #elif !defined(__RADWINRTAPI__) + #define __RADNT__ + #endif + #define __RADWIN__ + #define __RAD32__ + #else + #ifdef __NT__ + #if defined(_XENON) || (_XBOX_VER == 200) + // Remember that Xenon also defines _XBOX + #define __RADXENON__ + #define __RAD64REGS__ + #elif defined(_XBOX) + #define __RADXBOX__ + #else + #define __RADNT__ + #endif + #define __RADWIN__ + #define __RAD32__ + #else + #ifdef __WINDOWS_386__ + #define __RADWIN__ + #define __RADWINEXT__ + #define __RAD32__ + #define S64_DEFINED // turn off these types + #define U64_DEFINED + #define S64 double //should error + #define U64 double //should error + #else + #ifdef __WINDOWS__ + #define __RADWIN__ + #define __RAD16__ + #else + #ifdef WIN32 + #if defined(_XENON) || (_XBOX_VER == 200) + // Remember that Xenon also defines _XBOX + #define __RADXENON__ + #elif defined(_XBOX) + #define __RADXBOX__ + #else + #define __RADNT__ + #endif + #define __RADWIN__ + #define __RAD32__ + #endif + #endif + #endif + #endif + #endif + + #ifdef __WATCOMC__ + #define RADINLINE + #else + #define RADINLINE __inline + #endif + #endif + + #if defined __RADMAC__ || defined __RADIPHONE__ + #define __RADBSD__ + #endif + + #if defined __RADBSD__ || defined __RADLINUX__ + #define __RADPOSIX__ + #endif + + #if (!defined(__RADDOS__) && !defined(__RADWIN__) && !defined(__RADMAC__) && \ + !defined(__RADNGC__) && !defined(__RADNDS__) && !defined(__RADXBOX__) && \ + !defined(__RADXENON__) && !defined(__RADDURANGO__) && !defined(__RADPS4__) && !defined(__RADLINUX__) && !defined(__RADPS2__) && \ + !defined(__RADPSP__) && !defined(__RADPSP2__) && !defined(__RADPS3__) && !defined(__RADSPU__) && \ + !defined(__RADWII__) && !defined(__RADIPHONE__) && !defined(__RADX32__) && !defined(__RADARM__) && \ + !defined(__RADWIIU__) && !defined(__RADANDROID__) && !defined(__RADNACL__) && !defined (__RADQNX__) ) + #error "RAD.H did not detect your platform. Define DOS, WINDOWS, WIN32, macintosh, powerpc, or appropriate console." + #endif + + + #ifdef __RADFINAL__ + #define RADTODO(str) { char __str[0]=str; } + #else + #define RADTODO(str) + #endif + + #ifdef __RADX32__ + #if defined(_MSC_VER) + #define RADLINK __stdcall + #define RADEXPLINK __stdcall + #else + #define RADLINK __attribute__((stdcall)) + #define RADEXPLINK __attribute__((stdcall)) + #endif + #define RADEXPFUNC RADDEFFUNC + + #elif (defined(__RADNGC__) || defined(__RADWII__) || defined( __RADPS2__) || \ + defined(__RADPSP__) || defined(__RADPSP2__) || defined(__RADPS3__) || \ + defined(__RADSPU__) || defined(__RADNDS__) || defined(__RADIPHONE__) || \ + (defined(__RADARM__) && !defined(__RADWINRTAPI__)) || defined(__RADWIIU__) || defined(__RADPS4__) ) + + #define RADLINK + #define RADEXPLINK + #define RADEXPFUNC RADDEFFUNC + #define RADASMLINK + + #elif defined(__RADANDROID__) + #define RADLINK + #define RADEXPLINK + #define RADEXPFUNC RADDEFFUNC + #define RADASMLINK + #elif defined(__RADNACL__) + #define RADLINK + #define RADEXPLINK + #define RADEXPFUNC RADDEFFUNC + #define RADASMLINK + #elif defined(__RADLINUX__) || defined (__RADQNX__) + + #ifdef __RAD64__ + #define RADLINK + #define RADEXPLINK + #else + #define RADLINK __attribute__((cdecl)) + #define RADEXPLINK __attribute__((cdecl)) + #endif + + #define RADEXPFUNC RADDEFFUNC + #define RADASMLINK + + #elif defined(__RADMAC__) + + // this define is for CodeWarrior 11's stupid new libs (even though + // we don't use longlong's). + + #define __MSL_LONGLONG_SUPPORT__ + + #define RADLINK + #define RADEXPLINK + + #if defined(__CFM68K__) || defined(__MWERKS__) + #ifdef __RADINDLL__ + #define RADEXPFUNC RADDEFFUNC __declspec(export) + #else + #define RADEXPFUNC RADDEFFUNC __declspec(import) + #endif + #else + #if defined(__RADMACH__) && !defined(__MWERKS__) + #ifdef __RADINDLL__ + #define RADEXPFUNC RADDEFFUNC __attribute__((visibility("default"))) + #else + #define RADEXPFUNC RADDEFFUNC + #endif + #else + #define RADEXPFUNC RADDEFFUNC + #endif + #endif + #define RADASMLINK + + #else + + #ifdef __RADNT__ + #ifndef _WIN32 + #define _WIN32 + #endif + #ifndef WIN32 + #define WIN32 + #endif + #endif + + #ifdef __RADWIN__ + #ifdef __RAD32__ + + #ifdef __RADXBOX__ + + #define RADLINK __stdcall + #define RADEXPLINK __stdcall + #define RADEXPFUNC RADDEFFUNC + + #elif defined(__RADXENON__) || defined(__RADDURANGO__) + + #define RADLINK __stdcall + #define RADEXPLINK __stdcall + + #define RADEXPFUNC RADDEFFUNC + + #elif defined(__RADWINRTAPI__) + + #define RADLINK __stdcall + #define RADEXPLINK __stdcall + + #if ( defined(__RADINSTATICLIB__) || defined(__RADNOEXPORTS__ ) || ( defined(__RADNOEXEEXPORTS__) && ( !defined(__RADINDLL__) ) && ( !defined(__RADINSTATICLIB__) ) ) ) + #define RADEXPFUNC RADDEFFUNC + #else + #ifndef __RADINDLL__ + #define RADEXPFUNC RADDEFFUNC __declspec(dllimport) + #else + #define RADEXPFUNC RADDEFFUNC __declspec(dllexport) + #endif + #endif + + #elif defined(__RADNTBUILDLINUX__) + + #define RADLINK __cdecl + #define RADEXPLINK __cdecl + #define RADEXPFUNC RADDEFFUNC + + #else + #ifdef __RADNT__ + + #define RADLINK __stdcall + #define RADEXPLINK __stdcall + + #if ( defined(__RADINSTATICLIB__) || defined(__RADNOEXPORTS__ ) || ( defined(__RADNOEXEEXPORTS__) && ( !defined(__RADINDLL__) ) && ( !defined(__RADINSTATICLIB__) ) ) ) + #define RADEXPFUNC RADDEFFUNC + #else + #ifndef __RADINDLL__ + #define RADEXPFUNC RADDEFFUNC __declspec(dllimport) + #ifdef __BORLANDC__ + #if __BORLANDC__<=0x460 + #undef RADEXPFUNC + #define RADEXPFUNC RADDEFFUNC + #endif + #endif + #else + #define RADEXPFUNC RADDEFFUNC __declspec(dllexport) + #endif + #endif + #else + #define RADLINK __pascal + #define RADEXPLINK __far __pascal + #define RADEXPFUNC RADDEFFUNC + #endif + #endif + #else + #define RADLINK __pascal + #define RADEXPLINK __far __pascal __export + #define RADEXPFUNC RADDEFFUNC + #endif + #else + #define RADLINK __pascal + #define RADEXPLINK __pascal + #define RADEXPFUNC RADDEFFUNC + #endif + + #define RADASMLINK __cdecl + + #endif + + #if !defined(__RADXBOX__) && !defined(__RADXENON__) && !defined(__RADDURANGO__) && !defined(__RADXBOXONE__) + #ifdef __RADWIN__ + #ifndef _WINDOWS + #define _WINDOWS + #endif + #endif + #endif + + #ifdef __RADLITTLEENDIAN__ + #ifdef __RADBIGENDIAN__ + #error both endians !? + #endif + #endif + + #if !defined(__RADLITTLEENDIAN__) && !defined(__RADBIGENDIAN__) + #error neither endian! + #endif + + + //----------------------------------------------------------------- + + #ifndef RADDEFFUNC + + #ifdef __cplusplus + #define RADDEFFUNC extern "C" + #define RADDEFSTART extern "C" { + #define RADDEFEND } + #define RADDEFINEDATA extern "C" + #define RADDECLAREDATA extern "C" + #define RADDEFAULT( val ) =val + + #define RR_NAMESPACE rr + #define RR_NAMESPACE_START namespace RR_NAMESPACE { + #define RR_NAMESPACE_END }; + #define RR_NAMESPACE_USE using namespace RR_NAMESPACE; + + #else + #define RADDEFFUNC + #define RADDEFSTART + #define RADDEFEND + #define RADDEFINEDATA + #define RADDECLAREDATA extern + #define RADDEFAULT( val ) + + #define RR_NAMESPACE + #define RR_NAMESPACE_START + #define RR_NAMESPACE_END + #define RR_NAMESPACE_USE + + #endif + + #endif + + // probably s.b: RAD_DECLARE_ALIGNED(type, name, alignment) + #if (defined(__RADWII__) || defined(__RADWIIU__) || defined(__RADPSP__) || defined(__RADPSP2__) || \ + defined(__RADPS3__) || defined(__RADSPU__) || defined(__RADPS4__) || \ + defined(__RADLINUX__) || defined(__RADMAC__)) || defined(__RADNDS__) || defined(__RAD3DS__) || \ + defined(__RADIPHONE__) || defined(__RADANDROID__) || defined (__RADQNX__) + #define RAD_ALIGN(type,var,num) type __attribute__ ((aligned (num))) var + #elif (defined(__RADNGC__) || defined(__RADPS2__)) + #define RAD_ALIGN(type,var,num) __attribute__ ((aligned (num))) type var + #elif (defined(_MSC_VER) && (_MSC_VER >= 1300)) || defined(__RADWINRTAPI__) + #define RAD_ALIGN(type,var,num) type __declspec(align(num)) var + #else + // NOTE: / / is a guaranteed parse error in C/C++. + #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / + #endif + + // WARNING : RAD_TLS should really only be used for debug/tools stuff + // it's not reliable because even if we are built as a lib, our lib can + // be put into a DLL and then it doesn't work + #if defined(__RADNT__) || defined(__RADXENON__) + #ifndef __RADINDLL__ + // note that you can't use this in windows DLLs + #define RAD_TLS(type,var) __declspec(thread) type var + #endif + #elif defined(__RADPS3__) || defined(__RADLINUX__) || defined(__RADMAC__) + // works on PS3/gcc I believe : + #define RAD_TLS(type,var) __thread type var + #else + // RAD_TLS not defined + #endif + + // Note that __RAD16__/__RAD32__/__RAD64__ refers to the size of a pointer. + // The size of integers is specified explicitly in the code, i.e. u32 or whatever. + + #define RAD_S8 signed char + #define RAD_U8 unsigned char + + #if defined(__RAD64__) + // Remember that __RAD32__ will also be defined! + #if defined(__RADX64__) + // x64 still has 32-bit ints! + #define RAD_U32 unsigned int + #define RAD_S32 signed int + // But pointers are 64 bits. + #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) + #define RAD_SINTa __w64 signed __int64 + #define RAD_UINTa __w64 unsigned __int64 + #else // non-vc.net compiler or /Wp64 turned off + #define RAD_UINTa unsigned long long + #define RAD_SINTa signed long long + #endif + #else + #error Unknown 64-bit processor (see radbase.h) + #endif + #elif defined(__RAD32__) + #define RAD_U32 unsigned int + #define RAD_S32 signed int + // Pointers are 32 bits. + + #if ( ( defined(_MSC_VER) && (_MSC_VER >= 1300 ) ) && ( defined(_Wp64) && ( _Wp64 ) ) ) + #define RAD_SINTa __w64 signed long + #define RAD_UINTa __w64 unsigned long + #else // non-vc.net compiler or /Wp64 turned off + #ifdef _Wp64 + #define RAD_SINTa signed long + #define RAD_UINTa unsigned long + #else + #define RAD_SINTa signed int + #define RAD_UINTa unsigned int + #endif + #endif + #else + #define RAD_U32 unsigned long + #define RAD_S32 signed long + // Pointers in 16-bit land are still 32 bits. + #define RAD_UINTa unsigned long + #define RAD_SINTa signed long + #endif + + #define RAD_F32 float + #if defined(__RADPS2__) || defined(__RADPSP__) + typedef RADSTRUCT RAD_F64 // do this so that we don't accidentally use doubles + { // while using the same space + RAD_U32 vals[ 2 ]; + } RAD_F64; + #define RAD_F64_OR_32 float // type is F64 if available, otherwise F32 + #else + #define RAD_F64 double + #define RAD_F64_OR_32 double // type is F64 if available, otherwise F32 + #endif + + #if (defined(__RADMAC__) || defined(__MRC__) || defined( __RADNGC__ ) || \ + defined(__RADLINUX__) || defined( __RADWII__ ) || defined(__RADWIIU__) || \ + defined(__RADNDS__) || defined(__RADPSP__) || defined(__RADPS3__) || defined(__RADPS4__) || \ + defined(__RADSPU__) || defined(__RADIPHONE__) || defined(__RADNACL__) || defined( __RADANDROID__) || defined( __RADQNX__ ) ) + #define RAD_U64 unsigned long long + #define RAD_S64 signed long long + #elif defined(__RADPS2__) + #define RAD_U64 unsigned long + #define RAD_S64 signed long + #elif defined(__RADARM__) + #define RAD_U64 unsigned long long + #define RAD_S64 signed long long + #elif defined(__RADX64__) || defined(__RAD32__) + #define RAD_U64 unsigned __int64 + #define RAD_S64 signed __int64 + #else + // 16-bit + typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s + { // while using the same space + RAD_U32 vals[ 2 ]; + } RAD_U64; + typedef RADSTRUCT RAD_S64 // do this so that we don't accidentally use S64s + { // while using the same space + RAD_S32 vals[ 2 ]; + } RAD_S64; + #endif + + #if defined(__RAD32__) + #define PTR4 + #define RAD_U16 unsigned short + #define RAD_S16 signed short + #else + #define PTR4 __far + #define RAD_U16 unsigned int + #define RAD_S16 signed int + #endif + + //------------------------------------------------- + // RAD_PTRBITS and such defined here without using sizeof() + // so that they can be used in align() and other macros + + #ifdef __RAD64__ + + #define RAD_PTRBITS 64 + #define RAD_PTRBYTES 8 + #define RAD_TWOPTRBYTES 16 + + #else + + #define RAD_PTRBITS 32 + #define RAD_PTRBYTES 4 + #define RAD_TWOPTRBYTES 8 + + #endif + + + //------------------------------------------------- + // UINTr = int the size of a register + + #ifdef __RAD64REGS__ + + #define RAD_UINTr RAD_U64 + #define RAD_SINTr RAD_S64 + + #else + + #define RAD_UINTr RAD_U32 + #define RAD_SINTr RAD_S32 + + #endif + + //=========================================================================== + + /* + // CB : meh this is enough of a mess that it's probably best to just let each + #if defined(__RADX86__) && defined(_MSC_VER) && _MSC_VER >= 1300 + #define __RADX86INTRIN2003__ + #endif + */ + + // RADASSUME(expr) tells the compiler that expr is always true + // RADUNREACHABLE must never be reachable - even in event of error + // eg. it's okay for compiler to generate completely invalid code after RADUNREACHABLE + + #ifdef _MSC_VER + #define RADFORCEINLINE __forceinline + #if _MSC_VER >= 1300 + #define RADNOINLINE __declspec(noinline) + #else + #define RADNOINLINE + #endif + #define RADUNREACHABLE __assume(0) + #define RADASSUME(exp) __assume(exp) + #elif defined(__clang__) + #ifdef _DEBUG + #define RADFORCEINLINE inline + #else + #define RADFORCEINLINE inline __attribute((always_inline)) + #endif + #define RADNOINLINE __attribute__((noinline)) + + #define RADUNREACHABLE __builtin_unreachable() + + #if __has_builtin(__builtin_assume) + #define RADASSUME(exp) __builtin_assume(exp) + #else + #define RADASSUME(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) __builtin_unreachable(); ) + #endif + #elif (defined(__GCC__) || defined(__GNUC__)) || defined(ANDROID) + #ifdef _DEBUG + #define RADFORCEINLINE inline + #else + #define RADFORCEINLINE inline __attribute((always_inline)) + #endif + #define RADNOINLINE __attribute__((noinline)) + + #if __RAD_GCC_VERSION__ >= 40500 + #define RADUNREACHABLE __builtin_unreachable() + #define RADASSUME(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) __builtin_unreachable(); ) + #else + #define RADUNREACHABLE RAD_INFINITE_LOOP( RR_BREAK(); ) + #define RADASSUME(exp) + #endif + #elif defined(__CWCC__) + #define RADFORCEINLINE inline + #define RADNOINLINE __attribute__((never_inline)) + #define RADUNREACHABLE + #define RADASSUME(x) (void)0 + #else + // ? #define RADFORCEINLINE ? + #define RADFORCEINLINE inline + #define RADNOINLINE + #define RADASSUME(x) (void)0 + #endif + + //=========================================================================== + + // RAD_ALIGN_HINT tells the compiler how a given pointer is aligned + // it *must* be true, but the compiler may or may not use that information + // it is not for cases where the pointer is to an inherently aligned data type, + // it's when the compiler cannot tell the alignment but you have extra information. + // eg : + // U8 * ptr = rrMallocAligned(256,16); + // RAD_ALIGN_HINT(ptr,16,0); + + #ifdef __RADSPU__ + #define RAD_ALIGN_HINT(ptr,alignment,offset) __align_hint(ptr,alignment,offset); RR_ASSERT( ((UINTa)(ptr) & ((alignment)-1)) == (UINTa)(offset) ) + #else + #define RAD_ALIGN_HINT(ptr,alignment,offset) RADASSUME( ((UINTa)(ptr) & ((alignment)-1)) == (UINTa)(offset) ) + #endif + + //=========================================================================== + + // RAD_EXPECT is to tell the compiler the *likely* value of an expression + // different than RADASSUME in that expr might not have that value + // it's use for branch code layout and static branch prediction + // condition can technically be a variable but should usually be 0 or 1 + + #if (defined(__GCC__) || defined(__GNUC__)) || defined(__clang__) + + // __builtin_expect returns value of expr + #define RAD_EXPECT(expr,cond) __builtin_expect(expr,cond) + + #else + + #define RAD_EXPECT(expr,cond) (expr) + + #endif + + // helpers for doing an if ( ) with expect : + // if ( RAD_LIKELY(expr) ) { ... } + + #define RAD_LIKELY(expr) RAD_EXPECT(expr,1) + #define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0) + + //=========================================================================== + + // __RADX86ASM__ means you can use __asm {} style inline assembly + #if defined(__RADX86__) && !defined(__RADX64__) && defined(_MSC_VER) + #define __RADX86ASM__ + #endif + + //------------------------------------------------- + // typedefs : + + #ifndef RADNOTYPEDEFS + + #ifndef S8_DEFINED + #define S8_DEFINED + typedef RAD_S8 S8; + #endif + + #ifndef U8_DEFINED + #define U8_DEFINED + typedef RAD_U8 U8; + #endif + + #ifndef S16_DEFINED + #define S16_DEFINED + typedef RAD_S16 S16; + #endif + + #ifndef U16_DEFINED + #define U16_DEFINED + typedef RAD_U16 U16; + #endif + + #ifndef S32_DEFINED + #define S32_DEFINED + typedef RAD_S32 S32; + #endif + + #ifndef U32_DEFINED + #define U32_DEFINED + typedef RAD_U32 U32; + #endif + + #ifndef S64_DEFINED + #define S64_DEFINED + typedef RAD_S64 S64; + #endif + + #ifndef U64_DEFINED + #define U64_DEFINED + typedef RAD_U64 U64; + #endif + + #ifndef F32_DEFINED + #define F32_DEFINED + typedef RAD_F32 F32; + #endif + + #ifndef F64_DEFINED + #define F64_DEFINED + typedef RAD_F64 F64; + #endif + + #ifndef F64_OR_32_DEFINED + #define F64_OR_32_DEFINED + typedef RAD_F64_OR_32 F64_OR_32; + #endif + + // UINTa and SINTa are the ints big enough for an address + + #ifndef SINTa_DEFINED + #define SINTa_DEFINED + typedef RAD_SINTa SINTa; + #endif + + #ifndef UINTa_DEFINED + #define UINTa_DEFINED + typedef RAD_UINTa UINTa; + #endif + + #ifndef UINTr_DEFINED + #define UINTr_DEFINED + typedef RAD_UINTr UINTr; + #endif + + #ifndef SINTr_DEFINED + #define SINTr_DEFINED + typedef RAD_SINTr SINTr; + #endif + + #elif !defined(RADNOTYPEDEFINES) + + #ifndef S8_DEFINED + #define S8_DEFINED + #define S8 RAD_S8 + #endif + + #ifndef U8_DEFINED + #define U8_DEFINED + #define U8 RAD_U8 + #endif + + #ifndef S16_DEFINED + #define S16_DEFINED + #define S16 RAD_S16 + #endif + + #ifndef U16_DEFINED + #define U16_DEFINED + #define U16 RAD_U16 + #endif + + #ifndef S32_DEFINED + #define S32_DEFINED + #define S32 RAD_S32 + #endif + + #ifndef U32_DEFINED + #define U32_DEFINED + #define U32 RAD_U32 + #endif + + #ifndef S64_DEFINED + #define S64_DEFINED + #define S64 RAD_S64 + #endif + + #ifndef U64_DEFINED + #define U64_DEFINED + #define U64 RAD_U64 + #endif + + #ifndef F32_DEFINED + #define F32_DEFINED + #define F32 RAD_F32 + #endif + + #ifndef F64_DEFINED + #define F64_DEFINED + #define F64 RAD_F64 + #endif + + #ifndef F64_OR_32_DEFINED + #define F64_OR_32_DEFINED + #define F64_OR_32 RAD_F64_OR_32 + #endif + + // UINTa and SINTa are the ints big enough for an address (pointer) + #ifndef SINTa_DEFINED + #define SINTa_DEFINED + #define SINTa RAD_SINTa + #endif + + #ifndef UINTa_DEFINED + #define UINTa_DEFINED + #define UINTa RAD_UINTa + #endif + + #ifndef UINTr_DEFINED + #define UINTr_DEFINED + #define UINTr RAD_UINTr + #endif + + #ifndef SINTr_DEFINED + #define SINTr_DEFINED + #define SINTr RAD_SINTr + #endif + + #endif + + /// Some error-checking. + #if defined(__RAD64__) && !defined(__RAD32__) + // See top of file for why this is. + #error __RAD64__ must not be defined without __RAD32__ (see radbase.h) + #endif + +#ifdef _MSC_VER + // microsoft compilers + + #if _MSC_VER >= 1400 + #define RAD_STATEMENT_START \ + do { + + #define RAD_STATEMENT_END_FALSE \ + __pragma(warning(push)) \ + __pragma(warning(disable:4127)) \ + } while(0) \ + __pragma(warning(pop)) + + #define RAD_STATEMENT_END_TRUE \ + __pragma(warning(push)) \ + __pragma(warning(disable:4127)) \ + } while(1) \ + __pragma(warning(pop)) + + #else + #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #endif +#else + #define RAD_USE_STANDARD_LOOP_CONSTRUCT +#endif + +#ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_STATEMENT_START \ + do { + + #define RAD_STATEMENT_END_FALSE \ + } while ( (void)0,0 ) + + #define RAD_STATEMENT_END_TRUE \ + } while ( (void)1,1 ) + +#endif + +#define RAD_STATEMENT_WRAPPER( code ) \ + RAD_STATEMENT_START \ + code \ + RAD_STATEMENT_END_FALSE + +#define RAD_INFINITE_LOOP( code ) \ + RAD_STATEMENT_START \ + code \ + RAD_STATEMENT_END_TRUE + + +// Must be placed after variable declarations for code compiled as .c +#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later +# define RR_UNUSED_VARIABLE(x) (void) x +#else +# define RR_UNUSED_VARIABLE(x) (void)(sizeof(x)) +#endif + +//----------------------------------------------- +// RR_UINT3264 is a U64 in 64-bit code and a U32 in 32-bit code +// eg. it's pointer sized and the same type as a U32/U64 of the same size +// +// @@ CB 05/21/2012 : I think RR_UINT3264 may be deprecated +// it was useful back when UINTa was /Wp64 +// but since we removed that maybe it's not anymore ? +// + +#ifdef __RAD64__ +#define RR_UINT3264 U64 +#else +#define RR_UINT3264 U32 +#endif + +//RR_COMPILER_ASSERT( sizeof(RR_UINT3264) == sizeof(UINTa) ); + +//-------------------------------------------------- + +// RR_LINESTRING is the current line number as a string +#define RR_STRINGIZE( L ) #L +#define RR_DO_MACRO( M, X ) M(X) +#define RR_STRINGIZE_DELAY( X ) RR_DO_MACRO( RR_STRINGIZE, X ) +#define RR_LINESTRING RR_STRINGIZE_DELAY( __LINE__ ) + +#define RR_CAT(X,Y) X ## Y + +// RR_STRING_JOIN joins strings in the preprocessor and works with LINESTRING +#define RR_STRING_JOIN(arg1, arg2) RR_STRING_JOIN_DELAY(arg1, arg2) +#define RR_STRING_JOIN_DELAY(arg1, arg2) RR_STRING_JOIN_IMMEDIATE(arg1, arg2) +#define RR_STRING_JOIN_IMMEDIATE(arg1, arg2) arg1 ## arg2 + +// RR_NUMBERNAME is a macro to make a name unique, so that you can use it to declare +// variable names and they won't conflict with each other +// using __LINE__ is broken in MSVC with /ZI , but __COUNTER__ is an MSVC extension that works + +#ifdef _MSC_VER + #define RR_NUMBERNAME(name) RR_STRING_JOIN(name,__COUNTER__) +#else + #define RR_NUMBERNAME(name) RR_STRING_JOIN(name,__LINE__) +#endif + +//-------------------------------------------------- +// current plan is to use "rrbool" with plain old "true" and "false" +// if true and false give us trouble we might have to go to rrtrue and rrfalse +// BTW there's a danger for evil bugs here !! If you're checking == true +// then the rrbool must be set to exactly "1" not just "not zero" !! + +#ifndef RADNOTYPEDEFS + #ifndef RRBOOL_DEFINED + #define RRBOOL_DEFINED + typedef S32 rrbool; + typedef S32 RRBOOL; + #endif +#elif !defined(RADNOTYPEDEFINES) + #ifndef RRBOOL_DEFINED + #define RRBOOL_DEFINED + #define rrbool S32 + #define RRBOOL S32 + #endif +#endif + +//-------------------------------------------------- +// Range macros + + #ifndef RR_MIN + #define RR_MIN(a,b) ( (a) < (b) ? (a) : (b) ) + #endif + + #ifndef RR_MAX + #define RR_MAX(a,b) ( (a) > (b) ? (a) : (b) ) + #endif + + #ifndef RR_ABS + #define RR_ABS(a) ( ((a) < 0) ? -(a) : (a) ) + #endif + + #ifndef RR_CLAMP + #define RR_CLAMP(val,lo,hi) RR_MAX( RR_MIN(val,hi), lo ) + #endif + +//-------------------------------------------------- +// Data layout macros + + #define RR_ARRAY_SIZE(array) ( sizeof(array)/sizeof(array[0]) ) + + // MEMBER_OFFSET tells you the offset of a member in a type + #ifdef __RAD3DS__ + #define RR_MEMBER_OFFSET(type,member) (unsigned int)(( (char *) &(((type *)0)->member) - (char *) 0 )) + #elif defined(__RADANDROID__) || defined(__RADPSP__) || defined(__RADPS3__) || defined(__RADSPU__) + // offsetof() gets mucked with by system headers on android, making things dependent on #include order. + #define RR_MEMBER_OFFSET(type,member) __builtin_offsetof(type, member) + #elif defined(__RADLINUX__) + #define RR_MEMBER_OFFSET(type,member) (offsetof(type, member)) + #else + #define RR_MEMBER_OFFSET(type,member) ( (size_t) (UINTa) &(((type *)0)->member) ) + #endif + + // MEMBER_SIZE tells you the size of a member in a type + #define RR_MEMBER_SIZE(type,member) ( sizeof( ((type *) 0)->member) ) + + // just to make gcc shut up about derefing null : + #define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) ) + #define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) ) + + // MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object + // you should then RR_ASSERT( &(ret->member) == ptr ); + #define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) ) + +//-------------------------------------------------- +// Cache / prefetch macros : + +// RR_PREFETCH for various platforms : +// +// RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan +// platforms that automatically prefetch sequential (eg. PC) should be a no-op here +// RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined +// (may be a no-op, may be a normal prefetch, may zero memory) +// warning : RR_PREFETCH_WRITE_INVALIDATE may write memory so don't do it past the end of buffers + +#ifdef __RADX86__ + +#define RR_PREFETCH_SEQUENTIAL(ptr,offset) // nop +#define RR_PREFETCH_WRITE_INVALIDATE(ptr,offset) // nop + +#elif defined(__RADXENON__) + +#define RR_PREFETCH_SEQUENTIAL(ptr,offset) __dcbt((int)(offset),(void *)(ptr)) +#define RR_PREFETCH_WRITE_INVALIDATE(ptr,offset) __dcbz128((int)(offset),(void *)(ptr)) + +#elif defined(__RADPS3__) + +#define RR_PREFETCH_SEQUENTIAL(ptr,offset) __dcbt((char *)(ptr) + (int)(offset)) +#define RR_PREFETCH_WRITE_INVALIDATE(ptr,offset) __dcbz((char *)(ptr) + (int)(offset)) + +#elif defined(__RADSPU__) + +#define RR_PREFETCH_SEQUENTIAL(ptr,offset) // intentional NOP +#define RR_PREFETCH_WRITE_INVALIDATE(ptr,offset) // nop + +#elif defined(__RADWII__) || defined(__RADWIIU__) + +#define RR_PREFETCH_SEQUENTIAL(ptr,offset) // intentional NOP for now +#define RR_PREFETCH_WRITE_INVALIDATE(ptr,offset) // nop + +#elif defined(__RAD3DS__) + +#define RR_PREFETCH_SEQUENTIAL(ptr,offset) __pld((char *)(ptr) + (int)(offset)) +#define RR_PREFETCH_WRITE_INVALIDATE(ptr,offset) __pldw((char *)(ptr) + (int)(offset)) + +#else + +// other platform +#define RR_PREFETCH_SEQUENTIAL(ptr,offset) // need_prefetch // compile error +#define RR_PREFETCH_WRITE_INVALIDATE(ptr,offset) // need_writezero // error + +#endif + +//-------------------------------------------------- +// LIGHTWEIGHT ASSERTS without rrAssert.h + +RADDEFSTART + +// set up RR_BREAK : + + #ifdef __RADNGC__ + + #define RR_BREAK() asm(" .long 0x00000001") + #define RR_CACHE_LINE_SIZE xxx + + #elif defined(__RADWII__) + + #define RR_BREAK() __asm__ volatile("trap") + #define RR_CACHE_LINE_SIZE 32 + + #elif defined(__RADWIIU__) + + #define RR_BREAK() asm("trap") + #define RR_CACHE_LINE_SIZE 32 + + #elif defined(__RAD3DS__) + + #define RR_BREAK() *((int volatile*)0)=0 + #define RR_CACHE_LINE_SIZE 32 + + #elif defined(__RADNDS__) + + #define RR_BREAK() asm("BKPT 0") + #define RR_CACHE_LINE_SIZE xxx + + #elif defined(__RADPS2__) + + #define RR_BREAK() __asm__ volatile("break") + #define RR_CACHE_LINE_SIZE 64 + + #elif defined(__RADPSP__) + + #define RR_BREAK() __asm__("break 0") + #define RR_CACHE_LINE_SIZE 64 + + #elif defined(__RADPSP2__) + + #define RR_BREAK() { __asm__ volatile("bkpt 0x0000"); } + #define RR_CACHE_LINE_SIZE 32 + + #elif defined (__RADQNX__) + #define RR_BREAK() __builtin_trap() + #define RR_CACHE_LINE_SIZE 32 + #elif defined (__RADARM__) && defined (__RADLINUX__) + #define RR_BREAK() __builtin_trap() + #define RR_CACHE_LINE_SIZE 32 + #elif defined(__RADSPU__) + + #define RR_BREAK() __asm volatile ("stopd 0,1,1") + #define RR_CACHE_LINE_SIZE 128 + + #elif defined(__RADPS3__) + + // #ifdef snPause // in LibSN.h + // snPause + // __asm__ volatile ( "tw 31,1,1" ) + + #define RR_BREAK() __asm__ volatile ( "tw 31,1,1" ) + //#define RR_BREAK() __asm__ volatile("trap"); + + #define RR_CACHE_LINE_SIZE 128 + + #elif defined(__RADMAC__) + + #if defined(__GNUG__) || defined(__GNUC__) + #ifdef __RADX86__ + #define RR_BREAK() __asm__ volatile ( "int $3" ) + #else + #define RR_BREAK() __builtin_trap() + #endif + #else + #ifdef __RADMACH__ + void DebugStr(unsigned char const *); + #else + void pascal DebugStr(unsigned char const *); + #endif + #define RR_BREAK() DebugStr("\pRR_BREAK() was called") + #endif + + #define RR_CACHE_LINE_SIZE 64 + + #elif defined(__RADIPHONE__) + #define RR_BREAK() __builtin_trap() + #define RR_CACHE_LINE_SIZE 32 + #elif defined(__RADXENON__) + #define RR_BREAK() __debugbreak() + #define RR_CACHE_LINE_SIZE 128 + #elif defined(__RADANDROID__) + #define RR_BREAK() __builtin_trap() + #define RR_CACHE_LINE_SIZE 32 + #elif defined(__RADPS4__) + #define RR_BREAK() __builtin_trap() + #define RR_CACHE_LINE_SIZE 64 + #elif defined(__RADNACL__) + #define RR_BREAK() __builtin_trap() + #define RR_CACHE_LINE_SIZE 64 + #else + // x86 : + #define RR_CACHE_LINE_SIZE 64 + + #ifdef __RADLINUX__ + #define RR_BREAK() __asm__ volatile ( "int $3" ) + #elif defined(__WATCOMC__) + + void RR_BREAK( void ); + #pragma aux RR_BREAK = "int 0x3"; + + #elif defined(__RADWIN__) && defined(_MSC_VER) && _MSC_VER >= 1300 + + #define RR_BREAK __debugbreak + + #else + + #define RR_BREAK() RAD_STATEMENT_WRAPPER( __asm {int 3} ) + + #endif + + #endif + +// simple RR_ASSERT : + +// CB 5-27-10 : use RR_DO_ASSERTS to toggle asserts on and off : +#if (defined(_DEBUG) && !defined(NDEBUG)) || defined(ASSERT_IN_RELEASE) + #define RR_DO_ASSERTS +#endif + +/********* + +rrAsserts : + +RR_ASSERT(exp) - the normal assert thing, toggled with RR_DO_ASSERTS +RR_ASSERT_ALWAYS(exp) - assert that you want to test even in ALL builds (including final!) +RR_ASSERT_RELEASE(exp) - assert that you want to test even in release builds (not for final!) +RR_ASSERT_LITE(exp) - normal assert is not safe from threads or inside malloc; use this instead +RR_DURING_ASSERT(exp) - wrap operations that compute stuff for assert in here +RR_DO_ASSERTS - toggle tells you if asserts are enabled or not + +RR_BREAK() - generate a debug break - always ! +RR_ASSERT_BREAK() - RR_BREAK for asserts ; disable with RAD_NO_BREAK + +RR_ASSERT_FAILURE(str) - just break with a messsage; like assert with no condition +RR_ASSERT_FAILURE_ALWAYS(str) - RR_ASSERT_FAILURE in release builds too +RR_CANT_GET_HERE() - put in spots execution should never go +RR_COMPILER_ASSERT(exp) - checks constant conditions at compile time + +RADTODO - note to search for nonfinal stuff +RR_PRAGMA_MESSAGE - message dealy, use with #pragma in MSVC + +*************/ + +//----------------------------------------------------------- + + +#if defined(__GNUG__) || defined(__GNUC__) || (defined(_MSC_VER) && _MSC_VER > 1200) + #define RR_FUNCTION_NAME __FUNCTION__ +#else + #define RR_FUNCTION_NAME 0 + + // __func__ is in the C99 standard +#endif + +//----------------------------------------------------------- + +// rrDisplayAssertion might just log, or it might pop a message box, depending on settings +// rrDisplayAssertion returns whether you should break or not +typedef rrbool (RADLINK fp_rrDisplayAssertion)(int * Ignored, const char * fileName,const int line,const char * function,const char * message); + +extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; + +// if I have func pointer, call it, else true ; true = do int 3 +#define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 ) + +//----------------------------------------------------------- + +// RAD_NO_BREAK : option if you don't like your assert to break +// CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional +#ifdef RAD_NO_BREAK +#define RR_ASSERT_BREAK() 0 +#else +#define RR_ASSERT_BREAK() RR_BREAK() +#endif + +// assert_always is on FINAL ! +#define RR_ASSERT_ALWAYS(exp) RAD_STATEMENT_WRAPPER( static int Ignored=0; if ( ! (exp) ) { if ( rrDisplayAssertion(&Ignored,__FILE__,__LINE__,RR_FUNCTION_NAME,#exp) ) RR_ASSERT_BREAK(); } ) + +// RR_ASSERT_FAILURE is like an assert without a condition - if you hit it, you're bad +#define RR_ASSERT_FAILURE_ALWAYS(str) RAD_STATEMENT_WRAPPER( static int Ignored=0; if ( rrDisplayAssertion(&Ignored,__FILE__,__LINE__,RR_FUNCTION_NAME,str) ) RR_ASSERT_BREAK(); ) + +#define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } ) + +//----------------------------------- +#ifdef RR_DO_ASSERTS + +#define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp) +#define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp) +#define RR_ASSERT_NO_ASSUME(exp) RR_ASSERT_ALWAYS(exp) +// RR_DURING_ASSERT is to set up expressions or declare variables that are only used in asserts +#define RR_DURING_ASSERT(exp) exp + +#define RR_ASSERT_FAILURE(str) RR_ASSERT_FAILURE_ALWAYS(str) + +// RR_CANT_GET_HERE is for like defaults in switches that should never be hit +#define RR_CANT_GET_HERE() RAD_STATEMENT_WRAPPER( RR_ASSERT_FAILURE("can't get here"); RADUNREACHABLE; ) + + +#else // RR_DO_ASSERTS //----------------------------------- + +#define RR_ASSERT(exp) (void)0 +#define RR_ASSERT_LITE(exp) (void)0 +#define RR_ASSERT_NO_ASSUME(exp) (void)0 + +#define RR_DURING_ASSERT(exp) (void)0 + +#define RR_ASSERT_FAILURE(str) (void)0 + +#define RR_CANT_GET_HERE() RADUNREACHABLE + +#endif // RR_DO_ASSERTS //----------------------------------- + +//================================================================= + +// RR_ASSERT_RELEASE is on in release build, but not final + +#ifndef __RADFINAL__ + +#define RR_ASSERT_RELEASE(exp) RR_ASSERT_ALWAYS(exp) +#define RR_ASSERT_LITE_RELEASE(exp) RR_ASSERT_LITE_ALWAYS(exp) + +#else + +#define RR_ASSERT_RELEASE(exp) (void)0 +#define RR_ASSERT_LITE_RELEASE(exp) (void)0 + +#endif + +// BH: This never gets compiled away except for __RADFINAL__ +#define RR_ASSERT_ALWAYS_NO_SHIP RR_ASSERT_RELEASE + +#define rrAssert RR_ASSERT +#define rrassert RR_ASSERT + +#ifdef _MSC_VER + // without this, our assert errors... + #if _MSC_VER >= 1300 + #pragma warning( disable : 4127) // conditional expression is constant + #endif +#endif + +//--------------------------------------- +// Get/Put from memory in little or big endian : +// +// val = RR_GET32_BE(ptr) +// RR_PUT32_BE(ptr,val) +// +// available here : +// RR_[GET/PUT][16/32]_[BE/LE][_UNALIGNED][_OFFSET] +// +// if you don't specify _UNALIGNED , then ptr & offset shoud both be aligned to type size +// _OFFSET is in *bytes* ! + +// you can #define RR_GET_RESTRICT to make all RR_GETs be RESTRICT +// if you set nothing they are not + +#ifdef RR_GET_RESTRICT +#define RR_GET_PTR_POST RADRESTRICT +#endif +#ifndef RR_GET_PTR_POST +#define RR_GET_PTR_POST +#endif + +// native version of get/put is always trivial : + +#define RR_GET16_NATIVE(ptr) *((const U16 * RR_GET_PTR_POST)(ptr)) +#define RR_PUT16_NATIVE(ptr,val) *((U16 * RR_GET_PTR_POST)(ptr)) = (val) + +// offset is in bytes +#define RR_U16_PTR_OFFSET(ptr,offset) ((U16 * RR_GET_PTR_POST)((char *)(ptr) + (offset))) +#define RR_GET16_NATIVE_OFFSET(ptr,offset) *( RR_U16_PTR_OFFSET((ptr),offset) ) +#define RR_PUT16_NATIVE_OFFSET(ptr,val,offset) *( RR_U16_PTR_OFFSET((ptr),offset)) = (val) + +#define RR_GET32_NATIVE(ptr) *((const U32 * RR_GET_PTR_POST)(ptr)) +#define RR_PUT32_NATIVE(ptr,val) *((U32 * RR_GET_PTR_POST)(ptr)) = (val) + +// offset is in bytes +#define RR_U32_PTR_OFFSET(ptr,offset) ((U32 * RR_GET_PTR_POST)((char *)(ptr) + (offset))) +#define RR_GET32_NATIVE_OFFSET(ptr,offset) *( RR_U32_PTR_OFFSET((ptr),offset) ) +#define RR_PUT32_NATIVE_OFFSET(ptr,val,offset) *( RR_U32_PTR_OFFSET((ptr),offset)) = (val) + +#define RR_GET64_NATIVE(ptr) *((const U64 * RR_GET_PTR_POST)(ptr)) +#define RR_PUT64_NATIVE(ptr,val) *((U64 * RR_GET_PTR_POST)(ptr)) = (val) + +// offset is in bytes +#define RR_U64_PTR_OFFSET(ptr,offset) ((U64 * RR_GET_PTR_POST)((char *)(ptr) + (offset))) +#define RR_GET64_NATIVE_OFFSET(ptr,offset) *( RR_U64_PTR_OFFSET((ptr),offset) ) +#define RR_PUT64_NATIVE_OFFSET(ptr,val,offset) *( RR_U64_PTR_OFFSET((ptr),offset)) = (val) + +//--------------------------------------------------- + +#ifdef __RADLITTLEENDIAN__ + +#define RR_GET16_LE RR_GET16_NATIVE +#define RR_PUT16_LE RR_PUT16_NATIVE +#define RR_GET16_LE_OFFSET RR_GET16_NATIVE_OFFSET +#define RR_PUT16_LE_OFFSET RR_PUT16_NATIVE_OFFSET + +#define RR_GET32_LE RR_GET32_NATIVE +#define RR_PUT32_LE RR_PUT32_NATIVE +#define RR_GET32_LE_OFFSET RR_GET32_NATIVE_OFFSET +#define RR_PUT32_LE_OFFSET RR_PUT32_NATIVE_OFFSET + +#define RR_GET64_LE RR_GET64_NATIVE +#define RR_PUT64_LE RR_PUT64_NATIVE +#define RR_GET64_LE_OFFSET RR_GET64_NATIVE_OFFSET +#define RR_PUT64_LE_OFFSET RR_PUT64_NATIVE_OFFSET + +#else + +#define RR_GET16_BE RR_GET16_NATIVE +#define RR_PUT16_BE RR_PUT16_NATIVE +#define RR_GET16_BE_OFFSET RR_GET16_NATIVE_OFFSET +#define RR_PUT16_BE_OFFSET RR_PUT16_NATIVE_OFFSET + +#define RR_GET32_BE RR_GET32_NATIVE +#define RR_PUT32_BE RR_PUT32_NATIVE +#define RR_GET32_BE_OFFSET RR_GET32_NATIVE_OFFSET +#define RR_PUT32_BE_OFFSET RR_PUT32_NATIVE_OFFSET + +#define RR_GET64_BE RR_GET64_NATIVE +#define RR_PUT64_BE RR_PUT64_NATIVE +#define RR_GET64_BE_OFFSET RR_GET64_NATIVE_OFFSET +#define RR_PUT64_BE_OFFSET RR_PUT64_NATIVE_OFFSET + +#endif + +//------------------------- +// non-native Get/Put implementations go here : + +#if defined(__RADX86__) +// good implementation for X86 : + +#if (_MSC_VER >= 1300) + +unsigned short __cdecl _byteswap_ushort (unsigned short _Short); +unsigned long __cdecl _byteswap_ulong (unsigned long _Long); +#pragma intrinsic(_byteswap_ushort, _byteswap_ulong) + +#define RR_BSWAP16 _byteswap_ushort +#define RR_BSWAP32 _byteswap_ulong + +unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +#pragma intrinsic(_byteswap_uint64) +#define RR_BSWAP64 _byteswap_uint64 + +#elif defined(_MSC_VER) // VC6 + +RADFORCEINLINE unsigned long RR_BSWAP16 (unsigned long _Long) +{ + __asm { + mov eax, [_Long] + rol ax, 8 + mov [_Long], eax; + } + return _Long; +} + +RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) +{ + __asm { + mov eax, [_Long] + bswap eax + mov [_Long], eax + } + return _Long; +} + +RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +{ + __asm { + mov eax, DWORD PTR _Long + mov edx, DWORD PTR _Long+4 + bswap eax + bswap edx + mov DWORD PTR _Long, edx + mov DWORD PTR _Long+4, eax + } + return _Long; +} + +#elif defined(__GNUC__) || defined(__clang__) + +// GCC has __builtin_bswap16, but Clang only seems to have added it recently. +// We use __builtin_bswap32/64 but 16 just uses the macro version. (No big +// deal if that turns into shifts anyway) +#define RR_BSWAP16(u16) ( (U16) ( ((u16) >> 8) | ((u16) << 8) ) ) +#define RR_BSWAP32 __builtin_bswap32 +#define RR_BSWAP64 __builtin_bswap64 + +#endif + +#define RR_GET16_BE(ptr) RR_BSWAP16(*((U16 *)(ptr))) +#define RR_PUT16_BE(ptr,val) *((U16 *)(ptr)) = (U16) RR_BSWAP16(val) +#define RR_GET16_BE_OFFSET(ptr,offset) RR_BSWAP16(*RR_U16_PTR_OFFSET(ptr,offset)) +#define RR_PUT16_BE_OFFSET(ptr,val,offset) *RR_U16_PTR_OFFSET(ptr,offset) = RR_BSWAP16(val) + +#define RR_GET32_BE(ptr) RR_BSWAP32(*((U32 *)(ptr))) +#define RR_PUT32_BE(ptr,val) *((U32 *)(ptr)) = RR_BSWAP32(val) +#define RR_GET32_BE_OFFSET(ptr,offset) RR_BSWAP32(*RR_U32_PTR_OFFSET(ptr,offset)) +#define RR_PUT32_BE_OFFSET(ptr,val,offset) *RR_U32_PTR_OFFSET(ptr,offset) = RR_BSWAP32(val) + +#define RR_GET64_BE(ptr) RR_BSWAP64(*((U64 *)(ptr))) +#define RR_PUT64_BE(ptr,val) *((U64 *)(ptr)) = RR_BSWAP64(val) +#define RR_GET64_BE_OFFSET(ptr,offset) RR_BSWAP64(*RR_U64_PTR_OFFSET(ptr,offset)) +#define RR_PUT64_BE_OFFSET(ptr,val,offset) *RR_U64_PTR_OFFSET(ptr,offset) = RR_BSWAP64(val) + +// end _MSC_VER + +#elif defined(__RADXENON__) // Xenon has built-in funcs for this + +unsigned short __loadshortbytereverse(int offset, const void *base); +unsigned long __loadwordbytereverse (int offset, const void *base); + +void __storeshortbytereverse(unsigned short val, int offset, void *base); +void __storewordbytereverse (unsigned int val, int offset, void *base); + +#define RR_GET16_LE(ptr) __loadshortbytereverse(0, ptr) +#define RR_PUT16_LE(ptr,val) __storeshortbytereverse((U16) (val), 0, ptr) + +#define RR_GET16_LE_OFFSET(ptr,offset) __loadshortbytereverse(offset, ptr) +#define RR_PUT16_LE_OFFSET(ptr,val,offset) __storeshortbytereverse((U16) (val), offset, ptr) + +#define RR_GET32_LE(ptr) __loadwordbytereverse(0, ptr) +#define RR_PUT32_LE(ptr,val) __storewordbytereverse((U32) (val), 0, ptr) + +#define RR_GET32_LE_OFFSET(ptr,offset) __loadwordbytereverse(offset, ptr) +#define RR_PUT32_LE_OFFSET(ptr,val,offset) __storewordbytereverse((U32) (val), offset, ptr) + +#define RR_GET64_LE(ptr) ( ((U64)RR_GET32_OFFSET_LE(ptr,4)<<32) | RR_GET32_LE(ptr) ) +#define RR_PUT64_LE(ptr,val) RR_PUT32_LE(ptr, (U32) (val)), RR_PUT32_OFFSET_LE(ptr, (U32) ((val)>>32),4) + +#elif defined(__RADPS3__) + +#include + +#define RR_GET16_LE(ptr) __lhbrx(ptr) +#define RR_PUT16_LE(ptr,val) __sthbrx(ptr, (U16) (val)) + +#define RR_GET16_LE_OFFSET(ptr,offset) __lhbrx(RR_U16_PTR_OFFSET(ptr, offset)) +#define RR_PUT16_LE_OFFSET(ptr,val,offset) __sthbrx(RR_U16_PTR_OFFSET(ptr, offset), (U16) (val)) + +#define RR_GET32_LE(ptr) __lwbrx(ptr) +#define RR_PUT32_LE(ptr,val) __stwbrx(ptr, (U32) (val)) + +#define RR_GET64_LE(ptr) __ldbrx(ptr) +#define RR_PUT64_LE(ptr,val) __stdbrx(ptr, (U32) (val)) + +#define RR_GET32_LE_OFFSET(ptr,offset) __lwbrx(RR_U32_PTR_OFFSET(ptr, offset)) +#define RR_PUT32_LE_OFFSET(ptr,val,offset) __stwbrx(RR_U32_PTR_OFFSET(ptr, offset), (U32) (val)) + +#elif defined(__RADWII__) + +#define RR_GET16_LE(ptr) __lhbrx(ptr, 0) +#define RR_PUT16_LE(ptr,val) __sthbrx((U16) (val), ptr, 0) + +#define RR_GET16_LE_OFFSET(ptr,offset) __lhbrx(ptr, offset) +#define RR_PUT16_LE_OFFSET(ptr,val,offset) __sthbrx((U16) (val), ptr, offset) + +#define RR_GET32_LE(ptr) __lwbrx(ptr, 0) +#define RR_PUT32_LE(ptr,val) __stwbrx((U32) (val), ptr, 0) + +#define RR_GET32_LE_OFFSET(ptr,offset) __lwbrx(ptr, offset) +#define RR_PUT32_LE_OFFSET(ptr,val,offset) __stwbrx((U32) (val), ptr, offset) + +#elif defined(__RAD3DS__) + +#define RR_GET16_BE(ptr) __rev16(*(U16 *) (ptr)) +#define RR_PUT16_BE(ptr,val) *(U16 *) (ptr) = __rev16(val) + +#define RR_GET16_BE_OFFSET(ptr,offset) __rev16(*RR_U16_PTR_OFFSET(ptr,offset)) +#define RR_PUT16_BE_OFFSET(ptr,offset,val) *RR_U16_PTR_OFFSET(ptr,offset) = __rev16(val) + +#define RR_GET32_BE(ptr) __rev(*(U32 *) (ptr)) +#define RR_PUT32_BE(ptr,val) *(U32 *) (ptr) = __rev(val) + +#define RR_GET32_BE_OFFSET(ptr,offset) __rev(*RR_U32_PTR_OFFSET(ptr,offset)) +#define RR_PUT32_BE_OFFSET(ptr,offset,val) *RR_U32_PTR_OFFSET(ptr,offset) = __rev(val) + +#elif defined(__RADIPHONE__) + +// iPhone does not seem to have intrinsics for this, so use generic fallback! + +// Bswap is just here for use of implementing get/put +// caller should use Get/Put , not bswap +#define RR_BSWAP16(u16) ( (U16) ( ((u16) >> 8) | ((u16) << 8) ) ) +#define RR_BSWAP32(u32) ( (U32) ( ((u32) >> 24) | (((u32)<<8) & 0x00FF0000) | (((u32)>>8) & 0x0000FF00) | ((u32) << 24) ) ) + +#define RR_GET16_BE(ptr) RR_BSWAP16(*((U16 *)(ptr))) +#define RR_PUT16_BE(ptr,val) *((U16 *)(ptr)) = RR_BSWAP16(val) + +#define RR_GET32_BE(ptr) RR_BSWAP32(*((U32 *)(ptr))) +#define RR_PUT32_BE(ptr,val) *((U32 *)(ptr)) = RR_BSWAP32(val) + +#elif defined(__RADWIIU__) + +#include + +#define RR_GET16_LE(ptr) (*(__bytereversed U16 *) (ptr)) +#define RR_PUT16_LE(ptr,val) *(__bytereversed U16 *) (ptr) = val + +#define RR_GET16_LE_OFFSET(ptr,offset) (*(__bytereversed U16 *)RR_U16_PTR_OFFSET(ptr,offset)) +#define RR_PUT16_LE_OFFSET(ptr,val,offset) *(__bytereversed U16 *)RR_U16_PTR_OFFSET(ptr,offset) = val + +#define RR_GET32_LE(ptr) (*(__bytereversed U32 *) (ptr)) +#define RR_PUT32_LE(ptr,val) *(__bytereversed U32 *) (ptr) = val + +#define RR_GET32_LE_OFFSET(ptr,offset) (*(__bytereversed U32 *)RR_U32_PTR_OFFSET(ptr,offset)) +#define RR_PUT32_LE_OFFSET(ptr,val,offset) *(__bytereversed U32 *)RR_U32_PTR_OFFSET(ptr,offset) = val + +#define RR_GET64_LE(ptr) (*(__bytereversed U64 *) (ptr)) +#define RR_PUT64_LE(ptr,val) *(__bytereversed U64 *) (ptr) = val + +#define RR_GET64_LE_OFFSET(ptr,offset) (*(__bytereversed U64 *)RR_U32_PTR_OFFSET(ptr,offset)) +#define RR_PUT64_LE_OFFSET(ptr,val,offset) *(__bytereversed U64 *)RR_U32_PTR_OFFSET(ptr,offset) = val + +#elif defined(__RADWINRTAPI__) && defined(__RADARM__) + +#include + +#define RR_BSWAP16(u16) _arm_rev16(u16) +#define RR_BSWAP32(u32) _arm_rev(u32) + +#define RR_GET16_BE(ptr) RR_BSWAP16(*((U16 *)(ptr))) +#define RR_PUT16_BE(ptr,val) *((U16 *)(ptr)) = RR_BSWAP16(val) + +#define RR_GET32_BE(ptr) RR_BSWAP32(*((U32 *)(ptr))) +#define RR_PUT32_BE(ptr,val) *((U32 *)(ptr)) = RR_BSWAP32(val) + +#elif defined(__RADPSP2__) + +// no rev16 exposed +#define RR_BSWAP16(u16) ( (U16) ( ((u16) >> 8) | ((u16) << 8) ) ) +#define RR_BSWAP32(u32) __builtin_rev(u32) + +#define RR_GET16_BE(ptr) RR_BSWAP16(*((U16 *)(ptr))) +#define RR_PUT16_BE(ptr,val) *((U16 *)(ptr)) = RR_BSWAP16(val) + +#define RR_GET32_BE(ptr) RR_BSWAP32(*((U32 *)(ptr))) +#define RR_PUT32_BE(ptr,val) *((U32 *)(ptr)) = RR_BSWAP32(val) + +#else // other platforms ? + +// fall back : + +// Bswap is just here for use of implementing get/put +// caller should use Get/Put , not bswap +#define RR_BSWAP16(u16) ( (U16) ( ((u16) >> 8) | ((u16) << 8) ) ) +#define RR_BSWAP32(u32) ( (U32) ( ((u32) >> 24) | (((u32)<<8) & 0x00FF0000) | (((u32)>>8) & 0x0000FF00) | ((u32) << 24) ) ) +#define RR_BSWAP64(u64) ( ((U64) RR_BSWAP32((U32) (u64)) << 32) | (U64) RR_BSWAP32((U32) ((u64) >> 32)) ) + +#ifdef __RADLITTLEENDIAN__ + +// comment out fallbacks so users will get errors +//#define RR_GET16_BE(ptr) RR_BSWAP16(*((U16 *)(ptr))) +//#define RR_PUT16_BE(ptr,val) *((U16 *)(ptr)) = RR_BSWAP16(val) +//#define RR_GET32_BE(ptr) RR_BSWAP32(*((U32 *)(ptr))) +//#define RR_PUT32_BE(ptr,val) *((U32 *)(ptr)) = RR_BSWAP32(val) + +#else + +// comment out fallbacks so users will get errors +//#define RR_GET16_LE(ptr) RR_BSWAP16(*((U16 *)(ptr))) +//#define RR_PUT16_LE(ptr,val) *((U16 *)(ptr)) = RR_BSWAP16(val) +//#define RR_GET32_LE(ptr) RR_BSWAP32(*((U32 *)(ptr))) +//#define RR_PUT32_LE(ptr,val) *((U32 *)(ptr)) = RR_BSWAP32(val) + +#endif + +#endif + +//=================================================================== +// @@ TEMP : Aliases for old names : remove me when possible : + +#define RR_GET32_OFFSET_LE RR_GET32_LE_OFFSET +#define RR_GET32_OFFSET_BE RR_GET32_BE_OFFSET +#define RR_PUT32_OFFSET_LE RR_PUT32_LE_OFFSET +#define RR_PUT32_OFFSET_BE RR_PUT32_BE_OFFSET +#define RR_GET16_OFFSET_LE RR_GET16_LE_OFFSET +#define RR_GET16_OFFSET_BE RR_GET16_BE_OFFSET +#define RR_PUT16_OFFSET_LE RR_PUT16_LE_OFFSET +#define RR_PUT16_OFFSET_BE RR_PUT16_BE_OFFSET + + +//=================================================================== +// UNALIGNED VERSIONS : + +#if defined(__RADX86__) || defined(__RADPPC__) // platforms where unaligned is fast : + +#define RR_GET32_BE_UNALIGNED(ptr) RR_GET32_BE(ptr) +#define RR_GET32_BE_UNALIGNED_OFFSET(ptr,offset) RR_GET32_BE_OFFSET(ptr,offset) +#define RR_GET16_BE_UNALIGNED(ptr) RR_GET16_BE(ptr) +#define RR_GET16_BE_UNALIGNED_OFFSET(ptr,offset) RR_GET16_BE_OFFSET(ptr,offset) + +#define RR_GET32_LE_UNALIGNED(ptr) RR_GET32_LE(ptr) +#define RR_GET32_LE_UNALIGNED_OFFSET(ptr,offset) RR_GET32_LE_OFFSET(ptr,offset) +#define RR_GET16_LE_UNALIGNED(ptr) RR_GET16_LE(ptr) +#define RR_GET16_LE_UNALIGNED_OFFSET(ptr,offset) RR_GET16_LE_OFFSET(ptr,offset) + +#elif defined(__RAD3DS__) + +// arm has a "__packed" qualifier to tell the compiler to do unaligned accesses +#define RR_U16_PTR_OFFSET_UNALIGNED(ptr,offset) ((__packed U16 * RR_GET_PTR_POST)((char *)(ptr) + (offset))) +#define RR_U32_PTR_OFFSET_UNALIGNED(ptr,offset) ((__packed U32 * RR_GET_PTR_POST)((char *)(ptr) + (offset))) + +#define RR_GET32_BE_UNALIGNED(ptr) __rev(*RR_U32_PTR_OFFSET_UNALIGNED(ptr,0)) +#define RR_GET32_BE_UNALIGNED_OFFSET(ptr,offset) __rev(*RR_U32_PTR_OFFSET_UNALIGNED(ptr,offset)) +#define RR_GET16_BE_UNALIGNED(ptr) __rev16(*RR_U16_PTR_OFFSET_UNALIGNED(ptr,0)) +#define RR_GET16_BE_UNALIGNED_OFFSET(ptr,offset) __rev16(*RR_U16_PTR_OFFSET_UNALIGNED(ptr,offset)) + +#define RR_GET32_LE_UNALIGNED(ptr) *RR_U32_PTR_OFFSET_UNALIGNED(ptr,0) +#define RR_GET32_LE_UNALIGNED_OFFSET(ptr,offset) *RR_U32_PTR_OFFSET_UNALIGNED(ptr,offset) +#define RR_GET16_LE_UNALIGNED(ptr) *RR_U16_PTR_OFFSET_UNALIGNED(ptr,0) +#define RR_GET16_LE_UNALIGNED_OFFSET(ptr,offset) *RR_U16_PTR_OFFSET_UNALIGNED(ptr,offset) + +#elif defined(__RADPSP2__) + +#define RR_U16_PTR_OFFSET_UNALIGNED(ptr,offset) ((U16 __unaligned * RR_GET_PTR_POST)((char *)(ptr) + (offset))) +#define RR_U32_PTR_OFFSET_UNALIGNED(ptr,offset) ((U32 __unaligned * RR_GET_PTR_POST)((char *)(ptr) + (offset))) + +#define RR_GET32_BE_UNALIGNED(ptr) RR_BSWAP32(*RR_U32_PTR_OFFSET_UNALIGNED(ptr,0)) +#define RR_GET32_BE_UNALIGNED_OFFSET(ptr,offset) RR_BSWAP32(*RR_U32_PTR_OFFSET_UNALIGNED(ptr,offset)) +#define RR_GET16_BE_UNALIGNED(ptr) RR_BSWAP16(*RR_U16_PTR_OFFSET_UNALIGNED(ptr,0)) +#define RR_GET16_BE_UNALIGNED_OFFSET(ptr,offset) RR_BSWAP16(*RR_U16_PTR_OFFSET_UNALIGNED(ptr,offset)) + +#define RR_GET32_LE_UNALIGNED(ptr) *RR_U32_PTR_OFFSET_UNALIGNED(ptr,0) +#define RR_GET32_LE_UNALIGNED_OFFSET(ptr,offset) *RR_U32_PTR_OFFSET_UNALIGNED(ptr,offset) +#define RR_GET16_LE_UNALIGNED(ptr) *RR_U16_PTR_OFFSET_UNALIGNED(ptr,0) +#define RR_GET16_LE_UNALIGNED_OFFSET(ptr,offset) *RR_U16_PTR_OFFSET_UNALIGNED(ptr,offset) + +#else +// Unaligned via bytes : + +#define RR_GET32_BE_UNALIGNED(ptr) ( \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr)))[0] << 24 ) | \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr)))[1] << 16 ) | \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr)))[2] << 8 ) | \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr)))[3] << 0 ) ) + +#define RR_GET32_BE_UNALIGNED_OFFSET(ptr,offset) ( \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr))+(offset))[0] << 24 ) | \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr))+(offset))[1] << 16 ) | \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr))+(offset))[2] << 8 ) | \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr))+(offset))[3] << 0 ) ) + +#define RR_GET16_BE_UNALIGNED(ptr) ( \ + ( (U16)(((const U8 * RR_GET_PTR_POST)(ptr)))[0] << 8 ) | \ + ( (U16)(((const U8 * RR_GET_PTR_POST)(ptr)))[1] << 0 ) ) + +#define RR_GET16_BE_UNALIGNED_OFFSET(ptr,offset) ( \ + ( (U16)(((const U8 * RR_GET_PTR_POST)(ptr))+(offset))[0] << 8 ) | \ + ( (U16)(((const U8 * RR_GET_PTR_POST)(ptr))+(offset))[1] << 0 ) ) + +#define RR_GET32_LE_UNALIGNED(ptr) ( \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr)))[3] << 24 ) | \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr)))[2] << 16 ) | \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr)))[1] << 8 ) | \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr)))[0] << 0 ) ) + +#define RR_GET32_LE_UNALIGNED_OFFSET(ptr,offset) ( \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr))+(offset))[3] << 24 ) | \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr))+(offset))[2] << 16 ) | \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr))+(offset))[1] << 8 ) | \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr))+(offset))[0] << 0 ) ) + +#define RR_GET16_LE_UNALIGNED(ptr) ( \ + ( (U16)(((const U8 * RR_GET_PTR_POST)(ptr)))[1] << 8 ) | \ + ( (U16)(((const U8 * RR_GET_PTR_POST)(ptr)))[0] << 0 ) ) + +#define RR_GET16_LE_UNALIGNED_OFFSET(ptr,offset) ( \ + ( (U16)(((const U8 * RR_GET_PTR_POST)(ptr))+(offset))[1] << 8 ) | \ + ( (U16)(((const U8 * RR_GET_PTR_POST)(ptr))+(offset))[0] << 0 ) ) + +#endif + +//=================================================================== +// RR_ROTL32 : 32-bit rotate +// + +#ifdef _MSC_VER + + unsigned long __cdecl _lrotl(unsigned long, int); + #pragma intrinsic(_lrotl) + + #define RR_ROTL32(x,k) _lrotl((unsigned long)(x),(int)(k)) + +#elif defined(__RADCELL__) || defined(__RADLINUX__) || defined(__RADWII__) || defined(__RADMACAPI__) || defined(__RADWIIU__) || defined(__RADPS4__) || defined(__RADPSP2__) + + // Compiler turns this into rotate correctly : + #define RR_ROTL32(u32,num) ( ( (u32) << (num) ) | ( (u32) >> (32 - (num))) ) + +#elif defined(__RAD3DS__) + + #define RR_ROTL32(u32,num) __ror(u32, (-(num))&31) + +#else + +// comment out fallbacks so users will get errors +// fallback implementation using shift and or : +//#define RR_ROTL32(u32,num) ( ( (u32) << (num) ) | ( (u32) >> (32 - (num))) ) + +#endif + + +//=================================================================== +// RR_ROTL64 : 64-bit rotate + +#if ( defined(_MSC_VER) && _MSC_VER >= 1300) + +unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +#pragma intrinsic(_rotl64) + +#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) + +#elif defined(__RADCELL__) + +// PS3 GCC turns this into rotate correctly : +#define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) ) + +#elif defined(__RADLINUX__) || defined(__RADMACAPI__) + +//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. +#define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) ) + +#else + +// comment out fallbacks so users will get errors +// fallback implementation using shift and or : +//#define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) ) + +#endif + +//=================================================================== + +RADDEFEND + +//=================================================================== + +// RR_COMPILER_ASSERT +#if defined(__cplusplus) && !defined(RR_COMPILER_ASSERT) + #if defined(_MSC_VER) && (_MSC_VER >=1400) + + // better version of COMPILER_ASSERT using boost technique + template struct RR_COMPILER_ASSERT_FAILURE; + + template <> struct RR_COMPILER_ASSERT_FAILURE<1> { enum { value = 1 }; }; + + template struct rr_compiler_assert_test{}; + + // __LINE__ macro broken when -ZI is used see Q199057 + #define RR_COMPILER_ASSERT( B ) \ + typedef rr_compiler_assert_test<\ + sizeof(RR_COMPILER_ASSERT_FAILURE< (B) ? 1 : 0 >)\ + > rr_compiler_assert_typedef_ + + #endif +#endif + +#ifndef RR_COMPILER_ASSERT + // this happens at declaration time, so if it's inside a function in a C file, drop {} around it + #define RR_COMPILER_ASSERT(exp) typedef char RR_STRING_JOIN(_dummy_array, __LINE__) [ (exp) ? 1 : -1 ] +#endif + +//=================================================================== +// some error checks : + + RR_COMPILER_ASSERT( sizeof(RAD_UINTa) == sizeof( RR_STRING_JOIN(RAD_U,RAD_PTRBITS) ) ); + RR_COMPILER_ASSERT( sizeof(RAD_UINTa) == RAD_PTRBYTES ); + RR_COMPILER_ASSERT( RAD_TWOPTRBYTES == 2* RAD_PTRBYTES ); + +//=================================================================== + + #endif // __RADRES__ + +//include "testconstant.inl" // uncomment and include to test statement constants + +#endif // __RADRR_COREH__ + + diff --git a/Minecraft.Client/Durango/Iggy/lib/iggy_durango.lib b/Minecraft.Client/Durango/Iggy/lib/iggy_durango.lib new file mode 100644 index 00000000..90c41ff5 Binary files /dev/null and b/Minecraft.Client/Durango/Iggy/lib/iggy_durango.lib differ diff --git a/Minecraft.Client/Durango/Iggy/lib/iggy_durango_debugcrt.lib b/Minecraft.Client/Durango/Iggy/lib/iggy_durango_debugcrt.lib new file mode 100644 index 00000000..567a6083 Binary files /dev/null and b/Minecraft.Client/Durango/Iggy/lib/iggy_durango_debugcrt.lib differ diff --git a/Minecraft.Client/Durango/Iggy/lib/iggyperfmon_durango.lib b/Minecraft.Client/Durango/Iggy/lib/iggyperfmon_durango.lib new file mode 100644 index 00000000..be43300c Binary files /dev/null and b/Minecraft.Client/Durango/Iggy/lib/iggyperfmon_durango.lib differ diff --git a/Minecraft.Client/Durango/Iggy/lib/iggyperfmon_durango_debugcrt.lib b/Minecraft.Client/Durango/Iggy/lib/iggyperfmon_durango_debugcrt.lib new file mode 100644 index 00000000..59043ede Binary files /dev/null and b/Minecraft.Client/Durango/Iggy/lib/iggyperfmon_durango_debugcrt.lib differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/CU/DLCXbox1.cmp b/Minecraft.Client/Durango/Layout/Image/Loose/CU/DLCXbox1.cmp new file mode 100644 index 00000000..5943983b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/CU/DLCXbox1.cmp differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/MediaDurango.arc b/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/MediaDurango.arc new file mode 100644 index 00000000..53e9b222 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/MediaDurango.arc differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/CHT/DFHeiMedium-B5.ttf b/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/CHT/DFHeiMedium-B5.ttf new file mode 100644 index 00000000..f9fb4894 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/CHT/DFHeiMedium-B5.ttf differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/JPN/DF-DotDotGothic16.ttf b/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/JPN/DF-DotDotGothic16.ttf new file mode 100644 index 00000000..1be2b4b3 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/JPN/DF-DotDotGothic16.ttf differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/JPN/DFGMaruGothic-Md.ttf b/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/JPN/DFGMaruGothic-Md.ttf new file mode 100644 index 00000000..4eb4eef7 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/JPN/DFGMaruGothic-Md.ttf differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/KOR/BOKMSD.ttf b/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/KOR/BOKMSD.ttf new file mode 100644 index 00000000..83fe8699 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/KOR/BOKMSD.ttf differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/KOR/candadite2.ttf b/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/KOR/candadite2.ttf new file mode 100644 index 00000000..f2ba094f Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/KOR/candadite2.ttf differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/Mojang Font_11.ttf b/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/Mojang Font_11.ttf new file mode 100644 index 00000000..969cee58 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/Mojang Font_11.ttf differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/Mojang Font_7.ttf b/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/Mojang Font_7.ttf new file mode 100644 index 00000000..727c5fb6 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/Mojang Font_7.ttf differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/Mojangles.ttf b/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/Mojangles.ttf new file mode 100644 index 00000000..e7b87e9f Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/Mojangles.ttf differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/RU/SpaceMace.ttf b/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/RU/SpaceMace.ttf new file mode 100644 index 00000000..70cd3f7d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/media/font/RU/SpaceMace.ttf differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/achievement/bg.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/achievement/bg.png new file mode 100644 index 00000000..23dd85a8 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/achievement/bg.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/achievement/icons.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/achievement/icons.png new file mode 100644 index 00000000..6a3f3ea5 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/achievement/icons.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/chain_1.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/chain_1.png new file mode 100644 index 00000000..3632af5b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/chain_1.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/chain_2.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/chain_2.png new file mode 100644 index 00000000..330425b1 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/chain_2.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/cloth_1.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/cloth_1.png new file mode 100644 index 00000000..f3cf4aa3 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/cloth_1.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/cloth_2.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/cloth_2.png new file mode 100644 index 00000000..15fb9084 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/cloth_2.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/diamond_1.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/diamond_1.png new file mode 100644 index 00000000..339da658 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/diamond_1.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/diamond_2.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/diamond_2.png new file mode 100644 index 00000000..c220c123 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/diamond_2.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/gold_1.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/gold_1.png new file mode 100644 index 00000000..885f309b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/gold_1.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/gold_2.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/gold_2.png new file mode 100644 index 00000000..9d1ea3b3 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/gold_2.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/iron_1.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/iron_1.png new file mode 100644 index 00000000..374ab076 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/iron_1.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/iron_2.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/iron_2.png new file mode 100644 index 00000000..53af4f4d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/iron_2.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/power.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/power.png new file mode 100644 index 00000000..809539ca Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/armor/power.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/art/kz.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/art/kz.png new file mode 100644 index 00000000..ecc4823e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/art/kz.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/environment/clouds.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/environment/clouds.png new file mode 100644 index 00000000..b4a78c2f Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/environment/clouds.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/environment/light_normal.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/environment/light_normal.png new file mode 100644 index 00000000..023f3cd5 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/environment/light_normal.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/environment/rain.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/environment/rain.png new file mode 100644 index 00000000..75d775b1 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/environment/rain.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/environment/snow.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/environment/snow.png new file mode 100644 index 00000000..84417c5c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/environment/snow.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/alternate.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/alternate.png new file mode 100644 index 00000000..70a732e6 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/alternate.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/default.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/default.png new file mode 100644 index 00000000..96094378 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/default.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_00.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_00.png new file mode 100644 index 00000000..badaa89a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_00.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_01.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_01.png new file mode 100644 index 00000000..8b13263a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_01.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_02.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_02.png new file mode 100644 index 00000000..b7f79b67 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_02.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_03.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_03.png new file mode 100644 index 00000000..66c8da1e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_03.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_04.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_04.png new file mode 100644 index 00000000..f809f53a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_04.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_05.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_05.png new file mode 100644 index 00000000..abeeb179 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_05.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_06.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_06.png new file mode 100644 index 00000000..b1b982ef Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_06.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_07.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_07.png new file mode 100644 index 00000000..9006d79c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_07.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_09.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_09.png new file mode 100644 index 00000000..c7b8eb75 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_09.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_0A.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_0A.png new file mode 100644 index 00000000..febfc861 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_0A.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_0B.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_0B.png new file mode 100644 index 00000000..23a7d7fa Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_0B.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_0C.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_0C.png new file mode 100644 index 00000000..eaffa7e7 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_0C.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_0D.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_0D.png new file mode 100644 index 00000000..0f49ce7e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_0D.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_0E.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_0E.png new file mode 100644 index 00000000..23d740d3 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_0E.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_0F.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_0F.png new file mode 100644 index 00000000..ebfda315 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_0F.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_10.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_10.png new file mode 100644 index 00000000..9f534d18 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_10.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_11.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_11.png new file mode 100644 index 00000000..3fd49256 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_11.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_12.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_12.png new file mode 100644 index 00000000..0733830b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_12.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_13.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_13.png new file mode 100644 index 00000000..c242e269 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_13.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_14.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_14.png new file mode 100644 index 00000000..244a23af Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_14.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_15.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_15.png new file mode 100644 index 00000000..c9508d10 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_15.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_16.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_16.png new file mode 100644 index 00000000..09f817c1 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_16.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_17.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_17.png new file mode 100644 index 00000000..ab12c1b8 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_17.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_18.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_18.png new file mode 100644 index 00000000..abd40b8d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_18.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_19.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_19.png new file mode 100644 index 00000000..b009479e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_19.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_1A.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_1A.png new file mode 100644 index 00000000..eb856e9b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_1A.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_1B.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_1B.png new file mode 100644 index 00000000..343d1db7 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_1B.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_1C.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_1C.png new file mode 100644 index 00000000..89d5a5b9 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_1C.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_1D.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_1D.png new file mode 100644 index 00000000..58f621a4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_1D.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_1E.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_1E.png new file mode 100644 index 00000000..9c7fbf3b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_1E.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_1F.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_1F.png new file mode 100644 index 00000000..a88a086a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_1F.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_20.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_20.png new file mode 100644 index 00000000..7f58416b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_20.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_21.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_21.png new file mode 100644 index 00000000..66964996 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_21.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_22.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_22.png new file mode 100644 index 00000000..c12beacd Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_22.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_23.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_23.png new file mode 100644 index 00000000..dc081c91 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_23.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_24.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_24.png new file mode 100644 index 00000000..a72608b9 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_24.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_25.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_25.png new file mode 100644 index 00000000..fba91722 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_25.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_26.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_26.png new file mode 100644 index 00000000..9641f840 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_26.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_27.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_27.png new file mode 100644 index 00000000..a6d99c8a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_27.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_28.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_28.png new file mode 100644 index 00000000..358a414b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_28.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_29.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_29.png new file mode 100644 index 00000000..7ece5346 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_29.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_2A.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_2A.png new file mode 100644 index 00000000..6713fbf1 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_2A.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_2B.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_2B.png new file mode 100644 index 00000000..7108270b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_2B.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_2C.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_2C.png new file mode 100644 index 00000000..04369ea6 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_2C.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_2D.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_2D.png new file mode 100644 index 00000000..3a43bf9f Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_2D.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_2E.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_2E.png new file mode 100644 index 00000000..f17a127d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_2E.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_2F.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_2F.png new file mode 100644 index 00000000..8049f83d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_2F.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_30.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_30.png new file mode 100644 index 00000000..87a1b6d7 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_30.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_31.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_31.png new file mode 100644 index 00000000..d1a9e1ba Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_31.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_32.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_32.png new file mode 100644 index 00000000..06b38098 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_32.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_33.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_33.png new file mode 100644 index 00000000..31372341 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_33.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_34.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_34.png new file mode 100644 index 00000000..75240d6b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_34.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_35.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_35.png new file mode 100644 index 00000000..c53366d3 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_35.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_36.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_36.png new file mode 100644 index 00000000..89dd0147 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_36.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_37.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_37.png new file mode 100644 index 00000000..86818e12 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_37.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_38.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_38.png new file mode 100644 index 00000000..0d7ce9ba Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_38.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_39.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_39.png new file mode 100644 index 00000000..323e0c3d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_39.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_3A.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_3A.png new file mode 100644 index 00000000..8b2b4d8b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_3A.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_3B.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_3B.png new file mode 100644 index 00000000..f42d51d4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_3B.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_3C.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_3C.png new file mode 100644 index 00000000..083a92da Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_3C.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_3D.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_3D.png new file mode 100644 index 00000000..465b9b47 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_3D.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_3E.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_3E.png new file mode 100644 index 00000000..66c7d97e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_3E.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_3F.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_3F.png new file mode 100644 index 00000000..fd557b58 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_3F.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_40.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_40.png new file mode 100644 index 00000000..f66192f6 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_40.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_41.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_41.png new file mode 100644 index 00000000..e73f5a4d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_41.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_42.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_42.png new file mode 100644 index 00000000..abd075ce Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_42.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_43.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_43.png new file mode 100644 index 00000000..823bf103 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_43.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_44.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_44.png new file mode 100644 index 00000000..750ddf51 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_44.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_45.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_45.png new file mode 100644 index 00000000..055b239c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_45.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_46.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_46.png new file mode 100644 index 00000000..b019f5a9 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_46.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_47.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_47.png new file mode 100644 index 00000000..7a3fe80f Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_47.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_48.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_48.png new file mode 100644 index 00000000..80c3065a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_48.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_49.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_49.png new file mode 100644 index 00000000..d6c54c06 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_49.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_4A.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_4A.png new file mode 100644 index 00000000..438126be Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_4A.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_4B.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_4B.png new file mode 100644 index 00000000..0067b629 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_4B.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_4C.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_4C.png new file mode 100644 index 00000000..613d57f2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_4C.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_4D.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_4D.png new file mode 100644 index 00000000..bd9b8b3e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_4D.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_4E.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_4E.png new file mode 100644 index 00000000..0475ccca Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_4E.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_4F.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_4F.png new file mode 100644 index 00000000..8fb06bd2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_4F.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_50.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_50.png new file mode 100644 index 00000000..19ef3f63 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_50.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_51.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_51.png new file mode 100644 index 00000000..8c2cc60e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_51.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_52.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_52.png new file mode 100644 index 00000000..a1615f61 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_52.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_53.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_53.png new file mode 100644 index 00000000..d303d8b1 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_53.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_54.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_54.png new file mode 100644 index 00000000..7bc45be4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_54.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_55.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_55.png new file mode 100644 index 00000000..457996ca Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_55.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_56.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_56.png new file mode 100644 index 00000000..10a8f788 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_56.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_57.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_57.png new file mode 100644 index 00000000..e147b255 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_57.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_58.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_58.png new file mode 100644 index 00000000..f0ffb445 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_58.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_59.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_59.png new file mode 100644 index 00000000..13f0155f Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_59.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_5A.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_5A.png new file mode 100644 index 00000000..5d5f7c74 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_5A.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_5B.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_5B.png new file mode 100644 index 00000000..e5d33f53 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_5B.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_5C.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_5C.png new file mode 100644 index 00000000..4a292e8b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_5C.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_5D.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_5D.png new file mode 100644 index 00000000..975f832f Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_5D.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_5E.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_5E.png new file mode 100644 index 00000000..5e64061a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_5E.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_5F.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_5F.png new file mode 100644 index 00000000..52d12d3a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_5F.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_60.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_60.png new file mode 100644 index 00000000..6d677ab6 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_60.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_61.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_61.png new file mode 100644 index 00000000..28e6e314 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_61.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_62.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_62.png new file mode 100644 index 00000000..29b64848 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_62.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_63.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_63.png new file mode 100644 index 00000000..e4f5bbc7 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_63.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_64.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_64.png new file mode 100644 index 00000000..6ca84df0 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_64.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_65.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_65.png new file mode 100644 index 00000000..73000a53 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_65.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_66.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_66.png new file mode 100644 index 00000000..54a6506c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_66.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_67.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_67.png new file mode 100644 index 00000000..a326f389 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_67.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_68.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_68.png new file mode 100644 index 00000000..26c2c086 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_68.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_69.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_69.png new file mode 100644 index 00000000..cf28465b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_69.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_6A.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_6A.png new file mode 100644 index 00000000..f8a399a4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_6A.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_6B.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_6B.png new file mode 100644 index 00000000..1ad415cf Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_6B.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_6C.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_6C.png new file mode 100644 index 00000000..c359f2b5 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_6C.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_6D.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_6D.png new file mode 100644 index 00000000..b1f96be8 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_6D.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_6E.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_6E.png new file mode 100644 index 00000000..4b69dc89 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_6E.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_6F.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_6F.png new file mode 100644 index 00000000..9678cdd3 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_6F.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_70.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_70.png new file mode 100644 index 00000000..245ee9f4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_70.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_71.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_71.png new file mode 100644 index 00000000..54721e1d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_71.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_72.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_72.png new file mode 100644 index 00000000..aad17f8c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_72.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_73.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_73.png new file mode 100644 index 00000000..858e409b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_73.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_74.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_74.png new file mode 100644 index 00000000..2613bbe4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_74.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_75.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_75.png new file mode 100644 index 00000000..78fdb417 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_75.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_76.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_76.png new file mode 100644 index 00000000..232ebe3f Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_76.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_77.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_77.png new file mode 100644 index 00000000..1e0045c4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_77.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_78.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_78.png new file mode 100644 index 00000000..24a124c2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_78.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_79.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_79.png new file mode 100644 index 00000000..53fdd3e5 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_79.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_7A.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_7A.png new file mode 100644 index 00000000..2dcc560f Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_7A.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_7B.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_7B.png new file mode 100644 index 00000000..544dfe95 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_7B.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_7C.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_7C.png new file mode 100644 index 00000000..a476ce3c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_7C.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_7D.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_7D.png new file mode 100644 index 00000000..b547d5bb Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_7D.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_7E.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_7E.png new file mode 100644 index 00000000..83feea20 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_7E.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_7F.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_7F.png new file mode 100644 index 00000000..beb0bed4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_7F.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_80.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_80.png new file mode 100644 index 00000000..c97da9c0 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_80.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_81.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_81.png new file mode 100644 index 00000000..6c5944cc Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_81.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_82.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_82.png new file mode 100644 index 00000000..6c1fe0e4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_82.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_83.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_83.png new file mode 100644 index 00000000..423c90a0 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_83.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_84.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_84.png new file mode 100644 index 00000000..8f2e8c85 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_84.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_85.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_85.png new file mode 100644 index 00000000..1799c0d3 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_85.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_86.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_86.png new file mode 100644 index 00000000..ddf36edb Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_86.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_87.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_87.png new file mode 100644 index 00000000..6950664e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_87.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_88.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_88.png new file mode 100644 index 00000000..ba2afc91 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_88.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_89.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_89.png new file mode 100644 index 00000000..54f7f0f4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_89.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_8A.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_8A.png new file mode 100644 index 00000000..44a98609 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_8A.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_8B.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_8B.png new file mode 100644 index 00000000..f8411526 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_8B.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_8C.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_8C.png new file mode 100644 index 00000000..f0e0faac Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_8C.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_8D.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_8D.png new file mode 100644 index 00000000..3448dfa2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_8D.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_8E.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_8E.png new file mode 100644 index 00000000..24e378ae Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_8E.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_8F.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_8F.png new file mode 100644 index 00000000..da8116b1 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_8F.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_90.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_90.png new file mode 100644 index 00000000..8d322441 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_90.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_91.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_91.png new file mode 100644 index 00000000..25161436 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_91.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_92.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_92.png new file mode 100644 index 00000000..1dce777e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_92.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_93.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_93.png new file mode 100644 index 00000000..0cd88c45 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_93.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_94.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_94.png new file mode 100644 index 00000000..e4ed8ffb Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_94.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_95.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_95.png new file mode 100644 index 00000000..c2351611 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_95.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_96.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_96.png new file mode 100644 index 00000000..8dd0b6ea Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_96.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_97.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_97.png new file mode 100644 index 00000000..e9f15153 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_97.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_98.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_98.png new file mode 100644 index 00000000..ccf000c8 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_98.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_99.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_99.png new file mode 100644 index 00000000..181cd07b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_99.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_9A.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_9A.png new file mode 100644 index 00000000..75c49f6e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_9A.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_9B.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_9B.png new file mode 100644 index 00000000..9501459d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_9B.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_9C.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_9C.png new file mode 100644 index 00000000..af54e47e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_9C.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_9D.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_9D.png new file mode 100644 index 00000000..1c61203a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_9D.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_9E.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_9E.png new file mode 100644 index 00000000..ad805f8a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_9E.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_9F.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_9F.png new file mode 100644 index 00000000..f1632c08 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_9F.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A0.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A0.png new file mode 100644 index 00000000..c11b46ae Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A0.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A1.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A1.png new file mode 100644 index 00000000..79a554a2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A1.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A2.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A2.png new file mode 100644 index 00000000..712577b9 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A2.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A3.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A3.png new file mode 100644 index 00000000..8913bc96 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A3.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A4.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A4.png new file mode 100644 index 00000000..39f7f989 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A4.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A5.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A5.png new file mode 100644 index 00000000..865620be Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A5.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A6.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A6.png new file mode 100644 index 00000000..69012bcd Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A6.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A7.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A7.png new file mode 100644 index 00000000..efd1cd11 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A7.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A8.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A8.png new file mode 100644 index 00000000..55b79c02 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A8.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A9.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A9.png new file mode 100644 index 00000000..a275c39b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_A9.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_AA.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_AA.png new file mode 100644 index 00000000..5394ac7c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_AA.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_AB.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_AB.png new file mode 100644 index 00000000..96a74786 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_AB.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_AC.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_AC.png new file mode 100644 index 00000000..bd34b867 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_AC.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_AD.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_AD.png new file mode 100644 index 00000000..026899f9 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_AD.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_AE.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_AE.png new file mode 100644 index 00000000..49cfab89 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_AE.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_AF.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_AF.png new file mode 100644 index 00000000..b6b666df Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_AF.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B0.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B0.png new file mode 100644 index 00000000..28dc440e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B0.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B1.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B1.png new file mode 100644 index 00000000..d944e6f1 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B1.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B2.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B2.png new file mode 100644 index 00000000..ad6eaca4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B2.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B3.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B3.png new file mode 100644 index 00000000..0e11fadd Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B3.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B4.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B4.png new file mode 100644 index 00000000..03e74324 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B4.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B5.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B5.png new file mode 100644 index 00000000..4ebc7df6 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B5.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B6.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B6.png new file mode 100644 index 00000000..7c73305a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B6.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B7.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B7.png new file mode 100644 index 00000000..299ca4ee Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B7.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B8.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B8.png new file mode 100644 index 00000000..964f094a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B8.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B9.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B9.png new file mode 100644 index 00000000..2a4ba15d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_B9.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_BA.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_BA.png new file mode 100644 index 00000000..e8e32e6d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_BA.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_BB.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_BB.png new file mode 100644 index 00000000..130a7a6e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_BB.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_BC.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_BC.png new file mode 100644 index 00000000..31584307 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_BC.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_BD.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_BD.png new file mode 100644 index 00000000..3c369874 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_BD.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_BE.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_BE.png new file mode 100644 index 00000000..bc1e4d90 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_BE.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_BF.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_BF.png new file mode 100644 index 00000000..95174381 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_BF.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C0.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C0.png new file mode 100644 index 00000000..f5af2962 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C0.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C1.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C1.png new file mode 100644 index 00000000..b42f7982 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C1.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C2.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C2.png new file mode 100644 index 00000000..483f9212 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C2.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C3.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C3.png new file mode 100644 index 00000000..05b8c2bc Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C3.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C4.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C4.png new file mode 100644 index 00000000..e1f23a14 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C4.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C5.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C5.png new file mode 100644 index 00000000..8490de77 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C5.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C6.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C6.png new file mode 100644 index 00000000..92123f77 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C6.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C7.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C7.png new file mode 100644 index 00000000..86f444fc Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C7.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C8.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C8.png new file mode 100644 index 00000000..e5e7f70c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C8.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C9.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C9.png new file mode 100644 index 00000000..b289f71b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_C9.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_CA.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_CA.png new file mode 100644 index 00000000..5c3e6196 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_CA.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_CB.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_CB.png new file mode 100644 index 00000000..314e4134 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_CB.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_CC.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_CC.png new file mode 100644 index 00000000..75d5e30e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_CC.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_CD.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_CD.png new file mode 100644 index 00000000..73a44121 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_CD.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_CE.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_CE.png new file mode 100644 index 00000000..c0836349 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_CE.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_CF.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_CF.png new file mode 100644 index 00000000..be4094a8 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_CF.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D0.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D0.png new file mode 100644 index 00000000..955bdbbb Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D0.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D1.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D1.png new file mode 100644 index 00000000..8a50a7b6 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D1.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D2.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D2.png new file mode 100644 index 00000000..eebd5ae5 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D2.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D3.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D3.png new file mode 100644 index 00000000..2d3f63a2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D3.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D4.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D4.png new file mode 100644 index 00000000..b95104f6 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D4.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D5.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D5.png new file mode 100644 index 00000000..ab562fbf Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D5.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D6.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D6.png new file mode 100644 index 00000000..a181bd8c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D6.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D7.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D7.png new file mode 100644 index 00000000..83057df8 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_D7.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_F9.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_F9.png new file mode 100644 index 00000000..d683df45 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_F9.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_FA.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_FA.png new file mode 100644 index 00000000..25182d04 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_FA.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_FB.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_FB.png new file mode 100644 index 00000000..b6de14e3 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_FB.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_FC.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_FC.png new file mode 100644 index 00000000..0cfaa52c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_FC.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_FD.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_FD.png new file mode 100644 index 00000000..79687861 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_FD.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_FE.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_FE.png new file mode 100644 index 00000000..9b508ba6 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_FE.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_FF.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_FF.png new file mode 100644 index 00000000..da328a78 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_FF.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_sizes.bin b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_sizes.bin new file mode 100644 index 00000000..69c857e3 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/font/glyph_sizes.bin differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/alchemy.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/alchemy.png new file mode 100644 index 00000000..214a44bc Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/alchemy.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/allitems.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/allitems.png new file mode 100644 index 00000000..e1e5d779 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/allitems.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/background.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/background.png new file mode 100644 index 00000000..b29e0092 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/background.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/container.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/container.png new file mode 100644 index 00000000..bd1d383c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/container.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/crafting.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/crafting.png new file mode 100644 index 00000000..da831189 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/crafting.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/crash_logo.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/crash_logo.png new file mode 100644 index 00000000..78c5ef17 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/crash_logo.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/enchant.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/enchant.png new file mode 100644 index 00000000..0fddfd4c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/enchant.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/furnace.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/furnace.png new file mode 100644 index 00000000..8527289e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/furnace.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/gui.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/gui.png new file mode 100644 index 00000000..70c39540 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/gui.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/icons.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/icons.png new file mode 100644 index 00000000..e5d56d73 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/icons.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/inventory.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/inventory.png new file mode 100644 index 00000000..4d991169 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/inventory.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/items.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/items.png new file mode 100644 index 00000000..8f8a877e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/items.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/particles.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/particles.png new file mode 100644 index 00000000..ac7e39f4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/particles.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/slot.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/slot.png new file mode 100644 index 00000000..caf4786a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/slot.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/trap.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/trap.png new file mode 100644 index 00000000..594860a6 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/trap.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/unknown_pack.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/unknown_pack.png new file mode 100644 index 00000000..3a45a90e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/gui/unknown_pack.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/arrows.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/arrows.png new file mode 100644 index 00000000..75c58287 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/arrows.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/boat.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/boat.png new file mode 100644 index 00000000..132a0f7c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/boat.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/book.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/book.png new file mode 100644 index 00000000..ae411ff2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/book.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/cart.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/cart.png new file mode 100644 index 00000000..ba73b60d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/cart.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/chest.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/chest.png new file mode 100644 index 00000000..fece5e1a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/chest.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/door.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/door.png new file mode 100644 index 00000000..52df2d92 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/door.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/largechest.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/largechest.png new file mode 100644 index 00000000..fb6e94fe Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/largechest.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/sign.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/sign.png new file mode 100644 index 00000000..e8294724 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/sign.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/xporb.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/xporb.png new file mode 100644 index 00000000..33670ee6 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/item/xporb.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/dial.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/dial.png new file mode 100644 index 00000000..140e7e34 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/dial.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/explosion.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/explosion.png new file mode 100644 index 00000000..732069b3 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/explosion.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/foliagecolor.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/foliagecolor.png new file mode 100644 index 00000000..81673cae Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/foliagecolor.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/footprint.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/footprint.png new file mode 100644 index 00000000..e29b6a6d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/footprint.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/glint.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/glint.png new file mode 100644 index 00000000..67732093 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/glint.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/grasscolor.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/grasscolor.png new file mode 100644 index 00000000..a6d9c209 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/grasscolor.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/mapbg.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/mapbg.png new file mode 100644 index 00000000..ff2faaa7 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/mapbg.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/mapicons.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/mapicons.png new file mode 100644 index 00000000..9f325237 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/mapicons.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/particlefield.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/particlefield.png new file mode 100644 index 00000000..c8c56415 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/particlefield.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/pumpkinblur.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/pumpkinblur.png new file mode 100644 index 00000000..c6e2ffc9 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/pumpkinblur.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/shadow.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/shadow.png new file mode 100644 index 00000000..06d999b2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/shadow.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/tunnel.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/tunnel.png new file mode 100644 index 00000000..dc479e07 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/tunnel.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/vignette.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/vignette.png new file mode 100644 index 00000000..f236acb3 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/vignette.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/water.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/water.png new file mode 100644 index 00000000..8b92f9bc Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/water.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/watercolor.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/watercolor.png new file mode 100644 index 00000000..38bff05e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/misc/watercolor.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/cat_black.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/cat_black.png new file mode 100644 index 00000000..028ffcd1 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/cat_black.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/cat_red.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/cat_red.png new file mode 100644 index 00000000..5ca3fa1e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/cat_red.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/cat_siamese.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/cat_siamese.png new file mode 100644 index 00000000..70a88aed Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/cat_siamese.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/cavespider.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/cavespider.png new file mode 100644 index 00000000..288e5c3c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/cavespider.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/char.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/char.png new file mode 100644 index 00000000..7cfa08a8 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/char.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/chicken.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/chicken.png new file mode 100644 index 00000000..d4812939 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/chicken.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/cow.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/cow.png new file mode 100644 index 00000000..4264021e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/cow.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/creeper.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/creeper.png new file mode 100644 index 00000000..e0a5e0a1 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/creeper.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/beam.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/beam.png new file mode 100644 index 00000000..b0042418 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/beam.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/body.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/body.png new file mode 100644 index 00000000..e604a7ce Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/body.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/crystal.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/crystal.png new file mode 100644 index 00000000..f825ed69 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/crystal.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/dragon.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/dragon.png new file mode 100644 index 00000000..6abddc82 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/dragon.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/ender.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/ender.png new file mode 100644 index 00000000..2ea98241 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/ender.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/ender_eyes.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/ender_eyes.png new file mode 100644 index 00000000..1a98ba1c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/ender_eyes.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/shuffle.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/shuffle.png new file mode 100644 index 00000000..89be1d71 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderdragon/shuffle.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderman.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderman.png new file mode 100644 index 00000000..11b05d0e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderman.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderman_eyes.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderman_eyes.png new file mode 100644 index 00000000..8265fd7f Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/enderman_eyes.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/fire.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/fire.png new file mode 100644 index 00000000..05364b49 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/fire.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/ghast.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/ghast.png new file mode 100644 index 00000000..e83a60da Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/ghast.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/ghast_fire.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/ghast_fire.png new file mode 100644 index 00000000..fff9718c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/ghast_fire.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/lava.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/lava.png new file mode 100644 index 00000000..036812f2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/lava.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/ozelot.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/ozelot.png new file mode 100644 index 00000000..7a0b8b39 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/ozelot.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/pig.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/pig.png new file mode 100644 index 00000000..1ed505b5 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/pig.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/pigman.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/pigman.png new file mode 100644 index 00000000..c900b362 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/pigman.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/pigzombie.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/pigzombie.png new file mode 100644 index 00000000..0a0a25a4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/pigzombie.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/redcow.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/redcow.png new file mode 100644 index 00000000..c0a2c976 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/redcow.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/saddle.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/saddle.png new file mode 100644 index 00000000..aaea7a6d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/saddle.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/sheep.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/sheep.png new file mode 100644 index 00000000..647d0dd2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/sheep.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/sheep_fur.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/sheep_fur.png new file mode 100644 index 00000000..f1291a5f Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/sheep_fur.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/silverfish.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/silverfish.png new file mode 100644 index 00000000..cc84f1d0 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/silverfish.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/skeleton.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/skeleton.png new file mode 100644 index 00000000..9d223394 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/skeleton.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/slime.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/slime.png new file mode 100644 index 00000000..42fc8736 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/slime.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/snowman.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/snowman.png new file mode 100644 index 00000000..7cab7144 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/snowman.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/spider.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/spider.png new file mode 100644 index 00000000..08344a83 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/spider.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/spider_eyes.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/spider_eyes.png new file mode 100644 index 00000000..2a7734f9 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/spider_eyes.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/squid.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/squid.png new file mode 100644 index 00000000..ff3f5b0a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/squid.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager.png new file mode 100644 index 00000000..1a496f33 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager/butcher.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager/butcher.png new file mode 100644 index 00000000..702cb8cf Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager/butcher.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager/farmer.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager/farmer.png new file mode 100644 index 00000000..683c3d51 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager/farmer.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager/librarian.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager/librarian.png new file mode 100644 index 00000000..5b7da625 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager/librarian.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager/priest.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager/priest.png new file mode 100644 index 00000000..928eab46 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager/priest.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager/smith.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager/smith.png new file mode 100644 index 00000000..c70b4bb8 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager/smith.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager/villager.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager/villager.png new file mode 100644 index 00000000..aa3afde8 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager/villager.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager_golem.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager_golem.png new file mode 100644 index 00000000..24c46185 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/villager_golem.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/wolf.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/wolf.png new file mode 100644 index 00000000..7a723066 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/wolf.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/wolf_angry.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/wolf_angry.png new file mode 100644 index 00000000..89b3d2d6 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/wolf_angry.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/wolf_tame.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/wolf_tame.png new file mode 100644 index 00000000..d46e572c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/wolf_tame.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/zombie.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/zombie.png new file mode 100644 index 00000000..5f39fd80 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/mob/zombie.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/pack.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/pack.png new file mode 100644 index 00000000..973a7cf2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/pack.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/pack.txt b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/pack.txt new file mode 100644 index 00000000..c14bb3b4 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/pack.txt @@ -0,0 +1,2 @@ +The default look of Minecraft + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/particles.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/particles.png new file mode 100644 index 00000000..de34f1b9 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/particles.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/terrain.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/terrain.png new file mode 100644 index 00000000..4d2270b8 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/terrain.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/terrain/moon.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/terrain/moon.png new file mode 100644 index 00000000..61cebbc7 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/terrain/moon.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/terrain/moon_phases.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/terrain/moon_phases.png new file mode 100644 index 00000000..ce239ea7 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/terrain/moon_phases.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/terrain/sun.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/terrain/sun.png new file mode 100644 index 00000000..43ba79a9 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/terrain/sun.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/bg/panorama0.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/bg/panorama0.png new file mode 100644 index 00000000..8ba1dadd Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/bg/panorama0.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/bg/panorama1.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/bg/panorama1.png new file mode 100644 index 00000000..c16841ad Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/bg/panorama1.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/bg/panorama2.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/bg/panorama2.png new file mode 100644 index 00000000..0436d776 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/bg/panorama2.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/bg/panorama3.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/bg/panorama3.png new file mode 100644 index 00000000..2c7ad778 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/bg/panorama3.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/bg/panorama4.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/bg/panorama4.png new file mode 100644 index 00000000..03900967 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/bg/panorama4.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/bg/panorama5.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/bg/panorama5.png new file mode 100644 index 00000000..0331ad4a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/bg/panorama5.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/black.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/black.png new file mode 100644 index 00000000..dc2ad3e7 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/black.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/credits.txt b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/credits.txt new file mode 100644 index 00000000..8f593e24 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/credits.txt @@ -0,0 +1,57 @@ +[C]§f=============== +[C]§eMinecraft Credits +[C]§f=============== + +§7Created by: +§f Markus Persson + +§7Game design, programming and graphics: +§f Markus Persson +§f Jens Bergensten + +§7Music and sound: +§f Daniel Rosenfeld + +§7Ingame artwork and paintings: +§f Kristoffer Zetterstrand + +§7End game narrative: +§f Julian Gough + +§7Website development: +§f Tobias Möllstam +§f Daniel Frisk +§f Leonard Axelsson +§f Jens Bergensten +§f Markus Persson + +§7Logo and promotional artwork: +§f Markus Toivonen + +§7Business and administration: +§f Carl Manneh +§f Daniel Kaplan + +§7Director of fun: +§f Lydia Winters + +§7Number crunching and statistics: +§f Patrick Geuder + +§7Additional programming: +§f Paul Spooner +§f Ryan 'Scaevolus' Hitchman +§f Elliot 'Hippoplatimus' Segal + +§7Technologies used: +§f Java by Oracle +§f LWJGL by many talented people +§f "3d Sound System" by Paul Lamb +§f JOrbis by JCraft + + + + + + +§f"Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover." §7- Mark Twain \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/earlyplayers.txt b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/earlyplayers.txt new file mode 100644 index 00000000..eee4d7bc --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/earlyplayers.txt @@ -0,0 +1,722 @@ +ez +Racccccer12 +UlyssesSlaughter +newspaperboy55 +eatwhitefish +AmpTxFeaR +danteELITE +SoulPL +Ami2804 +Infamus +Rufus1852 +Raymoo9 +Muhs +MuHW +Steelion +Zee_Man +jackpeneycad +Mugz +Goonerman97 +Mimoun +bjoel2 +Pottux +timdv +DDJD9 +Damien27 +TheEyesOfLife +muji +Private_Public +BrickInTheHead +TimeZ +rip1427 +lennonzb654 +Parger129 +Snowbar +Vladivostok1 +Ginger879 +instagibb +marhom +paramime +RyleLGS +verbel +trovanon +Thorizzle +NinjaManBLAM +mudu +Delirus +SmickeyMcgee +MathewMkay +UncleMonteh +BigZ94 +tomtheuseless +Damien76 +Muff +snijboon1 +fuzzyliam780 +Gigith +Kanten +Jimmybean +Soulsy +SoulSR +Timic +deadlus +damien86 +Timin +Hutchenstein +damien95 +azoreanjeff +quackstar84 +korokun +randomshot +Triss247 +Tythiss +Murf +samwise +Murg +loltank +Murx +Harbinger617 +musa +killian123 +gumigoo +Soulix +BrettsFly +BrianBoyko +zarkboy +Mupz +Elad98 +tkranyak +kazeako +Turbopenguin42 +Tubbywatch +zionishe +johnyliltoe +Riczone +gamesta62 +AHungryHungarian +mups +varun_nath93 +Ratherdash +XenosEriadin +Vaedritol +dannyrocker +Mull +Tonya01 +sully96 +NJL97 +interfect +novack +spacepotatoman +Timan +funkjosh +teecubed333 +Snarkout89 +Nubsawce +DoubleOBond +Vault48 +Ninjila +DevonWargod +jkjk600 +Mulm +nathan329 +Mimore +reisyukaku +Georukh +Tokiko +NotBaldwin +zerox106 +Marakuja +Murhapuro +Bigbrown4114493 +boggyman123 +peter_buchan +Doozle +jpeuvion +iNTENZOR +Muzn +David987654321 +zjcain877 +nerbil +thaboyster +mitchyslick +Sirius_Amory +slatts +AndrijaG1 +JeffersonWilson +partyvan0 +Muzk +Muwo +TaoTev +sustainablejoe +destroyer451 +mune +hivemind101 +timbo +timba +Nodlehs +robotnik185 +darthmaul22 +jtslug +Shazbar +Brawlfanboy +nickschober +Muss +AceFantastic +deloctyte +Teck87 +sOuLsK +gnomerman +Sgt_Grumbles +imgreglol +InvertedMutiny +h4rris +CommodoreSkippy +Toysrmi +Slashwrists +SickThiele +Krakatoah +rellimnoraa +Muty +TazDontTap +borscht +Mikomaxless +blamblamblam +HelloMeow +Souleh +accronym +Darkokillzall +Nathan271 +djmousey +metalchaos +GentleBro +RorySmale +vipiao +Proffen93 +EwanJackson +doozey +Mikedood +blaskkaffe +josefkenny +Burned_Toast +Gigify +Justin_Joffrion +Yourself +MysterySMJ +Newbyninja +MidgetCo +Compwiz1993 +raymosh +Lucifersknight +irrationalistic +Shazbot +Lunchebox +kansom +shoggdog +mult +Fulibor +Murr +bails12 +Runn3R +scottlfc96 +Tim_K +Acctubi +suckonmyproness +Heenix +Fudgelette +deadmat +RedMageZidane +lukyluke +TaosSW +tegera1 +ThePaperclip +Arcsoft +Nik_Mahmood +Mark42 +Novaok +instagibz +ophelia123 +Mulk +nyleva +tazelhoff +liamh101 +lichking155 +drunkster +Timothy +Munk +Ginger987 +link825 +verado +markaidos13 +Sniper_Kill98 +czechplz +Sanctuary1 +TheBrokenOne +bdogproductions1 +mvit +LewisBroderick +Verace +picardan +Eskill +VictoriouSecret +Knightstrike +StatutoryApe66 +drewscreations +ollieg80 +anuador +Magneticmyst +Alaflex +OneOfTheAbove +TheEvilPenguin +Eskilo +voigt88 +ArtfulDodger42 +ws141 +BlondeUnknown +Pillsbury27530 +Stressless +DoctorProto +Evil_Otto +piippe +gohoosiers29 +Tullymanbanana +erikolanan +Muzy +loopylouise +drakkheim +VJ396768 +Invisix +Nametaker40 +mwoody +Jalathas +Wyrelade +starjik +Verail +frjulia +Mutagen +Zed_Boss +babymuseum +squiresfan +lephareamousse +Tilex +Larrss12 +VorSandwich +wollemamoth +Exodeux +O8GC +Keeko15 +danjt42 +farmerfarley +Ryan_Cook +Zharger +squalllion1uk +10882 +SLAPPAYURFACE +Tilan +nukerman +Arachnid0101 +Bzkill +toshiro7 +Link777 +ethos231 +olliedag +garrison888 +atronajs +Rafiki1996 +devinmrn +PutNameHere +JasonFozzy +ddj88 +MinwuWhite +imedio +JCabasquini +Raymose +Wyvryn +Artemisser +jcurses +Levis96 +MVec +Intenzio +Antthemighty +Coltrex +luckydog1123 +Utterballe +Kahdgar +doom195 +Bb505 +mnj777 +Teuprobont +koroke2 +ImaShortKid +Doomliquor +mvst +Helelos +Shuma22 +Zxcvbnmkj +TiLeN +spintherism +Aellia +Wrenky +Bipolarbear +TheShipoopi +Barkerman47 +Atercrest +ZeroPoints +Techvi +austinpika +Jinjithillion +PaRaDOX_578 +rocketseed +m616vp +GrasshopperInPJs +snyper1243 +Tash_Michael +Llamathelegend +MidgetMe +SOCCERKICK +Link709 +nathan420 +pleasedont +pants12 +Tilon +Tuddywutwut +slatie +Marict +bobless +musp +bigkev169 +AngryRhetoric +MisterYura +guster11 +thommyt +DiannaoChong +Nernums +Dartheh +Nyholtern +ApertureSci +heythomwhatsup +DarthFJ +sfbobz +Tiksi +irishgranader +LichKing112 +tim96 +tim92 +karlos_kumma +lomelith +flyers1980 +Penzane121 +p0megranates +xKRYPTiiCx +TheXshot +mrtibgfdk +techne +alanaki2 +derlandsknecht +Regrub +SgtWesticles +Tee_Bee +3b +eljay808 +George1997 +magnusgerner +MOMA231 +Mariko +haffissx +str3ss +Arkanatos +Ereh_Dogon +Tokida +Crimsonwave +NECHTOVIKING +dakota6565 +unjustend +kanuck +uncountedvermin +Dreamslinger +zach_pwns1 +mini_ninja +Timoteh +Hoppip +GracefulTed +The_WasteLands +TyphoonFour +TheNetherhero +namapus +Clowreisung +Mariel +jyscal +AndyR311 +hoshinokaze +Genshinin +Eddie0715 +erikadair +o7uk +DINOhurp +Sheridan +runnie +Eskiel +starian +Sakisbrat +Symbiote100 +Aramande +kantra +Gundozer +bongis1 +Mwonti +guspa01 +lightjedi5 +Darthim +asian0sensation +Techie +andocmdo +PatrickDyderski +pottan +darthd1 +8U +JetForceGemini1 +tk300 +thomjoo +dragonking17 +leekyboy +spike6599 +Anthony_Stone +TehJammers +LudVichzme +Crunchy_Chicken +Asytra +Hopper +Kantos +Starion +Xaiano +Tim87 +kurtje89 +ansemx13 +tiong +Tony_Perkis +Cephalopod +techk8 +Abbsence +NeonLotus +Slaveg +marfnl +Balisung +Funky_Zebra +xblah1242 +Leprkan +VerbNounGuy +MegaLoser +Delirix +Eladon +tman12354 +clorigu2 +Sputters +UnlabledMilk +Techin +Mark15 +scriptersx +starink +DGmustard +MarioG +Csheroe +nnutnut +TheCloak +shodan1138 +bigz2k +Tikot +TheAndy97 +L4rsThomas +mario1 +mariok +tadtad994 +bsdpunk +BigZ33 +LittleRaptor +Cazif +mwnj +Kjermy +TheKanKin +cousinoer5 +Goddish +Feragon +Adz666 +Radar38 +AK47Xeall +41dasircyril27 +Cazic +RinPinion +skinnyondrums +Nehmulos +User123abc +JockBassman +DragonKing06 +xXcr1sXx +Groblox +bonghit +cy1337 +exzzz +Kantuz +Jemeni +aronz11 +Nepthan +FlygonWing +MechaDolphin +Gamoocha +stark62 +raven10165 +MrBlackswordsman +wanderingman +fzuul +RedneckNinja +Cygggy +Navysealcdr +KenjiNinja +GaMeOvEr_Mac +Dr_Zandi +jiffman +Synthetic_Moose +kittemusen +Asyvan +GamerTheHut +Tim34 +g33kster +memnarch +Cazen +BLASTER504 +Nylhin +ClosetAxelsexual +toxicman44 +MrSalvador +Locaido +slava8 +vangunda +Tricky14 +Nathan051 +8BitAce +swashyson +juxxi +jclong98 +andy8271 +crystaldeluxe +Bongers +mariio +michellevisuano +glendrine +Rockeysa +DrillDazer +slaven +doclobsta +jcirque +Aldurg +underd0g +Blockbyblockx +Lathyrus +bjogje +Harbulblum +Jemeyr +faja2485 +jojo11 +muushu +McTwist +Parilax +BumTheBobo +Jerkakame +hawkeyeff7 +Xsdfa +JoJo07 +mwtb +proffenke +endairo +Kintine +wraytehbeast +onarga88 +Scoodles +Kurunth +Madcat2575 +MothBones +Grindforit +CaptMarion +RjRocket +abbysall19 +nicksandvich +Lil_Richard3 +onigame +DarthG1 +Swiftnsilent +Mini_Zen +hmv007 +my2k +McDeathNugget +Tinus +ag00dnewb +MarioZ +matidios +runjmc +cazjs +Blue1681 +Parilus +asger1002 +AzraelEternity +npack72 +KingGeebs +kmmeerts +samwii1 +tiohn +Bigbyrd39 +damienix +nathan105 +MartianCat +CraimerX +ErikyErik +TheClock +n1njabread +levinet +Dagabond +Supernurd +TNASESRaider +saki2fifty +green731 +Tnextdoor +jojo56 +lolcoptr +Tekneus +Sockrates +CraZyKoKeNo +PillowTalk +darkconsole +aus_smurf +Mwoa +Starman_MD +Dr_Tom +Dooxie +Feralparrot +Ewstar +Bonedust +MrTomnus +Marexx +RoughOutline +Bugler +Wonderwhale +nikeneo +damieng0 +Lolsarfesh +jemen9 +sdsmittie +MarkSoupial +Danthefat2 +TechTF +darkquilan +shnoka +DamienDe +JrFlav +ExiledRen1250 +theevilone +Disciple_of_Bob +lazormaggot +grantcallahan +MnehDroid +xnoobonex +slax01 +MarfXD +sniperwolf329 +ChestStrongwell +Poundcake \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/mclogo.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/mclogo.png new file mode 100644 index 00000000..a69254d2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/mclogo.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/mojang.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/mojang.png new file mode 100644 index 00000000..023f0b4f Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/mojang.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/splashes.txt b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/splashes.txt new file mode 100644 index 00000000..567f890d --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/splashes.txt @@ -0,0 +1,304 @@ +This message will never appear on the splash screen, isn't that weird? +Hobo humping slobo babe! +This text is hard to read if you play the game at the default resolution, but at 1080p it's fine! +As seen on TV! +Awesome! +100% pure! +May contain nuts! +Better than Prey! +More polygons! +Sexy! +Limited edition! +Flashing letters! +Made by Notch! +It's here! +Best in class! +It's finished! +Kind of dragon free! +Excitement! +More than 500 sold! +One of a kind! +Heaps of hits on YouTube! +Indev! +Spiders everywhere! +Check it out! +Holy cow, man! +It's a game! +Made in Sweden! +Uses LWJGL! +Reticulating splines! +Minecraft! +Yaaay! +Singleplayer! +Keyboard compatible! +Undocumented! +Ingots! +Exploding creepers! +That's no moon! +l33t! +Create! +Survive! +Dungeon! +Exclusive! +The bee's knees! +Down with O.P.P.! +Closed source! +Classy! +Wow! +Not on steam! +Oh man! +Awesome community! +Pixels! +Teetsuuuuoooo! +Kaaneeeedaaaa! +Now with difficulty! +Enhanced! +90% bug free! +Pretty! +12 herbs and spices! +Fat free! +Absolutely no memes! +Free dental! +Ask your doctor! +Minors welcome! +Cloud computing! +Legal in Finland! +Hard to label! +Technically good! +Bringing home the bacon! +Indie! +GOTY! +Ceci n'est pas une title screen! +Euclidian! +Now in 3D! +Inspirational! +Herregud! +Complex cellular automata! +Yes, sir! +Played by cowboys! +OpenGL 1.2! +Thousands of colors! +Try it! +Age of Wonders is better! +Try the mushroom stew! +Sensational! +Hot tamale, hot hot tamale! +Play him off, keyboard cat! +Guaranteed! +Macroscopic! +Bring it on! +Random splash! +Call your mother! +Monster infighting! +Loved by millions! +Ultimate edition! +Freaky! +You've got a brand new key! +Water proof! +Uninflammable! +Whoa, dude! +All inclusive! +Tell your friends! +NP is not in P! +Notch <3 ez! +Music by C418! +Livestreamed! +Haunted! +Polynomial! +Terrestrial! +All is full of love! +Full of stars! +Scientific! +Cooler than Spock! +Collaborate and listen! +Never dig down! +Take frequent breaks! +Not linear! +Han shot first! +Nice to meet you! +Buckets of lava! +Ride the pig! +Larger than Earth! +sqrt(-1) love you! +Phobos anomaly! +Punching wood! +Falling off cliffs! +0% sugar! +150% hyperbole! +Synecdoche! +Let's danec! +Seecret Friday update! +Reference implementation! +Lewd with two dudes with food! +Kiss the sky! +20 GOTO 10! +Verlet intregration! +Peter Griffin! +Do not distribute! +Cogito ergo sum! +4815162342 lines of code! +A skeleton popped out! +The Work of Notch! +The sum of its parts! +BTAF used to be good! +I miss ADOM! +umop-apisdn! +OICU812! +Bring me Ray Cokes! +Finger-licking! +Thematic! +Pneumatic! +Sublime! +Octagonal! +Une baguette! +Gargamel plays it! +Rita is the new top dog! +SWM forever! +Representing Edsbyn! +Matt Damon! +Supercalifragilisticexpialidocious! +Consummate V's! +Cow Tools! +Double buffered! +Fan fiction! +Flaxkikare! +Jason! Jason! Jason! +Hotter than the sun! +Internet enabled! +Autonomous! +Engage! +Fantasy! +DRR! DRR! DRR! +Kick it root down! +Regional resources! +Woo, facepunch! +Woo, somethingawful! +Woo, /v/! +Woo, tigsource! +Woo, minecraftforum! +Woo, worldofminecraft! +Woo, reddit! +Woo, 2pp! +Google anlyticsed! +Now supports åäö! +Give us Gordon! +Tip your waiter! +Very fun! +12345 is a bad password! +Vote for net neutrality! +Lives in a pineapple under the sea! +MAP11 has two names! +Omnipotent! +Gasp! +...! +Bees, bees, bees, bees! +Jag känner en bot! +Haha, LOL! +Hampsterdance! +Switches and ores! +Menger sponge! +idspispopd! +Eple (original edit)! +So fresh, so clean! +Slow acting portals! +Try the Nether! +Don't look directly at the bugs! +Oh, ok, Pigmen! +Finally with ladders! +Scary! +Play Minecraft, Watch Topgear, Get Pig! +Twittered about! +Jump up, jump up, and get down! +Joel is neat! +A riddle, wrapped in a mystery! +Huge tracts of land! +Welcome to your Doom! +Stay a while, stay forever! +Stay a while and listen! +Treatment for your rash! +"Autological" is! +Information wants to be free! +"Almost never" is an interesting concept! +Lots of truthiness! +The creeper is a spy! +Turing complete! +It's groundbreaking! +Let our battle's begin! +The sky is the limit! +Jeb has amazing hair! +Casual gaming! +Undefeated! +Kinda like Lemmings! +Follow the train, CJ! +Leveraging synergy! +DungeonQuest is unfair! +110813! +90210! +Check out the far lands! +Tyrion would love it! +Also try VVVVVV! +Also try Super Meat Boy! +Also try Terraria! +Also try Mount And Blade! +Also try Project Zomboid! +Also try World of Goo! +Also try Limbo! +Also try Pixeljunk Shooter! +Also try Braid! +That's super! +Bread is pain! +Read more books! +Khaaaaaaaaan! +Less addictive than TV Tropes! +More addictive than lemonade! +Bigger than a bread box! +Millions of peaches! +Fnord! +This is my true form! +Totally forgot about Dre! +Don't bother with the clones! +Pumpkinhead! +Made by Jeb! +Has an ending! +Finally complete! +Feature packed! +Boots with the fur! +Stop, hammertime! +Testificates! +Conventional! +Homeomorphic to a 3-sphere! +Doesn't avoid double negatives! +Place ALL the blocks! +Does barrel rolls! +Meeting expectations! +PC gaming since 1873! +Ghoughpteighbteau tchoghs! +Déjà vu! +Déjà vu! +Got your nose! +Haley loves Elan! +Afraid of the big, black bat! +Doesn't use the U-word! +Child's play! +See you next Friday or so! +From the streets of Södermalm! +150 bpm for 400000 minutes! +Technologic! +Funk soul brother! +Pumpa kungen! +日本ãƒãƒ­ãƒ¼ï¼ +한국 안녕하세요! +Helo Cymru! +Cześć Polska! +ä½ å¥½ä¸­å›½ï¼ +Привет РоÑÑиÑ! +Γεια σου Ελλάδα! +My life for Aiur! +Lennart lennart = new Lennart(); +I see your vocabulary has improved! +Who put it there? +You can't explain that! +if not ok then return end +§1C§2o§3l§4o§5r§6m§7a§8t§9i§ac +§kFUNKY LOL +SOPA means LOSER in Swedish diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/win.txt b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/win.txt new file mode 100644 index 00000000..72775248 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/1_2_2/title/win.txt @@ -0,0 +1,151 @@ +§3I see the player you mean. + +§2PLAYERNAME? + +§3Yes. Take care. It has reached a higher level now. It can read our thoughts. + +§2That doesn't matter. It thinks we are part of the game. + +§3I like this player. It played well. It did not give up. + +§2It is reading our thoughts as though they were words on a screen. + +§3That is how it chooses to imagine many things, when it is deep in the dream of a game. + +§2Words make a wonderful interface. Very flexible. And less terrifying than staring at the reality behind the screen. + +§3They used to hear voices. Before players could read. Back in the days when those who did not play called the players witches, and warlocks. And players dreamed they flew through the air, on sticks powered by demons. + +§2What did this player dream? + +§3This player dreamed of sunlight and trees. Of fire and water. It dreamed it created. And it dreamed it destroyed. It dreamed it hunted, and was hunted. It dreamed of shelter. + +§2Hah, the original interface. A million years old, and it still works. But what true structure did this player create, in the reality behind the screen? + +§3It worked, with a million others, to sculpt a true world in a fold of the §f§k§a§b§3, and created a §f§k§a§b§3 for §f§k§a§b§3, in the §f§k§a§b§3. + +§2It cannot read that thought. + +§3No. It has not yet achieved the highest level. That, it must achieve in the long dream of life, not the short dream of a game. + +§2Does it know that we love it? That the universe is kind? + +§3Sometimes, through the noise of its thoughts, it hears the universe, yes. + +§2But there are times it is sad, in the long dream. It creates worlds that have no summer, and it shivers under a black sun, and it takes its sad creation for reality. + +§3To cure it of sorrow would destroy it. The sorrow is part of its own private task. We cannot interfere. + +§2Sometimes when they are deep in dreams, I want to tell them, they are building true worlds in reality. Sometimes I want to tell them of their importance to the universe. Sometimes, when they have not made a true connection in a while, I want to help them to speak the word they fear. + +§3It reads our thoughts. + +§2Sometimes I do not care. Sometimes I wish to tell them, this world you take for truth is merely §f§k§a§b§2 and §f§k§a§b§2, I wish to tell them that they are §f§k§a§b§2 in the §f§k§a§b§2. They see so little of reality, in their long dream. + +§3And yet they play the game. + +§2But it would be so easy to tell them... + +§3Too strong for this dream. To tell them how to live is to prevent them living. + +§2I will not tell the player how to live. + +§3The player is growing restless. + +§2I will tell the player a story. + +§3But not the truth. + +§2No. A story that contains the truth safely, in a cage of words. Not the naked truth that can burn over any distance. + +§3Give it a body, again. + +§2Yes. Player... + +§3Use its name. + +§2PLAYERNAME. Player of games. + +§3Good. + +§2Take a breath, now. Take another. Feel air in your lungs. Let your limbs return. Yes, move your fingers. Have a body again, under gravity, in air. Respawn in the long dream. There you are. Your body touching the universe again at every point, as though you were separate things. As though we were separate things. + +§3Who are we? Once we were called the spirit of the mountain. Father sun, mother moon. Ancestral spirits, animal spirits. Jinn. Ghosts. The green man. Then gods, demons. Angels. Poltergeists. Aliens, extraterrestrials. Leptons, quarks. The words change. We do not change. + +§2We are the universe. We are everything you think isn't you. You are looking at us now, through your skin and your eyes. And why does the universe touch your skin, and throw light on you? To see you, player. To know you. And to be known. I shall tell you a story. + +§2Once upon a time, there was a player. + +§3The player was you, PLAYERNAME. + +§2Sometimes it thought itself human, on the thin crust of a spinning globe of molten rock. The ball of molten rock circled a ball of blazing gas that was three hundred and thirty thousand times more massive than it. They were so far apart that light took eight minutes to cross the gap. The light was information from a star, and it could burn your skin from a hundred and fifty million kilometres away. + +§2Sometimes the player dreamed it was a miner, on the surface of a world that was flat, and infinite. The sun was a square of white. The days were short; there was much to do; and death was a temporary inconvenience. + +§3Sometimes the player dreamed it was lost in a story. + +§2Sometimes the player dreamed it was other things, in other places. Sometimes these dreams were disturbing. Sometimes very beautiful indeed. Sometimes the player woke from one dream into another, then woke from that into a third. + +§3Sometimes the player dreamed it watched words on a screen. + +§2Let's go back. + +§2The atoms of the player were scattered in the grass, in the rivers, in the air, in the ground. A woman gathered the atoms; she drank and ate and inhaled; and the woman assembled the player, in her body. + +§2And the player awoke, from the warm, dark world of its mother's body, into the long dream. + +§2And the player was a new story, never told before, written in letters of DNA. And the player was a new program, never run before, generated by a sourcecode a billion years old. And the player was a new human, never alive before, made from nothing but milk and love. + +§3You are the player. The story. The program. The human. Made from nothing but milk and love. + +§2Let's go further back. + +§2The seven billion billion billion atoms of the player's body were created, long before this game, in the heart of a star. So the player, too, is information from a star. And the player moves through a story, which is a forest of information planted by a man called Julian, on a flat, infinite world created by a man called Markus, that exists inside a small, private world created by the player, who inhabits a universe created by... + +§3Shush. Sometimes the player created a small, private world that was soft and warm and simple. Sometimes hard, and cold, and complicated. Sometimes it built a model of the universe in its head; flecks of energy, moving through vast empty spaces. Sometimes it called those flecks "electrons" and "protons". + +§2Sometimes it called them "planets" and "stars". + +§2Sometimes it believed it was in a universe that was made of energy that was made of offs and ons; zeros and ones; lines of code. Sometimes it believed it was playing a game. Sometimes it believed it was reading words on a screen. + +§3You are the player, reading words... + +§2Shush... Sometimes the player read lines of code on a screen. Decoded them into words; decoded words into meaning; decoded meaning into feelings, emotions, theories, ideas, and the player started to breathe faster and deeper and realised it was alive, it was alive, those thousand deaths had not been real, the player was alive + +§3You. You. You are alive. + +§2and sometimes the player believed the universe had spoken to it through the sunlight that came through the shuffling leaves of the summer trees + +§3and sometimes the player believed the universe had spoken to it through the light that fell from the crisp night sky of winter, where a fleck of light in the corner of the player's eye might be a star a million times as massive as the sun, boiling its planets to plasma in order to be visible for a moment to the player, walking home at the far side of the universe, suddenly smelling food, almost at the familiar door, about to dream again + +§2and sometimes the player believed the universe had spoken to it through the zeros and ones, through the electricity of the world, through the scrolling words on a screen at the end of a dream + +§3and the universe said I love you + +§2and the universe said you have played the game well + +§3and the universe said everything you need is within you + +§2and the universe said you are stronger than you know + +§3and the universe said you are the daylight + +§2and the universe said you are the night + +§3and the universe said the darkness you fight is within you + +§2and the universe said the light you seek is within you + +§3and the universe said you are not alone + +§2and the universe said you are not separate from every other thing + +§3and the universe said you are the universe tasting itself, talking to itself, reading its own code + +§2and the universe said I love you because you are love. + +§3And the game was over and the player woke up from the dream. And the player began a new dream. And the player dreamed again, dreamed better. And the player was the universe. And the player was love. + +§3You are the player. + +§2Wake up. diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Candy/Data/TexturePack.xzp b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Candy/Data/TexturePack.xzp new file mode 100644 index 00000000..f2e865fc Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Candy/Data/TexturePack.xzp differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Candy/Data/x16Data.pck b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Candy/Data/x16Data.pck new file mode 100644 index 00000000..50d5d4ee Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Candy/Data/x16Data.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/City/Data/TexturePack.xzp b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/City/Data/TexturePack.xzp new file mode 100644 index 00000000..b2d02efd Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/City/Data/TexturePack.xzp differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/City/Data/x32Data.pck b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/City/Data/x32Data.pck new file mode 100644 index 00000000..4968ba01 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/City/Data/x32Data.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Fantasy/Data/TexturePack.xzp b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Fantasy/Data/TexturePack.xzp new file mode 100644 index 00000000..87fc9d91 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Fantasy/Data/TexturePack.xzp differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Fantasy/Data/x32Data.pck b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Fantasy/Data/x32Data.pck new file mode 100644 index 00000000..9d909b93 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Fantasy/Data/x32Data.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Halloween/Data/TexturePack.xzp b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Halloween/Data/TexturePack.xzp new file mode 100644 index 00000000..ce7ea034 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Halloween/Data/TexturePack.xzp differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Halloween/Data/x16Data.pck b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Halloween/Data/x16Data.pck new file mode 100644 index 00000000..9da2ef1b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Halloween/Data/x16Data.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Halo/Data/GameRules.grf b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Halo/Data/GameRules.grf new file mode 100644 index 00000000..05fb95d1 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Halo/Data/GameRules.grf differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Halo/Data/TexturePack.xzp b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Halo/Data/TexturePack.xzp new file mode 100644 index 00000000..73339be4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Halo/Data/TexturePack.xzp differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Halo/Data/x16Data.pck b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Halo/Data/x16Data.pck new file mode 100644 index 00000000..63d88194 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Halo/Data/x16Data.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Halo/TexturePack.pck b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Halo/TexturePack.pck new file mode 100644 index 00000000..fddfbb38 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Halo/TexturePack.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/MassEffect/Data/GameRules.grf b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/MassEffect/Data/GameRules.grf new file mode 100644 index 00000000..48816b27 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/MassEffect/Data/GameRules.grf differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/MassEffect/Data/TexturePack.xzp b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/MassEffect/Data/TexturePack.xzp new file mode 100644 index 00000000..5b2df78a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/MassEffect/Data/TexturePack.xzp differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/MassEffect/Data/masseffect.mcs b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/MassEffect/Data/masseffect.mcs new file mode 100644 index 00000000..c3e1cb8d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/MassEffect/Data/masseffect.mcs differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/MassEffect/Data/x16Data.pck b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/MassEffect/Data/x16Data.pck new file mode 100644 index 00000000..2c01acae Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/MassEffect/Data/x16Data.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/MassEffect/TexturePack.pck b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/MassEffect/TexturePack.pck new file mode 100644 index 00000000..e0576ed8 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/MassEffect/TexturePack.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Natural/Data/TexturePack.xzp b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Natural/Data/TexturePack.xzp new file mode 100644 index 00000000..34f7dc99 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Natural/Data/TexturePack.xzp differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Natural/Data/x32Data.pck b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Natural/Data/x32Data.pck new file mode 100644 index 00000000..4224184c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Natural/Data/x32Data.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Plastic/Data/TexturePack.xzp b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Plastic/Data/TexturePack.xzp new file mode 100644 index 00000000..033840eb Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Plastic/Data/TexturePack.xzp differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Plastic/Data/x16Data.pck b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Plastic/Data/x16Data.pck new file mode 100644 index 00000000..b5b5c14a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Plastic/Data/x16Data.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Skyrim/Data/GameRules.grf b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Skyrim/Data/GameRules.grf new file mode 100644 index 00000000..d52e6b03 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Skyrim/Data/GameRules.grf differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Skyrim/Data/TexturePack.xzp b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Skyrim/Data/TexturePack.xzp new file mode 100644 index 00000000..45c24d41 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Skyrim/Data/TexturePack.xzp differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Skyrim/Data/x16Data.pck b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Skyrim/Data/x16Data.pck new file mode 100644 index 00000000..82a5965d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Skyrim/Data/x16Data.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Skyrim/TexturePack.pck b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Skyrim/TexturePack.pck new file mode 100644 index 00000000..2dc382a1 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/DLC/Skyrim/TexturePack.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildAll.cmd b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildAll.cmd new file mode 100644 index 00000000..06175558 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildAll.cmd @@ -0,0 +1,10 @@ +@ECHO OFF + +call .\BuildGameRule.cmd Tutorial +call .\BuildGameRule_PS3.cmd Tutorial +call .\BuildGameRule_Windows64.cmd Tutorial +call .\BuildGameRule_Durango.cmd Tutorial +call .\BuildGameRule_Orbis.cmd Tutorial +call .\BuildGameRule_PSVita.cmd Tutorial + +pause diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule.cmd b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule.cmd new file mode 100644 index 00000000..4594adf2 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule.cmd @@ -0,0 +1,19 @@ +ECHO OFF + +set RULENAME=%1 +cd %RULENAME% +rem set TOOLS=..\..\..\..\..\..\Tools + +ECHO "Building Localisation" +%TOOLS%\NewLocalisationPacker.exe --oldFormat Microsoft %CD%\Strings_Xbox360 %CD%\languages.loc + +ECHO "Building Game Rules" +%TOOLS%\GameRulesPacker -i %CD%\GameRules.xml -o %CD%\ -c lzxrle + +ECHO "Building DLC Pack" +%TOOLS%\DLC_DataCreator2_CL %CD%\%RULENAME%.xml + +rem Return the new tutorial. +copy %RULENAME%.pck ..\..\%RULENAME%.pck + +cd .. \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule_Durango.cmd b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule_Durango.cmd new file mode 100644 index 00000000..bebbbd8e --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule_Durango.cmd @@ -0,0 +1,28 @@ +@ECHO OFF + +set RULENAME=%1 +cd %RULENAME% + +rem set TOOLS=..\..\..\..\..\..\Tools + +echo Durango + +echo Building Localisation... +%TOOLS%\NewLocalisationPacker --oldFormat Microsoft %CD%\Strings_Durango %CD%\languages.loc + +echo Building Game Rules... +%TOOLS%\GameRulesPacker -i %CD%\GameRules.xml -o %CD%\ -c zlibrle + +echo Building DLC Pack... +%TOOLS%\DLC_DataCreator2_CL --LittleEndian %CD%\%RULENAME%.xml + +rem Return the new tutorial. +copy %RULENAME%.pck ..\..\%RULENAME%_Durango.pck + +echo Cleaning-up... +rem del %CD%\languages.loc +rem del %CD%\GameRules.grf +rem del %CD%\%RULENAME%.pck + +echo Finished. +cd .. \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule_Orbis.cmd b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule_Orbis.cmd new file mode 100644 index 00000000..3f2411a2 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule_Orbis.cmd @@ -0,0 +1,28 @@ +@ECHO OFF + +set RULENAME=%1 +cd %RULENAME% + +rem set TOOLS=..\..\..\..\..\..\Tools + +echo Orbis + +echo Building Localisation... +%TOOLS%\NewLocalisationPacker --oldFormat Sony %CD%\Strings_Orbis %CD%\languages.loc + +echo Building Game Rules... +%TOOLS%\GameRulesPacker -i %CD%\GameRules.xml -o %CD%\ -c zlibrle + +echo Building DLC Pack... +%TOOLS%\DLC_DataCreator2_CL --LittleEndian %CD%\%RULENAME%.xml + +rem Return the new tutorial. +copy %RULENAME%.pck ..\..\%RULENAME%_Orbis.pck + +echo Cleaning-up... +rem del %CD%\languages.loc +rem del %CD%\GameRules.grf +rem del %CD%\%RULENAME%.pck + +echo Finished. +cd .. \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule_PS3.cmd b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule_PS3.cmd new file mode 100644 index 00000000..9cdfd387 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule_PS3.cmd @@ -0,0 +1,28 @@ +@ECHO OFF + +set RULENAME=%1 +cd %RULENAME% + +rem set TOOLS=..\..\..\..\..\..\Tools + +echo Play Station 3 + +echo Building Localisation... +%TOOLS%\NewLocalisationPacker --oldFormat Sony %CD%\Strings_PS3 %CD%\languages.loc + +echo Building Game Rules... +%TOOLS%\GameRulesPacker -i %CD%\GameRules.xml -o %CD%\ -c edgezlibrle + +echo Building DLC Pack... +%TOOLS%\DLC_DataCreator2_CL %CD%\%RULENAME%.xml + +rem Return the new tutorial. +copy %RULENAME%.pck ..\..\%RULENAME%_PS3.pck + +echo Cleaning-up... +rem del %CD%\languages.loc +rem del %CD%\GameRules.grf +rem del %CD%\%RULENAME%.pck + +echo Finished. +cd .. \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule_PSVita.cmd b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule_PSVita.cmd new file mode 100644 index 00000000..7891eb20 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule_PSVita.cmd @@ -0,0 +1,28 @@ +@ECHO OFF + +set RULENAME=%1 +cd %RULENAME% + +rem set TOOLS=..\..\..\..\..\..\Tools + +echo PSVita + +echo Building Localisation... +%TOOLS%\NewLocalisationPacker --oldFormat Sony %CD%\Strings_PSVita %CD%\languages.loc + +echo Building Game Rules... +%TOOLS%\GameRulesPacker -i %CD%\GameRules.xml -o %CD%\ -c zlibrle + +echo Building DLC Pack... +%TOOLS%\DLC_DataCreator2_CL --LittleEndian %CD%\%RULENAME%.xml + +rem Return the new tutorial. +copy %RULENAME%.pck ..\..\%RULENAME%_PSVita.pck + +echo Cleaning-up... +rem del %CD%\languages.loc +rem del %CD%\GameRules.grf +rem del %CD%\%RULENAME%.pck + +echo Finished. +cd .. \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule_Windows64.cmd b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule_Windows64.cmd new file mode 100644 index 00000000..8e9b730b --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule_Windows64.cmd @@ -0,0 +1,28 @@ +@ECHO OFF + +set RULENAME=%1 +cd %RULENAME% + +rem set TOOLS=..\..\..\..\..\..\Tools + +echo Windows 64 + +echo Building Localisation... +%TOOLS%\NewLocalisationPacker --oldFormat Microsoft %CD%\Strings_Win64 %CD%\languages.loc + +echo Building Game Rules... +%TOOLS%\GameRulesPacker -i %CD%\GameRules.xml -o %CD%\ -c zlibrle + +echo Building DLC Pack... +%TOOLS%\DLC_DataCreator2_CL --LittleEndian %CD%\%RULENAME%.xml + +rem Return the new tutorial. +copy %RULENAME%.pck ..\..\%RULENAME%_Windows64.pck + +echo Cleaning-up... +rem del %CD%\languages.loc +rem del %CD%\GameRules.grf +rem del %CD%\%RULENAME%.pck + +echo Finished. +cd .. \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule_Xbox.cmd b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule_Xbox.cmd new file mode 100644 index 00000000..fde98245 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/BuildGameRule_Xbox.cmd @@ -0,0 +1,28 @@ +@ECHO OFF + +set RULENAME=%1 +cd %RULENAME% + +rem set TOOLS=..\..\..\..\..\..\Tools + +echo Xbox 360 + +echo Building Localisation... +%TOOLS%\NewLocalisationPacker.exe --oldFormat Microsoft %CD%\Strings_Xbox360 %CD%\languages.loc + +echo Building Game Rules... +%TOOLS%\GameRulesPacker -i %CD%\GameRules.xml -o %CD%\ -c lzxrle + +echo Building DLC Pack... +%TOOLS%\DLC_DataCreator2_CL %CD%\%RULENAME%.xml + +rem Return the new tutorial. +copy %RULENAME%.pck ..\..\%RULENAME%_Xbox.pck + +echo Cleaning-up... +rem del %CD%\languages.loc +rem del %CD%\GameRules.grf +rem del %CD%\%RULENAME%.pck + +echo Finished. +cd .. \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/GameRules.sln b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/GameRules.sln new file mode 100644 index 00000000..31c1bd39 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/GameRules.sln @@ -0,0 +1,30 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GameRules", "GameRules.vcxproj", "{0DD2FD59-36AC-476F-9201-D687A4CE9E98}" +EndProject +Global + GlobalSection(TeamFoundationVersionControl) = preSolution + SccNumberOfProjects = 2 + SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C} + SccTeamFoundationServer = http://tfs_server:8080/tfs/storiespark + SccProjectUniqueName0 = GameRules.vcxproj + SccLocalPath0 = . + SccLocalPath1 = . + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Xbox 360 = Debug|Xbox 360 + Release|Xbox 360 = Release|Xbox 360 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0DD2FD59-36AC-476F-9201-D687A4CE9E98}.Debug|Xbox 360.ActiveCfg = Debug|Xbox 360 + {0DD2FD59-36AC-476F-9201-D687A4CE9E98}.Debug|Xbox 360.Build.0 = Debug|Xbox 360 + {0DD2FD59-36AC-476F-9201-D687A4CE9E98}.Debug|Xbox 360.Deploy.0 = Debug|Xbox 360 + {0DD2FD59-36AC-476F-9201-D687A4CE9E98}.Release|Xbox 360.ActiveCfg = Release|Xbox 360 + {0DD2FD59-36AC-476F-9201-D687A4CE9E98}.Release|Xbox 360.Build.0 = Release|Xbox 360 + {0DD2FD59-36AC-476F-9201-D687A4CE9E98}.Release|Xbox 360.Deploy.0 = Release|Xbox 360 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/GameRules.vcxproj b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/GameRules.vcxproj new file mode 100644 index 00000000..0bcb4e30 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/GameRules.vcxproj @@ -0,0 +1,103 @@ + + + + + Debug + Xbox 360 + + + Release + Xbox 360 + + + + {0DD2FD59-36AC-476F-9201-D687A4CE9E98} + MakeFileProj + SAK + SAK + SAK + SAK + + + + Makefile + + + Makefile + + + + + + + + + + + + + + + _DEBUG;$(NMakePreprocessorDefinitions) + BuildGameRule.cmd Tutorial + + + GameRules.xex + NDEBUG;$(NMakePreprocessorDefinitions) + + + + + + + + CopyToHardDrive + + + + + + Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + true + + + + + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/GameRules.vcxproj.filters b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/GameRules.vcxproj.filters new file mode 100644 index 00000000..9c46ad82 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/GameRules.vcxproj.filters @@ -0,0 +1,114 @@ + + + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {ab02d5da-7fb3-494b-a636-03764d9a8acd} + + + {e1a87048-bca2-46e6-a234-91d7d64eb983} + + + {da425f4a-cf76-48e8-87cb-d9fda0f42365} + + + {c0ba5f53-4881-495e-8158-5d87f379426d} + + + {61651432-41a1-42f0-a853-c7795d813418} + + + {e194e42b-1c9b-4e35-9a4b-dabd68eab3e0} + + + + + Tutorial + + + Tutorial\Loc + + + Tutorial\Loc\Microsoft + + + Tutorial\Loc\Microsoft + + + Tutorial\Loc\Microsoft + + + Tutorial\Loc\Microsoft + + + Tutorial\Loc\Microsoft + + + Tutorial\Loc\Microsoft + + + Tutorial\Loc\Microsoft + + + Tutorial\Loc\Microsoft + + + Tutorial\Loc\Microsoft + + + Packs + + + Tutorial\schematics + + + Tutorial\schematics + + + Tutorial\schematics + + + Tutorial\schematics + + + Tutorial\schematics + + + Tutorial\schematics + + + Tutorial\schematics + + + Tutorial\schematics + + + Tutorial\schematics + + + Tutorial\schematics + + + Tutorial\schematics + + + Tutorial\schematics + + + + + + + + + + + + + Shared + + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/GameRules.vcxproj.vspscc b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/GameRules.vcxproj.vspscc new file mode 100644 index 00000000..b6d32892 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/GameRules.vcxproj.vspscc @@ -0,0 +1,10 @@ +"" +{ +"FILE_VERSION" = "9237" +"ENLISTMENT_CHOICE" = "NEVER" +"PROJECT_FILE_RELATIVE_PATH" = "" +"NUMBER_OF_EXCLUDED_FILES" = "0" +"ORIGINAL_PROJECT_FILE_PATH" = "" +"NUMBER_OF_NESTED_PROJECTS" = "0" +"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" +} diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/GameRulesDefinition.xsd b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/GameRulesDefinition.xsd new file mode 100644 index 00000000..a41f6865 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/GameRulesDefinition.xsd @@ -0,0 +1,2848 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Count children + + + + + Accumulate childrens goals + + + + + + + + + + Crafting Table + + + + + Chest + + + + + Furnace + + + + + Dispenser + + + + + + + + + + Mineshaft + + + + + Nether Bridge + + + + + Temples + + + + + Stronghold + + + + + Village + + + + + + + + + + SOUTH + + + + + WEST + + + + + NORTH + + + + + EAST + + + + + + + + + + NORTH + + + + + SOUTH + + + + + WEST + + + + + EAST + + + + + + + + + + Overworld + + + + + Nether + + + + + The End + + + + + + + + + + Protection + + + + + Fire Protection + + + + + Feather Falling + + + + + Blast Protection + + + + + Projectile Protection + + + + + Respiration + + + + + Aqua Affinity + + + + + Thorns + + + + + Sharpness + + + + + Smite + + + + + Bane of Arthropods + + + + + Knockback + + + + + Fire Aspect + + + + + Looting + + + + + Efficiency + + + + + Silk Touch + + + + + Unbreaking + + + + + Fortune + + + + + Power + + + + + Punch + + + + + Flame + + + + + Infinity + + + + + + + + + + Air + + + + + Stone + + + + + Grass Block + + + + + Dirt + + + + + Cobblestone + + + + + Wooden Planks + + + + + Sapling + + + + + Bedrock + + + + + Water + + + + + Water + + + + + Lava + + + + + Lava + + + + + Sand + + + + + Gravel + + + + + Gold Ore + + + + + Iron Ore + + + + + Coal Ore + + + + + Wood + + + + + Leaves + + + + + Sponge + + + + + Glass + + + + + Lapis Lazuli Ore + + + + + Lapis Lazuli Block + + + + + Dispenser + + + + + Sandstone + + + + + Note Block + + + + + Bed + + + + + Powered Rail + + + + + Detector Rail + + + + + Sticky Piston + + + + + Web + + + + + Shrub + + + + + Dead Bush + + + + + Piston + + + + + Piston + + + + + Wool + + + + + Piston + + + + + Flower + + + + + Rose + + + + + Mushroom + + + + + Mushroom + + + + + Block of Gold + + + + + Block of Iron + + + + + Stone Slab + + + + + Stone Slab + + + + + Bricks + + + + + TNT + + + + + Bookshelf + + + + + Moss Stone + + + + + Obsidian + + + + + Torch + + + + + Fire + + + + + Monster Spawner + + + + + Wooden Stairs + + + + + Chest + + + + + Redstone Dust + + + + + Diamond Ore + + + + + Block of Diamond + + + + + Crafting Table + + + + + Crops + + + + + Farmland + + + + + Furnace + + + + + Furnace + + + + + Sign + + + + + Wooden Door + + + + + Ladder + + + + + Rail + + + + + Stone Stairs + + + + + Sign + + + + + Lever + + + + + Pressure Plate + + + + + Iron Door + + + + + Pressure Plate + + + + + Redstone Ore + + + + + Redstone Ore + + + + + Redstone Torch + + + + + Redstone Torch + + + + + Button + + + + + Snow + + + + + Ice + + + + + Snow + + + + + Cactus + + + + + Clay + + + + + Sugar Cane + + + + + Jukebox + + + + + Fence + + + + + Pumpkin + + + + + Netherrack + + + + + Soul Sand + + + + + Glowstone + + + + + Portal + + + + + Jack-O-Lantern + + + + + Cake + + + + + Redstone Repeater + + + + + Redstone Repeater + + + + + Locked Chest + + + + + Trapdoor + + + + + Silverfish Stone + + + + + Stone Bricks + + + + + Mushroom + + + + + Mushroom + + + + + Iron Bars + + + + + Glass Pane + + + + + Melon + + + + + Pumpkin Stem + + + + + Melon Stem + + + + + Vines + + + + + Fence Gate + + + + + Brick Stairs + + + + + Stone Brick Stairs + + + + + Mycelium + + + + + Lily Pad + + + + + Nether Brick + + + + + Nether Brick Fence + + + + + Nether Brick Stairs + + + + + Nether Wart + + + + + Enchantment Table + + + + + Brewing Stand + + + + + Cauldron + + + + + End Portal + + + + + End Portal Frame + + + + + End Stone + + + + + Dragon Egg + + + + + Redstone Lamp + + + + + Redstone Lamp + + + + + Oak Wood Slab + + + + + Oak Wood Slab + + + + + Cocoa + + + + + Sandstone Stairs + + + + + Emerald Ore + + + + + Ender Chest + + + + + Tripwire Hook + + + + + Tripwire + + + + + Block of Emerald + + + + + Spruce Wood Stairs + + + + + Birch Wood Stairs + + + + + Jungle Wood Stairs + + + + + Cobblestone Wall + + + + + Flower Pot + + + + + Carrots + + + + + Potatoes + + + + + Button + + + + + Skull + + + + + Anvil + + + + + Nether Quartz Ore + + + + + Block of Quartz + + + + + Quartz Stairs + + + + + Carpet + + + + + + + + + + Stone + + + + + Grass Block + + + + + Dirt + + + + + Cobblestone + + + + + Wooden Planks + + + + + Sapling + + + + + Bedrock + + + + + Water + + + + + Water + + + + + Lava + + + + + Lava + + + + + Sand + + + + + Gravel + + + + + Gold Ore + + + + + Iron Ore + + + + + Coal Ore + + + + + Wood + + + + + Leaves + + + + + Sponge + + + + + Glass + + + + + Lapis Lazuli Ore + + + + + Lapis Lazuli Block + + + + + Dispenser + + + + + Sandstone + + + + + Note Block + + + + + Bed + + + + + Powered Rail + + + + + Detector Rail + + + + + Sticky Piston + + + + + Web + + + + + Tall Grass + + + + + Dead Bush + + + + + Piston + + + + + Piston + + + + + Wool + + + + + Piston + + + + + Flower + + + + + Rose + + + + + Mushroom + + + + + Mushroom + + + + + Block of Gold + + + + + Block of Iron + + + + + Stone Slab + + + + + Stone Slab + + + + + Bricks + + + + + TNT + + + + + Bookshelf + + + + + Moss Stone + + + + + Obsidian + + + + + Torch + + + + + Fire + + + + + Monster Spawner + + + + + Wooden Stairs + + + + + Chest + + + + + Redstone Dust + + + + + Diamond Ore + + + + + Block of Diamond + + + + + Crafting Table + + + + + Crops + + + + + Farmland + + + + + Furnace + + + + + Furnace + + + + + Sign + + + + + Wooden Door + + + + + Ladder + + + + + Rail + + + + + Stone Stairs + + + + + Sign + + + + + Lever + + + + + Pressure Plate + + + + + Iron Door + + + + + Pressure Plate + + + + + Redstone Ore + + + + + Redstone Ore + + + + + Redstone Torch + + + + + Redstone Torch + + + + + Button + + + + + Snow + + + + + Ice + + + + + Snow + + + + + Cactus + + + + + Clay + + + + + Sugar Cane + + + + + Jukebox + + + + + Fence + + + + + Pumpkin + + + + + Netherrack + + + + + Soul Sand + + + + + Glowstone + + + + + Portal + + + + + Jack-O-Lantern + + + + + Cake + + + + + Redstone Repeater + + + + + Redstone Repeater + + + + + Locked Chest + + + + + Trapdoor + + + + + Silverfish Stone + + + + + Stone Bricks + + + + + Mushroom + + + + + Mushroom + + + + + Iron Bars + + + + + Glass Pane + + + + + Melon + + + + + Pumpkin Stem + + + + + Melon Stem + + + + + Vines + + + + + Fence Gate + + + + + Brick Stairs + + + + + Stone Brick Stairs + + + + + Mycelium + + + + + Lily Pad + + + + + Nether Brick + + + + + Nether Brick Fence + + + + + Nether Brick Stairs + + + + + Nether Wart + + + + + Enchantment Table + + + + + Brewing Stand + + + + + Cauldron + + + + + End Portal + + + + + End Portal Frame + + + + + End Stone + + + + + Dragon Egg + + + + + Redstone Lamp + + + + + Redstone Lamp + + + + + Oak Wood Slab + + + + + Oak Wood Slab + + + + + Cocoa + + + + + Sandstone Stairs + + + + + Emerald Ore + + + + + Ender Chest + + + + + Tripwire Hook + + + + + Tripwire + + + + + Block of Emerald + + + + + Spruce Wood Stairs + + + + + Birch Wood Stairs + + + + + Jungle Wood Stairs + + + + + Cobblestone Wall + + + + + Flower Pot + + + + + Carrots + + + + + Potatoes + + + + + Button + + + + + Skull + + + + + Anvil + + + + + Nether Quartz Ore + + + + + Block of Quartz + + + + + Quartz Stairs + + + + + Carpet + + + + + Iron Shovel + + + + + Iron Pickaxe + + + + + Iron Axe + + + + + Flint and Steel + + + + + Apple + + + + + Bow + + + + + Arrow + + + + + Coal + + + + + Diamond + + + + + Iron Ingot + + + + + Gold Ingot + + + + + Iron Sword + + + + + Wooden Sword + + + + + Wooden Shovel + + + + + Wooden Pickaxe + + + + + Wooden Axe + + + + + Stone Sword + + + + + Stone Shovel + + + + + Stone Pickaxe + + + + + Stone Axe + + + + + Diamond Sword + + + + + Diamond Shovel + + + + + Diamond Pickaxe + + + + + Diamond Axe + + + + + Stick + + + + + Bowl + + + + + Mushroom Stew + + + + + Golden Sword + + + + + Golden Shovel + + + + + Golden Pickaxe + + + + + Golden Axe + + + + + String + + + + + Feather + + + + + Gunpowder + + + + + Wooden Hoe + + + + + Stone Hoe + + + + + Iron Hoe + + + + + Diamond Hoe + + + + + Golden Hoe + + + + + Seeds + + + + + Wheat + + + + + Bread + + + + + Leather Cap + + + + + Leather Tunic + + + + + Leather Pants + + + + + Leather Boots + + + + + Chain Helmet + + + + + Chain Chestplate + + + + + Chain Leggings + + + + + Chain Boots + + + + + Iron Helmet + + + + + Iron Chestplate + + + + + Iron Leggings + + + + + Iron Boots + + + + + Diamond Helmet + + + + + Diamond Chestplate + + + + + Diamond Leggings + + + + + Diamond Boots + + + + + Golden Helmet + + + + + Golden Chestplate + + + + + Golden Leggings + + + + + Golden Boots + + + + + Flint + + + + + Raw Porkchop + + + + + Cooked Porkchop + + + + + Painting + + + + + Golden Apple + + + + + Sign + + + + + Wooden Door + + + + + Bucket + + + + + Water Bucket + + + + + Lava Bucket + + + + + Minecart + + + + + Saddle + + + + + Iron Door + + + + + Redstone + + + + + Snowball + + + + + Boat + + + + + Leather + + + + + Milk Bucket + + + + + Brick + + + + + Clay + + + + + Sugar Canes + + + + + Paper + + + + + Book + + + + + Slimeball + + + + + Minecart with Chest + + + + + Minecart with Furnace + + + + + Egg + + + + + Compass + + + + + Fishing Rod + + + + + Clock + + + + + Glowstone Dust + + + + + Raw Fish + + + + + Cooked Fish + + + + + Dye Powder + + + + + Bone + + + + + Sugar + + + + + Cake + + + + + Bed + + + + + Redstone Repeater + + + + + Cookie + + + + + Map + + + + + Shears + + + + + Melon Slice + + + + + Pumpkin Seeds + + + + + Melon Seeds + + + + + Raw Beef + + + + + Steak + + + + + Raw Chicken + + + + + Cooked Chicken + + + + + Rotten Flesh + + + + + Ender Pearl + + + + + Blaze Rod + + + + + Ghast Tear + + + + + Gold Nugget + + + + + Nether Wart + + + + + {*splash*}{*prefix*}Potion {*postfix*} + + + + + Glass Bottle + + + + + Spider Eye + + + + + Fermented Spider Eye + + + + + Blaze Powder + + + + + Magma Cream + + + + + Brewing Stand + + + + + Cauldron + + + + + Eye of Ender + + + + + Glistering Melon + + + + + Spawn {*CREATURE*} + + + + + Bottle o' Enchanting + + + + + Fire Charge + + + + + Emerald + + + + + Item Frame + + + + + Flower Pot + + + + + Carrot + + + + + Potato + + + + + Baked Potato + + + + + Poisonous Potato + + + + + Golden Carrot + + + + + Skull + + + + + Carrot on a Stick + + + + + Pumpkin Pie + + + + + Enchanted Book + + + + + Nether Brick + + + + + Nether Quartz + + + + + Music Disc - "13" + + + + + Music Disc - "cat" + + + + + Music Disc - "blocks" + + + + + Music Disc - "chirp" + + + + + Music Disc - "far" + + + + + Music Disc - "mall" + + + + + Music Disc - "mellohi" + + + + + Music Disc - "stal" + + + + + Music Disc - "strad" + + + + + Music Disc - "ward" + + + + + Music Disc - "11" + + + + + Music Disc - "where are we now" + + + + + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/GameRules.grf b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/GameRules.grf new file mode 100644 index 00000000..3628e09a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/GameRules.grf differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/GameRules.grh b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/GameRules.grh new file mode 100644 index 00000000..602a525b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/GameRules.grh differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/GameRules.xml b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/GameRules.xml new file mode 100644 index 00000000..77fcefaa Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/GameRules.xml differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/de-DE.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/de-DE.lang new file mode 100644 index 00000000..7311b639 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/de-DE.lang @@ -0,0 +1,4 @@ + +Du hast {*progress*} von {*goal*} Schallplatten gefunden! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/es-ES.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/es-ES.lang new file mode 100644 index 00000000..df610909 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/es-ES.lang @@ -0,0 +1,5 @@ + +¡Has encontrado {*progress*} de {*goal*} discos! + + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/fr-FR.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/fr-FR.lang new file mode 100644 index 00000000..c01e36b4 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/fr-FR.lang @@ -0,0 +1,4 @@ + +Vous avez trouvé {*progress*} / {*goal*} disques ! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/it-IT.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/it-IT.lang new file mode 100644 index 00000000..ef0b627c --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/it-IT.lang @@ -0,0 +1,4 @@ + +Hai trovato {*progress*} dischi su {*goal*}! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/ja-JP.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/ja-JP.lang new file mode 100644 index 00000000..cae65a04 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/ja-JP.lang @@ -0,0 +1,4 @@ + +音楽ディスクを見ã¤ã‘ã¾ã—㟠({*progress*}/{*goal*}) + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/ko-KR.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/ko-KR.lang new file mode 100644 index 00000000..e67d5517 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/ko-KR.lang @@ -0,0 +1,4 @@ + +ìŒì•… ë””ìŠ¤í¬ {*progress*}/{*goal*}ìž¥ì„ ì°¾ì•˜ìŠµë‹ˆë‹¤! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/pt-BR.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/pt-BR.lang new file mode 100644 index 00000000..82f11c82 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/pt-BR.lang @@ -0,0 +1,4 @@ + +Você encontrou {*progress*} de {*goal*} discos de música! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/pt-PT.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/pt-PT.lang new file mode 100644 index 00000000..381f4567 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/pt-PT.lang @@ -0,0 +1,4 @@ + +Encontraste {*progress*} de {*goal*} Discos de Música! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/zh-CHT.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/zh-CHT.lang new file mode 100644 index 00000000..8c04f771 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/Microsoft/zh-CHT.lang @@ -0,0 +1,4 @@ + +您已經找到 {*progress*}/{*goal*} å¼µå”±ç‰‡ï¼ + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/en-EN.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/en-EN.lang new file mode 100644 index 00000000..cfda2eb8 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings/en-EN.lang @@ -0,0 +1,5 @@ + + + You have found {*progress*} of {*goal*} Music Discs! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/de-DE.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/de-DE.lang new file mode 100644 index 00000000..02775ada --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/de-DE.lang @@ -0,0 +1,4 @@ + +Du hast {*progress*} von {*goal*} Schallplatten gefunden! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/es-ES.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/es-ES.lang new file mode 100644 index 00000000..2d91f76e --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/es-ES.lang @@ -0,0 +1,5 @@ + +¡Has encontrado {*progress*} de {*goal*} discos! + + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/fr-FR.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/fr-FR.lang new file mode 100644 index 00000000..eba483f8 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/fr-FR.lang @@ -0,0 +1,4 @@ + +Vous avez trouvé {*progress*} / {*goal*} disques ! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/it-IT.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/it-IT.lang new file mode 100644 index 00000000..f0883a6c --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/it-IT.lang @@ -0,0 +1,4 @@ + +Hai trovato {*progress*} dischi su {*goal*}! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/ja-JP.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/ja-JP.lang new file mode 100644 index 00000000..b95f8692 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/ja-JP.lang @@ -0,0 +1,4 @@ + +音楽ディスクを見ã¤ã‘ã¾ã—㟠({*progress*}/{*goal*}) + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/ko-KR.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/ko-KR.lang new file mode 100644 index 00000000..87cb920d --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/ko-KR.lang @@ -0,0 +1,4 @@ + +ìŒì•… ë””ìŠ¤í¬ {*progress*}/{*goal*}ìž¥ì„ ì°¾ì•˜ìŠµë‹ˆë‹¤! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/pt-BR.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/pt-BR.lang new file mode 100644 index 00000000..bcfbbe79 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/pt-BR.lang @@ -0,0 +1,4 @@ + +Você encontrou {*progress*} de {*goal*} discos de música! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/pt-PT.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/pt-PT.lang new file mode 100644 index 00000000..917482c6 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/pt-PT.lang @@ -0,0 +1,4 @@ + +Encontraste {*progress*} de {*goal*} Discos de Música! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/zh-CHT.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/zh-CHT.lang new file mode 100644 index 00000000..461ae695 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/Microsoft/zh-CHT.lang @@ -0,0 +1,4 @@ + +您已經找到 {*progress*}/{*goal*} å¼µå”±ç‰‡ï¼ + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/en-EN.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/en-EN.lang new file mode 100644 index 00000000..7d85ded6 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Durango/en-EN.lang @@ -0,0 +1,5 @@ + + + You have found {*progress*} of {*goal*} Music Discs! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/da-DA.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/da-DA.lang new file mode 100644 index 00000000..efc321d9 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/da-DA.lang @@ -0,0 +1,6 @@ + + + + Du har fundet {*progress*} af {*goal*} musikplader! + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/de-DE.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/de-DE.lang new file mode 100644 index 00000000..02775ada --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/de-DE.lang @@ -0,0 +1,4 @@ + +Du hast {*progress*} von {*goal*} Schallplatten gefunden! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/es-ES.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/es-ES.lang new file mode 100644 index 00000000..2d91f76e --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/es-ES.lang @@ -0,0 +1,5 @@ + +¡Has encontrado {*progress*} de {*goal*} discos! + + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/fi-FI.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/fi-FI.lang new file mode 100644 index 00000000..229e1e14 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/fi-FI.lang @@ -0,0 +1,6 @@ + + + + Olet löytänyt {*progress*}/{*goal*} musiikkilevyistä! + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/fr-FR.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/fr-FR.lang new file mode 100644 index 00000000..eba483f8 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/fr-FR.lang @@ -0,0 +1,4 @@ + +Vous avez trouvé {*progress*} / {*goal*} disques ! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/it-IT.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/it-IT.lang new file mode 100644 index 00000000..f0883a6c --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/it-IT.lang @@ -0,0 +1,4 @@ + +Hai trovato {*progress*} dischi su {*goal*}! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/ja-JP.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/ja-JP.lang new file mode 100644 index 00000000..b95f8692 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/ja-JP.lang @@ -0,0 +1,4 @@ + +音楽ディスクを見ã¤ã‘ã¾ã—㟠({*progress*}/{*goal*}) + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/ko-KR.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/ko-KR.lang new file mode 100644 index 00000000..87cb920d --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/ko-KR.lang @@ -0,0 +1,4 @@ + +ìŒì•… ë””ìŠ¤í¬ {*progress*}/{*goal*}ìž¥ì„ ì°¾ì•˜ìŠµë‹ˆë‹¤! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/la-LAS.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/la-LAS.lang new file mode 100644 index 00000000..61f2842b --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/la-LAS.lang @@ -0,0 +1,6 @@ + + + + ¡Has encontrado {*progress*} de {*goal*} discos! + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/nl-NL.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/nl-NL.lang new file mode 100644 index 00000000..a1710841 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/nl-NL.lang @@ -0,0 +1,6 @@ + + + + Je hebt {*progress*} van {*goal*} muziekplaten gevonden! + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/no-NO.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/no-NO.lang new file mode 100644 index 00000000..a3d244be --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/no-NO.lang @@ -0,0 +1,6 @@ + + + + Du har funnet {*progress*} av {*goal*} musikkplater! + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/pl-PL.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/pl-PL.lang new file mode 100644 index 00000000..5b5c99d2 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/pl-PL.lang @@ -0,0 +1,6 @@ + + + + UdaÅ‚o ci siÄ™ znaleźć {*progress*} z {*goal*} pÅ‚yt muzycznych! + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/pt-BR.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/pt-BR.lang new file mode 100644 index 00000000..bcfbbe79 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/pt-BR.lang @@ -0,0 +1,4 @@ + +Você encontrou {*progress*} de {*goal*} discos de música! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/pt-PT.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/pt-PT.lang new file mode 100644 index 00000000..917482c6 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/pt-PT.lang @@ -0,0 +1,4 @@ + +Encontraste {*progress*} de {*goal*} Discos de Música! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/ru-RU.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/ru-RU.lang new file mode 100644 index 00000000..7a1c49fa --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/ru-RU.lang @@ -0,0 +1,5 @@ + + + Ð’Ñ‹ нашли {*progress*} из {*goal*} музыкальных диÑков! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/sv-SV.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/sv-SV.lang new file mode 100644 index 00000000..3745f9da --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/sv-SV.lang @@ -0,0 +1,6 @@ + + + + Du har hittat {*progress*} av {*goal*} musikskivor! + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/tr-TR.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/tr-TR.lang new file mode 100644 index 00000000..778361fb --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/tr-TR.lang @@ -0,0 +1,6 @@ + + + + {*goal*} Müzik Plağından {*progress*} tanesini buldun! + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/zh-CHT.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/zh-CHT.lang new file mode 100644 index 00000000..461ae695 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/Sony/zh-CHT.lang @@ -0,0 +1,4 @@ + +您已經找到 {*progress*}/{*goal*} å¼µå”±ç‰‡ï¼ + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/en-EN.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/en-EN.lang new file mode 100644 index 00000000..7d85ded6 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Orbis/en-EN.lang @@ -0,0 +1,5 @@ + + + You have found {*progress*} of {*goal*} Music Discs! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/da-DA.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/da-DA.lang new file mode 100644 index 00000000..efc321d9 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/da-DA.lang @@ -0,0 +1,6 @@ + + + + Du har fundet {*progress*} af {*goal*} musikplader! + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/de-DE.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/de-DE.lang new file mode 100644 index 00000000..02775ada --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/de-DE.lang @@ -0,0 +1,4 @@ + +Du hast {*progress*} von {*goal*} Schallplatten gefunden! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/es-ES.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/es-ES.lang new file mode 100644 index 00000000..2d91f76e --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/es-ES.lang @@ -0,0 +1,5 @@ + +¡Has encontrado {*progress*} de {*goal*} discos! + + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/fi-FI.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/fi-FI.lang new file mode 100644 index 00000000..229e1e14 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/fi-FI.lang @@ -0,0 +1,6 @@ + + + + Olet löytänyt {*progress*}/{*goal*} musiikkilevyistä! + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/fr-FR.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/fr-FR.lang new file mode 100644 index 00000000..eba483f8 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/fr-FR.lang @@ -0,0 +1,4 @@ + +Vous avez trouvé {*progress*} / {*goal*} disques ! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/it-IT.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/it-IT.lang new file mode 100644 index 00000000..f0883a6c --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/it-IT.lang @@ -0,0 +1,4 @@ + +Hai trovato {*progress*} dischi su {*goal*}! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/ja-JP.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/ja-JP.lang new file mode 100644 index 00000000..b95f8692 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/ja-JP.lang @@ -0,0 +1,4 @@ + +音楽ディスクを見ã¤ã‘ã¾ã—㟠({*progress*}/{*goal*}) + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/ko-KR.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/ko-KR.lang new file mode 100644 index 00000000..87cb920d --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/ko-KR.lang @@ -0,0 +1,4 @@ + +ìŒì•… ë””ìŠ¤í¬ {*progress*}/{*goal*}ìž¥ì„ ì°¾ì•˜ìŠµë‹ˆë‹¤! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/la-LAS.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/la-LAS.lang new file mode 100644 index 00000000..61f2842b --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/la-LAS.lang @@ -0,0 +1,6 @@ + + + + ¡Has encontrado {*progress*} de {*goal*} discos! + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/nl-NL.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/nl-NL.lang new file mode 100644 index 00000000..a1710841 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/nl-NL.lang @@ -0,0 +1,6 @@ + + + + Je hebt {*progress*} van {*goal*} muziekplaten gevonden! + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/no-NO.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/no-NO.lang new file mode 100644 index 00000000..a3d244be --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/no-NO.lang @@ -0,0 +1,6 @@ + + + + Du har funnet {*progress*} av {*goal*} musikkplater! + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/pl-PL.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/pl-PL.lang new file mode 100644 index 00000000..5b5c99d2 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/pl-PL.lang @@ -0,0 +1,6 @@ + + + + UdaÅ‚o ci siÄ™ znaleźć {*progress*} z {*goal*} pÅ‚yt muzycznych! + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/pt-BR.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/pt-BR.lang new file mode 100644 index 00000000..bcfbbe79 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/pt-BR.lang @@ -0,0 +1,4 @@ + +Você encontrou {*progress*} de {*goal*} discos de música! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/pt-PT.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/pt-PT.lang new file mode 100644 index 00000000..917482c6 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/pt-PT.lang @@ -0,0 +1,4 @@ + +Encontraste {*progress*} de {*goal*} Discos de Música! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/ru-RU.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/ru-RU.lang new file mode 100644 index 00000000..7a1c49fa --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/ru-RU.lang @@ -0,0 +1,5 @@ + + + Ð’Ñ‹ нашли {*progress*} из {*goal*} музыкальных диÑков! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/sv-SV.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/sv-SV.lang new file mode 100644 index 00000000..3745f9da --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/sv-SV.lang @@ -0,0 +1,6 @@ + + + + Du har hittat {*progress*} av {*goal*} musikskivor! + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/tr-TR.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/tr-TR.lang new file mode 100644 index 00000000..778361fb --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/tr-TR.lang @@ -0,0 +1,6 @@ + + + + {*goal*} Müzik Plağından {*progress*} tanesini buldun! + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/zh-CHT.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/zh-CHT.lang new file mode 100644 index 00000000..461ae695 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/Sony/zh-CHT.lang @@ -0,0 +1,4 @@ + +您已經找到 {*progress*}/{*goal*} å¼µå”±ç‰‡ï¼ + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/en-EN.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/en-EN.lang new file mode 100644 index 00000000..7d85ded6 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PS3/en-EN.lang @@ -0,0 +1,5 @@ + + + You have found {*progress*} of {*goal*} Music Discs! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/da-DA.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/da-DA.lang new file mode 100644 index 00000000..efc321d9 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/da-DA.lang @@ -0,0 +1,6 @@ + + + + Du har fundet {*progress*} af {*goal*} musikplader! + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/de-DE.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/de-DE.lang new file mode 100644 index 00000000..02775ada --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/de-DE.lang @@ -0,0 +1,4 @@ + +Du hast {*progress*} von {*goal*} Schallplatten gefunden! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/es-ES.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/es-ES.lang new file mode 100644 index 00000000..2d91f76e --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/es-ES.lang @@ -0,0 +1,5 @@ + +¡Has encontrado {*progress*} de {*goal*} discos! + + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/fi-FI.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/fi-FI.lang new file mode 100644 index 00000000..229e1e14 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/fi-FI.lang @@ -0,0 +1,6 @@ + + + + Olet löytänyt {*progress*}/{*goal*} musiikkilevyistä! + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/fr-FR.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/fr-FR.lang new file mode 100644 index 00000000..eba483f8 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/fr-FR.lang @@ -0,0 +1,4 @@ + +Vous avez trouvé {*progress*} / {*goal*} disques ! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/it-IT.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/it-IT.lang new file mode 100644 index 00000000..f0883a6c --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/it-IT.lang @@ -0,0 +1,4 @@ + +Hai trovato {*progress*} dischi su {*goal*}! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/ja-JP.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/ja-JP.lang new file mode 100644 index 00000000..b95f8692 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/ja-JP.lang @@ -0,0 +1,4 @@ + +音楽ディスクを見ã¤ã‘ã¾ã—㟠({*progress*}/{*goal*}) + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/ko-KR.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/ko-KR.lang new file mode 100644 index 00000000..87cb920d --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/ko-KR.lang @@ -0,0 +1,4 @@ + +ìŒì•… ë””ìŠ¤í¬ {*progress*}/{*goal*}ìž¥ì„ ì°¾ì•˜ìŠµë‹ˆë‹¤! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/la-LAS.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/la-LAS.lang new file mode 100644 index 00000000..61f2842b --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/la-LAS.lang @@ -0,0 +1,6 @@ + + + + ¡Has encontrado {*progress*} de {*goal*} discos! + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/nl-NL.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/nl-NL.lang new file mode 100644 index 00000000..a1710841 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/nl-NL.lang @@ -0,0 +1,6 @@ + + + + Je hebt {*progress*} van {*goal*} muziekplaten gevonden! + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/no-NO.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/no-NO.lang new file mode 100644 index 00000000..a3d244be --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/no-NO.lang @@ -0,0 +1,6 @@ + + + + Du har funnet {*progress*} av {*goal*} musikkplater! + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/pl-PL.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/pl-PL.lang new file mode 100644 index 00000000..5b5c99d2 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/pl-PL.lang @@ -0,0 +1,6 @@ + + + + UdaÅ‚o ci siÄ™ znaleźć {*progress*} z {*goal*} pÅ‚yt muzycznych! + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/pt-BR.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/pt-BR.lang new file mode 100644 index 00000000..bcfbbe79 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/pt-BR.lang @@ -0,0 +1,4 @@ + +Você encontrou {*progress*} de {*goal*} discos de música! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/pt-PT.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/pt-PT.lang new file mode 100644 index 00000000..917482c6 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/pt-PT.lang @@ -0,0 +1,4 @@ + +Encontraste {*progress*} de {*goal*} Discos de Música! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/ru-RU.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/ru-RU.lang new file mode 100644 index 00000000..7a1c49fa --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/ru-RU.lang @@ -0,0 +1,5 @@ + + + Ð’Ñ‹ нашли {*progress*} из {*goal*} музыкальных диÑков! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/sv-SV.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/sv-SV.lang new file mode 100644 index 00000000..3745f9da --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/sv-SV.lang @@ -0,0 +1,6 @@ + + + + Du har hittat {*progress*} av {*goal*} musikskivor! + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/tr-TR.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/tr-TR.lang new file mode 100644 index 00000000..778361fb --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/tr-TR.lang @@ -0,0 +1,6 @@ + + + + {*goal*} Müzik Plağından {*progress*} tanesini buldun! + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/zh-CHT.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/zh-CHT.lang new file mode 100644 index 00000000..461ae695 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/Sony/zh-CHT.lang @@ -0,0 +1,4 @@ + +您已經找到 {*progress*}/{*goal*} å¼µå”±ç‰‡ï¼ + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/en-EN.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/en-EN.lang new file mode 100644 index 00000000..7d85ded6 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_PSVita/en-EN.lang @@ -0,0 +1,5 @@ + + + You have found {*progress*} of {*goal*} Music Discs! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/de-DE.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/de-DE.lang new file mode 100644 index 00000000..02775ada --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/de-DE.lang @@ -0,0 +1,4 @@ + +Du hast {*progress*} von {*goal*} Schallplatten gefunden! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/es-ES.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/es-ES.lang new file mode 100644 index 00000000..2d91f76e --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/es-ES.lang @@ -0,0 +1,5 @@ + +¡Has encontrado {*progress*} de {*goal*} discos! + + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/fr-FR.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/fr-FR.lang new file mode 100644 index 00000000..eba483f8 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/fr-FR.lang @@ -0,0 +1,4 @@ + +Vous avez trouvé {*progress*} / {*goal*} disques ! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/it-IT.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/it-IT.lang new file mode 100644 index 00000000..f0883a6c --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/it-IT.lang @@ -0,0 +1,4 @@ + +Hai trovato {*progress*} dischi su {*goal*}! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/ja-JP.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/ja-JP.lang new file mode 100644 index 00000000..b95f8692 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/ja-JP.lang @@ -0,0 +1,4 @@ + +音楽ディスクを見ã¤ã‘ã¾ã—㟠({*progress*}/{*goal*}) + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/ko-KR.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/ko-KR.lang new file mode 100644 index 00000000..87cb920d --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/ko-KR.lang @@ -0,0 +1,4 @@ + +ìŒì•… ë””ìŠ¤í¬ {*progress*}/{*goal*}ìž¥ì„ ì°¾ì•˜ìŠµë‹ˆë‹¤! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/pt-BR.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/pt-BR.lang new file mode 100644 index 00000000..bcfbbe79 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/pt-BR.lang @@ -0,0 +1,4 @@ + +Você encontrou {*progress*} de {*goal*} discos de música! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/pt-PT.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/pt-PT.lang new file mode 100644 index 00000000..917482c6 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/pt-PT.lang @@ -0,0 +1,4 @@ + +Encontraste {*progress*} de {*goal*} Discos de Música! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/zh-CHT.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/zh-CHT.lang new file mode 100644 index 00000000..461ae695 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/Microsoft/zh-CHT.lang @@ -0,0 +1,4 @@ + +您已經找到 {*progress*}/{*goal*} å¼µå”±ç‰‡ï¼ + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/en-EN.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/en-EN.lang new file mode 100644 index 00000000..7d85ded6 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Win64/en-EN.lang @@ -0,0 +1,5 @@ + + + You have found {*progress*} of {*goal*} Music Discs! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/de-DE.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/de-DE.lang new file mode 100644 index 00000000..02775ada --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/de-DE.lang @@ -0,0 +1,4 @@ + +Du hast {*progress*} von {*goal*} Schallplatten gefunden! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/es-ES.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/es-ES.lang new file mode 100644 index 00000000..2d91f76e --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/es-ES.lang @@ -0,0 +1,5 @@ + +¡Has encontrado {*progress*} de {*goal*} discos! + + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/fr-FR.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/fr-FR.lang new file mode 100644 index 00000000..eba483f8 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/fr-FR.lang @@ -0,0 +1,4 @@ + +Vous avez trouvé {*progress*} / {*goal*} disques ! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/it-IT.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/it-IT.lang new file mode 100644 index 00000000..f0883a6c --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/it-IT.lang @@ -0,0 +1,4 @@ + +Hai trovato {*progress*} dischi su {*goal*}! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/ja-JP.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/ja-JP.lang new file mode 100644 index 00000000..b95f8692 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/ja-JP.lang @@ -0,0 +1,4 @@ + +音楽ディスクを見ã¤ã‘ã¾ã—㟠({*progress*}/{*goal*}) + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/ko-KR.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/ko-KR.lang new file mode 100644 index 00000000..87cb920d --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/ko-KR.lang @@ -0,0 +1,4 @@ + +ìŒì•… ë””ìŠ¤í¬ {*progress*}/{*goal*}ìž¥ì„ ì°¾ì•˜ìŠµë‹ˆë‹¤! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/pt-BR.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/pt-BR.lang new file mode 100644 index 00000000..bcfbbe79 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/pt-BR.lang @@ -0,0 +1,4 @@ + +Você encontrou {*progress*} de {*goal*} discos de música! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/pt-PT.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/pt-PT.lang new file mode 100644 index 00000000..917482c6 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/pt-PT.lang @@ -0,0 +1,4 @@ + +Encontraste {*progress*} de {*goal*} Discos de Música! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/zh-CHT.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/zh-CHT.lang new file mode 100644 index 00000000..461ae695 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/Microsoft/zh-CHT.lang @@ -0,0 +1,4 @@ + +您已經找到 {*progress*}/{*goal*} å¼µå”±ç‰‡ï¼ + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/en-EN.lang b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/en-EN.lang new file mode 100644 index 00000000..7d85ded6 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Strings_Xbox360/en-EN.lang @@ -0,0 +1,5 @@ + + + You have found {*progress*} of {*goal*} Music Discs! + + diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Tutorial.pck b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Tutorial.pck new file mode 100644 index 00000000..fc4b9530 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Tutorial.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Tutorial.xml b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Tutorial.xml new file mode 100644 index 00000000..325eb3fd Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/Tutorial.xml differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/languages.loc b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/languages.loc new file mode 100644 index 00000000..50ef48d4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/languages.loc differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Boat.sch b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Boat.sch new file mode 100644 index 00000000..323e10d5 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Boat.sch differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/CasTes1.sch b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/CasTes1.sch new file mode 100644 index 00000000..de373732 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/CasTes1.sch differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/CasTes2.sch b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/CasTes2.sch new file mode 100644 index 00000000..a7140c60 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/CasTes2.sch differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/JungleTemp.sch b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/JungleTemp.sch new file mode 100644 index 00000000..9f6003b7 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/JungleTemp.sch differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Lava.sch b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Lava.sch new file mode 100644 index 00000000..1e162408 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Lava.sch differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/MinecraftSign.sch b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/MinecraftSign.sch new file mode 100644 index 00000000..3625264a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/MinecraftSign.sch differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Mushroom.sch b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Mushroom.sch new file mode 100644 index 00000000..8b012bbe Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Mushroom.sch differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/PillarHouse.sch b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/PillarHouse.sch new file mode 100644 index 00000000..ae95dcc9 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/PillarHouse.sch differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Pyramid.sch b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Pyramid.sch new file mode 100644 index 00000000..5c7ea6b2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Pyramid.sch differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/RuinedHouse.sch b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/RuinedHouse.sch new file mode 100644 index 00000000..c7844400 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/RuinedHouse.sch differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Ship.sch b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Ship.sch new file mode 100644 index 00000000..6aa37242 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Ship.sch differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Smithy.sch b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Smithy.sch new file mode 100644 index 00000000..c1847304 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Smithy.sch differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/SnowHouse.sch b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/SnowHouse.sch new file mode 100644 index 00000000..17a3b250 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/SnowHouse.sch differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Spider.sch b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Spider.sch new file mode 100644 index 00000000..e6049259 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Spider.sch differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Stairs.sch b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Stairs.sch new file mode 100644 index 00000000..33943c2a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Stairs.sch differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/StoneCircle.sch b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/StoneCircle.sch new file mode 100644 index 00000000..0c06ec53 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/StoneCircle.sch differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/StoneTemp.sch b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/StoneTemp.sch new file mode 100644 index 00000000..f227b0ec Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/StoneTemp.sch differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Tower.sch b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Tower.sch new file mode 100644 index 00000000..102fdff2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/Tower.sch differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/UWChamber.sch b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/UWChamber.sch new file mode 100644 index 00000000..f1c0e2c7 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/Tutorial/schematics/UWChamber.sch differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/launchCMD.cmd b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/launchCMD.cmd new file mode 100644 index 00000000..d21751d7 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/BuildOnly/launchCMD.cmd @@ -0,0 +1 @@ +cmd & \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/Tutorial.pck b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/Tutorial.pck new file mode 100644 index 00000000..8f44945b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/Tutorial.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/Tutorial_Durango.pck b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/Tutorial_Durango.pck new file mode 100644 index 00000000..d5e1d6b0 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/Tutorial_Durango.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/Tutorial_Orbis.pck b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/Tutorial_Orbis.pck new file mode 100644 index 00000000..fc4b9530 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/GameRules/Tutorial_Orbis.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/audio/AdditionalMusic.xwb b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/audio/AdditionalMusic.xwb new file mode 100644 index 00000000..ebea388f Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/audio/AdditionalMusic.xwb differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/audio/Minecraft.xgs b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/audio/Minecraft.xgs new file mode 100644 index 00000000..5d6c55be Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/audio/Minecraft.xgs differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/audio/additional.xsb b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/audio/additional.xsb new file mode 100644 index 00000000..e60b3524 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/audio/additional.xsb differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/audio/additional.xwb b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/audio/additional.xwb new file mode 100644 index 00000000..983306db Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/audio/additional.xwb differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/audio/minecraft.xsb b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/audio/minecraft.xsb new file mode 100644 index 00000000..2154729d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/audio/minecraft.xsb differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/armor/cloth_1.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/armor/cloth_1.png new file mode 100644 index 00000000..ebcfc411 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/armor/cloth_1.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/armor/cloth_1_b.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/armor/cloth_1_b.png new file mode 100644 index 00000000..546397d5 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/armor/cloth_1_b.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/armor/cloth_2.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/armor/cloth_2.png new file mode 100644 index 00000000..8d8bba6c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/armor/cloth_2.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/armor/cloth_2_b.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/armor/cloth_2_b.png new file mode 100644 index 00000000..56556598 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/armor/cloth_2_b.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/armor/power.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/armor/power.png new file mode 100644 index 00000000..809539ca Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/armor/power.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/art/kz.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/art/kz.png new file mode 100644 index 00000000..4cb9a07c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/art/kz.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/colours.col b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/colours.col new file mode 100644 index 00000000..abe91ebe Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/colours.col differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/colours.xml b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/colours.xml new file mode 100644 index 00000000..f6a85645 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/colours.xml @@ -0,0 +1,283 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/font/Default.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/font/Default.png new file mode 100644 index 00000000..07ec8d9d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/font/Default.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/font/Mojangles_11.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/font/Mojangles_11.png new file mode 100644 index 00000000..cfa86446 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/font/Mojangles_11.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/font/Mojangles_7.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/font/Mojangles_7.png new file mode 100644 index 00000000..9de84520 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/font/Mojangles_7.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/item/book.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/item/book.png new file mode 100644 index 00000000..708eaab6 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/item/book.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/item/enderchest.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/item/enderchest.png new file mode 100644 index 00000000..dc26c059 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/item/enderchest.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/items.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/items.png new file mode 100644 index 00000000..c86026a0 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/items.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/additionalmapicons.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/additionalmapicons.png new file mode 100644 index 00000000..3f61270b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/additionalmapicons.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/explosion.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/explosion.png new file mode 100644 index 00000000..242d9115 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/explosion.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/footprint.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/footprint.png new file mode 100644 index 00000000..2260afeb Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/footprint.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/glint.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/glint.png new file mode 100644 index 00000000..ec9a3d1c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/glint.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/mapicons.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/mapicons.png new file mode 100644 index 00000000..8371a52a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/mapicons.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/particlefield.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/particlefield.png new file mode 100644 index 00000000..ea256619 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/particlefield.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/tunnel.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/tunnel.png new file mode 100644 index 00000000..2f82e845 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/misc/tunnel.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/enderdragon/beam.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/enderdragon/beam.png new file mode 100644 index 00000000..9ddd1d15 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/enderdragon/beam.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/enderdragon/ender.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/enderdragon/ender.png new file mode 100644 index 00000000..f82ef136 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/enderdragon/ender.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/enderdragon/ender_eyes.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/enderdragon/ender_eyes.png new file mode 100644 index 00000000..b16c9a50 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/enderdragon/ender_eyes.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/enderman_eyes.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/enderman_eyes.png new file mode 100644 index 00000000..5e3f4782 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/enderman_eyes.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/redcow.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/redcow.png new file mode 100644 index 00000000..1d94cc0d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/redcow.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/skeleton_wither.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/skeleton_wither.png new file mode 100644 index 00000000..b0db19df Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/skeleton_wither.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/snowman.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/snowman.png new file mode 100644 index 00000000..be61ec92 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/snowman.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/villager/butcher.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/villager/butcher.png new file mode 100644 index 00000000..935352f1 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/villager/butcher.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/villager/farmer.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/villager/farmer.png new file mode 100644 index 00000000..d01778ab Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/villager/farmer.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/villager/librarian.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/villager/librarian.png new file mode 100644 index 00000000..73b99518 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/villager/librarian.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/villager/priest.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/villager/priest.png new file mode 100644 index 00000000..14ae9398 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/villager/priest.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/villager/smith.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/villager/smith.png new file mode 100644 index 00000000..a97c37f9 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/villager/smith.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/villager/villager.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/villager/villager.png new file mode 100644 index 00000000..f002b0e5 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/villager/villager.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/wolf_collar.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/wolf_collar.png new file mode 100644 index 00000000..62d85725 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/wolf_collar.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/wolf_tame.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/wolf_tame.png new file mode 100644 index 00000000..18830a05 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/wolf_tame.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/zombie.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/zombie.png new file mode 100644 index 00000000..333fcd6e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/zombie.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/zombie_villager.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/zombie_villager.png new file mode 100644 index 00000000..0b2cecef Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/mob/zombie_villager.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/particles.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/particles.png new file mode 100644 index 00000000..aed54da5 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/particles.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/terrain.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/terrain.png new file mode 100644 index 00000000..d5d3751d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/terrain.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/terrainMipMapLevel2.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/terrainMipMapLevel2.png new file mode 100644 index 00000000..771bb2d5 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/terrainMipMapLevel2.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/terrainMipMapLevel3.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/terrainMipMapLevel3.png new file mode 100644 index 00000000..900ba0f3 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/terrainMipMapLevel3.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/fire_0.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/fire_0.png new file mode 100644 index 00000000..cf8910f6 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/fire_0.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/fire_0.txt b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/fire_0.txt new file mode 100644 index 00000000..58d1715d --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/fire_0.txt @@ -0,0 +1,16 @@ +8, +9, +10, +11, +12, +13, +14, +15, +0, +1, +2, +3, +4, +5, +6, +7, diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/fire_1.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/fire_1.png new file mode 100644 index 00000000..6db92ac4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/fire_1.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/fire_1.txt b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/fire_1.txt new file mode 100644 index 00000000..0519ecba --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/fire_1.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/lava.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/lava.png new file mode 100644 index 00000000..78bb29d5 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/lava.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/lava.txt b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/lava.txt new file mode 100644 index 00000000..b0a7c084 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/lava.txt @@ -0,0 +1,38 @@ +0*2 +1*2 +2*2 +3*2 +4*2 +5*2 +6*2 +7*2 +8*2 +9*2 +10*2 +11*2 +12*2 +13*2 +14*2 +15*2 +16*2 +17*2 +18*2 +19*2 +18*2 +17*2 +16*2 +15*2 +14*2 +13*2 +12*2 +11*2 +10*2 +9*2 +8*2 +7*2 +6*2 +5*2 +4*2 +3*2 +2*2 +1*2 diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/lava_flow.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/lava_flow.png new file mode 100644 index 00000000..af07f91d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/lava_flow.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/lava_flow.txt b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/lava_flow.txt new file mode 100644 index 00000000..2e6ca4fc --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/lava_flow.txt @@ -0,0 +1,16 @@ +0*3 +1*3 +2*3 +3*3 +4*3 +5*3 +6*3 +7*3 +8*3 +9*3 +10*3 +11*3 +12*3 +13*3 +14*3 +15*3 diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/portal.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/portal.png new file mode 100644 index 00000000..96859e2d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/portal.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/portal.txt b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/portal.txt new file mode 100644 index 00000000..0519ecba --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/portal.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/water.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/water.png new file mode 100644 index 00000000..c7e90b07 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/water.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/water.txt b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/water.txt new file mode 100644 index 00000000..d8fe765a --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/water.txt @@ -0,0 +1,32 @@ +0*2 +1*2 +2*2 +3*2 +4*2 +5*2 +6*2 +7*2 +8*2 +9*2 +10*2 +11*2 +12*2 +13*2 +14*2 +15*2 +16*2 +17*2 +18*2 +19*2 +20*2 +21*2 +22*2 +23*2 +24*2 +25*2 +26*2 +27*2 +28*2 +29*2 +30*2 +31*2 diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/water_flow.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/water_flow.png new file mode 100644 index 00000000..e72280c4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/water_flow.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/water_flow.txt b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/water_flow.txt new file mode 100644 index 00000000..0519ecba --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/blocks/water_flow.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/items/clock.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/items/clock.png new file mode 100644 index 00000000..069a0abf Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/items/clock.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/items/clock.txt b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/items/clock.txt new file mode 100644 index 00000000..0519ecba --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/items/clock.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/items/compass.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/items/compass.png new file mode 100644 index 00000000..9dcbdfe6 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/items/compass.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/items/compass.txt b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/items/compass.txt new file mode 100644 index 00000000..0519ecba --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/res/textures/items/compass.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/tutorialDiff b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/tutorialDiff new file mode 100644 index 00000000..be9e2e60 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/TitleUpdate/tutorialDiff differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/achievement/bg.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/achievement/bg.png new file mode 100644 index 00000000..23dd85a8 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/achievement/bg.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/achievement/icons.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/achievement/icons.png new file mode 100644 index 00000000..6a3f3ea5 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/achievement/icons.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/chain_1.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/chain_1.png new file mode 100644 index 00000000..3632af5b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/chain_1.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/chain_2.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/chain_2.png new file mode 100644 index 00000000..330425b1 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/chain_2.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/cloth_1.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/cloth_1.png new file mode 100644 index 00000000..f3cf4aa3 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/cloth_1.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/cloth_2.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/cloth_2.png new file mode 100644 index 00000000..15fb9084 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/cloth_2.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/diamond_1.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/diamond_1.png new file mode 100644 index 00000000..339da658 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/diamond_1.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/diamond_2.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/diamond_2.png new file mode 100644 index 00000000..c220c123 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/diamond_2.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/gold_1.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/gold_1.png new file mode 100644 index 00000000..885f309b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/gold_1.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/gold_2.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/gold_2.png new file mode 100644 index 00000000..9d1ea3b3 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/gold_2.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/iron_1.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/iron_1.png new file mode 100644 index 00000000..374ab076 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/iron_1.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/iron_2.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/iron_2.png new file mode 100644 index 00000000..53af4f4d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/iron_2.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/power.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/power.png new file mode 100644 index 00000000..809539ca Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/armor/power.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/art/kz.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/art/kz.png new file mode 100644 index 00000000..ecc4823e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/art/kz.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/audio/Minecraft.xgs b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/audio/Minecraft.xgs new file mode 100644 index 00000000..9761e4ca Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/audio/Minecraft.xgs differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/audio/minecraft.xsb b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/audio/minecraft.xsb new file mode 100644 index 00000000..4bfe9120 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/audio/minecraft.xsb differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/audio/resident.xwb b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/audio/resident.xwb new file mode 100644 index 00000000..3fa725a1 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/audio/resident.xwb differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/audio/streamed.xwb b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/audio/streamed.xwb new file mode 100644 index 00000000..ec2fb4ed Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/audio/streamed.xwb differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/environment/clouds.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/environment/clouds.png new file mode 100644 index 00000000..b4a78c2f Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/environment/clouds.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/environment/rain.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/environment/rain.png new file mode 100644 index 00000000..75d775b1 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/environment/rain.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/environment/snow.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/environment/snow.png new file mode 100644 index 00000000..84417c5c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/environment/snow.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/font/Mojangles_11.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/font/Mojangles_11.png new file mode 100644 index 00000000..1b8af338 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/font/Mojangles_11.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/font/Mojangles_7.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/font/Mojangles_7.png new file mode 100644 index 00000000..2ad933fe Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/font/Mojangles_7.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/font/default.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/font/default.png new file mode 100644 index 00000000..96094378 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/font/default.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/background.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/background.png new file mode 100644 index 00000000..b29e0092 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/background.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/container.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/container.png new file mode 100644 index 00000000..bd1d383c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/container.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/crafting.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/crafting.png new file mode 100644 index 00000000..da831189 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/crafting.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/furnace.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/furnace.png new file mode 100644 index 00000000..a5834e19 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/furnace.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/gui.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/gui.png new file mode 100644 index 00000000..81af329e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/gui.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/icons.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/icons.png new file mode 100644 index 00000000..73fe9bbd Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/icons.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/inventory.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/inventory.png new file mode 100644 index 00000000..0b5f2916 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/inventory.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/items.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/items.png new file mode 100644 index 00000000..3f51245f Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/items.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/logo.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/logo.png new file mode 100644 index 00000000..b7c28795 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/logo.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/particles.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/particles.png new file mode 100644 index 00000000..ac7e39f4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/particles.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/slot.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/slot.png new file mode 100644 index 00000000..4eb39baf Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/slot.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/trap.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/trap.png new file mode 100644 index 00000000..594860a6 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/trap.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/unknown_pack.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/unknown_pack.png new file mode 100644 index 00000000..3a45a90e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/gui/unknown_pack.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/item/arrows.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/item/arrows.png new file mode 100644 index 00000000..75c58287 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/item/arrows.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/item/boat.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/item/boat.png new file mode 100644 index 00000000..132a0f7c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/item/boat.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/item/cart.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/item/cart.png new file mode 100644 index 00000000..32af68e3 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/item/cart.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/item/door.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/item/door.png new file mode 100644 index 00000000..52df2d92 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/item/door.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/item/sign.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/item/sign.png new file mode 100644 index 00000000..e8294724 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/item/sign.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/dial.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/dial.png new file mode 100644 index 00000000..140e7e34 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/dial.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/foliagecolor.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/foliagecolor.png new file mode 100644 index 00000000..81673cae Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/foliagecolor.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/footprint.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/footprint.png new file mode 100644 index 00000000..e29b6a6d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/footprint.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/grasscolor.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/grasscolor.png new file mode 100644 index 00000000..a6d9c209 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/grasscolor.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/mapbg.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/mapbg.png new file mode 100644 index 00000000..3f67e74c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/mapbg.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/mapicons.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/mapicons.png new file mode 100644 index 00000000..2dd03d19 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/mapicons.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/pumpkinblur.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/pumpkinblur.png new file mode 100644 index 00000000..c6e2ffc9 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/pumpkinblur.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/shadow.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/shadow.png new file mode 100644 index 00000000..06d999b2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/shadow.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/vignette.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/vignette.png new file mode 100644 index 00000000..f236acb3 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/vignette.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/water.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/water.png new file mode 100644 index 00000000..8b92f9bc Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/water.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/watercolor.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/watercolor.png new file mode 100644 index 00000000..8537e0d0 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/misc/watercolor.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char.png new file mode 100644 index 00000000..7cfa08a8 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char1.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char1.png new file mode 100644 index 00000000..41576e63 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char1.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char2.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char2.png new file mode 100644 index 00000000..b921f856 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char2.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char3.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char3.png new file mode 100644 index 00000000..c7a39868 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char3.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char4.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char4.png new file mode 100644 index 00000000..25dcfec4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char4.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char5.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char5.png new file mode 100644 index 00000000..4cc80ac1 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char5.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char6.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char6.png new file mode 100644 index 00000000..74a71c4f Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char6.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char7.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char7.png new file mode 100644 index 00000000..5018dc45 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/char7.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/chicken.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/chicken.png new file mode 100644 index 00000000..d4812939 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/chicken.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/cow.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/cow.png new file mode 100644 index 00000000..2080ebcb Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/cow.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/creeper.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/creeper.png new file mode 100644 index 00000000..e0a5e0a1 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/creeper.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/ghast.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/ghast.png new file mode 100644 index 00000000..e83a60da Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/ghast.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/ghast_fire.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/ghast_fire.png new file mode 100644 index 00000000..fff9718c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/ghast_fire.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/pig.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/pig.png new file mode 100644 index 00000000..5c1efc2d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/pig.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/pigman.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/pigman.png new file mode 100644 index 00000000..c900b362 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/pigman.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/pigzombie.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/pigzombie.png new file mode 100644 index 00000000..0a0a25a4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/pigzombie.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/saddle.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/saddle.png new file mode 100644 index 00000000..aaea7a6d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/saddle.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/sheep.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/sheep.png new file mode 100644 index 00000000..98cfa9ac Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/sheep.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/sheep_fur.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/sheep_fur.png new file mode 100644 index 00000000..f1291a5f Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/sheep_fur.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/skeleton.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/skeleton.png new file mode 100644 index 00000000..9d223394 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/skeleton.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/slime.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/slime.png new file mode 100644 index 00000000..42fc8736 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/slime.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/spider.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/spider.png new file mode 100644 index 00000000..08344a83 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/spider.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/spider_eyes.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/spider_eyes.png new file mode 100644 index 00000000..2a7734f9 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/spider_eyes.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/squid.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/squid.png new file mode 100644 index 00000000..ff3f5b0a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/squid.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/wolf.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/wolf.png new file mode 100644 index 00000000..4b24458f Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/wolf.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/wolf_angry.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/wolf_angry.png new file mode 100644 index 00000000..89b3d2d6 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/wolf_angry.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/wolf_tame.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/wolf_tame.png new file mode 100644 index 00000000..159f45b5 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/wolf_tame.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/zombie.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/zombie.png new file mode 100644 index 00000000..0ab70895 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/mob/zombie.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/pack.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/pack.png new file mode 100644 index 00000000..973a7cf2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/pack.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/particles.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/particles.png new file mode 100644 index 00000000..e1ec7d2d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/particles.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/terrain.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/terrain.png new file mode 100644 index 00000000..244f7668 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/terrain.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/terrain/moon.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/terrain/moon.png new file mode 100644 index 00000000..61cebbc7 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/terrain/moon.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/terrain/sun.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/terrain/sun.png new file mode 100644 index 00000000..d3433441 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/terrain/sun.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/title/black.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/title/black.png new file mode 100644 index 00000000..dc2ad3e7 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/title/black.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/title/mclogo.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/title/mclogo.png new file mode 100644 index 00000000..752da0e7 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/title/mclogo.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/title/mojang.png b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/title/mojang.png new file mode 100644 index 00000000..829cfc45 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Common/res/title/mojang.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Battle And Beasts 2/BattleAndBeasts2.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Battle And Beasts 2/BattleAndBeasts2.pck new file mode 100644 index 00000000..6f042cca Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Battle And Beasts 2/BattleAndBeasts2.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Battle And Beasts/BattleAndBeasts.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Battle And Beasts/BattleAndBeasts.pck new file mode 100644 index 00000000..f3741222 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Battle And Beasts/BattleAndBeasts.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Candy Texture Pack/Data/media.arc b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Candy Texture Pack/Data/media.arc new file mode 100644 index 00000000..aa6bc459 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Candy Texture Pack/Data/media.arc differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Candy Texture Pack/Data/x16Data.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Candy Texture Pack/Data/x16Data.pck new file mode 100644 index 00000000..db0222c4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Candy Texture Pack/Data/x16Data.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Candy Texture Pack/TexturePack.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Candy Texture Pack/TexturePack.pck new file mode 100644 index 00000000..f3b38823 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Candy Texture Pack/TexturePack.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Cartoon Texture Pack/Data/media.arc b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Cartoon Texture Pack/Data/media.arc new file mode 100644 index 00000000..dd00c321 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Cartoon Texture Pack/Data/media.arc differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Cartoon Texture Pack/Data/x32Data.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Cartoon Texture Pack/Data/x32Data.pck new file mode 100644 index 00000000..3752e75a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Cartoon Texture Pack/Data/x32Data.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Cartoon Texture Pack/TexturePack.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Cartoon Texture Pack/TexturePack.pck new file mode 100644 index 00000000..4294d023 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Cartoon Texture Pack/TexturePack.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/City Texture Pack/Data/media.arc b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/City Texture Pack/Data/media.arc new file mode 100644 index 00000000..1482dde0 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/City Texture Pack/Data/media.arc differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/City Texture Pack/Data/x32Data.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/City Texture Pack/Data/x32Data.pck new file mode 100644 index 00000000..61161ba4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/City Texture Pack/Data/x32Data.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/City Texture Pack/TexturePack.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/City Texture Pack/TexturePack.pck new file mode 100644 index 00000000..a0b25725 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/City Texture Pack/TexturePack.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Doctor Who Skins Volume I/SkinPackDrWho.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Doctor Who Skins Volume I/SkinPackDrWho.pck new file mode 100644 index 00000000..7cad273b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Doctor Who Skins Volume I/SkinPackDrWho.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Fantasy Texture Pack/Data/media.arc b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Fantasy Texture Pack/Data/media.arc new file mode 100644 index 00000000..438a9d36 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Fantasy Texture Pack/Data/media.arc differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Fantasy Texture Pack/Data/x32Data.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Fantasy Texture Pack/Data/x32Data.pck new file mode 100644 index 00000000..64618ef7 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Fantasy Texture Pack/Data/x32Data.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Fantasy Texture Pack/TexturePack.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Fantasy Texture Pack/TexturePack.pck new file mode 100644 index 00000000..380dbb03 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Fantasy Texture Pack/TexturePack.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Festive Skin Pack/SkinsFestive.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Festive Skin Pack/SkinsFestive.pck new file mode 100644 index 00000000..c2ccd75e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Festive Skin Pack/SkinsFestive.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halloween Texture Pack/Data/media.arc b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halloween Texture Pack/Data/media.arc new file mode 100644 index 00000000..a0c2a66e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halloween Texture Pack/Data/media.arc differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halloween Texture Pack/Data/x16Data.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halloween Texture Pack/Data/x16Data.pck new file mode 100644 index 00000000..719d0e28 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halloween Texture Pack/Data/x16Data.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halloween Texture Pack/TexturePack.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halloween Texture Pack/TexturePack.pck new file mode 100644 index 00000000..561c831c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halloween Texture Pack/TexturePack.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Action Figure Hands.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Action Figure Hands.binka new file mode 100644 index 00000000..eaab0090 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Action Figure Hands.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/An End of Dying.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/An End of Dying.binka new file mode 100644 index 00000000..16700bf3 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/An End of Dying.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Cairo Suite 2.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Cairo Suite 2.binka new file mode 100644 index 00000000..76151181 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Cairo Suite 2.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Cloaked in Blackness.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Cloaked in Blackness.binka new file mode 100644 index 00000000..8cac6c56 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Cloaked in Blackness.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Delta Halo Suite.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Delta Halo Suite.binka new file mode 100644 index 00000000..2d10f590 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Delta Halo Suite.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Dewy Decimate.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Dewy Decimate.binka new file mode 100644 index 00000000..42ff1210 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Dewy Decimate.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Earth City.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Earth City.binka new file mode 100644 index 00000000..05c8e2a1 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Earth City.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Finale 1.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Finale 1.binka new file mode 100644 index 00000000..87cce227 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Finale 1.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Fingerprints Are Broken.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Fingerprints Are Broken.binka new file mode 100644 index 00000000..2f5fb05f Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Fingerprints Are Broken.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/First Step.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/First Step.binka new file mode 100644 index 00000000..ef16e794 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/First Step.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Flip and Sizzle.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Flip and Sizzle.binka new file mode 100644 index 00000000..5739faba Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Flip and Sizzle.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Flollo.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Flollo.binka new file mode 100644 index 00000000..e8af1cba Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Flollo.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/GameRules.grf b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/GameRules.grf new file mode 100644 index 00000000..c4d59ff1 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/GameRules.grf differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/HALO M02.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/HALO M02.binka new file mode 100644 index 00000000..36944526 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/HALO M02.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/High Charity Suite 1.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/High Charity Suite 1.binka new file mode 100644 index 00000000..6aaad943 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/High Charity Suite 1.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Insignificantia (All Sloppy-No Joe).binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Insignificantia (All Sloppy-No Joe).binka new file mode 100644 index 00000000..6e2f8592 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Insignificantia (All Sloppy-No Joe).binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Intimate.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Intimate.binka new file mode 100644 index 00000000..43f4cb78 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Intimate.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Money or Meteors.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Money or Meteors.binka new file mode 100644 index 00000000..a7c1b1dc Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Money or Meteors.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Night Dreams.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Night Dreams.binka new file mode 100644 index 00000000..83d68601 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Night Dreams.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Opening Suite 2.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Opening Suite 2.binka new file mode 100644 index 00000000..ed1bbeee Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Opening Suite 2.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Quiet Giant.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Quiet Giant.binka new file mode 100644 index 00000000..6a1d1dc4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Quiet Giant.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Rising Legacy.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Rising Legacy.binka new file mode 100644 index 00000000..5c141fea Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Rising Legacy.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Sacred Icon Suite 1.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Sacred Icon Suite 1.binka new file mode 100644 index 00000000..5c6ff13c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Sacred Icon Suite 1.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Spirit of Fire.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Spirit of Fire.binka new file mode 100644 index 00000000..675e5439 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Spirit of Fire.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Still, Moving.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Still, Moving.binka new file mode 100644 index 00000000..cdb86591 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Still, Moving.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Suite Fall.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Suite Fall.binka new file mode 100644 index 00000000..a10bfa76 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Suite Fall.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Survive.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Survive.binka new file mode 100644 index 00000000..52bf6ccf Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Survive.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/The Big Guns.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/The Big Guns.binka new file mode 100644 index 00000000..5ebcad3b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/The Big Guns.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Truth And Reconciliation.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Truth And Reconciliation.binka new file mode 100644 index 00000000..ee56d9e1 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Truth And Reconciliation.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Wolverines Reborn.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Wolverines Reborn.binka new file mode 100644 index 00000000..03b653a7 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Wolverines Reborn.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Work Burns and Runaway Grunts.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Work Burns and Runaway Grunts.binka new file mode 100644 index 00000000..7303c8b2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/Work Burns and Runaway Grunts.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/halo.mcs b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/halo.mcs new file mode 100644 index 00000000..159aa626 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/halo.mcs differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/media.arc b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/media.arc new file mode 100644 index 00000000..7cc155d4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/media.arc differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/x16Data.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/x16Data.pck new file mode 100644 index 00000000..eeea0eaa Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/Data/x16Data.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/TexturePack.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/TexturePack.pck new file mode 100644 index 00000000..423ac2d8 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Halo/TexturePack.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Marvel Avengers/SkinPackMarvelAvengers1.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Marvel Avengers/SkinPackMarvelAvengers1.pck new file mode 100644 index 00000000..5f89ecd5 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Marvel Avengers/SkinPackMarvelAvengers1.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Marvel Guardians Of The Galaxy/SkinPackGOG.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Marvel Guardians Of The Galaxy/SkinPackGOG.pck new file mode 100644 index 00000000..f0eb1f38 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Marvel Guardians Of The Galaxy/SkinPackGOG.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Marvel Spider-Man/SkinPackMarvelSpiderman.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Marvel Spider-Man/SkinPackMarvelSpiderman.pck new file mode 100644 index 00000000..584cc04d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Marvel Spider-Man/SkinPackMarvelSpiderman.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/01-The Fate of the Galaxy.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/01-The Fate of the Galaxy.binka new file mode 100644 index 00000000..4462b69f Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/01-The Fate of the Galaxy.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/02-Leaving Earth.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/02-Leaving Earth.binka new file mode 100644 index 00000000..33624ece Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/02-Leaving Earth.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/03-Mars.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/03-Mars.binka new file mode 100644 index 00000000..678af97d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/03-Mars.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/04-A Cerberus Agent.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/04-A Cerberus Agent.binka new file mode 100644 index 00000000..e9f3ea99 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/04-A Cerberus Agent.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/05-The View of Palaven.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/05-The View of Palaven.binka new file mode 100644 index 00000000..672ed958 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/05-The View of Palaven.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/06-A Future for the Krogan.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/06-A Future for the Krogan.binka new file mode 100644 index 00000000..8faf90d9 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/06-A Future for the Krogan.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/07-Surkesh.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/07-Surkesh.binka new file mode 100644 index 00000000..b16dc965 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/07-Surkesh.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/08-The Ardat Yakshi.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/08-The Ardat Yakshi.binka new file mode 100644 index 00000000..54c17580 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/08-The Ardat Yakshi.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/09-Rannoch.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/09-Rannoch.binka new file mode 100644 index 00000000..766375c9 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/09-Rannoch.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/10-I'm Sorry.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/10-I'm Sorry.binka new file mode 100644 index 00000000..846d2360 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/10-I'm Sorry.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/11-The Cerberus Plot.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/11-The Cerberus Plot.binka new file mode 100644 index 00000000..31877f58 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/11-The Cerberus Plot.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/12-The Scientists.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/12-The Scientists.binka new file mode 100644 index 00000000..92dec6be Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/12-The Scientists.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/13-Aralakh Company.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/13-Aralakh Company.binka new file mode 100644 index 00000000..8a615db7 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/13-Aralakh Company.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/14-Prothean Beacon.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/14-Prothean Beacon.binka new file mode 100644 index 00000000..e1a8a36a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/14-Prothean Beacon.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/15-Defeat.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/15-Defeat.binka new file mode 100644 index 00000000..e955dc2c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/15-Defeat.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/16-Reaper Chase.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/16-Reaper Chase.binka new file mode 100644 index 00000000..237bd6a4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/16-Reaper Chase.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/17-Stand Strong, Stand Together.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/17-Stand Strong, Stand Together.binka new file mode 100644 index 00000000..03afa022 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/17-Stand Strong, Stand Together.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/18-I Was Lost Without You.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/18-I Was Lost Without You.binka new file mode 100644 index 00000000..f2cfe2f5 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/18-I Was Lost Without You.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/19-The Fleets Arrive.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/19-The Fleets Arrive.binka new file mode 100644 index 00000000..75823cc2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/19-The Fleets Arrive.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/20-We Face Our Enemy Together.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/20-We Face Our Enemy Together.binka new file mode 100644 index 00000000..05aba0e2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/20-We Face Our Enemy Together.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/21-I'm Proud Of You.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/21-I'm Proud Of You.binka new file mode 100644 index 00000000..c44e3595 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/21-I'm Proud Of You.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/22-An End, Once and For All.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/22-An End, Once and For All.binka new file mode 100644 index 00000000..24d674b7 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/22-An End, Once and For All.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/GameRules.grf b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/GameRules.grf new file mode 100644 index 00000000..33449e04 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/GameRules.grf differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/masseffect.mcs b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/masseffect.mcs new file mode 100644 index 00000000..e2a3fb41 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/masseffect.mcs differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/media.arc b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/media.arc new file mode 100644 index 00000000..2721343d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/media.arc differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/x16Data.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/x16Data.pck new file mode 100644 index 00000000..1f03ff10 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/Data/x16Data.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/TexturePack.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/TexturePack.pck new file mode 100644 index 00000000..020d763a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Mass Effect/TexturePack.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Natural Texture Pack/Data/media.arc b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Natural Texture Pack/Data/media.arc new file mode 100644 index 00000000..b08a1006 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Natural Texture Pack/Data/media.arc differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Natural Texture Pack/Data/x32Data.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Natural Texture Pack/Data/x32Data.pck new file mode 100644 index 00000000..cafb05e0 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Natural Texture Pack/Data/x32Data.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Natural Texture Pack/TexturePack.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Natural Texture Pack/TexturePack.pck new file mode 100644 index 00000000..6c9430c4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Natural Texture Pack/TexturePack.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Plastic Texture Pack/Data/media.arc b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Plastic Texture Pack/Data/media.arc new file mode 100644 index 00000000..7aa5aea5 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Plastic Texture Pack/Data/media.arc differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Plastic Texture Pack/Data/x16Data.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Plastic Texture Pack/Data/x16Data.pck new file mode 100644 index 00000000..979f75c8 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Plastic Texture Pack/Data/x16Data.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Plastic Texture Pack/TexturePack.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Plastic Texture Pack/TexturePack.pck new file mode 100644 index 00000000..72a03983 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Plastic Texture Pack/TexturePack.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skin Pack 1/Skins1.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skin Pack 1/Skins1.pck new file mode 100644 index 00000000..fca0a9a4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skin Pack 1/Skins1.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skin Pack 2/Skins2.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skin Pack 2/Skins2.pck new file mode 100644 index 00000000..04cd7e6b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skin Pack 2/Skins2.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skin Pack 3/Skins3.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skin Pack 3/Skins3.pck new file mode 100644 index 00000000..fac17c2f Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skin Pack 3/Skins3.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skin Pack 4/Skins4_XB1.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skin Pack 4/Skins4_XB1.pck new file mode 100644 index 00000000..435fb41d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skin Pack 4/Skins4_XB1.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skin Pack 5/SkinPack5.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skin Pack 5/SkinPack5.pck new file mode 100644 index 00000000..4cda4af5 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skin Pack 5/SkinPack5.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skin Pack 6/SkinPack6.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skin Pack 6/SkinPack6.pck new file mode 100644 index 00000000..03351d9c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skin Pack 6/SkinPack6.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/01 (A) Dragonborn.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/01 (A) Dragonborn.binka new file mode 100644 index 00000000..0547c070 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/01 (A) Dragonborn.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/02 (A) Awake.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/02 (A) Awake.binka new file mode 100644 index 00000000..2d1f4699 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/02 (A) Awake.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/03 (A) From Past To Present.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/03 (A) From Past To Present.binka new file mode 100644 index 00000000..fd7de9ab Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/03 (A) From Past To Present.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/06 (A) The City Gates.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/06 (A) The City Gates.binka new file mode 100644 index 00000000..42f9e859 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/06 (A) The City Gates.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/08 (A) Dragonsreach.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/08 (A) Dragonsreach.binka new file mode 100644 index 00000000..fa65c6d2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/08 (A) Dragonsreach.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/09 (A) Tooth and Claw.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/09 (A) Tooth and Claw.binka new file mode 100644 index 00000000..0b12cad5 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/09 (A) Tooth and Claw.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/13 (A) Distant Horizons.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/13 (A) Distant Horizons.binka new file mode 100644 index 00000000..f0123afc Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/13 (A) Distant Horizons.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/14 (A) Dawn.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/14 (A) Dawn.binka new file mode 100644 index 00000000..bc7b0604 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/14 (A) Dawn.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/15 (A) The Jerall Mountains.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/15 (A) The Jerall Mountains.binka new file mode 100644 index 00000000..a7ace7e7 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/15 (A) The Jerall Mountains.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/17 (A) Secunda.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/17 (A) Secunda.binka new file mode 100644 index 00000000..6c0a62f1 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/17 (A) Secunda.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/19 (B) Frostfall.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/19 (B) Frostfall.binka new file mode 100644 index 00000000..78458557 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/19 (B) Frostfall.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/21 (B) Into Darkness.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/21 (B) Into Darkness.binka new file mode 100644 index 00000000..b70a08e6 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/21 (B) Into Darkness.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/23 (B) Unbound.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/23 (B) Unbound.binka new file mode 100644 index 00000000..0e2f1004 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/23 (B) Unbound.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/24 (B) Far Horizons.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/24 (B) Far Horizons.binka new file mode 100644 index 00000000..6d71f92f Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/24 (B) Far Horizons.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/27 (B) The Streets of Whiterun.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/27 (B) The Streets of Whiterun.binka new file mode 100644 index 00000000..c8055493 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/27 (B) The Streets of Whiterun.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/29 (B) The White River.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/29 (B) The White River.binka new file mode 100644 index 00000000..540e49d5 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/29 (B) The White River.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/31 (B) Standing Stones.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/31 (B) Standing Stones.binka new file mode 100644 index 00000000..039a7b0d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/31 (B) Standing Stones.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/33 (B) Tundra.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/33 (B) Tundra.binka new file mode 100644 index 00000000..b8b460d4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/33 (B) Tundra.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/34 (B) Journey's End.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/34 (B) Journey's End.binka new file mode 100644 index 00000000..c20e8511 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/34 (B) Journey's End.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/39 (C) Shadows and Echoes.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/39 (C) Shadows and Echoes.binka new file mode 100644 index 00000000..5ad13e79 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/39 (C) Shadows and Echoes.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/41 (C) Aurora.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/41 (C) Aurora.binka new file mode 100644 index 00000000..eb8b5c94 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/41 (C) Aurora.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/43 (C) Towers and Shadows.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/43 (C) Towers and Shadows.binka new file mode 100644 index 00000000..1ff1d4bd Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/43 (C) Towers and Shadows.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/45 (C) Solitude.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/45 (C) Solitude.binka new file mode 100644 index 00000000..e9730ddb Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/45 (C) Solitude.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/46 (C) Watch the Skies.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/46 (C) Watch the Skies.binka new file mode 100644 index 00000000..e59eee44 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/46 (C) Watch the Skies.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/49 (C) Death in the Darkness.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/49 (C) Death in the Darkness.binka new file mode 100644 index 00000000..71ea7daa Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/49 (C) Death in the Darkness.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/52 (C) Wind Guide You.binka b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/52 (C) Wind Guide You.binka new file mode 100644 index 00000000..9adb25be Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/52 (C) Wind Guide You.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/GameRules.grf b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/GameRules.grf new file mode 100644 index 00000000..e59b4efd Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/GameRules.grf differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/media.arc b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/media.arc new file mode 100644 index 00000000..28f02a37 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/media.arc differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/skyrim.mcs b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/skyrim.mcs new file mode 100644 index 00000000..1a561f71 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/skyrim.mcs differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/x16Data.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/x16Data.pck new file mode 100644 index 00000000..66a1be36 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/Data/x16Data.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/TexturePack.pck b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/TexturePack.pck new file mode 100644 index 00000000..c44c03ca Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLC/Skyrim/TexturePack.pck differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/MPHA_360x360.png b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/MPHA_360x360.png new file mode 100644 index 00000000..6a805f47 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/MPHA_360x360.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/MPMA_360x360.png b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/MPMA_360x360.png new file mode 100644 index 00000000..22fd45c2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/MPMA_360x360.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/MPSR_360x360.png b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/MPSR_360x360.png new file mode 100644 index 00000000..9a6db8e2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/MPSR_360x360.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SP1_360x360.png b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SP1_360x360.png new file mode 100644 index 00000000..ed4cc736 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SP1_360x360.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SP2_360x360.png b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SP2_360x360.png new file mode 100644 index 00000000..a576039c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SP2_360x360.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SP3_360x360.png b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SP3_360x360.png new file mode 100644 index 00000000..1c35e16b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SP3_360x360.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SP4_360x360.png b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SP4_360x360.png new file mode 100644 index 00000000..69924440 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SP4_360x360.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SP5_360x360.png b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SP5_360x360.png new file mode 100644 index 00000000..56ab6465 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SP5_360x360.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SP6_360x360.png b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SP6_360x360.png new file mode 100644 index 00000000..e418a96d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SP6_360x360.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPB2_360x360.png b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPB2_360x360.png new file mode 100644 index 00000000..c88e8d0c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPB2_360x360.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPB_360x360.png b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPB_360x360.png new file mode 100644 index 00000000..f7966758 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPB_360x360.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPC_360x360.png b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPC_360x360.png new file mode 100644 index 00000000..65a93bc1 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPC_360x360.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPD1_360x360.png b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPD1_360x360.png new file mode 100644 index 00000000..10125eaf Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPD1_360x360.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPF_360x360.png b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPF_360x360.png new file mode 100644 index 00000000..db5af5c1 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPF_360x360.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPG_360x360.png b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPG_360x360.png new file mode 100644 index 00000000..8e47c8d1 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPG_360x360.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPI_360x360.png b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPI_360x360.png new file mode 100644 index 00000000..8d29b155 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPI_360x360.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPM_360x360.png b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPM_360x360.png new file mode 100644 index 00000000..99cd9572 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPM_360x360.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPZ_360x360.png b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPZ_360x360.png new file mode 100644 index 00000000..69f2e042 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/SPZ_360x360.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP01_360x360.png b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP01_360x360.png new file mode 100644 index 00000000..4c7a51cb Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP01_360x360.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP02_360x360.png b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP02_360x360.png new file mode 100644 index 00000000..e199b492 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP02_360x360.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP03_360x360.png b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP03_360x360.png new file mode 100644 index 00000000..8ad4f300 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP03_360x360.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP04_360x360.png b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP04_360x360.png new file mode 100644 index 00000000..c6a30056 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP04_360x360.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP05_360x360.png b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP05_360x360.png new file mode 100644 index 00000000..ee9f8b86 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP05_360x360.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP06_360x360.png b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP06_360x360.png new file mode 100644 index 00000000..bbe59598 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP06_360x360.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP07_360x360.png b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP07_360x360.png new file mode 100644 index 00000000..6449e656 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCImages/TP07_360x360.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/DLCXbox1.cmp b/Minecraft.Client/Durango/Layout/Image/Loose/DLCXbox1.cmp new file mode 100644 index 00000000..14359d2c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/DLCXbox1.cmp differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/SmallLogo.png b/Minecraft.Client/Durango/Layout/Image/Loose/SmallLogo.png new file mode 100644 index 00000000..00b54071 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/SmallLogo.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Sound/Minecraft.msscmp b/Minecraft.Client/Durango/Layout/Image/Loose/Sound/Minecraft.msscmp new file mode 100644 index 00000000..13983f6d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/Sound/Minecraft.msscmp differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/SplashScreen.png b/Minecraft.Client/Durango/Layout/Image/Loose/SplashScreen.png new file mode 100644 index 00000000..948fdad7 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/SplashScreen.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/StoreLogo.png b/Minecraft.Client/Durango/Layout/Image/Loose/StoreLogo.png new file mode 100644 index 00000000..679b33da Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/StoreLogo.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/Update.alignmentchunk b/Minecraft.Client/Durango/Layout/Image/Loose/Update.alignmentchunk new file mode 100644 index 00000000..c2270834 --- /dev/null +++ b/Minecraft.Client/Durango/Layout/Image/Loose/Update.alignmentchunk @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/WideLogo.png b/Minecraft.Client/Durango/Layout/Image/Loose/WideLogo.png new file mode 100644 index 00000000..88bd1af5 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/WideLogo.png differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/11.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/11.binka new file mode 100644 index 00000000..5e321ec6 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/11.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/13.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/13.binka new file mode 100644 index 00000000..e5021e6d Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/13.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/blocks.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/blocks.binka new file mode 100644 index 00000000..d5df69f2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/blocks.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/cat.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/cat.binka new file mode 100644 index 00000000..49ec9b59 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/cat.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/chirp.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/chirp.binka new file mode 100644 index 00000000..45733e5a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/chirp.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/far.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/far.binka new file mode 100644 index 00000000..014ca050 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/far.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/mall.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/mall.binka new file mode 100644 index 00000000..d8629c75 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/mall.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/mellohi.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/mellohi.binka new file mode 100644 index 00000000..906395e2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/mellohi.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/stal.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/stal.binka new file mode 100644 index 00000000..3d82bf93 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/stal.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/strad.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/strad.binka new file mode 100644 index 00000000..2a29ffb2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/strad.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/ward.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/ward.binka new file mode 100644 index 00000000..032a9187 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/ward.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/where_are_we_now.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/where_are_we_now.binka new file mode 100644 index 00000000..8168990e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/cds/where_are_we_now.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/calm1.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/calm1.binka new file mode 100644 index 00000000..990e816a Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/calm1.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/calm2.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/calm2.binka new file mode 100644 index 00000000..9444e2a9 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/calm2.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/calm3.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/calm3.binka new file mode 100644 index 00000000..99b171fd Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/calm3.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/creative1.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/creative1.binka new file mode 100644 index 00000000..ca3559c4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/creative1.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/creative2.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/creative2.binka new file mode 100644 index 00000000..462fb1e3 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/creative2.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/creative3.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/creative3.binka new file mode 100644 index 00000000..9cd64e7e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/creative3.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/creative4.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/creative4.binka new file mode 100644 index 00000000..921a5b13 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/creative4.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/creative5.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/creative5.binka new file mode 100644 index 00000000..167ab36c Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/creative5.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/creative6.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/creative6.binka new file mode 100644 index 00000000..b31eb99e Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/creative6.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/hal1.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/hal1.binka new file mode 100644 index 00000000..949420f2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/hal1.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/hal2.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/hal2.binka new file mode 100644 index 00000000..58bf56ed Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/hal2.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/hal3.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/hal3.binka new file mode 100644 index 00000000..bf6a76e0 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/hal3.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/hal4.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/hal4.binka new file mode 100644 index 00000000..541128a4 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/hal4.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/menu1.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/menu1.binka new file mode 100644 index 00000000..b0ea4240 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/menu1.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/menu2.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/menu2.binka new file mode 100644 index 00000000..d5f61ab6 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/menu2.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/menu3.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/menu3.binka new file mode 100644 index 00000000..97d37292 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/menu3.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/menu4.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/menu4.binka new file mode 100644 index 00000000..0f40cd66 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/menu4.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/nether1.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/nether1.binka new file mode 100644 index 00000000..034bab5f Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/nether1.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/nether2.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/nether2.binka new file mode 100644 index 00000000..a065e659 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/nether2.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/nether3.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/nether3.binka new file mode 100644 index 00000000..4c42a6e2 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/nether3.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/nether4.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/nether4.binka new file mode 100644 index 00000000..87000717 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/nether4.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/nuance1.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/nuance1.binka new file mode 100644 index 00000000..ff776a04 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/nuance1.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/nuance2.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/nuance2.binka new file mode 100644 index 00000000..2ceac487 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/nuance2.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/piano1.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/piano1.binka new file mode 100644 index 00000000..7170108f Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/piano1.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/piano2.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/piano2.binka new file mode 100644 index 00000000..9983f94b Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/piano2.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/piano3.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/piano3.binka new file mode 100644 index 00000000..befbf102 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/piano3.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/the_end_dragon_alive.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/the_end_dragon_alive.binka new file mode 100644 index 00000000..700a1c30 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/the_end_dragon_alive.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/music/music/the_end_end.binka b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/the_end_end.binka new file mode 100644 index 00000000..24b45108 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/music/music/the_end_end.binka differ diff --git a/Minecraft.Client/Durango/Layout/Image/Loose/xcompress.dll b/Minecraft.Client/Durango/Layout/Image/Loose/xcompress.dll new file mode 100644 index 00000000..b95e3701 Binary files /dev/null and b/Minecraft.Client/Durango/Layout/Image/Loose/xcompress.dll differ diff --git a/Minecraft.Client/Durango/Leaderboards/DurangoLeaderboardManager.cpp b/Minecraft.Client/Durango/Leaderboards/DurangoLeaderboardManager.cpp new file mode 100644 index 00000000..cbedb033 --- /dev/null +++ b/Minecraft.Client/Durango/Leaderboards/DurangoLeaderboardManager.cpp @@ -0,0 +1,717 @@ +#include "stdafx.h" +#include "DurangoLeaderboardManager.h" +#include "..\..\..\Minecraft.World\StringHelpers.h" + +namespace WFC = Windows::Foundation::Collections; +namespace CC = concurrency; + +LeaderboardManager *LeaderboardManager::m_instance = new DurangoLeaderboardManager(); //Singleton instance of the LeaderboardManager + +DurangoLeaderboardManager::DurangoLeaderboardManager() +{ + m_eStatsState = eStatsState_Idle; + InitializeCriticalSection(&m_csStatsState); + + m_openSessions = 0; + m_xboxLiveContext = nullptr; + m_scores = NULL; + m_readCount = 0; + m_maxRank = 0; + m_waitingForProfiles = false; + + m_difficulty = 0; + m_type = eStatsType_UNDEFINED; + m_statNames = ref new PC::Vector(); + m_xboxUserIds = ref new PC::Vector(); + m_leaderboardAsyncOp = nullptr; + m_statsAsyncOp = nullptr; + + for(unsigned int difficulty = 0; difficulty < 4; ++difficulty) + { + m_leaderboardNames[difficulty][eStatsType_Travelling] = L"LeaderboardTravelling" + _toString(difficulty); + m_leaderboardNames[difficulty][eStatsType_Mining] = L"LeaderboardMining" + _toString(difficulty); + m_leaderboardNames[difficulty][eStatsType_Farming] = L"LeaderboardFarming" + _toString(difficulty); + m_leaderboardNames[difficulty][eStatsType_Kills] = L"LeaderboardKills" + _toString(difficulty); + + m_socialLeaderboardNames[difficulty][eStatsType_Travelling] = L"Leaderboard.LeaderboardId.0.DifficultyLevelId." + _toString(difficulty); + m_socialLeaderboardNames[difficulty][eStatsType_Mining] = L"Leaderboard.LeaderboardId.1.DifficultyLevelId." + _toString(difficulty); + m_socialLeaderboardNames[difficulty][eStatsType_Farming] = L"Leaderboard.LeaderboardId.2.DifficultyLevelId." + _toString(difficulty); + m_socialLeaderboardNames[difficulty][eStatsType_Kills] = L"Leaderboard.LeaderboardId.3.DifficultyLevelId." + _toString(difficulty); + + m_leaderboardStatNames[difficulty][eStatsType_Travelling].push_back( L"DistanceTravelled.DifficultyLevelId." + _toString(difficulty) + L".TravelMethodId.0"); // Walked + m_leaderboardStatNames[difficulty][eStatsType_Travelling].push_back( L"DistanceTravelled.DifficultyLevelId." + _toString(difficulty) + L".TravelMethodId.2"); // Fallen + m_leaderboardStatNames[difficulty][eStatsType_Travelling].push_back( L"DistanceTravelled.DifficultyLevelId." + _toString(difficulty) + L".TravelMethodId.4"); // Minecart + m_leaderboardStatNames[difficulty][eStatsType_Travelling].push_back( L"DistanceTravelled.DifficultyLevelId." + _toString(difficulty) + L".TravelMethodId.5"); // Boat + + m_leaderboardStatNames[difficulty][eStatsType_Mining].push_back( L"BlockBroken.DifficultyLevelId." + _toString(difficulty) + L".BlockId.3"); // Dirt + m_leaderboardStatNames[difficulty][eStatsType_Mining].push_back( L"BlockBroken.DifficultyLevelId." + _toString(difficulty) + L".BlockId.4"); // Cobblestone + m_leaderboardStatNames[difficulty][eStatsType_Mining].push_back( L"BlockBroken.DifficultyLevelId." + _toString(difficulty) + L".BlockId.12"); // Sand + m_leaderboardStatNames[difficulty][eStatsType_Mining].push_back( L"BlockBroken.DifficultyLevelId." + _toString(difficulty) + L".BlockId.1"); // Stone + m_leaderboardStatNames[difficulty][eStatsType_Mining].push_back( L"BlockBroken.DifficultyLevelId." + _toString(difficulty) + L".BlockId.13"); // Gravel + m_leaderboardStatNames[difficulty][eStatsType_Mining].push_back( L"BlockBroken.DifficultyLevelId." + _toString(difficulty) + L".BlockId.82"); // Clay + m_leaderboardStatNames[difficulty][eStatsType_Mining].push_back( L"BlockBroken.DifficultyLevelId." + _toString(difficulty) + L".BlockId.49"); // Obsidian + + m_leaderboardStatNames[difficulty][eStatsType_Farming].push_back( L"McItemAcquired.DifficultyLevelId." + _toString(difficulty) + L".AcquisitionMethodId.1.ItemId.344"); // Eggs + m_leaderboardStatNames[difficulty][eStatsType_Farming].push_back( L"BlockBroken.DifficultyLevelId." + _toString(difficulty) + L".BlockId.59"); // Wheat + m_leaderboardStatNames[difficulty][eStatsType_Farming].push_back( L"BlockBroken.DifficultyLevelId." + _toString(difficulty) + L".BlockId.39"); // Mushroom + m_leaderboardStatNames[difficulty][eStatsType_Farming].push_back( L"BlockBroken.DifficultyLevelId." + _toString(difficulty) + L".BlockId.83"); // Sugarcane + m_leaderboardStatNames[difficulty][eStatsType_Farming].push_back( L"McItemAcquired.DifficultyLevelId." + _toString(difficulty) + L".AcquisitionMethodId.2.ItemId.335"); // Milk + m_leaderboardStatNames[difficulty][eStatsType_Farming].push_back( L"McItemAcquired.DifficultyLevelId." + _toString(difficulty) + L".AcquisitionMethodId.1.ItemId.86"); // Pumpkin + + m_leaderboardStatNames[difficulty][eStatsType_Kills].push_back( L"MobKilledTotal.DifficultyLevelId." + _toString(difficulty) + L".EnemyRoleId.54"); // Zombie + m_leaderboardStatNames[difficulty][eStatsType_Kills].push_back( L"MobKilledTotal.DifficultyLevelId." + _toString(difficulty) + L".EnemyRoleId.51"); // Skeleton + m_leaderboardStatNames[difficulty][eStatsType_Kills].push_back( L"MobKilledTotal.DifficultyLevelId." + _toString(difficulty) + L".EnemyRoleId.50"); // Creeper + m_leaderboardStatNames[difficulty][eStatsType_Kills].push_back( L"MobKilledTotal.DifficultyLevelId." + _toString(difficulty) + L".EnemyRoleId.52"); // Spider + m_leaderboardStatNames[difficulty][eStatsType_Kills].push_back( L"MobKilledTotal.DifficultyLevelId." + _toString(difficulty) + L".EnemyRoleId.49"); // Spider Jockey + m_leaderboardStatNames[difficulty][eStatsType_Kills].push_back( L"MobKilledTotal.DifficultyLevelId." + _toString(difficulty) + L".EnemyRoleId.57"); // Zombie Pigman + m_leaderboardStatNames[difficulty][eStatsType_Kills].push_back( L"MobKilledTotal.DifficultyLevelId." + _toString(difficulty) + L".EnemyRoleId.55"); // Slime + } +} + +void DurangoLeaderboardManager::Tick() +{ + ReadView view; + + switch( getState() ) + { + case eStatsState_GettingLeaderboardInfo: + break; + case eStatsState_ReceivedLeaderboardInfo: + { + setState(eStatsState_GettingStatsInfo); + + // Get the actual display info for the stats + m_statsAsyncOp = m_xboxLiveContext->UserStatisticsService->GetMultipleUserStatisticsAsync( + m_xboxUserIds->GetView(), // the collection of Xbox user IDs whose stats we want to retrieve + SERVICE_CONFIG_ID, // the service config that contains the stats we want + m_statNames->GetView() // a list of stat names we want + ); + + auto task = concurrency::create_task(m_statsAsyncOp).then( [this] (CC::task^> resultListTask) + { + try + { + app.DebugPrintf("[LeaderboardManager] Second continuation\n"); + m_statsAsyncOp = nullptr; + + WFC::IVectorView^ resultList = resultListTask.get(); + + if (m_xboxLiveContext == nullptr) throw(ref new P::Exception(-1)); + + int userIndex = 0; + for( MXS::UserStatistics::UserStatisticsResult^ result : resultList ) + { + app.DebugPrintf("XboxUserId: %ls\n", result->XboxUserId->Data()); + + for( UINT index = 0; indexServiceConfigurationStatistics->Size; index++ ) + { + MXS::UserStatistics::ServiceConfigurationStatistic^ configStat = result->ServiceConfigurationStatistics->GetAt(index); + //app.DebugPrintf("ServiceConfigurationId: %ls\n", configStat->ServiceConfigurationId->Data()); + + updateStatsInfo(userIndex, m_difficulty, m_type, configStat->Statistics); + } + ++userIndex; + } + + app.DebugPrintf("[LeaderboardManager] Setting to ready\n"); + setState(eStatsState_Ready); + + } + catch (Platform::Exception^ ex) + { + m_leaderboardAsyncOp = nullptr; + setState(eStatsState_Failed); + + if (ex->HResult == HTTP_E_STATUS_NOT_FOUND) app.DebugPrintf("[LeaderboardManager] ERROR calling GetLeaderboardAsync: 404 Not Found - 0x%0.8x\n", ex->HResult); + else app.DebugPrintf("[LeaderboardManager] ERROR calling GetLeaderboardAsync: 0x%0.8x\n", ex->HResult); + } + catch (...) + { + app.DebugPrintf("[LeaderboardManager] SecondContinuation: Unknown exception.\n"); + } + }); + } + break; + case eStatsState_GettingStatsInfo: + break; + case eStatsState_Ready: + { + // If we're waiting on profiles, don't return scores just yet + if (m_waitingForProfiles) + { + return; + } + else + { + if (m_displayNames.size() == m_readCount) + { + // Add display names to scores + for (int i = 0; i < m_displayNames.size(); i++) + { + m_scores[i].m_name = m_displayNames[i]; + } + } + else + { + // This seem to happen if something went wrong with Xbox Live + app.DebugPrintf("DurangoLeaderboardManager::Tick: Display names count (%i) didn't match read count (%i)", m_displayNames.size(), m_readCount); + } + + m_displayNames.clear(); + } + + //assert(m_scores != NULL || m_readCount == 0); + + view.m_numQueries = m_readCount; + view.m_queries = m_scores; + + // 4J-JEV: Debugging. + //LeaderboardManager::printStats(view); + + eStatsReturn ret = view.m_numQueries > 0 ? eStatsReturn_Success : eStatsReturn_NoResults; + + if (m_readListener != NULL) + { + app.DebugPrintf("[LeaderboardManager] OnStatsReadComplete(%i, %i, _)\n", ret, m_readCount); + m_readListener->OnStatsReadComplete(ret, m_maxRank, view); + } + + app.DebugPrintf("[LeaderboardManager] Deleting scores\n"); + delete [] m_scores; + m_scores = NULL; + + setState(eStatsState_Idle); + } + break; + + case eStatsState_Failed: + view.m_numQueries = 0; + view.m_queries = NULL; + + if ( m_readListener != NULL ) + { + m_readListener->OnStatsReadComplete(eStatsReturn_NetworkError, 0, view); + } + + setState(eStatsState_Idle); + + break; + + case eStatsState_Canceled: + app.DebugPrintf("[LeaderboardManager] Setting canceled\n"); + setState(eStatsState_Idle); + break; + + default: // Getting or Idle. + if (m_openSessions == 0 && m_xboxLiveContext != nullptr) + { + m_xboxLiveContext = nullptr; + + app.DebugPrintf("[LeaderboardManager] Tick(): Nulled XboxLiveContext\n"); + } + break; + } +} + +//Open a session +bool DurangoLeaderboardManager::OpenSession() +{ + if (m_openSessions == 0) + { + app.DebugPrintf("[LeaderboardManager] OpenSession()\n"); + + try + { + WXS::User^ user = ProfileManager.GetUser(ProfileManager.GetPrimaryPad()); + if(user != nullptr && user->IsSignedIn && !user->IsGuest) + { + m_xboxLiveContext = ref new MXS::XboxLiveContext(user); + } + else + { + app.DebugPrintf("[LeaderboardManager] OpenSession(): Failed to created new XboxLiveContext, No valid user\n"); + return false; + } + } + catch (Platform::Exception^ ex) + { + m_xboxLiveContext = nullptr; + app.DebugPrintf("[LeaderboardManager] OpenSession(): Failed to created new XboxLiveContext, ret == 0x%08X.\n", ex->HResult); + return false; + } + catch (...) + { + app.DebugPrintf("[LeaderboardManager] OpenSession(): Unknown exception.\n"); + return false; + } + } + else app.DebugPrintf("[LeaderboardManager] OpenSession(): Another session opened, total=%i\n", m_openSessions+1); + + m_openSessions++; + return true; +} + +//Close a session +void DurangoLeaderboardManager::CloseSession() +{ + m_openSessions--; + + if (m_openSessions == 0) + { + if(isIdle()) + { + m_xboxLiveContext = nullptr; + + app.DebugPrintf("[LeaderboardManager] CloseSession(): Nulled XboxLiveContext\n"); + } + } + else app.DebugPrintf("[LeaderboardManager] CloseSession(): %i sessions still open.\n", m_openSessions); +} + +//Delete a session +void DurangoLeaderboardManager::DeleteSession() +{ +} + +//Write the given stats +//This is called synchronously and will not free any memory allocated for views when it is done + +bool DurangoLeaderboardManager::WriteStats(unsigned int viewCount, ViewIn views) +{ + return false; +} + +bool DurangoLeaderboardManager::ReadStats_Friends(LeaderboardReadListener *listener, int difficulty, EStatsType type, PlayerUID myUID, unsigned int startIndex, unsigned int readCount) +{ + // Need to cancel read/write operation first. + if (!isIdle()) return false; + if (!LeaderboardManager::ReadStats_Friends(listener, difficulty, type, myUID, startIndex, readCount)) return false; + setState(eStatsState_GettingLeaderboardInfo); + + if( m_xboxLiveContext == nullptr ) + { + throw ref new Platform::InvalidArgumentException(L"A valid User is required"); + } + + // Request the leaderboard to get ranking information + auto asyncOp = m_xboxLiveContext->LeaderboardService->GetLeaderboardForSocialGroupWithSkipToRankAsync( + ref new P::String(myUID.toString().c_str()), + SERVICE_CONFIG_ID, + ref new P::String(m_socialLeaderboardNames[difficulty][type].c_str()), + MXS::Social::SocialGroupConstants::People, + startIndex, + ref new P::String(L"descending"), + readCount + ); + + runLeaderboardRequest(asyncOp, difficulty, type, readCount, EFilterMode::eFM_Friends); + + return true; +} + +bool DurangoLeaderboardManager::ReadStats_MyScore(LeaderboardReadListener *listener, int difficulty, EStatsType type, PlayerUID myUID, unsigned int readCount) +{ + // Need to cancel read/write operation first. + if (!isIdle()) return false; + if (!LeaderboardManager::ReadStats_MyScore(listener, difficulty, type, myUID, readCount)) return false; + setState(eStatsState_GettingLeaderboardInfo); + + if( m_xboxLiveContext == nullptr ) + { + throw ref new Platform::InvalidArgumentException(L"A valid User is required"); + } + + P::String^ leaderboardName = ref new P::String(m_leaderboardNames[difficulty][type].c_str()); + + // Request the leaderboard to get ranking information + auto asyncOp = m_xboxLiveContext->LeaderboardService->GetLeaderboardWithSkipToUserAsync( + SERVICE_CONFIG_ID, + leaderboardName, + ref new P::String(myUID.toString().c_str()), // skip to this user + readCount + ); + + runLeaderboardRequest(asyncOp, difficulty, type, readCount, EFilterMode::eFM_MyScore); + + return true; +} + +bool DurangoLeaderboardManager::ReadStats_TopRank(LeaderboardReadListener *listener, int difficulty, EStatsType type, unsigned int startIndex, unsigned int readCount) +{ + // Need to cancel read/write operation first. + if (!isIdle()) return false; + if (!LeaderboardManager::ReadStats_TopRank(listener, difficulty, type, startIndex, readCount)) return false; + setState(eStatsState_GettingLeaderboardInfo); + + if( m_xboxLiveContext == nullptr ) + { + throw ref new Platform::InvalidArgumentException(L"A valid User is required"); + } + + P::String^ leaderboardName = ref new P::String(m_leaderboardNames[difficulty][type].c_str()); + + // Request the leaderboard to get ranking information + auto asyncOp = m_xboxLiveContext->LeaderboardService->GetLeaderboardAsync( + SERVICE_CONFIG_ID, + leaderboardName, + startIndex, // skip this many ranks + readCount + ); + + runLeaderboardRequest(asyncOp, difficulty, type, readCount, EFilterMode::eFM_TopRank); + + return true; +} + +//Perform a flush of the stats +void DurangoLeaderboardManager::FlushStats() +{ +} + +//Cancel the current operation +void DurangoLeaderboardManager::CancelOperation() +{ + m_readListener = NULL; + setState(eStatsState_Canceled); + + if(m_leaderboardAsyncOp) m_leaderboardAsyncOp->Cancel(); + if(m_statsAsyncOp) m_statsAsyncOp->Cancel(); + + //if (m_transactionCtx != 0) + //{ + // int ret = sceNpScoreAbortTransaction(m_transactionCtx); + // + // if (ret < 0) + // { + // app.DebugPrintf("[LeaderboardManager] CancelOperation(): Problem encountered aborting current operation, 0x%X.\n", ret); + // } + // else + // { + // app.DebugPrintf("[LeaderboardManager] CancelOperation(): Operation aborted successfully.\n"); + // } + //} + //else app.DebugPrintf("[LeaderboardManager] CancelOperation(): No current operation.\n"); +} + +//Is the leaderboard manager idle. +bool DurangoLeaderboardManager::isIdle() +{ + return getState() == eStatsState_Idle; +} + +void DurangoLeaderboardManager::runLeaderboardRequest(WF::IAsyncOperation^ asyncOp, int difficulty, EStatsType type, unsigned int readCount, EFilterMode filter) +{ + m_leaderboardAsyncOp = asyncOp; + m_difficulty = difficulty; + m_type = type; + + // Build stat names + m_statNames = ref new PC::Vector(); + m_statNames->Clear(); + for(wstring name : m_leaderboardStatNames[difficulty][type]) + { + m_statNames->Append(ref new P::String(name.c_str())); + } + + app.DebugPrintf("[LeaderboardManager] Running request\n"); + CC::create_task(asyncOp) + .then( [this, readCount, difficulty, type, filter] (CC::task resultTask) + { + try + { + app.DebugPrintf("[LeaderboardManager] First continuation.\n"); + + m_leaderboardAsyncOp = nullptr; + + MXSL::LeaderboardResult^ lastResult = resultTask.get(); + + app.DebugPrintf( + "Name: %ls - Filter: %ls - Rows: Retrieved=%d Total=%d Requested=%d.\n", + lastResult->DisplayName->Data(), + LeaderboardManager::filterNames[ (int) filter ].c_str(), + lastResult->Rows->Size, lastResult->TotalRowCount, readCount + ); + + //app.DebugPrintf("Column count: %d, Column: %ls, %ls, %d\n", lastResult->Columns->Size, lastResult->Columns->GetAt(0)->DisplayName->Data(), lastResult->Columns->GetAt(0)->StatisticName->Data(), lastResult->Columns->GetAt(0)->StatisticType); + + // 4J-JEV: Fix for Xbox One #162541 - [CRASH] Code: Leaderboards: Title crashes after pressing [B] Back button while changing Leaderboards' filter to 'My Score' + // 4J-JEV: Fix for X1: #165487 - [CRASH] XR-074: Compliance: The title does not properly handle switching to offline session while browsing the Leaderboards. + if (m_xboxLiveContext == nullptr) throw(ref new P::Exception(-1)); + + // If this is My_Score, check that the user appears + if (filter == eFM_MyScore) + { + bool userIncluded = false; + for(int i = 0; i < lastResult->Rows->Size; i++) + { + if (lastResult->Rows->GetAt(i)->XboxUserId == m_xboxLiveContext->User->XboxUserId) userIncluded = true; + } + + // If the user isn't included, don't show the results + if (!userIncluded) + { + m_readCount = 0; + throw(ref new P::Exception(INET_E_DATA_NOT_AVAILABLE)); + } + } + + m_maxRank = lastResult->TotalRowCount; + m_readCount = lastResult->Rows->Size; + + if (m_scores != NULL) delete [] m_scores; + m_scores = new ReadScore[m_readCount]; + ZeroMemory(m_scores, sizeof(ReadScore) * m_readCount); + + m_xboxUserIds->Clear(); + + app.DebugPrintf("[LeaderboardManager] Retrieved Scores:\n"); + for( UINT index = 0; index < lastResult->Rows->Size; index++ ) + { + MXSL::LeaderboardRow^ row = lastResult->Rows->GetAt(index); + + app.DebugPrintf( + "\tIndex: %d\tRank: %d\tPercentile: %.1f%%\tXboxUserId: %ls\tValue: %ls.\n", + index, + row->Rank, + row->Percentile * 100, + row->XboxUserId->Data(), + row->Values->GetAt(0)->Data() + ); + + m_scores[index].m_name = row->Gamertag->Data(); + m_scores[index].m_rank = row->Rank; + m_scores[index].m_uid = PlayerUID(row->XboxUserId->Data()); + + // 4J-JEV: Added to help determine if this player's score is hidden due to their privacy settings. + m_scores[index].m_totalScore = (unsigned long) _fromString(row->Values->GetAt(0)->Data()); + + m_xboxUserIds->Append(row->XboxUserId); + } + + if(m_readCount > 0) + { + vector xuids = vector(); + for(int i = 0; i < lastResult->Rows->Size; i++) + { + xuids.push_back(PlayerUID(lastResult->Rows->GetAt(i)->XboxUserId->Data())); + } + m_waitingForProfiles = true; + ProfileManager.GetProfiles(xuids, &GetProfilesCallback, this); + setState(eStatsState_ReceivedLeaderboardInfo); + } + else + { + // we hit the end of the list + app.DebugPrintf("Reach the end\n"); + setState(eStatsState_Ready); + } + } + catch (Platform::Exception^ ex) + { + m_leaderboardAsyncOp = nullptr; + if (ex->HResult == INET_E_DATA_NOT_AVAILABLE) + { + // we hit the end of the list + app.DebugPrintf("ERROR: Reach the end\n"); + setState(eStatsState_Ready); + } + else if(ex->HResult == HTTP_E_STATUS_NOT_FOUND) + { + app.DebugPrintf("Error calling GetLeaderboardAsync function: 404 Not Found - 0x%0.8x\n", ex->HResult); + setState(eStatsState_Failed); + } + else + { + app.DebugPrintf("Error calling GetLeaderboardAsync function: 0x%0.8x\n", ex->HResult); + setState(eStatsState_Failed); + } + } + catch (...) + { + app.DebugPrintf("[LeaderboardManager] Unknown exception.\n"); + } + }); +} + +void DurangoLeaderboardManager::updateStatsInfo(int userIndex, int difficulty, EStatsType type, WFC::IVectorView^ statsResult) +{ + if (m_scores) + { + LeaderboardManager::ReadScore *userScore = &m_scores[userIndex]; + + switch (type) + { + case eStatsType_Farming: userScore->m_statsSize = 6; break; + case eStatsType_Mining: userScore->m_statsSize = 7; break; + case eStatsType_Kills: userScore->m_statsSize = 7; break; + case eStatsType_Travelling: userScore->m_statsSize = 4; break; + } + + int statIndex = 0, sumScores = 0; + for(wstring statName : m_leaderboardStatNames[difficulty][type]) + { + bool found = false; + for(auto result : statsResult) + { + if(statName.compare(result->StatisticName->Data()) == 0) + { + userScore->m_statsData[statIndex] = _fromString(result->Value->Data()); + found = true; + break; + } + } + if(!found) + { + userScore->m_statsData[statIndex] = 0; + } + + sumScores += userScore->m_statsData[statIndex]; + ++statIndex; + } + + if ( (sumScores == 0) && (userScore->m_totalScore > 0) ) + { + app.DebugPrintf("[LeaderboardManager] Player '%s' (rank %d) likely has privacy settings enabled.\n", userScore->m_name.c_str(), userScore->m_rank); + userScore->m_idsErrorMessage = IDS_LEADERBOARD_SCORE_HIDDEN; + } + } +} + +void DurangoLeaderboardManager::GetProfilesCallback(LPVOID param, std::vector profiles) +{ + DurangoLeaderboardManager *dlm = (DurangoLeaderboardManager *)param; + + app.DebugPrintf("[LeaderboardManager] GetProfilesCallback, profiles.size() == %d.\n", profiles.size()); + + if (profiles.size() > 0) + { + dlm->m_displayNames = vector(); + for (int i = 0; i < profiles.size(); i++) + { + dlm->m_displayNames.push_back(profiles[i]->GameDisplayName->Data()); + } + } + else + { + dlm->setState(eStatsState_Failed); + } + + dlm->m_waitingForProfiles = false; +} + +DurangoLeaderboardManager::EStatsState DurangoLeaderboardManager::getState() +{ + return m_eStatsState; +} + +void DurangoLeaderboardManager::setState(EStatsState newState) +{ + EnterCriticalSection(&m_csStatsState); + + bool validTransition = false; + + switch(m_eStatsState) + { + case eStatsState_Idle: + switch(newState) + { + case eStatsState_GettingLeaderboardInfo: + validTransition = true; + break; + }; + break; + case eStatsState_GettingLeaderboardInfo: + switch(newState) + { + case eStatsState_Ready: + case eStatsState_ReceivedLeaderboardInfo: + case eStatsState_Canceled: + case eStatsState_Failed: + validTransition = true; + break; + }; + break; + break; + case eStatsState_ReceivedLeaderboardInfo: + switch(newState) + { + case eStatsState_GettingStatsInfo: + case eStatsState_Canceled: + case eStatsState_Failed: + validTransition = true; + break; + }; + break; + case eStatsState_GettingStatsInfo: + switch(newState) + { + case eStatsState_Ready: + case eStatsState_Canceled: + case eStatsState_Failed: + validTransition = true; + break; + }; + break; + case eStatsState_Failed: + switch(newState) + { + case eStatsState_Idle: + validTransition = true; + break; + }; + break; + case eStatsState_Ready: + switch(newState) + { + case eStatsState_Canceled: + case eStatsState_Idle: + case eStatsState_Failed: + validTransition = true; + break; + }; + break; + case eStatsState_Canceled: + switch(newState) + { + case eStatsState_Ready: + newState = eStatsState_Idle; + case eStatsState_Idle: + validTransition = true; + break; + }; + break; + }; + +#ifndef _CONTENT_PACKAGE + app.DebugPrintf( + "[LeaderboardManager] %s state transition:\t%ls(%d) -> %ls(%d).\n", + (validTransition ? "Valid" : "INVALID"), + stateToString(m_eStatsState).c_str(), m_eStatsState, + stateToString(newState).c_str(), newState + ); +#endif + + if (validTransition) + { + m_eStatsState = newState; + } + + LeaveCriticalSection(&m_csStatsState); +} + +wstring DurangoLeaderboardManager::stateToString(EStatsState eState) +{ + switch (eState) + { + case eStatsState_Idle: return L"eStatsState_Idle"; + case eStatsState_GettingLeaderboardInfo: return L"eStatsState_GettingLeaderboardInfo"; + case eStatsState_ReceivedLeaderboardInfo: return L"eStatsState_ReceivedLeaderboardInfo"; + case eStatsState_GettingStatsInfo: return L"eStatsState_GettingStatsInfo"; + case eStatsState_ReceivedStatsInfo: return L"eStatsState_ReceivedStatsInfo"; + case eStatsState_Failed: return L"eStatsState_Failed"; + case eStatsState_Ready: return L"eStatsState_Ready"; + case eStatsState_Canceled: return L"eStatsState_Canceled"; + case eStatsState_Max: return L"eStatsState_MAX"; + default: return L"UNKNOWN"; + } +} \ No newline at end of file diff --git a/Minecraft.Client/Durango/Leaderboards/DurangoLeaderboardManager.h b/Minecraft.Client/Durango/Leaderboards/DurangoLeaderboardManager.h new file mode 100644 index 00000000..233d8b71 --- /dev/null +++ b/Minecraft.Client/Durango/Leaderboards/DurangoLeaderboardManager.h @@ -0,0 +1,94 @@ +#pragma once + +#include "Common\Leaderboards\LeaderboardManager.h" + +namespace P = Platform; +namespace PC = Platform::Collections; +namespace WF = Windows::Foundation; +namespace WFC = Windows::Foundation::Collections; +namespace MXSL = Microsoft::Xbox::Services::Leaderboard; + +class DurangoLeaderboardManager : public LeaderboardManager +{ +protected: + enum EStatsState + { + eStatsState_Idle, + eStatsState_GettingLeaderboardInfo, + eStatsState_ReceivedLeaderboardInfo, + eStatsState_GettingStatsInfo, + eStatsState_ReceivedStatsInfo, + eStatsState_Failed, + eStatsState_Ready, + eStatsState_Canceled, + //eStatsState_Writing, + eStatsState_Max + }; + +private: + unsigned short m_openSessions; + + CRITICAL_SECTION m_csStatsState; + EStatsState m_eStatsState; //State of the stats read + + ReadScore *m_scores; + unsigned int m_maxRank; + + MXS::XboxLiveContext^ m_xboxLiveContext; + wstring m_leaderboardNames[4][eStatsType_MAX]; + wstring m_socialLeaderboardNames[4][eStatsType_MAX]; + std::vector m_leaderboardStatNames[4][eStatsType_MAX]; + + // Display names for the current scores + std::vector m_displayNames; + bool m_waitingForProfiles; + + int m_difficulty; + EStatsType m_type; + PC::Vector^ m_statNames; + PC::Vector^ m_xboxUserIds; + WF::IAsyncOperation^ m_leaderboardAsyncOp; + WF::IAsyncOperation^ >^ m_statsAsyncOp; + +public: + DurangoLeaderboardManager(); + + virtual void Tick(); + + //Open a session + virtual bool OpenSession(); + + //Close a session + virtual void CloseSession(); + + //Delete a session + virtual void DeleteSession(); + + //Write the given stats + //This is called synchronously and will not free any memory allocated for views when it is done + + virtual bool WriteStats(unsigned int viewCount, ViewIn views); + + virtual bool ReadStats_Friends(LeaderboardReadListener *listener, int difficulty, EStatsType type, PlayerUID myUID, unsigned int startIndex, unsigned int readCount); + virtual bool ReadStats_MyScore(LeaderboardReadListener *listener, int difficulty, EStatsType type, PlayerUID myUID, unsigned int readCount); + virtual bool ReadStats_TopRank(LeaderboardReadListener *listener, int difficulty, EStatsType type, unsigned int startIndex, unsigned int readCount); + + //Perform a flush of the stats + virtual void FlushStats(); + + //Cancel the current operation + virtual void CancelOperation(); + + //Is the leaderboard manager idle. + virtual bool isIdle(); + + static void GetProfilesCallback(LPVOID param, std::vector profiles); + +private: + void runLeaderboardRequest(WF::IAsyncOperation^ asyncOp, int difficulty, EStatsType type, unsigned int readCount, EFilterMode filter); + void updateStatsInfo(int userIndex, int difficulty, EStatsType type, WFC::IVectorView^ statsResult); + + EStatsState getState(); + void setState(EStatsState newState); + wstring stateToString(EStatsState eState); +}; diff --git a/Minecraft.Client/Durango/Leaderboards/DurangoStatsDebugger.cpp b/Minecraft.Client/Durango/Leaderboards/DurangoStatsDebugger.cpp new file mode 100644 index 00000000..caa5857e --- /dev/null +++ b/Minecraft.Client/Durango/Leaderboards/DurangoStatsDebugger.cpp @@ -0,0 +1,487 @@ +#include "stdafx.h" + +#include "..\Minecraft.World\Tile.h" +#include "..\Minecraft.World\Item.h" + +#include "..\Minecraft.World\DurangoStats.h" + +#include "..\Minecraft.World\EntityIO.h" + +#include "..\Minecraft.World\StringHelpers.h" + +#include "Common\Console_Awards_enum.h" + +#include "DurangoStatsDebugger.h" + +namespace WFC = Windows::Foundation::Collections; +namespace CC = concurrency; + +StatParam::StatParam(const wstring &base) +{ + m_base = base; + //m_numArgs = numArgs; + m_args = vector(); + + unsigned int count=0; + wstring::size_type pos =base.find(L"*"); + while(pos!=string::npos) + { + count++; + pos=base.find(L"*",pos+1); + } + + m_numArgs = count; +} + +void StatParam::addArgs(int v1, ...) +{ + va_list argptr; + va_start(argptr, v1); + m_args.push_back(v1); + for (int i=0; i<(m_numArgs-1); i++) + { + int vi = va_arg(argptr, int); + m_args.push_back(vi); + } + va_end(argptr); +} + +vector *StatParam::getStats() +{ + vector *out = new vector(); + + static const int MAXSIZE = 256; + static const wstring SUBSTR = L"*"; + + wstring wstr_itr, wstr_num; + + if (m_args.size() <= 0 || m_numArgs <= 0) + { + out->push_back(m_base); + } + else + { + for (int i = 0; i < m_args.size(); i += m_numArgs) + { + wstr_itr = m_base; + + if (m_numArgs > 0) + { + for (int j=0; jpush_back( wstr_itr ); + } + } + + return out; +} + +DurangoStatsDebugger *DurangoStatsDebugger::instance = NULL; + +DurangoStatsDebugger::DurangoStatsDebugger() +{ + InitializeCriticalSection(&m_retrievedStatsLock); +} + +vector *DurangoStatsDebugger::getStats() +{ + vector *out = new vector(); + + for (auto it = m_stats.begin(); it!=m_stats.end(); it++) + { + vector *sublist = (*it)->getStats(); + out->insert(out->end(), sublist->begin(), sublist->end()); + } + + return out; +} + +DurangoStatsDebugger *DurangoStatsDebugger::Initialize() +{ + DurangoStatsDebugger *out = new DurangoStatsDebugger(); + + StatParam *sp = new StatParam(L"McItemAcquired.AcquisitionMethodId.*.ItemId.*.ItemAux.*"); + sp->addArgs(1, Tile::dirt_Id, 0); // works + sp->addArgs(2, Tile::dirt_Id, 0); // works + + sp->addArgs(DsItemEvent::eAcquisitionMethod_Pickedup, Tile::cloth_Id, 0); // fixed (+ach 'Rainbow Collection') + sp->addArgs(DsItemEvent::eAcquisitionMethod_Pickedup, Tile::cloth_Id, 1); + sp->addArgs(DsItemEvent::eAcquisitionMethod_Pickedup, Tile::cloth_Id, 2); + sp->addArgs(DsItemEvent::eAcquisitionMethod_Pickedup, Tile::cloth_Id, 3); + sp->addArgs(DsItemEvent::eAcquisitionMethod_Pickedup, Tile::cloth_Id, 4); + sp->addArgs(DsItemEvent::eAcquisitionMethod_Pickedup, Tile::cloth_Id, 5); + sp->addArgs(DsItemEvent::eAcquisitionMethod_Pickedup, Tile::cloth_Id, 6); + sp->addArgs(DsItemEvent::eAcquisitionMethod_Pickedup, Tile::cloth_Id, 7); + sp->addArgs(DsItemEvent::eAcquisitionMethod_Pickedup, Tile::cloth_Id, 8); + sp->addArgs(DsItemEvent::eAcquisitionMethod_Pickedup, Tile::cloth_Id, 9); + sp->addArgs(DsItemEvent::eAcquisitionMethod_Pickedup, Tile::cloth_Id, 10); + sp->addArgs(DsItemEvent::eAcquisitionMethod_Pickedup, Tile::cloth_Id, 11); + sp->addArgs(DsItemEvent::eAcquisitionMethod_Pickedup, Tile::cloth_Id, 12); + sp->addArgs(DsItemEvent::eAcquisitionMethod_Pickedup, Tile::cloth_Id, 13); + sp->addArgs(DsItemEvent::eAcquisitionMethod_Pickedup, Tile::cloth_Id, 14); + sp->addArgs(DsItemEvent::eAcquisitionMethod_Pickedup, Tile::cloth_Id, 15); + + out->m_stats.push_back(sp); + + sp = new StatParam(L"McItemAcquired.AcquisitionMethodId.*.ItemId.*"); + sp->addArgs(DsItemEvent::eAcquisitionMethod_Pickedup, Tile::dirt_Id); // works + sp->addArgs(DsItemEvent::eAcquisitionMethod_Crafted, Item::milk_Id); // works. + sp->addArgs(DsItemEvent::eAcquisitionMethod_Crafted, Tile::dirt_Id); // works. + sp->addArgs(DsItemEvent::eAcquisitionMethod_Crafted, Item::porkChop_cooked_Id); // BROKEN! (ach 'Pork Chop' configured incorrectly) + sp->addArgs(DsItemEvent::eAcquisitionMethod_Crafted, Item::cake_Id); // works. (ach 'The Lie' configured incorrectly) + sp->addArgs(DsItemEvent::eAcquisitionMethod_Bought, Item::emerald_Id); // fixed (+ach) + sp->addArgs(DsItemEvent::eAcquisitionMethod_Crafted, Item::ironIngot_Id); // works. (+ach 'Acquired Hardware') + sp->addArgs(DsItemEvent::eAcquisitionMethod_Pickedup, Item::fish_raw_Id); // works. (+ach 'Delicious Fish') + sp->addArgs(DsItemEvent::eAcquisitionMethod_Crafted, Item::fish_cooked_Id); // works. (+ach 'Delicious Fish') + sp->addArgs(DsItemEvent::eAcquisitionMethod_Crafted, Item::sign_Id); + sp->addArgs(DsItemEvent::eAcquisitionMethod_Crafted, Item::flowerPot_Id); // FIXING! + out->m_stats.push_back(sp); + + sp = new StatParam(L"McItemAcquired.DifficultyLevelId.*.AcquisitionMethodId.*.ItemId.*"); + sp->addArgs(1, 1, Tile::dirt_Id); // works + sp->addArgs(2, 2, Tile::dirt_Id); // works + out->m_stats.push_back(sp); + + sp = new StatParam(L"McItemUsed.ItemId.*.ItemAux.*"); + //sp->addArgs(Item::apple_Id, 0); + //sp->addArgs(Item::cake_Id, 0); + sp->addArgs(Item::beef_raw_Id, 0); // works + sp->addArgs(Item::porkChop_cooked_Id, 0); // works + out->m_stats.push_back(sp); + + sp = new StatParam(L"MinHungerWhenEaten.ItemId.*"); + //sp->addArgs(Item::apple_Id); + //sp->addArgs(Item::cake_Id); + sp->addArgs(Item::beef_raw_Id); // works + sp->addArgs(Item::rotten_flesh_Id); // works (+ach IronBelly) + out->m_stats.push_back(sp); + + sp = new StatParam(L"BlockBroken.BlockId.*"); + sp->addArgs( Tile::dirt_Id ); + sp->addArgs( Tile::rock_Id ); + sp->addArgs( Tile::emeraldOre_Id ); + out->m_stats.push_back(sp); + + sp = new StatParam(L"BlockBroken.BlockId.*.BlockAux.*"); + sp->addArgs( Tile::dirt_Id, 0 ); + sp->addArgs( Tile::rock_Id, 0 ); + out->m_stats.push_back(sp); + + sp = new StatParam(L"BlockBroken.DifficultyLevelId.*.BlockId.*"); + sp->addArgs( 1, Tile::dirt_Id ); + sp->addArgs( 2, Tile::dirt_Id ); + sp->addArgs( 1, Tile::rock_Id ); + sp->addArgs( 2, Tile::rock_Id ); + out->m_stats.push_back(sp); + + sp = new StatParam(L"BlockBroken"); + sp->addArgs( -1 ); + out->m_stats.push_back(sp); + + sp = new StatParam(L"BlockPlaced.BlockId.*"); + sp->addArgs( Tile::dirt_Id ); + sp->addArgs( Tile::stoneBrick_Id ); + sp->addArgs( Tile::sand_Id ); // works + sp->addArgs( Tile::sign_Id ); // fixed + sp->addArgs( Tile::wallSign_Id ); // fixed + out->m_stats.push_back(sp); + + sp = new StatParam(L"MobKilled.KillTypeId.*.EnemyRoleId.*.PlayerWeaponId.*"); // BROKEN! + sp->addArgs( /*MELEE*/ 0, ioid_Cow, 0 ); + sp->addArgs( /*MELEE*/ 0, ioid_Cow, Item::sword_stone_Id ); + sp->addArgs( /*MELEE*/ 0, ioid_Pig, Item::sword_stone_Id ); + out->m_stats.push_back(sp); + + sp = new StatParam(L"MaxKillDistance.KillTypeId.*.EnemyRoleId.*.PlayerWeaponId.*"); // BROKEN! + sp->addArgs( /*MELEE*/ 0, ioid_Cow, Item::sword_stone_Id ); + sp->addArgs( /*MELEE*/ 0, ioid_Pig, Item::sword_stone_Id ); + sp->addArgs( /*RANGE*/ 1, ioid_Creeper, ioid_Arrow ); // FIXING! + out->m_stats.push_back(sp); + + sp = new StatParam(L"MobKilled.KillTypeId.*.EnemyRoleId.*"); // BROKEN! + sp->addArgs( /*MELEE*/ 0, ioid_Cow ); + sp->addArgs( /*MELEE*/ 0, ioid_Pig ); + out->m_stats.push_back(sp); + + sp = new StatParam(L"MobKilled.EnemyRoleId.*"); // BROKEN! + sp->addArgs( ioid_Cow ); + sp->addArgs( ioid_Pig ); + sp->addArgs( ioid_Zombie ); + sp->addArgs( ioid_Spiderjocky ); + out->m_stats.push_back(sp); + + sp = new StatParam(L"MobKilledTotal.DifficultyLevelId.*.EnemyRoleId.*"); // BROKEN! + sp->addArgs( 1, ioid_Cow ); + sp->addArgs( 2, ioid_Cow ); + out->m_stats.push_back(sp); + + sp = new StatParam(L"MobKilledTotal"); // BROKEN! + sp->addArgs(-1); + out->m_stats.push_back(sp); + + sp = new StatParam(L"MobInteract.MobId.*.Interaction.*"); + // sp->addArgs( ioid_Cow, /*MILKED*/ 6 ); no longer an interaction type. + sp->addArgs( ioid_Cow, /*BRED*/ 1 ); // fixed (+ach) + sp->addArgs( ioid_Sheep, /*SHEARED*/ 5 ); // works (+ach) + sp->addArgs( ioid_VillagerGolem, /*CRAFTED*/ 4 ); // works (+ach) + sp->addArgs( ioid_Ozelot, /*TAMED*/ 2 ); // works (+ach) + sp->addArgs( ioid_Zombie, /*CURED*/ 3 ); // fixed (+ach) + out->m_stats.push_back(sp); + + sp = new StatParam(L"EnteredNewBiome.BiomeId.*"); + for (int i=0; i<20; i++) + sp->addArgs( i ); + out->m_stats.push_back(sp); + + sp = new StatParam(L"AchievementGet.AchievementId.*"); + sp->addArgs( eAward_TakingInventory ); // works (+ach) + sp->addArgs( eAward_WhenPigsFly ); // works (+ach) + sp->addArgs( eAward_InToTheNether ); // works (+ach) + sp->addArgs( eAward_theEnd ); // works (+ach) + sp->addArgs( eAward_winGame ); // fixed (+ach) + sp->addArgs( eAward_diamondsToYou ); + sp->addArgs( eAward_stayinFrosty ); // works (achievement configured incorrectly) + sp->addArgs( eAward_ironMan ); // fixed (+ach) + sp->addArgs( eAward_renewableEnergy ); + out->m_stats.push_back(sp); + + sp = new StatParam(L"TimePlayed.DifficultyLevelId.*"); // BROKEN! + for (int i=0; i<4; i++) sp->addArgs(i); // Difficulty Levels. + out->m_stats.push_back(sp); + + sp = new StatParam(L"DistanceTravelled.DifficultyLevelId.*.TravelMethodId.*"); + for (int i = 0; i<4; i++) + { + sp->addArgs( i, DsTravel::eMethod_walk ); + sp->addArgs( i, DsTravel::eMethod_climb ); + sp->addArgs( i, DsTravel::eMethod_fall ); + sp->addArgs( i, DsTravel::eMethod_minecart ); + sp->addArgs( i, DsTravel::eMethod_swim ); + sp->addArgs( i, DsTravel::eMethod_pig ); + } + out->m_stats.push_back(sp); + + sp = new StatParam(L"DistanceTravelled"); + sp->addArgs( /*NO ARGUMENTS*/ -1 ); + out->m_stats.push_back(sp); + + sp = new StatParam(L"PlayedMusicDisc.DiscId.*"); // works (+ach) + for (int i = 2256; i < 2268; i++) + sp->addArgs( i ); + out->m_stats.push_back(sp); + + sp = new StatParam(L"ChestfulOfCobblestone"); // works. (+ach) + sp->addArgs( /*NO ARGUMENTS*/ -1 ); + out->m_stats.push_back(sp); + + sp = new StatParam(L"Overkill"); // works. (+ach) + sp->addArgs( /*NO ARGUMENTS*/ -1 ); + out->m_stats.push_back(sp); + + sp = new StatParam(L"OnARail"); // works. (+ach) + sp->addArgs( /*NO ARGUMENTS*/ -1 ); + out->m_stats.push_back(sp); + + sp = new StatParam(L"Leaderboard.LeaderboardId.*.DifficultyLevelId.*"); + for (int i = 0; i < 4; i++) + { + sp->addArgs( eLeaderboardId_FARMING, i ); + sp->addArgs( eLeaderboardId_MINING, i ); + sp->addArgs( eLeaderboardId_TRAVELLING, i ); + sp->addArgs( eLeaderboardId_KILLING, i ); + } + out->m_stats.push_back(sp); + + + // Debugging 1 // + + sp = new StatParam(L"DistanceTravelled"); + sp->addArgs( /*NO ARGUMENTS*/ -1 ); + out->m_stats.push_back(sp); + + sp = new StatParam(L"BlockBroken"); + sp->addArgs( /*NO ARGUMENTS*/ -1 ); + out->m_stats.push_back(sp); + + sp = new StatParam(L"MobKilledTotal"); + sp->addArgs( /*NO ARGUMENTS*/ -1 ); + out->m_stats.push_back(sp); + + return out; +} + +void DurangoStatsDebugger::PrintStats(int iPad) +{ + if (instance == NULL) instance = Initialize(); + + vector *tmp = instance->getStats(); + instance->m_printQueue.insert(instance->m_printQueue.end(), tmp->begin(), tmp->end()); + + // app.DebugPrintf("[DEBUG] START\n"); + // for (wstring t : *tmp) app.DebugPrintf("[DEBUG] %s\n", wstringtofilename(t)); + // app.DebugPrintf("[DEBUG] END\n"); + + instance->retrieveStats(iPad); + + app.DebugPrintf("[DurangoStatsDebugger] (%i) Results returned, starting printing.\n", instance->m_retrievedStats.size()); + for (StatResult result : instance->m_retrievedStats) + { + app.DebugPrintf("[DSB] '%s' == ", wstringtofilename(result.m_statName)); + app.DebugPrintf("%s\n", wstringtofilename(result.m_score)); + } + + // Empty list. + EnterCriticalSection(&instance->m_retrievedStatsLock); + instance->m_retrievedStats.erase( + instance->m_retrievedStats.begin(), + instance->m_retrievedStats.end() + ); + LeaveCriticalSection(&instance->m_retrievedStatsLock); + +} + +void DurangoStatsDebugger::retrieveStats(int iPad) +{ + MXS::XboxLiveContext ^xboxLiveContext; + try + { + WFC::IVectorView^ userList = Windows::Xbox::System::User::Users; + if( userList != nullptr ) + { + for (Windows::Xbox::System::User^ user : userList) + { + if( user->IsSignedIn && !user->IsGuest ) + { + xboxLiveContext = ref new MXS::XboxLiveContext(user); + break; + } + } + + if (xboxLiveContext == nullptr) + { + app.DebugPrintf("[DurangoStatsDebugger] Problem occured while creating 'XboxLiveContext'.\n"); return; + } + } + } + catch (Platform::Exception^ ex) + { + app.DebugPrintf("[DurangoStatsDebugger] Problem occured while creating 'XboxLiveContext'.\n"); return; + } + + if ( xboxLiveContext ) { app.DebugPrintf("[DurangoStatsDebugger] 'XboxLiveContext' created successfully.\n"); } + else { app.DebugPrintf("[DurangoStatsDebugger] 'XboxLiveContext' not created.\n"); return; } + + PlayerUID xuid; + ProfileManager.GetXUID(iPad, &xuid, true); + + const int readCount = 1, difficulty = 1, type = 0; + + // ----------------------------------------- // + + byte runningThreads = 0; + byte *r_runningThreads = &runningThreads; + + if (xuid.toString().compare(L"") == 0) + { + app.DebugPrintf("[DurangoStatsDebugger] NO LOGGED IN USER!\n"); + return; + } + + string plrname= wstringtofilename(xuid.toString()); + app.DebugPrintf( + "[DurangoStatsDebugger] Retrieving (%i) stats for '%s'.\n", + m_printQueue.size(), + plrname.c_str() + ); + + static const unsigned short R_SIZE = 20; + + // Create Stat retrieval threads until there is no long any stats to start retrieving. + while ( !instance->m_printQueue.empty() ) + { + vector *printing = new vector(); + + if (m_printQueue.size() > R_SIZE) + { + printing->insert( printing->end(), m_printQueue.begin(), m_printQueue.begin() + R_SIZE ); + m_printQueue.erase( m_printQueue.begin(), m_printQueue.begin() + R_SIZE ); + } + else + { + printing->insert( printing->end(), m_printQueue.begin(), m_printQueue.end() ); + m_printQueue.erase( m_printQueue.begin(), m_printQueue.end() ); + } + + // ------------------------------------------ // + + app.DebugPrintf("[DurangoStatsDebugger] Starting retrieval operation (%i/%i stats).\n", printing->size(), R_SIZE); + + runningThreads++; + + // Fill statNames string. + PC::Vector^ statNames = ref new PC::Vector(); + for ( auto it = printing->begin(); it != printing->end(); it++ ) + statNames->Append( ref new P::String(it->c_str()) ); + + // Create vector of the XboxId we want. + PC::Vector^ xboxUserIds = ref new PC::Vector(); + xboxUserIds->Append(ref new P::String(xuid.toString().c_str())); + + auto asyncOp = xboxLiveContext->UserStatisticsService->GetMultipleUserStatisticsAsync( + xboxUserIds->GetView(), // the collection of Xbox user IDs whose stats we want to retrieve + SERVICE_CONFIG_ID, // the service config that contains the stats we want + statNames->GetView() // a list of stat names we want + ); + + CC::create_task(asyncOp) + .then( [this,printing,iPad,r_runningThreads] (CC::task^> resultListTask) + { + try + { + WFC::IVectorView^ resultList = resultListTask.get(); + int userIndex = 0; + for( MXS::UserStatistics::UserStatisticsResult^ result : resultList ) + { + for( UINT index = 0; indexServiceConfigurationStatistics->Size; index++ ) + { + MXS::UserStatistics::ServiceConfigurationStatistic^ configStat = result->ServiceConfigurationStatistics->GetAt(index); + + app.DebugPrintf("[DurangoStatsDebugger] Retrieve complete, %i results returned.\n", configStat->Statistics->Size); + + for (auto result : configStat->Statistics) + { + StatResult sr = { iPad, result->StatisticName->Data(), result->Value->Data() }; + this->addRetrievedStat(sr); + } + } + ++userIndex; + } + + + } + catch (Platform::Exception ^ex) + { + app.DebugPrintf("[DurangoStatsDebugger] resultListTask.get() encountered an exception:\n\t'%s'\n", ex->ToString()->Data() ); + } + + (*r_runningThreads)--; + }); + } + + while (runningThreads > 0) Sleep(5); +} + +void DurangoStatsDebugger::addRetrievedStat(StatResult result) +{ + EnterCriticalSection(&m_retrievedStatsLock); + m_retrievedStats.push_back(result); + LeaveCriticalSection(&m_retrievedStatsLock); +} \ No newline at end of file diff --git a/Minecraft.Client/Durango/Leaderboards/DurangoStatsDebugger.h b/Minecraft.Client/Durango/Leaderboards/DurangoStatsDebugger.h new file mode 100644 index 00000000..f2ac0383 --- /dev/null +++ b/Minecraft.Client/Durango/Leaderboards/DurangoStatsDebugger.h @@ -0,0 +1,94 @@ +#pragma once + +#include "stdafx.h" + +namespace P = Platform; +namespace PC = Platform::Collections; +namespace WF = Windows::Foundation; +namespace WFC = Windows::Foundation::Collections; +namespace MXSL = Microsoft::Xbox::Services::Leaderboard; + +class StatParam +{ +private: + wstring m_base; + int m_numArgs; + + vector m_args; + +public: + StatParam(const wstring &base); + + void addArgs(int v1, ...); + + vector *getStats(); + +}; + + +class DurangoStatsDebugger +{ +protected: + static DurangoStatsDebugger *instance; + + enum + { + ioid_Arrow = 10, + + ioid_Spiderjocky = 49, + ioid_Creeper = 50, + ioid_Skeleton, + ioid_Spider, + ioid_Giant, + ioid_Zombie, + ioid_Slime, + ioid_Ghast, + ioid_PigZombie, + ioid_Enderman, + ioid_CaveSpider, + ioid_Silverfish, + ioid_Blaze, + ioid_LavaSlime, + ioid_EnderDragon, + + ioid_Pig = 90, + ioid_Sheep, + ioid_Cow, + ioid_Chicken, + ioid_Squid, + ioid_Wolf, + ioid_MushroomCow, + ioid_SnowMan, + ioid_Ozelot, + ioid_VillagerGolem, + }; + + DurangoStatsDebugger(); + + vector m_stats; + + vector *getStats(); + +public: + static DurangoStatsDebugger *Initialize(); + + static void PrintStats(int iPad); + +private: + vector m_printQueue; + + void retrieveStats(int iPad); + + typedef struct + { + int m_iPad; + wstring m_statName; + wstring m_score; + } StatResult; + + CRITICAL_SECTION m_retrievedStatsLock; + + vector m_retrievedStats; + + void addRetrievedStat(StatResult result); +}; \ No newline at end of file diff --git a/Minecraft.Client/Durango/Leaderboards/GameProgress.cpp b/Minecraft.Client/Durango/Leaderboards/GameProgress.cpp new file mode 100644 index 00000000..dd07f3e9 --- /dev/null +++ b/Minecraft.Client/Durango/Leaderboards/GameProgress.cpp @@ -0,0 +1,107 @@ +#include "stdafx.h" + +#include "Durango\ServiceConfig\Events-XBLA.8-149E11AEEvents.h" + +#include "..\Minecraft.World\DurangoStats.h" + +#include "GameProgress.h" + +namespace WFC = Windows::Foundation::Collections; +namespace MXSA = Microsoft::Xbox::Services::Achievements; +namespace CC = concurrency; + +GameProgress *GameProgress::instance = NULL; + +void GameProgress::Flush(int iPad) +{ + if (instance == NULL) + instance = new GameProgress(); + + instance->updatePlayer(iPad); +} + +void GameProgress::Tick() +{ + if (instance == NULL) + instance = new GameProgress(); + + long long currentTime = System::currentTimeMillis(); + if ( (currentTime - instance->m_lastUpdate) > (UPDATE_FREQUENCY / 4) ) + { + instance->updatePlayer(instance->m_nextPad); + instance->m_nextPad = ++instance->m_nextPad % MAX_LOCAL_PLAYERS; + instance->m_lastUpdate = currentTime; + } +} + +GameProgress::GameProgress() +{ + m_nextPad = 0; + m_lastUpdate = 0; +} + +void GameProgress::updatePlayer(int iPad) +{ + if ( ProfileManager.IsGuest(iPad) || !ProfileManager.IsSignedInLive(iPad) ) return; + + PlayerUID uid; + ProfileManager.GetXUID(iPad, &uid, true); + + WXS::User^ user = ProfileManager.GetUser(iPad); + + if (user == nullptr) return; + + MXS::XboxLiveContext ^xlc = ref new MXS::XboxLiveContext(user); + + // Get these while they are still valid. + LPCGUID playerSession = DurangoStats::getPlayerSession(); + + CC::create_task( + xlc->AchievementService->GetAchievementsForTitleIdAsync( + ref new Platform::String(uid.toString().c_str()), // Xuid + 0x149E11AE, // TitleId + MXSA::AchievementType::Persistent, // Use regular achievements (not challenges) + false, // Unlocked only + MXSA::AchievementOrderBy::UnlockTime, // Order (we don't really care) + 0, // skipItems (start index) + 200 // MaxItems + ) + ).then( [this,iPad,uid,playerSession] (CC::task resultTask) + { + try + { + int achievementsUnlocked = 0; + + MXSA::AchievementsResult^ result = resultTask.get(); + if(result) + { + for (unsigned int i = 0, iMax = result->Items->Size; i < iMax; i++) + { + MXSA::Achievement^ ach = result->Items->GetAt(i); + if (ach->ProgressState == MXSA::AchievementProgressState::Achieved) + achievementsUnlocked++; + } + + float gameprogress; + if (EventWriteGameProgress( + uid.toString().c_str(), + playerSession, + gameprogress = calcGameProgress(achievementsUnlocked) ) + == 0) + { + app.DebugPrintf("<%ls> GameProgress(%.1f)\n", uid.toString().c_str(), gameprogress); + } + } + } + catch (Platform::Exception ^ex) + { + app.DebugPrintf("GameProgress:: Error, couldn't contact the achievments service (?): %ls", ex->Message->Data()); + } + }); + +} + +float GameProgress::calcGameProgress(int achievementsUnlocked) +{ + return (float) achievementsUnlocked / 0.60f; +} \ No newline at end of file diff --git a/Minecraft.Client/Durango/Leaderboards/GameProgress.h b/Minecraft.Client/Durango/Leaderboards/GameProgress.h new file mode 100644 index 00000000..8ebb2716 --- /dev/null +++ b/Minecraft.Client/Durango/Leaderboards/GameProgress.h @@ -0,0 +1,23 @@ +#pragma once + +class GameProgress +{ +private: + static GameProgress *instance; + +public: + static const long long UPDATE_FREQUENCY = 64 * 1000; + + static void Tick(); + static void Flush(int iPad); + +protected: + GameProgress(); + + int m_nextPad; + long long m_lastUpdate; + + void updatePlayer(int iPad); + + float calcGameProgress(int achievementsUnlocked); +}; \ No newline at end of file diff --git a/Minecraft.Client/Durango/Miles/include/mss.h b/Minecraft.Client/Durango/Miles/include/mss.h new file mode 100644 index 00000000..531dcbc9 --- /dev/null +++ b/Minecraft.Client/Durango/Miles/include/mss.h @@ -0,0 +1,8429 @@ +//############################################################################ +//## ## +//## Miles Sound System ## +//## ## +//############################################################################ +//## ## +//## Contact RAD Game Tools at 425-893-4300 for technical support. ## +//## ## +//############################################################################ + +#ifndef MSS_VERSION + +// also update versions below for the docs + +// for cdep and installs +#define MILESVERSION "9.3m" +// see below in docs section +#define MILESMAJORVERSION 9 +#define MILESMINORVERSION 3 +#define MILESSUBVERSION 11 +#define MILESBUILDVERSION 0 +#define MILESVERSIONDATE "20-Jun-14" +#define MILESCOPYRIGHT "Copyright (C) 1991-2014, RAD Game Tools, Inc." + +// source files use these defines +#define MSS_VERSION MILESVERSION +#define MSS_MAJOR_VERSION MILESMAJORVERSION +#define MSS_MINOR_VERSION MILESMINORVERSION +#define MSS_SUB_VERSION MILESSUBVERSION +#define MSS_BUILD_VERSION MILESBUILDVERSION + +#define MSS_VERSION_DATE MILESVERSIONDATE +#define MSS_COPYRIGHT MILESCOPYRIGHT + +#endif + +#if !defined(MSS_H) && !defined(__RADRES__) +#define MSS_H + +// doc system stuff +#ifndef EXPAPI +#define EXPAPI +#endif +#ifndef EXPTYPE +#define EXPTYPE +#endif +#ifndef EXPMACRO +#define EXPMACRO +#endif +#ifndef EXPCONST +#define EXPCONST +#endif +#ifndef EXPOUT +#define EXPOUT +#endif +#ifndef EXPTYPEBEGIN +#define EXPTYPEBEGIN +#endif +#ifndef EXPTYPEEND +#define EXPTYPEEND +#endif +#ifndef EXPGROUP +#define EXPGROUP(GroupName) +#endif +#ifndef DEFGROUP +#define DEFGROUP(GroupName, Info) +#endif + +// For docs +EXPGROUP(_NullGroup) +#define MilesVersion "9.3m" EXPMACRO +#define MilesMajorVersion 9 EXPMACRO +#define MilesMinorVersion 3 EXPMACRO +#define MilesBuildNumber 11 EXPMACRO +#define MilesCustomization 0 EXPMACRO +EXPGROUP(_RootGroup) + + +// IS_WINDOWS for Windows or Win32 +// IS_WIN64 for Win64 +// IS_WIN32 for Win32 +// IS_WIN32API for Windows, Xbox and Xenon +// IS_64REGS when CPU registers are 64-bit - Xenon, PS3, Win64 and PS2 +// IS_32 for at least 32-bit pointers +// IS_LE for little endian (PCs) +// IS_BE for big endian (Macs, x360, ps3) +// IS_X86 for Intel +// IS_MAC for Mac +// IS_MACHO for Macho Mac +// IS_PPC for PPC Mac +// IS_68K for 68K Mac +// IS_LINUX for Linux +// IS_XBOX for Xbox +// IS_XENON for Xbox 360 +// IS_PS2 for PS/2 +// IS_PS3 for PS/3 +// IS_SPU for PS3 SPU +// IS_WII for Wii + +#include "rrCore.h" + +//#define MILES_CHECK_OFFSETS +#ifdef MILES_CHECK_OFFSETS + #include +#endif + +#ifdef __RADNT__ +#define IS_WIN32 +#if defined(__RAD64__) +#define IS_WIN64 +#endif +#endif + +#if defined(__RADWIN__) && !defined(__RADXENON__) && !defined(__RADXBOX__) && !defined(__RADWINRTAPI__) +#define IS_WINDOWS +#endif + +#if defined(__RADWIN__) +#define IS_WIN32API +#endif + +#if defined(__RAD64__) && defined(__RADWIN__) +#define IS_WIN64 +#endif + +// 16-bit not supported anymore +#define IS_32 + +#ifdef __RADLITTLEENDIAN__ +#define IS_LE +#endif + +#ifdef __RADBIGENDIAN__ +#define IS_BE +#endif + +#ifdef __RADX86__ +#define IS_X86 +#endif + +#ifdef __RADMAC__ +#define IS_MAC +#endif + +#ifdef __RADPPC__ +#define IS_PPC +#endif + +#ifdef __RAD68K__ +#define IS_68K +#endif + +#ifdef __RADLINUX__ +#define IS_LINUX +#endif + +// +// MSS_STATIC_RIB is used to determine whether anything loaded +// through the RIB interface is loaded via RIB_load_application_providers +// or via a static declaration from the user (Register_RIB) +// mirror this in rib.h +// +#if defined(__RADANDROID__) || defined(__RADPSP__) || defined(__RADPSP2__) || \ + defined(__RADWII__) || defined(__RADWIIU__) || defined(__RAD3DS__) || defined(__RADIPHONE__) || \ + defined(__RADXENON__) || defined(__RADPS4__) || defined(__RADPS3__) || defined(__RADSPU__) || \ + defined(__RADDURANGO__) || defined(__RADWINRTAPI__) + #define MSS_STATIC_RIB + // WinRT is weird in that we statically pull in the RIBs, but we dynamically link Midi + #ifndef __RADWINRTAPI__ + #define MSS_STATIC_MIDI + #endif +#elif defined(__RADWIN__) || defined(__RADLINUX__) || defined(__RADMAC__) + // not static. +#else + #error "MSS needs to know whether it is being distributed as a static lib!" +#endif + +// Retain the old IS_STATIC define for example code +#ifdef MSS_STATIC_RIB + #define IS_STATIC +#endif + +#ifdef __RADXBOX__ +#define IS_XBOX +#endif + +#ifdef __RADXENON__ +#define IS_XENON +#endif + +#ifdef __RADWII__ +#define IS_WII +#endif + +#ifdef __RADWIIU__ +#define IS_WIIU +#endif + +#ifdef __RADPS2__ +#define IS_PS2 +#endif + +#ifdef __RADPS3__ +#define IS_PS3 +#ifndef HOST_SPU_PROCESS + #define HOST_SPU_PROCESS +#endif +#endif + +#ifdef __RADSPU__ +#define IS_PS3 +#define IS_SPU +#endif + +#ifdef __RADPSP__ +#define IS_PSP +#endif + +#ifdef __RADPSP2__ +#define IS_PSP2 +#endif + +#ifdef __RADDOS__ +#define IS_DOS +#endif + +#ifdef __RAD64REGS__ +#define IS_64REGS +#endif + +#ifdef __RADMACH__ +#define IS_MACHO +#endif + +#ifdef __RADIPHONE__ +#define IS_IPHONE +#endif + +#ifdef __RADIPHONESIM__ +#define IS_IPHONESIM +#endif + +#ifdef __RAD3DS__ +#define IS_3DS +#endif + +#define MSSRESTRICT RADRESTRICT + +#define MSS_STRUCT RADSTRUCT + +#define C8 char +typedef void VOIDFUNC(void); + + +#if (!defined(IS_LE) && !defined(IS_BE)) + #error MSS.H did not detect your platform. Define _WINDOWS, WIN32, WIN64, or macintosh. +#endif + +// +// Pipeline filters supported on following platforms +// + +#define MSS_FLT_SUPPORTED 1 +#define EXTRA_BUILD_BUFFERS 1 +#define FLT_A (MAX_SPEAKERS) + +#if defined(IS_WIN32API) + #define MSS_VFLT_SUPPORTED 1 +#endif + +#define MSS_REVERB_SUPPORTED 1 + +//================ + +EXPGROUP(Basic Types) +#define AILCALL EXPTAG(AILCALL) +/* + Internal calling convention that all external Miles functions use. + + Usually cdecl or stdcall on Windows. +*/ + +#define AILCALLBACK EXPTAG(AILCALLBACK docproto) +/* + Calling convention that user supplied callbacks from Miles use. + + Usually cdecl or stdcall on Windows. +*/ + +EXPGROUP(_RootGroup) +#undef AILCALL +#undef AILCALLBACK +//================ + +RADDEFSTART + +#define MSSFOURCC U32 +#ifdef IS_LE + #define MSSMAKEFOURCC(ch0, ch1, ch2, ch3) \ + ((U32)(U8)(ch0) | ((U32)(U8)(ch1) << 8) | \ + ((U32)(U8)(ch2) << 16) | ((U32)(U8)(ch3) << 24 )) +#else + + #define MSSMAKEFOURCC(ch0, ch1, ch2, ch3) \ + (((U32)(U8)(ch0) << 24) | ((U32)(U8)(ch1) << 16) | \ + ((U32)(U8)(ch2) << 8) | ((U32)(U8)(ch3) )) +#endif + +#define MSSmmioFOURCC(w,x,y,z) MSSMAKEFOURCC(w,x,y,z) + +#if defined(__RADWINRTAPI__) + + #define AILLIBCALLBACK RADLINK + #define AILCALL RADLINK + #define AILEXPORT RADEXPLINK + #define AILCALLBACK RADLINK + #define DXDEF RADEXPFUNC + #define DXDEC RADEXPFUNC + +#elif defined(IS_WINDOWS) + + typedef char CHAR; + typedef short SHORT; + typedef int BOOL; + typedef long LONG; + typedef CHAR *LPSTR, *PSTR; + + #ifdef IS_WIN64 + typedef unsigned __int64 ULONG_PTR, *PULONG_PTR; + #else + #ifdef _Wp64 + #if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 + typedef __w64 unsigned long ULONG_PTR, *PULONG_PTR; + #else + typedef unsigned long ULONG_PTR, *PULONG_PTR; + #endif + #else + typedef unsigned long ULONG_PTR, *PULONG_PTR; + #endif + #endif + + typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR; + typedef unsigned long DWORD; + typedef unsigned short WORD; + typedef unsigned int UINT; + typedef struct HWAVE__ *HWAVE; + typedef struct HWAVEIN__ *HWAVEIN; + typedef struct HWAVEOUT__ *HWAVEOUT; + typedef HWAVEIN *LPHWAVEIN; + typedef HWAVEOUT *LPHWAVEOUT; + + #ifndef WAVE_MAPPER + #define WAVE_MAPPER ((UINT)-1) + #endif + + typedef struct waveformat_tag *LPWAVEFORMAT; + + typedef struct HMIDIOUT__ *HMIDIOUT; + typedef HMIDIOUT *LPHMIDIOUT; + typedef struct HWND__ *HWND; + typedef struct HINSTANCE__ *HINSTANCE; + typedef HINSTANCE HMODULE; + typedef struct wavehdr_tag *LPWAVEHDR; + + #define MSS_MAIN_DEF __cdecl + + // + // If compiling MSS DLL, use __declspec(dllexport) for both + // declarations and definitions + // + + #ifdef IS_WIN32 + + #if !defined(FORNONWIN) && !defined(__RADNTBUILDLINUX__) + #define AILLIBCALLBACK __stdcall + #define AILCALL __stdcall + #define AILCALLBACK __stdcall + #define AILEXPORT __stdcall + #else + #define AILLIBCALLBACK __cdecl + #define AILCALL __cdecl + #define AILCALLBACK __cdecl + #define AILEXPORT __cdecl + #endif + + #ifdef __RADINDLL__ + #define DXDEC __declspec(dllexport) + #define DXDEF __declspec(dllexport) + #else + + #if defined( __BORLANDC__ ) || defined( MSS_SPU_PROCESS ) + #define DXDEC extern + #else + #define DXDEC __declspec(dllimport) + #endif + + #endif + + #ifdef IS_WIN64 + #define MSSDLLNAME "MSS64.DLL" + #define MSS_REDIST_DIR_NAME "redist64" + #else + #define MSSDLLNAME "MSS32.DLL" + #define MSS_REDIST_DIR_NAME "redist" + #endif + + #define MSS_DIR_SEP "\\" + #define MSS_DIR_UP ".." MSS_DIR_SEP + #define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_UP + + #endif + + typedef void * LPVOID; + typedef LPVOID AILLPDIRECTSOUND; + typedef LPVOID AILLPDIRECTSOUNDBUFFER; + +#elif defined( IS_MAC ) || defined(IS_IPHONE) || defined(IS_LINUX) + + #if defined(__RADARM__) || defined(__RADX64__) + #define AILLIBCALLBACK + #define AILCALL + #define AILEXPORT + #define AILCALLBACK + #elif defined(__RADX86__) + #define AILLIBCALLBACK __attribute__((cdecl)) + #define AILCALL __attribute__((cdecl)) + #define AILCALLBACK __attribute__((cdecl)) + #define AILEXPORT __attribute__((cdecl)) + #else + #error "No fn call decorators specified" + #endif + + #ifdef __RADINDLL__ + #define DXDEC __attribute__((visibility("default"))) + #define DXDEF __attribute__((visibility("default"))) + #else + #define DXDEC extern + #define DXDEF + #endif + + #ifdef __RADX64__ + #define MSS_REDIST_DIR_NAME "redist/x64" + #elif defined(IS_X86) + #define MSS_REDIST_DIR_NAME "redist/x86" + #elif defined(__RADARM__) + #define MSS_REDIST_DIR_NAME "" + #else + #error "No Redist Dir Specified" + #endif + + #define MSS_DIR_SEP "/" + #define MSS_DIR_UP ".." MSS_DIR_SEP + #define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_UP + + #define MSS_MAIN_DEF + +#elif defined(IS_XENON) + + #define AILLIBCALLBACK __stdcall + #define AILCALL __stdcall + #define AILEXPORT __stdcall + #define AILCALLBACK __stdcall + + #define DXDEC extern + #define DXDEF + + typedef void * AILLPDIRECTSOUND; + typedef void * AILLPDIRECTSOUNDBUFFER; + +#else + + #define AILLIBCALLBACK + #define AILCALL + #define AILEXPORT + #define AILCALLBACK + + #define DXDEC extern + #define DXDEF + +#endif + + +// +// Misc. constant definitions +// + +#define MAX_DRVRS 16 // Max. # of simultaneous drivers +#define MAX_TIMERS 16 // Max. # of simultaneous timers +#define MAX_NOTES 32 // Max # of notes "on" +#define FOR_NEST 4 // # of nested XMIDI FOR loops +#define NUM_CHANS 16 // # of possible MIDI channels +#define MAX_W_VOICES 16 // Max virtual wave synth voice cnt +#define MAX_W_ENTRIES 512 // 512 wave library entries max. +#ifdef IS_WIN32 +#define MAX_SPEAKERS 9 // Up to 9 hardware output channels supported on Win32 +#elif defined(IS_PS3) || defined(IS_WII) || defined(IS_WIIU) || defined(__RADWINRTAPI__) || defined(__RADSEKRIT2__) +#define MAX_SPEAKERS 8 // Up to 8 hardware output channels on PS3, PS2, Wii, WiiU +#elif defined(IS_PSP) || defined(IS_IPHONE) || defined(IS_3DS) || defined(IS_PSP2) || defined(__RADANDROID__) +#define MAX_SPEAKERS 2 // Up to 2 hardware output channels on PSP +#else +#define MAX_SPEAKERS 6 // Up to 6 hardware output channels supported on other platforms +#endif +#define MAX_RECEIVER_SPECS 32 // Up to 32 receiver point specifications + +#define MAX_BUSSES 4 // # of busses that can be active. +#define MILES_MAX_STATES 4 // # of state pushes allowed. + + +#define MIN_CHAN ( 1-1) // Min channel recognized (0-based) +#define MAX_CHAN (16-1) // Max channel recognized +#define MIN_LOCK_CHAN ( 1-1) // Min channel available for locking +#define MAX_LOCK_CHAN (16-1) // Max channel available for locking +#define PERCUSS_CHAN (10-1) // Percussion channel (no locking) + +#define AIL_MAX_FILE_HEADER_SIZE 8192 // AIL_set_named_sample_file() requires at least 8K + // of data or the entire file image, whichever is less, + // to determine sample format +#define DIG_F_16BITS_MASK 1 +#define DIG_F_STEREO_MASK 2 +#define DIG_F_ADPCM_MASK 4 +#define DIG_F_XBOX_ADPCM_MASK 8 +#define DIG_F_MULTICHANNEL_MASK 16 +#define DIG_F_OUTPUT_FILTER_IN_USE 32 + +#define DIG_F_MONO_8 0 // PCM data formats +#define DIG_F_MONO_16 (DIG_F_16BITS_MASK) +#define DIG_F_STEREO_8 (DIG_F_STEREO_MASK) +#define DIG_F_MULTICHANNEL_8 (DIG_F_MULTICHANNEL_MASK) // (not actually supported) +#define DIG_F_STEREO_16 (DIG_F_STEREO_MASK|DIG_F_16BITS_MASK) +#define DIG_F_MULTICHANNEL_16 (DIG_F_MULTICHANNEL_MASK|DIG_F_16BITS_MASK) +#define DIG_F_ADPCM_MONO_16 (DIG_F_ADPCM_MASK |DIG_F_16BITS_MASK) +#define DIG_F_ADPCM_STEREO_16 (DIG_F_ADPCM_MASK |DIG_F_16BITS_MASK|DIG_F_STEREO_MASK) +#define DIG_F_ADPCM_MULTICHANNEL_16 (DIG_F_ADPCM_MASK |DIG_F_16BITS_MASK|DIG_F_STEREO_MASK) +#define DIG_F_XBOX_ADPCM_MONO_16 (DIG_F_XBOX_ADPCM_MASK |DIG_F_16BITS_MASK) +#define DIG_F_XBOX_ADPCM_STEREO_16 (DIG_F_XBOX_ADPCM_MASK |DIG_F_16BITS_MASK|DIG_F_STEREO_MASK) +#define DIG_F_XBOX_ADPCM_MULTICHANNEL_16 (DIG_F_XBOX_ADPCM_MASK |DIG_F_16BITS_MASK|DIG_F_MULTICHANNEL_MASK) + +#define DIG_F_NOT_8_BITS (DIG_F_16BITS_MASK | DIG_F_ADPCM_MASK | DIG_F_XBOX_ADPCM_MASK | DIG_F_MULTICHANNEL_MASK) + +#define DIG_F_USING_ASI 16 + +#define DIG_PCM_POLARITY 0x0004 // PCM flags used by driver hardware +#define DIG_PCM_SPLIT 0x0008 +#define DIG_BUFFER_SERVICE 0x0010 +#define DIG_DUAL_DMA 0x0020 +#define DIG_RECORDING_SUPPORTED 0x8000 + +#ifndef WAVE_FORMAT_PCM + #define WAVE_FORMAT_PCM 1 +#endif +#ifndef WAVE_FORMAT_IMA_ADPCM + #define WAVE_FORMAT_IMA_ADPCM 0x0011 +#endif +#ifndef WAVE_FORMAT_XBOX_ADPCM + #define WAVE_FORMAT_XBOX_ADPCM 0x0069 +#endif +#ifndef WAVE_FORMAT_EXTENSIBLE + #define WAVE_FORMAT_EXTENSIBLE 0xFFFE +#endif + +typedef enum +{ + MSS_SPEAKER_MONO = 0, + MSS_SPEAKER_FRONT_LEFT = 0, // Speaker order indexes correspond to + MSS_SPEAKER_FRONT_RIGHT = 1, // bitmasks in PSDK's ksmedia.h + MSS_SPEAKER_FRONT_CENTER = 2, // Also see microsoft.com/whdc/device/audio/multichaud.mspx + MSS_SPEAKER_LOW_FREQUENCY = 3, + MSS_SPEAKER_BACK_LEFT = 4, + MSS_SPEAKER_BACK_RIGHT = 5, + MSS_SPEAKER_FRONT_LEFT_OF_CENTER = 6, + MSS_SPEAKER_FRONT_RIGHT_OF_CENTER = 7, + MSS_SPEAKER_BACK_CENTER = 8, + MSS_SPEAKER_SIDE_LEFT = 9, + MSS_SPEAKER_SIDE_RIGHT = 10, + MSS_SPEAKER_TOP_CENTER = 11, + MSS_SPEAKER_TOP_FRONT_LEFT = 12, + MSS_SPEAKER_TOP_FRONT_CENTER = 13, + MSS_SPEAKER_TOP_FRONT_RIGHT = 14, + MSS_SPEAKER_TOP_BACK_LEFT = 15, + MSS_SPEAKER_TOP_BACK_CENTER = 16, + MSS_SPEAKER_TOP_BACK_RIGHT = 17, + MSS_SPEAKER_MAX_INDEX = 17, + MSS_SPEAKER_FORCE_32 = 0x7fffffff +} MSS_SPEAKER; + +// +// Pass to AIL_midiOutOpen for NULL MIDI driver +// + +#define MIDI_NULL_DRIVER ((U32)(S32)-2) + + +// +// Non-specific XMIDI/MIDI controllers and event types +// + +#define SYSEX_BYTE 105 +#define PB_RANGE 106 +#define CHAN_MUTE 107 +#define CALLBACK_PFX 108 +#define SEQ_BRANCH 109 +#define CHAN_LOCK 110 +#define CHAN_PROTECT 111 +#define VOICE_PROTECT 112 +#define TIMBRE_PROTECT 113 +#define PATCH_BANK_SEL 114 +#define INDIRECT_C_PFX 115 +#define FOR_LOOP 116 +#define NEXT_LOOP 117 +#define CLEAR_BEAT_BAR 118 +#define CALLBACK_TRIG 119 +#define SEQ_INDEX 120 + +#define GM_BANK_MSB 0 +#define MODULATION 1 +#define DATA_MSB 6 +#define PART_VOLUME 7 +#define PANPOT 10 +#define EXPRESSION 11 +#define GM_BANK_LSB 32 +#define DATA_LSB 38 +#define SUSTAIN 64 +#define REVERB 91 +#define CHORUS 93 +#define RPN_LSB 100 +#define RPN_MSB 101 +#define RESET_ALL_CTRLS 121 +#define ALL_NOTES_OFF 123 + +#define EV_NOTE_OFF 0x80 +#define EV_NOTE_ON 0x90 +#define EV_POLY_PRESS 0xa0 +#define EV_CONTROL 0xb0 +#define EV_PROGRAM 0xc0 +#define EV_CHAN_PRESS 0xd0 +#define EV_PITCH 0xe0 +#define EV_SYSEX 0xf0 +#define EV_ESC 0xf7 +#define EV_META 0xff + +#define META_EOT 0x2f +#define META_TEMPO 0x51 +#define META_TIME_SIG 0x58 + +// +// SAMPLE.system_data[] usage +// + +#define VOC_BLK_PTR 1 // Pointer to current block +#define VOC_REP_BLK 2 // Pointer to beginning of repeat loop block +#define VOC_N_REPS 3 // # of iterations left in repeat loop +#define VOC_MARKER 4 // Marker to search for, or -1 if all +#define VOC_MARKER_FOUND 5 // Desired marker found if 1, else 0 +#define STR_HSTREAM 6 // Stream, if any, that owns the HSAMPLE +#define SSD_TEMP 7 // Temporary storage location for general use +#define EVT_HANDLE_MAGIC 1 // EventSystem handle.magic +#define EVT_HANDLE_INDEX 2 // EventSystem handle.index + +// +// Timer status values +// + +#define AILT_FREE 0 // Timer handle is free for allocation +#define AILT_STOPPED 1 // Timer is stopped +#define AILT_RUNNING 2 // Timer is running + +// +// SAMPLE.status flag values +// + +#define SMP_FREE 0x0001 // Sample is available for allocation + +#define SMP_DONE 0x0002 // Sample has finished playing, or has + // never been started + +#define SMP_PLAYING 0x0004 // Sample is playing + +#define SMP_STOPPED 0x0008 // Sample has been stopped + +#define SMP_PLAYINGBUTRELEASED 0x0010 // Sample is playing, but digital handle + // has been temporarily released + + + +// +// SEQUENCE.status flag values +// + +#define SEQ_FREE 0x0001 // Sequence is available for allocation + +#define SEQ_DONE 0x0002 // Sequence has finished playing, or has + // never been started + +#define SEQ_PLAYING 0x0004 // Sequence is playing + +#define SEQ_STOPPED 0x0008 // Sequence has been stopped + +#define SEQ_PLAYINGBUTRELEASED 0x0010 // Sequence is playing, but MIDI handle + // has been temporarily released + +#ifdef IS_WINDOWS + +// +// AIL_set_direct_buffer_control() command values +// + +#define AILDS_RELINQUISH 0 // App returns control of secondary buffer +#define AILDS_SEIZE 1 // App takes control of secondary buffer +#define AILDS_SEIZE_LOOP 2 // App wishes to loop the secondary buffer + +#endif + +#ifndef MSS_BASIC + +#ifndef FILE_ERRS + #define FILE_ERRS + + #define AIL_NO_ERROR 0 + #define AIL_IO_ERROR 1 + #define AIL_OUT_OF_MEMORY 2 + #define AIL_FILE_NOT_FOUND 3 + #define AIL_CANT_WRITE_FILE 4 + #define AIL_CANT_READ_FILE 5 + #define AIL_DISK_FULL 6 + #define AIL_NO_AVAIL_ASYNC 7 +#endif + +#define MIN_VAL 0 +#define NOM_VAL 1 +#define MAX_VAL 2 + + +EXPGROUP(Basic Types) +EXPTYPEBEGIN typedef SINTa HMSSENUM; +#define MSS_FIRST ((HMSSENUM)-1) +EXPTYPEEND +/* + specifies a type used to enumerate through a list of properties. + + $:MSS_FIRST use this value to start the enumeration process. + +The Miles enumeration functions all work similarly - you set a local variable of type HMSSENUM to MSS_FIRST and then call +the enumeration function until it returns 0. + +*/ + + + + +// +// Preference names and default values +// + +#define AIL_MM_PERIOD 0 +#define DEFAULT_AMP 1 // Default MM timer period = 5 msec. + +#define AIL_TIMERS 1 +#define DEFAULT_AT 16 // 16 allocatable HTIMER handles + +#define AIL_ENABLE_MMX_SUPPORT 2 // Enable MMX support if present +#define DEFAULT_AEMS YES // (may be changed at any time) + + +#define DIG_MIXER_CHANNELS 3 +#define DEFAULT_DMC 64 // 64 allocatable SAMPLE structures + +#define DIG_ENABLE_RESAMPLE_FILTER 4 // Enable resampling filter by +#define DEFAULT_DERF YES // default + +#define DIG_RESAMPLING_TOLERANCE 5 +#define DEFAULT_DRT 131 // Resampling triggered at +/- 0.2% + +// 1 ms per mix. The PS3 has frag count restrictions, so we use 5 ms. +#define DIG_DS_FRAGMENT_SIZE 6 +#ifdef __RADPS3__ +# define DEFAULT_DDFS 5 +#else +# define DEFAULT_DDFS 1 +#endif + +// We want ~256 ms of buffers. PS3 must be 8, 16, or 32. +#define DIG_DS_FRAGMENT_CNT 7 +#ifdef __RADPS3__ +# define DEFAULT_DDFC 32 +#else +# define DEFAULT_DDFC 256 +#endif + +// Mix ahead ~48 ms. PS3 is based off on 5 ms frag size above... +#define DIG_DS_MIX_FRAGMENT_CNT 8 +#ifdef __RADPS3__ +# define DEFAULT_DDMFC 8 +#else +# define DEFAULT_DDMFC 48 +#endif + +#define DIG_LEVEL_RAMP_SAMPLES 9 +#define DEFAULT_DLRS 32 // Ramp level changes over first 32 samples in each buffer to reduce zipper noise + + +#define DIG_MAX_PREDELAY_MS 10 +#define DEFAULT_MPDMS 500 // Max predelay reverb time in ms + +#define DIG_3D_MUTE_AT_MAX 11 +#define DEFAULT_D3MAM YES // on by default + +#define DIG_DS_USE_PRIMARY 12 +#define DEFAULT_DDUP NO // Mix into secondary DirectSound buffer by default + + +#define DIG_DS_DSBCAPS_CTRL3D 13 +#define DEFAULT_DDDC NO // Do not use DSBCAPS_CTRL3D by default + +#define DIG_DS_CREATION_HANDLER 14 +#define DEFAULT_DDCH 0 // Use DirectSoundCreate() by default + + +#define DIG_MAX_CHAIN_ELEMENT_SIZE 15 +#define DEFAULT_MCES 8192 // max of 8192 bytes/waveOut buffer + +#define DIG_MIN_CHAIN_ELEMENT_TIME 16 +#define DEFAULT_MCET 100 // 100 milliseconds buffers + + +#define DIG_USE_WAVEOUT 17 +#define DEFAULT_DUW NO // Use DirectSound by default + +#define DIG_OUTPUT_BUFFER_SIZE 18 +#define DEFAULT_DOBS 49152 // Windows: waveout 48K output buffer size + + +#define DIG_PREFERRED_WO_DEVICE 19 +#define DEFAULT_DPWOD ((UINTa)-1) // Preferred WaveOut device == WAVE_MAPPER + +#define DIG_PREFERRED_DS_DEVICE 20 +#define DEFAULT_DPDSD 0 // Preferred DirectSound device == default NULL GUID + + +#define MDI_SEQUENCES 21 +#define DEFAULT_MS 8 // 8 sequence handles/driver + +#define MDI_SERVICE_RATE 22 +#define DEFAULT_MSR 120 // XMIDI sequencer timing = 120 Hz + +#define MDI_DEFAULT_VOLUME 23 +#define DEFAULT_MDV 127 // Default sequence volume = 127 (0-127) + +#define MDI_QUANT_ADVANCE 24 +#define DEFAULT_MQA 1 // Beat/bar count +1 interval + +#define MDI_ALLOW_LOOP_BRANCHING 25 +#define DEFAULT_ALB NO // Branches cancel XMIDI FOR loops + +#define MDI_DEFAULT_BEND_RANGE 26 +#define DEFAULT_MDBR 2 // Default pitch-bend range = 2 + +#define MDI_DOUBLE_NOTE_OFF 27 +#define DEFAULT_MDNO NO // For stuck notes on SB daughterboards + +#define MDI_SYSEX_BUFFER_SIZE 28 +#define DEFAULT_MSBS 1536 // Default sysex buffer = 1536 bytes + + +#define DLS_VOICE_LIMIT 29 +#define DEFAULT_DVL 64 // 64 voices supported + +#define DLS_TIMEBASE 30 +#define DEFAULT_DTB 120 // 120 intervals/second by default + +#define DLS_BANK_SELECT_ALIAS 31 +#define DEFAULT_DBSA NO // Do not treat controller 114 as bank + +#define DLS_STREAM_BOOTSTRAP 32 // Don't submit first stream buffer +#define DEFAULT_DSB YES // until at least 2 available + +#define DLS_VOLUME_BOOST 33 +#define DEFAULT_DVB 0 // Boost final volume by 0 dB + +#define DLS_ENABLE_FILTERING 34 // Filtering = on by default +#define DEFAULT_DEF YES // (may be changed at any time) + + +#define DLS_GM_PASSTHROUGH 35 // Pass unrecognized traffic on to +#define DEFAULT_DGP YES // default GM driver layer + // (may be changed at any time) + +#define DLS_ADPCM_TO_ASI_THRESHOLD 36 // Size in samples to switch to ASI +#define DEFAULT_DATAT 32768 + +#ifdef __RAD3DS__ +# define AIL_3DS_USE_SYSTEM_CORE 32 // Defaults to 0 +#endif + +#define N_PREFS 40 // # of preference types + +#if defined(IS_WIN32API) || defined(IS_WII) + #pragma pack(push, 1) +#endif + +typedef struct Mwavehdr_tag { + C8 * lpData; + U32 dwBufferLength; + U32 dwBytesRecorded; + UINTa dwUser; + U32 dwFlags; + U32 dwLoops; + struct Mwavehdr_tag *lpNext; + UINTa reserved; +} MWAVEHDR; +typedef MSS_STRUCT Mwaveformat_tag { + U16 wFormatTag; + U16 nChannels; + U32 nSamplesPerSec; + U32 nAvgBytesPerSec; + U16 nBlockAlign; +} MWAVEFORMAT; +typedef MSS_STRUCT Mpcmwaveformat_tag { + MWAVEFORMAT wf; + U16 wBitsPerSample; +} MPCMWAVEFORMAT; +typedef MSS_STRUCT Mwaveformatex_tag { + U16 wFormatTag; + U16 nChannels; + U32 nSamplesPerSec; + U32 nAvgBytesPerSec; + U16 nBlockAlign; + U16 wBitsPerSample; + U16 cbSize; +} MWAVEFORMATEX; +typedef MSS_STRUCT Mwaveformatextensible_tag { + MWAVEFORMATEX Format; + union { + U16 wValidBitsPerSample; + U16 wSamplesPerBlock; + U16 wReserved; + } Samples; + U32 dwChannelMask; + U8 SubFormat[16]; +} MWAVEFORMATEXTENSIBLE; + +#if defined(IS_WIN32API) || defined(IS_WII) + #pragma pack(pop) +#endif + +// This will fail if structure packing isn't correct for the compiler we are running. +RR_COMPILER_ASSERT(sizeof(MWAVEFORMATEXTENSIBLE) == 40); + + +typedef struct _AILSOUNDINFO { + S32 format; + void const* data_ptr; + U32 data_len; + U32 rate; + S32 bits; + S32 channels; + U32 channel_mask; + U32 samples; + U32 block_size; + void const* initial_ptr; +} AILSOUNDINFO; + +// asis use these callbacks +typedef void * (AILCALL MSS_ALLOC_TYPE)( UINTa size, UINTa user, char const * filename, U32 line ); +typedef void (AILCALL MSS_FREE_TYPE)( void * ptr, UINTa user, char const * filename, U32 line ); + +// helper functions that just turn around and call AIL_mem_alloc_lock +DXDEC void * AILCALL MSS_alloc_info( UINTa size, UINTa user, char const * filename, U32 line ); +DXDEC void AILCALL MSS_free_info( void * ptr, UINTa user, char const * filename, U32 line ); + +#if defined(STANDALONEMIXRIB) && !defined(FORNONWIN) +#define MSS_CALLBACK_ALIGNED_NAME( name ) name##_fixup +#define MSS_DEC_CB_STACK_ALIGN( name ) DXDEC void AILCALL MSS_CALLBACK_ALIGNED_NAME(name)(void); +#else +#define MSS_CALLBACK_ALIGNED_NAME( name ) name +#define MSS_DEC_CB_STACK_ALIGN( name ) +#endif + +MSS_DEC_CB_STACK_ALIGN( MSS_alloc_info ) +MSS_DEC_CB_STACK_ALIGN( MSS_free_info) + + +#ifndef RIB_H // RIB.H contents included if RIB.H not already included + +#define RIB_H +#define ARY_CNT(x) (sizeof((x)) / sizeof((x)[0])) + +// ---------------------------------- +// RIB data types +// ---------------------------------- + +typedef S32 RIBRESULT; + +#define RIB_NOERR 0 // Success -- no error +#define RIB_NOT_ALL_AVAILABLE 1 // Some requested functions/attribs not available +#define RIB_NOT_FOUND 2 // Resource not found +#define RIB_OUT_OF_MEM 3 // Out of system RAM + +// +// Handle to interface provider +// + +typedef UINTa HPROVIDER; + +// +// Handle representing token used to obtain property data +// +// This needs to be large enough to store a function pointer +// + +typedef UINTa HPROPERTY; + +// +// Data types for RIB properties +// + +typedef enum +{ + RIB_NONE = 0, // No type + RIB_CUSTOM, // Used for pointers to application-specific structures + RIB_DEC, // Used for 32-bit integer values to be reported in decimal + RIB_HEX, // Used for 32-bit integer values to be reported in hex + RIB_FLOAT, // Used for 32-bit single-precision FP values + RIB_PERCENT, // Used for 32-bit single-precision FP values to be reported as percentages + RIB_BOOL, // Used for Boolean-constrained integer values to be reported as TRUE or FALSE + RIB_STRING, // Used for pointers to null-terminated ASCII strings + RIB_READONLY = 0x80000000 // Property is read-only +} +RIB_DATA_SUBTYPE; + +// +// RIB_ENTRY_TYPE structure, used to register an interface or request one +// + +typedef enum +{ + RIB_FUNCTION = 0, + RIB_PROPERTY, // Property: read-only or read-write data type + RIB_ENTRY_FORCE_32 = 0x7fffffff +} +RIB_ENTRY_TYPE; + +// +// RIB_INTERFACE_ENTRY, used to represent a function or data entry in an +// interface +// + +typedef struct +{ + RIB_ENTRY_TYPE type; // See list above + const C8 *entry_name; // Name of desired function or property + UINTa token; // Function pointer or property token + RIB_DATA_SUBTYPE subtype; // Property subtype +} +RIB_INTERFACE_ENTRY; + +// +// Standard RAD Interface Broker provider identification properties +// + +#define PROVIDER_NAME ((U32) (S32) (-100)) // RIB_STRING name of decoder +#define PROVIDER_VERSION ((U32) (S32) (-101)) // RIB_HEX BCD version number + +// +// Standard function to obtain provider properties (see PROVIDER_ defines +// above) +// +// Each provider of a searchable interface must export this function +// + +typedef S32 (AILCALL *PROVIDER_PROPERTY) (HPROPERTY index, + void * before_value, + void const * new_value, + void * after_value + ); + +// +// Macros to simplify interface registrations/requests for functions, +// and properties +// + +#define FN(entry_name) { RIB_FUNCTION, #entry_name, (UINTa) &(entry_name), RIB_NONE } +#define REG_FN(entry_name) { RIB_FUNCTION, #entry_name, (UINTa) &(entry_name), RIB_NONE } + +#define PR(entry_name,ID) { RIB_PROPERTY, (entry_name), (UINTa) &(ID), RIB_NONE } +#define REG_PR(entry_name,ID,subtype) { RIB_PROPERTY, (entry_name), (UINTa) (ID), subtype } + +#define RIB_register(x,y,z) RIB_register_interface ((HPROVIDER)(x), y, ARY_CNT(z), z) +#define RIB_unregister(x,y,z) RIB_unregister_interface((HPROVIDER)(ssx), y, ARY_CNT(z), z) +#define RIB_unregister_all(x) RIB_unregister_interface((HPROVIDER)(x), 0, 0, 0) +#define RIB_free_libraries() RIB_free_provider_library((HPROVIDER)(0)); +#define RIB_request(x,y,z) RIB_request_interface (x, y, ARY_CNT(z), z) + +// passed to RIB DLLs in Miles 9 and up (so RIBS don't have to link to MSS32.dll) +typedef HPROVIDER AILCALL RIB_ALLOC_PROVIDER_HANDLE_TYPE(long module); + +typedef RIBRESULT AILCALL RIB_REGISTER_INTERFACE_TYPE (HPROVIDER provider, + C8 const *interface_name, + S32 entry_count, + RIB_INTERFACE_ENTRY const *rlist); + +typedef RIBRESULT AILCALL RIB_UNREGISTER_INTERFACE_TYPE (HPROVIDER provider, + C8 const *interface_name, + S32 entry_count, + RIB_INTERFACE_ENTRY const *rlist); + +#define RIB_registerP(x,y,z) rib_reg ((HPROVIDER)(x), y, ARY_CNT(z), z) +#define RIB_unregister_allP(x) rib_unreg ((HPROVIDER)(x), 0, 0, 0) + + +// ---------------------------------- +// Standard RIB API prototypes +// ---------------------------------- + +DXDEC HPROVIDER AILCALL RIB_alloc_provider_handle (long module); +DXDEC void AILCALL RIB_free_provider_handle (HPROVIDER provider); + +DXDEC HPROVIDER AILCALL RIB_load_provider_library (C8 const *filename); +DXDEC void AILCALL RIB_free_provider_library (HPROVIDER provider); + +DXDEC RIBRESULT AILCALL RIB_register_interface (HPROVIDER provider, + C8 const *interface_name, + S32 entry_count, + RIB_INTERFACE_ENTRY const *rlist); + +DXDEC RIBRESULT AILCALL RIB_unregister_interface (HPROVIDER provider, + C8 const *interface_name, + S32 entry_count, + RIB_INTERFACE_ENTRY const *rlist); + +DXDEC RIBRESULT AILCALL RIB_request_interface (HPROVIDER provider, + C8 const *interface_name, + S32 entry_count, + RIB_INTERFACE_ENTRY *rlist); + +DXDEC RIBRESULT AILCALL RIB_request_interface_entry (HPROVIDER provider, + C8 const *interface_name, + RIB_ENTRY_TYPE entry_type, + C8 const *entry_name, + UINTa *token); + +DXDEC S32 AILCALL RIB_enumerate_interface (HPROVIDER provider, + C8 const *interface_name, + RIB_ENTRY_TYPE type, + HMSSENUM *next, + RIB_INTERFACE_ENTRY *dest); + +DXDEC S32 AILCALL RIB_enumerate_providers (C8 const *interface_name, + HMSSENUM *next, + HPROVIDER *dest); + +DXDEC C8 * AILCALL RIB_type_string (void const * data, + RIB_DATA_SUBTYPE subtype); + +DXDEC HPROVIDER AILCALL RIB_find_file_provider (C8 const *interface_name, + C8 const *property_name, + C8 const *file_suffix); + +DXDEC HPROVIDER AILCALL RIB_find_provider (C8 const *interface_name, + C8 const *property_name, + void const *property_value); + +// +// Static library definitions +// + +#ifdef MSS_STATIC_RIB + #define RIB_MAIN_NAME( name ) name##_RIB_Main + + DXDEC S32 AILCALL RIB_MAIN_NAME(SRS)( HPROVIDER provider_handle, U32 up_down, RIB_ALLOC_PROVIDER_HANDLE_TYPE * rib_alloc, RIB_REGISTER_INTERFACE_TYPE * rib_reg, RIB_UNREGISTER_INTERFACE_TYPE * rib_unreg ); + DXDEC S32 AILCALL RIB_MAIN_NAME(DTS)( HPROVIDER provider_handle, U32 up_down, RIB_ALLOC_PROVIDER_HANDLE_TYPE * rib_alloc, RIB_REGISTER_INTERFACE_TYPE * rib_reg, RIB_UNREGISTER_INTERFACE_TYPE * rib_unreg ); + DXDEC S32 AILCALL RIB_MAIN_NAME(DolbySurround)( HPROVIDER provider_handle, U32 up_down, RIB_ALLOC_PROVIDER_HANDLE_TYPE * rib_alloc, RIB_REGISTER_INTERFACE_TYPE * rib_reg, RIB_UNREGISTER_INTERFACE_TYPE * rib_unreg ); + DXDEC S32 AILCALL RIB_MAIN_NAME(MP3Dec)( HPROVIDER provider_handle, U32 up_down, RIB_ALLOC_PROVIDER_HANDLE_TYPE * rib_alloc, RIB_REGISTER_INTERFACE_TYPE * rib_reg, RIB_UNREGISTER_INTERFACE_TYPE * rib_unreg ); + DXDEC S32 AILCALL RIB_MAIN_NAME(OggDec)( HPROVIDER provider_handle, U32 up_down, RIB_ALLOC_PROVIDER_HANDLE_TYPE * rib_alloc, RIB_REGISTER_INTERFACE_TYPE * rib_reg, RIB_UNREGISTER_INTERFACE_TYPE * rib_unreg ); + DXDEC S32 AILCALL RIB_MAIN_NAME(BinkADec)( HPROVIDER provider_handle, U32 up_down, RIB_ALLOC_PROVIDER_HANDLE_TYPE * rib_alloc, RIB_REGISTER_INTERFACE_TYPE * rib_reg, RIB_UNREGISTER_INTERFACE_TYPE * rib_unreg ); + DXDEC S32 AILCALL RIB_MAIN_NAME(SpxDec)( HPROVIDER provider_handle, U32 up_down, RIB_ALLOC_PROVIDER_HANDLE_TYPE * rib_alloc, RIB_REGISTER_INTERFACE_TYPE * rib_reg, RIB_UNREGISTER_INTERFACE_TYPE * rib_unreg ); + DXDEC S32 AILCALL RIB_MAIN_NAME(SpxEnc)( HPROVIDER provider_handle, U32 up_down, RIB_ALLOC_PROVIDER_HANDLE_TYPE * rib_alloc, RIB_REGISTER_INTERFACE_TYPE * rib_reg, RIB_UNREGISTER_INTERFACE_TYPE * rib_unreg ); + DXDEC S32 AILCALL RIB_MAIN_NAME(Voice)( HPROVIDER provider_handle, U32 up_down, RIB_ALLOC_PROVIDER_HANDLE_TYPE * rib_alloc, RIB_REGISTER_INTERFACE_TYPE * rib_reg, RIB_UNREGISTER_INTERFACE_TYPE * rib_unreg ); + DXDEC S32 AILCALL RIB_MAIN_NAME(SpxVoice)( HPROVIDER provider_handle, U32 up_down, RIB_ALLOC_PROVIDER_HANDLE_TYPE * rib_alloc, RIB_REGISTER_INTERFACE_TYPE * rib_reg, RIB_UNREGISTER_INTERFACE_TYPE * rib_unreg ); + DXDEC S32 AILCALL RIB_MAIN_NAME(DSP)( HPROVIDER provider_handle, U32 up_down, RIB_ALLOC_PROVIDER_HANDLE_TYPE * rib_alloc, RIB_REGISTER_INTERFACE_TYPE * rib_reg, RIB_UNREGISTER_INTERFACE_TYPE * rib_unreg ); + +#ifdef IS_XENON + DXDEC S32 AILCALL RIB_MAIN_NAME(XMADec)( HPROVIDER provider_handle, U32 up_down, RIB_ALLOC_PROVIDER_HANDLE_TYPE * rib_alloc, RIB_REGISTER_INTERFACE_TYPE * rib_reg, RIB_UNREGISTER_INTERFACE_TYPE * rib_unreg ); +#endif + + #define Register_RIB(name) RIB_load_static_provider_library(RIB_MAIN_NAME(name),#name) + +#else // MSS_STATIC_RIB + #define RIB_MAIN_NAME( name ) RIB_Main + DXDEC S32 AILCALL RIB_Main( HPROVIDER provider_handle, U32 up_down, RIB_ALLOC_PROVIDER_HANDLE_TYPE * rib_alloc, RIB_REGISTER_INTERFACE_TYPE * rib_reg, RIB_UNREGISTER_INTERFACE_TYPE * rib_unreg ); +#endif // MSS_STATIC_RIB + +typedef S32 ( AILCALL * RIB_MAIN_FUNC) ( HPROVIDER provider_handle, U32 up_down, RIB_ALLOC_PROVIDER_HANDLE_TYPE * rib_alloc, RIB_REGISTER_INTERFACE_TYPE * rib_reg, RIB_UNREGISTER_INTERFACE_TYPE * rib_unreg ); + +DXDEC HPROVIDER AILCALL RIB_load_static_provider_library (RIB_MAIN_FUNC main, const char* description); + + +DXDEC HPROVIDER AILCALL RIB_find_files_provider (C8 const *interface_name, + C8 const *property_name_1, + C8 const *file_suffix_1, + C8 const *property_name_2, + C8 const *file_suffix_2); + +DXDEC HPROVIDER AILCALL RIB_find_file_dec_provider (C8 const *interface_name, + C8 const *property_name_1, + U32 decimal_property_value_1, + C8 const *property_name_2, + C8 const *file_suffix_2); + +DXDEC S32 AILCALL RIB_load_application_providers + (C8 const *filespec); + +DXDEC void AILCALL RIB_set_provider_user_data (HPROVIDER provider, + U32 index, + SINTa value); + +DXDEC SINTa AILCALL RIB_provider_user_data (HPROVIDER provider, + U32 index); + +DXDEC void AILCALL RIB_set_provider_system_data + (HPROVIDER provider, + U32 index, + SINTa value); + +DXDEC SINTa AILCALL RIB_provider_system_data (HPROVIDER provider, + U32 index); + +DXDEC C8 * AILCALL RIB_error (void); + +#endif // RIB_H + + +#ifndef MSS_ASI_VERSION // MSSASI.H contents included if MSSASI.H not already included + +#define AIL_ASI_VERSION 1 +#define AIL_ASI_REVISION 0 + +// +// Handle to stream being managed by ASI codec +// + +typedef SINTa HASISTREAM; + +// +// ASI result codes +// + +typedef S32 ASIRESULT; + +#define ASI_NOERR 0 // Success -- no error +#define ASI_NOT_ENABLED 1 // ASI not enabled +#define ASI_ALREADY_STARTED 2 // ASI already started +#define ASI_INVALID_PARAM 3 // Invalid parameters used +#define ASI_INTERNAL_ERR 4 // Internal error in ASI driver +#define ASI_OUT_OF_MEM 5 // Out of system RAM +#define ASI_ERR_NOT_IMPLEMENTED 6 // Feature not implemented +#define ASI_NOT_FOUND 7 // ASI supported device not found +#define ASI_NOT_INIT 8 // ASI not initialized +#define ASI_CLOSE_ERR 9 // ASI not closed correctly + +// ---------------------------------- +// Application-provided ASI callbacks +// ---------------------------------- + +// +// AILASIFETCHCB: Called by ASI to obtain data from stream source +// +// offset normally will be either 0 at the first call made by the codec +// or -1 to specify a continuous stream, except when ASI_stream_seek() +// is called to restart the stream codec at a new stream offset. In this +// case, the application must execute the seek operation on the ASI codec's +// behalf. +// +// In response to this callback, the application should read the requested +// data and copy it to the specified destination buffer, returning the number +// of bytes copied (which can be less than bytes_requested if the end of +// the stream is reached). +// + + +typedef S32 (AILCALLBACK * AILASIFETCHCB) (UINTa user, // User value passed to ASI_open_stream() + void *dest, // Location to which stream data should be copied by app + S32 bytes_requested, // # of bytes requested by ASI codec + S32 offset); // If not -1, application should seek to this point in stream + +//############################################################################ +//## ## +//## Interface "ASI codec" ## +//## ## +//############################################################################ + +// +// Initialize ASI stream codec +// +// No other ASI functions may be called outside an ASI_startup() / +// ASI_shutdown() pair, except for the standard RIB function +// PROVIDER_property() where appropriate. +// + +typedef ASIRESULT (AILCALL *ASI_STARTUP)(void); + +// +// Shut down ASI codec +// + +typedef ASIRESULT (AILCALL * ASI_SHUTDOWN)(void); + +// +// Return codec error message, or NULL if no errors have occurred since +// last call +// +// The ASI error text state is global to all streams +// + +typedef C8 * (AILCALL * ASI_ERROR)(void); + +//############################################################################ +//## ## +//## Interface "ASI stream" ## +//## ## +//############################################################################ + +// +// Open a stream, returning handle to stream +// + +typedef HASISTREAM (AILCALL *ASI_STREAM_OPEN) (MSS_ALLOC_TYPE * palloc, + MSS_FREE_TYPE * pfree, + UINTa user, // User value passed to fetch callback + AILASIFETCHCB fetch_CB, // Source data fetch handler + U32 total_size); // Total size for %-done calculations (0=unknown) + +// +// Translate data in stream, returning # of bytes actually decoded or encoded +// +// Any number of bytes may be requested. Requesting more data than is +// available in the codec's internal buffer will cause the AILASIFETCHCB +// handler to be called to fetch more data from the stream. +// + +typedef S32 (AILCALL *ASI_STREAM_PROCESS) (HASISTREAM stream, // Handle of stream + void *buffer, // Destination for processed data + S32 buffer_size); // # of bytes to return in buffer + +// +// Restart stream decoding process at new offset +// +// Relevant for decoders only +// +// Seek destination is given as offset in bytes from beginning of stream +// +// At next ASI_stream_process() call, decoder will seek to the closest possible +// point in the stream which occurs at or after the specified position +// +// This function has no effect for decoders which do not support random +// seeks on a given stream type +// +// Warning: some decoders may need to implement seeking by reparsing +// the entire stream up to the specified offset, through multiple calls +// to the data-fetch callback. This operation may be extremely +// time-consuming on large files or slow network connections. +// +// A stream_offset value of -1 may be used to inform the decoder that the +// application has changed the input stream offset on its own, e.g. for a +// double-buffering application where the ASI decoder is not accessing the +// stream directly. ASI decoders should respond to this by flushing all +// internal buffers and resynchronizing themselves to the data stream. +// + +typedef ASIRESULT (AILCALL *ASI_STREAM_SEEK) (HASISTREAM stream, + S32 stream_offset); + +// +// Retrieve or set a property value by index (returns 1 on success) +// + +typedef S32 (AILCALL *ASI_STREAM_PROPERTY) (HASISTREAM stream, + HPROPERTY property, + void * before_value, + void const * new_value, + void * after_value + ); + +// +// Close stream, freeing handle and all internally-allocated resources +// + +typedef ASIRESULT (AILCALL *ASI_STREAM_CLOSE) (HASISTREAM stream); + +#endif // MSS_ASI_VERSION + +//############################################################################ +//## ## +//## Interface "MSS mixer services" ## +//## ## +//############################################################################ + +// +// Operation flags used by mixer and filter modules +// + +#define M_DEST_STEREO 1 // Set to enable stereo mixer output +#define M_SRC_16 2 // Set to enable mixing of 16-bit samples +#define M_FILTER 4 // Set to enable filtering when resampling +#define M_SRC_STEREO 8 // Set to enable mixing of stereo input samples +#define M_RESAMPLE 16 // Set to enable playback ratios other than 65536 +#define M_VOL_SCALING 32 // Set to enable volume scalars other than 2048 +#define M_COPY16_NOVOL 64 + +#ifdef IS_32 + +// +// Initialize mixer +// +// No other mixer functions may be called outside a MIXER_startup() / +// MIXER_shutdown() pair, except for the standard RIB function +// PROVIDER_property() as appropriate. +// + +typedef void (AILCALL *MIXER_STARTUP)(void); + +// +// Shut down mixer +// + +typedef void (AILCALL *MIXER_SHUTDOWN)(void); + +// +// Flush mixer buffer +// + +typedef void (AILCALL *MIXER_FLUSH) (S32 *dest, + S32 len +#ifdef IS_X86 + ,U32 MMX_available +#endif + ); + +// +// Perform audio mixing operation +// + +typedef void (AILCALL *MIXER_MERGE) (void const * *src, + U32 *src_fract, + void const *src_end, + S32 * *dest, + void *dest_end, + S32 *left_val, + S32 *right_val, + S32 playback_ratio, + S32 scale_left, + S32 scale_right, + U32 operation +#ifdef IS_X86 + ,U32 MMX_available +#endif + ); + +// +// Translate mixer buffer contents to final output format +// +// "option" parameter is big_endian_output on Mac, MMX on x86, overwrite flag on PS2 +// + +typedef void (AILCALL *MIXER_COPY) (void const *src, + S32 src_len, + void *dest, + U32 operation +#if defined(IS_BE) || defined(IS_X86) + ,U32 option +#endif + ); + +#else + +// +// Initialize mixer +// +// No other mixer functions may be called outside a MIXER_startup() / +// MIXER_shutdown() pair, except for the standard RIB function +// PROVIDER_property() as appropriate. +// + +typedef void (AILCALL *MIXER_STARTUP)(void); + +// +// Shut down mixer +// + +typedef void (AILCALL *MIXER_SHUTDOWN)(void); + +// +// Flush mixer buffer +// + +typedef void (AILCALL *MIXER_FLUSH) (S32 *dest, + S32 len, + U32 MMX_available); + +// +// Perform audio mixing operation +// + +typedef void (AILCALL *MIXER_MERGE) (U32 src_sel, + U32 dest_sel, + U32 *src_fract, + U32 *src_offset, + U32 *dest_offset, + U32 src_end_offset, + U32 dest_end_offset, + S32 *left_val, + S32 *right_val, + S32 playback_ratio, + S32 scale_both, + U32 operation); + +// +// Translate mixer buffer contents to final output format +// + +typedef void (AILCALL *MIXER_COPY) (void const *src, + S32 src_len, + void *dest, + U32 operation, + U32 option); +#endif + + +typedef struct _MSS_BB // Used in both MC and conventional mono/stereo configurations +{ + S32 *buffer; // Build buffer + S32 bytes; // Size in bytes + S32 chans; // Always mono (1) or stereo (2) + + S32 speaker_offset; // Destination offset in interleaved PCM block for left channel +} MSS_BB; + +typedef struct _ADPCMDATATAG +{ + U32 blocksize; + U32 extrasamples; + U32 blockleft; + U32 step; + UINTa savesrc; + U32 sample; + UINTa destend; + UINTa srcend; + U32 samplesL; + U32 samplesR; + U16 moresamples[16]; +} ADPCMDATA; + +typedef void (AILCALL * MIXER_MC_COPY) ( MSS_BB * build, + S32 n_build_buffers, + void * lpWaveAddr, + S32 hw_format, +#ifdef IS_X86 + S32 use_MMX, +#endif + S32 samples_per_buffer, + S32 physical_channels_per_sample ); + + +typedef void (AILCALL * MIXER_ADPCM_DECODE ) ( void * dest, + void const * in, + S32 out_len, + S32 in_len, + S32 input_format, + ADPCMDATA *adpcm_data); + +// +// Type definitions +// + +struct _DIG_DRIVER; + +struct _MDI_DRIVER; + +typedef struct _DIG_DRIVER * HDIGDRIVER; // Handle to digital driver + +typedef struct _MDI_DRIVER * HMDIDRIVER; // Handle to XMIDI driver + +typedef struct _SAMPLE * HSAMPLE; // Handle to sample + +typedef struct _SEQUENCE * HSEQUENCE; // Handle to sequence + +typedef S32 HTIMER; // Handle to timer + + +// +// Function pointer types +// + +typedef void (AILCALLBACK* AILINCB) (void const *data, S32 len, UINTa user_data); + +typedef void (AILCALLBACK* AILTRACECB) (C8 *text, S32 nest_depth); + +typedef void (AILCALLBACK* AILTIMERCB) (UINTa user); + +typedef void (AILCALLBACK* AILSAMPLECB) (HSAMPLE sample); + +typedef void (AILCALLBACK* AILMIXERCB) (HDIGDRIVER dig); + +typedef F32 (AILCALLBACK* AILFALLOFFCB) (HSAMPLE sample, F32 distance, F32 rolloff_factor, F32 min_dist, F32 max_dist); + +typedef S32 (AILCALLBACK* AILEVENTCB) (HMDIDRIVER hmi,HSEQUENCE seq,S32 status,S32 data_1,S32 data_2); + +typedef S32 (AILCALLBACK* AILTIMBRECB) (HMDIDRIVER hmi,S32 bank,S32 patch); + +typedef S32 (AILCALLBACK* AILPREFIXCB) (HSEQUENCE seq,S32 log,S32 data); + +typedef void (AILCALLBACK* AILTRIGGERCB) (HSEQUENCE seq,S32 log,S32 data); + +typedef void (AILCALLBACK* AILBEATCB) (HMDIDRIVER hmi,HSEQUENCE seq,S32 beat,S32 measure); + +typedef void (AILCALLBACK* AILSEQUENCECB) (HSEQUENCE seq); + +typedef S32 (AILCALLBACK *SS_STREAM_CB) (HSAMPLE S, S16 *dest_mono_sample_buffer, S32 dest_buffer_size); + +// +// Handle to sample and driver being managed by pipeline filter +// + +typedef SINTa HSAMPLESTATE; +typedef SINTa HDRIVERSTATE; + +// +// Digital pipeline stages +// +// These are the points at which external modules may be installed into +// a given HSAMPLE or HDIGDRIVER's processing pipeline +// + +typedef enum +{ + SP_ASI_DECODER = 0, // Must be "ASI codec stream" provider + SP_FILTER, // Must be "MSS pipeline filter" provider + SP_FILTER_0 = SP_FILTER, // Must be "MSS pipeline filter" provider + SP_FILTER_1, // Must be "MSS pipeline filter" provider + SP_FILTER_2, // Must be "MSS pipeline filter" provider + SP_FILTER_3, // Must be "MSS pipeline filter" provider + SP_FILTER_4, // Must be "MSS pipeline filter" provider + SP_FILTER_5, // Must be "MSS pipeline filter" provider + SP_FILTER_6, // Must be "MSS pipeline filter" provider + SP_FILTER_7, // Must be "MSS pipeline filter" provider + SP_MERGE, // Must be "MSS mixer" provider + N_SAMPLE_STAGES, // Placeholder for end of list (= # of valid sample pipeline stages) + SP_OUTPUT = N_SAMPLE_STAGES, // Used to set/get prefs/attribs on a driver's output or matrix filter (if present) + SAMPLE_ALL_STAGES // Used to signify all pipeline stages, for shutdown +} +SAMPLESTAGE; + +#define N_SP_FILTER_STAGES 8 // SP_FILTER_0 ... SP_FILTER_7 + +typedef enum +{ + DP_FLUSH = 0, // Must be "MSS mixer" provider + DP_DEFAULT_FILTER, // Must be "MSS pipeline filter" provider (sets the default) + DP_DEFAULT_MERGE, // Must be "MSS mixer" provider (sets the default) + DP_COPY, // Must be "MSS mixer" provider + DP_MC_COPY, // Must be "MSS mixer" provider + DP_ADPCM_DECODE, // Must be "MSS mixer" provider + N_DIGDRV_STAGES, // Placeholder for end of list (= # of valid stages) + DIGDRV_ALL_STAGES // Used to signify all pipeline stages, for shutdown +} +DIGDRVSTAGE; + +typedef struct + { + ASI_STREAM_OPEN ASI_stream_open; + ASI_STREAM_PROCESS ASI_stream_process; + ASI_STREAM_SEEK ASI_stream_seek; + ASI_STREAM_CLOSE ASI_stream_close; + ASI_STREAM_PROPERTY ASI_stream_property; + + HPROPERTY INPUT_BIT_RATE; + HPROPERTY INPUT_SAMPLE_RATE; + HPROPERTY INPUT_BITS; + HPROPERTY INPUT_CHANNELS; + HPROPERTY OUTPUT_BIT_RATE; + HPROPERTY OUTPUT_SAMPLE_RATE; + HPROPERTY OUTPUT_BITS; + HPROPERTY OUTPUT_CHANNELS; + HPROPERTY OUTPUT_CHANNEL_MASK; + HPROPERTY OUTPUT_RESERVOIR; + HPROPERTY POSITION; + HPROPERTY PERCENT_DONE; + HPROPERTY MIN_INPUT_BLOCK_SIZE; + HPROPERTY RAW_RATE; + HPROPERTY RAW_BITS; + HPROPERTY RAW_CHANNELS; + HPROPERTY REQUESTED_RATE; + HPROPERTY REQUESTED_BITS; + HPROPERTY REQUESTED_CHANS; + HPROPERTY STREAM_SEEK_POS; + HPROPERTY DATA_START_OFFSET; + HPROPERTY DATA_LEN; + HPROPERTY EXACT_SEEK; + HPROPERTY EXACT_GETPOS; + HPROPERTY SEEK_LOOKUP; + HPROPERTY SET_LOOPING_SAMPLES; + HPROPERTY CLEAR_LOOP_META; + + HASISTREAM stream; + } +ASISTAGE; + +typedef struct + { + struct _FLTPROVIDER *provider; + HSAMPLESTATE sample_state[MAX_SPEAKERS]; + } +FLTSTAGE; + +typedef struct +{ + S32 active; // Pass-through if 0, active if 1 + HPROVIDER provider; + + union + { + ASISTAGE ASI; + MIXER_MERGE MSS_mixer_merge; + FLTSTAGE FLT; + } + TYPE; +} +SPINFO; + +typedef struct +{ + S32 active; // Pass-through if 0, active if 1 + HPROVIDER provider; + + union + { + MIXER_FLUSH MSS_mixer_flush; + MIXER_COPY MSS_mixer_copy; + MIXER_MC_COPY MSS_mixer_mc_copy; + MIXER_ADPCM_DECODE MSS_mixer_adpcm_decode; + } + TYPE; +} +DPINFO; + +// +// Other data types +// + +typedef enum +{ + WIN32_HWAVEOUT, // waveOut handle for HDIGDRIVER, if any + WIN32_HWAVEIN, // waveIn handle for HDIGINPUT, if any + WIN32_LPDS, // lpDirectSound pointer for HSAMPLE + WIN32_LPDSB, // lpDirectSoundBuffer pointer for HSAMPLE + WIN32_HWND, // HWND that will be used to open DirectSound driver + WIN32_POSITION_ERR, // Nonzero if DirectSound play cursor stops moving (e.g., headphones removed) + + PS3_AUDIO_PORT, // cellaudio port that Miles is using + PS3_AUDIO_ADDRESS, // address of cellaudio sound buffer + PS3_AUDIO_LENGTH, // length of cellaudio sound buffer + PS3_AUDIO_POSITION, // current playback position of cellaudio sound buffer + + PSP_SUBMIT_THREAD, // Handle to thread submitting chucks of audio to the hw + PSP_AUDIO_PORT, // Port # Miles is using, -1 for simple audio, >= 0 for libwave + + PSP2_SUBMIT_THREAD, // Handle to thread submitting chucks of audio to the hw + PSP2_AUDIO_PORT, // Port # Miles is using + + OAL_CONTEXT, // OpenAL Context + OAL_DEVICE, // OpenAL Device + + XB_LPDS, // lpDirectSound pointer for HSAMPLE + XB_LPDSB, // lpDirectSoundBuffer pointer for HSAMPLE + + XB360_LPXAB // IXAudioSourceVoice pointer for HDIGDRIVER +} +MSS_PLATFORM_PROPERTY; + + +typedef struct _AIL_INPUT_INFO // Input descriptor type +{ + AILINCB callback; // Callback function to receive incoming data + UINTa user_data; // this is a user defined value + U32 device_ID; // DS LPGUID or wave device ID + U32 hardware_format; // e.g., DIG_F_STEREO_16 + U32 hardware_rate; // e.g., 22050 + S32 buffer_size; // Maximum # of bytes to be passed to callback (-1 to use DIG_INPUT_LATENCY) +} AIL_INPUT_INFO; + +typedef struct _AILTIMER // Timer instance +{ + AILTIMERCB callback; + U64 next; + U64 delta; + UINTa user; + U32 status; +} AILTIMERSTR; + +#ifndef IS_WIN64 + + #define OFSblocksize 0 // these constants valid for 32-bit versions only! + #define OFSextrasamples 4 + #define OFSblockleft 8 + #define OFSstep 12 + #define OFSsavesrc 16 + #define OFSsample 20 + #define OFSdestend 24 + #define OFSsrcend 28 + #define OFSsamplesL 32 + #define OFSsamplesR 36 + #define OFSmoresamples 40 + +#endif + +typedef struct LOWPASS_INFO +{ + S32 X0, X1; + S32 Y0, Y1; + S32 A, B0, B1; + S32 flags; + S32 queuedA, queuedB; + F32 calculated_cut; + F32 cutoff; +} LOWPASS_INFO; + + +typedef union STAGE_BUFFER +{ + union STAGE_BUFFER * next; + U8 data[ 1 ]; +} STAGE_BUFFER; + +typedef struct _MSSVECTOR3D +{ + F32 x; + F32 y; + F32 z; +} MSSVECTOR3D; + +#define MILES_TANGENT_LINEAR 0 +#define MILES_TANGENT_CURVE 1 +#define MILES_TANGENT_STEP 2 +#define MILES_MAX_FALLOFF_GRAPH_POINTS 5 + +#define MILES_MAX_SEGMENT_COUNT 10 + +typedef struct _MSSGRAPHPOINT +{ + F32 X, Y, ITX, ITY, OTX, OTY; // Point & tangents. + S32 IType, OType; +} MSSGRAPHPOINT; + +typedef struct _S3DSTATE // Portion of HSAMPLE that deals with 3D positioning +{ + MSSVECTOR3D position; // 3D position + MSSVECTOR3D face; // 3D orientation + MSSVECTOR3D up; // 3D up-vector + MSSVECTOR3D velocity; // 3D velocity + + S32 doppler_valid; // TRUE if OK to apply Doppler shift + F32 doppler_shift; // Scalar for S->playback rate + + F32 inner_angle; // Cone attenuation parameters + F32 outer_angle; // (Angles divided by two and convered to rads for dot-product comparisons) + F32 outer_volume; + S32 cone_enabled; + + F32 max_dist; // Sample distances + F32 min_dist; + S32 dist_changed; // TRUE if min/max distances have changed and need to be sent to the hardware + + S32 auto_3D_atten; // TRUE if distance/cone attenuation should be applied to wet signal + F32 atten_3D; // Attenuation due to distance/cone effects, calculated by software 3D positioner + F32 rolloff; // per sample rolloff factor to use instead of global rolloff, if non zero. + + F32 exclusion_3D; // exclusion value computed by falloff graph. -1 if not affected. + F32 lowpass_3D; // low pass cutoff computed by falloff graph. -1 if not affected. + + F32 spread; + + HSAMPLE owner; // May be NULL if used for temporary/internal calculations + AILFALLOFFCB falloff_function; // User function for min/max distance calculations, if desired + + MSSVECTOR3D position_graph[MILES_MAX_SEGMENT_COUNT]; + S32 position_graph_count; + + MSSGRAPHPOINT volgraph[MILES_MAX_FALLOFF_GRAPH_POINTS]; + MSSGRAPHPOINT excgraph[MILES_MAX_FALLOFF_GRAPH_POINTS]; + MSSGRAPHPOINT lpgraph[MILES_MAX_FALLOFF_GRAPH_POINTS]; + MSSGRAPHPOINT spreadgraph[MILES_MAX_FALLOFF_GRAPH_POINTS]; + + U8 volgraphcnt; + U8 excgraphcnt; + U8 lpgraphcnt; + U8 spreadgraphcnt; + +} S3DSTATE; + +typedef struct _SMPBUF +{ + void const *start; // Sample buffer address (W) + U32 len; // Sample buffer size in bytes (W) + U32 pos; // Index to next byte (R/W) + U32 done; // Nonzero if buffer with len=0 sent by app + S32 reset_ASI; // Reset the ASI decoder at the end of the buffer + S32 reset_seek_pos; // New destination offset in stream source data, for ASI codecs that care +} SMPBUF; + +typedef struct _SAMPLE // Sample instance +{ + U32 tag; // HSAM + + HDIGDRIVER driver; // Driver for playback + + S32 index; // Numeric index of this sample + + SMPBUF buf[8]; // Source data buffers + + U32 src_fract; // Fractional part of source address + + U32 mix_delay; // ms until start mixing (decreased every buffer mix) + F32 max_output_mix_volume; // max_volume of any speaker at last mix + + U64 mix_bytes; // total number of bytes sent to the mixer for this sample. + + S32 group_id; // ID for grouped operations. + + // size of the next dynamic arrays + U32 chan_buf_alloced; + U32 chan_buf_used; + U8* chan_buf_ptr; + + // these are dynamic arrays sized as n_channels long (so 1 for mono, 2 stereo, 6 for 5.1) + S32 *left_val; + S32 *right_val; + S32 *last_decomp; + LOWPASS_INFO *lp; // low pass info + + + // these are dynamic arrays pointing to dynamic arrays, each of the sub arrays are n_channels long or [MAX_SPEAKERS][n_channels] + F32 **user_channel_levels; // Channel levels set by AIL_set_sample_channel_levels() [source_channels][driver->logical_channels] + S32 **cur_scale; // Calculated 11-bit volume scale factors for current/previous mixing interval + S32 **prev_scale; // (These are all indexed by build buffer*2, not speaker indexes!) + S32 **ramps_left; + + // these are dynamic arrays + F32 *auto_3D_channel_levels; // Channel levels set by 3D positioner (always 1.0 if not 3D-positioned) + F32 *speaker_levels; // one level per speaker (multiplied after user or 3D) + + S8 *speaker_enum_to_source_chan; // array[MSS_SPEAKER_xx] = -1 if not present, else channel # + // 99% of the time this is a 1:1 mapping and is zero. + + S32 lp_any_on; // are any of the low pass filters on? + S32 user_channels_need_deinterlace; // do any of the user channels require a stereo sample to be deinterlaced? + + S32 n_buffers; // # of buffers (default = 2) + S32 head; + S32 tail; + S32 starved; // Buffer stream has run out of data + S32 exhaust_ASI; // Are we prolonging the buffer lifetime until ASI output is exhausted? + + S32 loop_count; // # of cycles-1 (1=one-shot, 0=indefinite) + S32 loop_start; // Starting offset of loop block (0=SOF) + S32 loop_end; // End offset of loop block (-1=EOF) + S32 orig_loop_count; // Original loop properties specified by app, before any + S32 orig_loop_start; // alignment constraints + S32 orig_loop_end; + + S32 format; // DIG_F format (8/16 bits, mono/stereo/multichannel) + S32 n_channels; // # of channels (which can be >2 for multichannel formats) + U32 channel_mask; // Same as WAVEFORMATEXTENSIBLE.dwChannelMask + + S32 original_playback_rate; // Playback rate in hertz + F32 playback_rate_factor; // Fractional playback rate, normally 1.0 + + F32 save_volume; // Sample volume 0-1.0 + F32 save_pan; // Mono panpot/stereo balance (0=L ... 1.0=R) + + F32 left_volume; // Left/mono volume 0 to 1.0 + F32 right_volume; // Right volume 0 to 1.0 + F32 wet_level; // reverb level 0 to 1.0 + F32 dry_level; // non-reverb level 0 to 1.0 + F32 sys_level; // system control + + F32 extra_volume; // Volume scalar for ramping or otherwise. + F32 extra_wet; + F32 extra_lp; + F32 extra_rate; + + + U32 low_pass_changed; // bit mask for what channels changed. + + S32 bus; // Bus assignment for this sample. + S32 bus_comp_sends; // Which buses this bus routes compressor input to. + S32 bus_comp_installed; // Nonzero if we have a compressor installed. + U32 bus_comp_input; // The input to use for this bus's compressor, if we have one installed + S32 bus_override_wet; // If true, samples on this bus will use the bus's wet level instead of their own. + U32 bus_signal_strength; // The bus level. + S32 bus_enable_limiter; // If true, a basic limiter will be run on the samples prior to clamping to S16. + S32 bus_limiter_atten; // The attenuation that was applied on the last bus pass. + + S32 fade_to_stop; // # of samples to fade to stop over. ( currently fixed at the volramp count ) + + U64 mix_start_time; // arbitrary non-zero id for starting sounds synced. + + S16 pop_fade_total; + S16 pop_fade_time; + U8 pop_fade_stop; // nonzero we end the sample when it fades out. + + U8 state_level; // Level the sample was started at. +#ifdef IS_WIIU + S8 route_to_drc; +#endif + + F32 obstruction; + F32 occlusion; + F32 exclusion; + + S32 service_type; // 1 if single-buffered; 2 if streamed + + AILSAMPLECB SOB; // Start-of-block callback function + AILSAMPLECB EOB; // End-of-buffer callback function + AILSAMPLECB EOS; // End-of-sample callback function + + SINTa user_data [8]; // Miscellaneous user data + SINTa system_data[8]; // Miscellaneous system data + SINTa hl_marker_list; + + ADPCMDATA adpcm; + + S32 doeob; // Flags to trigger callbacks + S32 dosob; + S32 doeos; + + S32 vol_ramps; + S32 resamp_tolerance; + S32 enable_resamp_filter; + + // + // Sample pipeline stages + // + + SPINFO pipeline[N_SAMPLE_STAGES]; + S32 n_active_filters; // # of SP_FILTER_n stages active + + // + // 3D-related state for all platforms (including Xbox) + // + + S32 is_3D; // TRUE if channel levels are derived automatically from 3D positional state, FALSE if they're controlled manually + + S3DSTATE S3D; // Software version applies 3D positioning only if is_3D == TRUE, but output filters always use it + +#ifdef MSS_VFLT_SUPPORTED + void *voice; // Optional object used by output filter to store per-sample information such as DS3D buffers +#endif + + F32 leftb_volume; // Left/mono volume 0 to 1.0 (back) + F32 rightb_volume; // Right volume 0 to 1.0 (back) + F32 center_volume; // Center volume 0 to 1.0 + F32 low_volume; // Low volume 0 to 1.0 + F32 save_fb_pan; // Sample volume 0-1.0 + F32 save_center; // saved center level + F32 save_low; // saved sub level + +#if defined(HOST_SPU_PROCESS) || defined(MSS_SPU_PROCESS) + S32 spu_on; + U32 align[1]; +#endif + +#if defined(IS_WINDOWS) + + // + // DirectSound-specific data + // + + S32 service_interval; // Service sample every n ms + S32 service_tick; // Current service countdown value + S32 buffer_segment_size; // Buffer segment size to fill + + S32 prev_segment; // Previous segment # (0...n) + S32 prev_cursor; // Previous play cursor location + + S32 bytes_remaining; // # of bytes left to play (if not -1) + + S32 direct_control; // 1 if app controls buffer, 0 if MSS + +#endif +} SAMPLE; + +#ifdef MILES_CHECK_OFFSETS + RR_COMPILER_ASSERT((RR_MEMBER_OFFSET(SAMPLE, save_low) & 3) == 0); +#endif + +// +// used for AIL_process +// + +typedef struct _AILMIXINFO { + AILSOUNDINFO Info; + ADPCMDATA mss_adpcm; + U32 src_fract; + S32 left_val; + S32 right_val; +} AILMIXINFO; + + + +DXDEC U32 AILCALL AIL_get_timer_highest_delay (void); + +DXDEC void AILCALL AIL_serve(void); + +#ifdef IS_MAC + + typedef void * LPSTR; + + #define WHDR_DONE 0 + + typedef struct _WAVEIN + { + long temp; + } * HWAVEIN; + + typedef struct _WAVEHDR + { + S32 dwFlags; + S32 dwBytesRecorded; + S32 dwUser; + S32 temp; + void * lpData; + S32 dwBufferLength; + S32 longdwLoops; + S32 dwLoops; + void * lpNext; + U32 * reserved; + + } WAVEHDR, * LPWAVEHDR; + +#endif + +#define N_WAVEIN_BUFFERS 8 // Use a ring of 8 buffers by default + +typedef struct _DIG_INPUT_DRIVER *HDIGINPUT; // Handle to digital input driver + +#ifdef IS_MAC + + #define AIL_DIGITAL_INPUT_DEFAULT 0 + + typedef struct _DIG_INPUT_DRIVER // Handle to digital input driver + { + U32 tag; // HDIN + S32 input_enabled; // 1 if enabled, 0 if not + U32 incoming_buffer_size; + void * incoming_buffer[ 2 ]; + void* outgoing_buffer; + U32 which_buffer; + AIL_INPUT_INFO info; // Input device descriptor + AILMIXINFO incoming_info; + long device; +#ifdef IS_MAC + char InternalRecordingState[128]; // Hide this so we dont' have to #include OS stuff everywhere. +#endif + } DIG_INPUT_DRIVER; + +#else + +#define AIL_DIGITAL_INPUT_DEFAULT ((U32)WAVE_MAPPER) + +typedef struct _DIG_INPUT_DRIVER // Handle to digital input driver +{ + U32 tag; // HDIN + + HTIMER background_timer; // Background timer handle + + AIL_INPUT_INFO info; // Input device descriptor + + S32 input_enabled; // 1 if enabled, 0 if not + + UINTa callback_user; // Callback user value + + // + // Provider-independent data + // + + U32 DMA_size; // Size of each DMA sub-buffer in bytes + void *DMA[N_WAVEIN_BUFFERS]; // Simulated DMA buffers + + U32 silence; // Silence value for current format (0 or 128) + + S32 device_active; // 1 if buffers submittable, 0 if not + +#if defined(IS_WINDOWS) && !defined(__RADWINRTAPI__) + // + // waveOut-specific data + // + + HWAVEIN hWaveIn; // Handle to wave input device + volatile MWAVEHDR wavehdr[N_WAVEIN_BUFFERS]; // Handles to wave headers + +#endif +} DIG_INPUT_DRIVER; +#endif + + +typedef struct REVERB_CONSTANT_INFO +{ + F32* start0,* start1,* start2,* start3,* start4,* start5; + F32* end0,* end1,* end2,* end3,* end4,* end5; + F32 C0, C1, C2, C3, C4, C5; + F32 A; + F32 B0, B1; +} REVERB_CONSTANT_INFO; + +typedef struct REVERB_UPDATED_INFO +{ + F32 * address0, * address1, * address2, * address3, * address4, * address5; + F32 X0, X1, Y0, Y1; +} REVERB_UPDATED_INFO; + +typedef struct REVERB_INFO +{ + REVERB_UPDATED_INFO u; + REVERB_CONSTANT_INFO c; +} REVERB_INFO; + +typedef struct REVERB_SETTINGS +{ + S32 room_type; // Changes to this drive master_wet and duration/damping/predelay! + F32 master_wet; // Master reverb level 0-1.0 + F32 master_dry; // Master non-reverb level 0-1.0 + + REVERB_INFO ri; + + S32 *reverb_build_buffer; + S32 reverb_total_size; + S32 reverb_fragment_size; + S32 reverb_buffer_size; + S32 reverb_on; + U32 reverb_off_time_ms; + + U32 reverb_duration_ms; + + F32 reverb_decay_time_s; + F32 reverb_predelay_s; + F32 reverb_damping; + + S32 reverb_head; + S32 reverb_tail; +} REVERB_SETTINGS; + + +typedef struct _MSS_RECEIVER_LIST +{ + MSSVECTOR3D direction; // Normalized direction vector from listener + + S32 speaker_index[MAX_SPEAKERS]; // List of speakers affected by sounds in this direction + F32 speaker_level[MAX_SPEAKERS]; // Each speaker's degree of effect from this source + S32 n_speakers_affected; +} MSS_RECEIVER_LIST; + +typedef struct _D3DSTATE +{ + S32 mute_at_max; + + MSSVECTOR3D listen_position; + MSSVECTOR3D listen_face; + MSSVECTOR3D listen_up; + MSSVECTOR3D listen_cross; + MSSVECTOR3D listen_velocity; + + F32 rolloff_factor; + F32 doppler_factor; + F32 distance_factor; + F32 falloff_power; + + // + // Precalculated listener info + // + + S32 ambient_channels [MAX_SPEAKERS]; // E.g., LFE + S32 n_ambient_channels; + + S32 directional_channels[MAX_SPEAKERS+1]; // Channel index, or -1 if virtual + MSSVECTOR3D listener_to_speaker [MAX_SPEAKERS+1]; + S32 n_directional_channels; + + MSS_RECEIVER_LIST receiver_specifications[MAX_RECEIVER_SPECS]; // Constellation of receiver vectors + S32 n_receiver_specs; + + MSSVECTOR3D speaker_positions [MAX_SPEAKERS]; // Listener-relative speaker locations + + F32 speaker_wet_reverb_response [MAX_SPEAKERS]; // Reverb sensitivity of each speaker + F32 speaker_dry_reverb_response [MAX_SPEAKERS]; +} D3DSTATE; + +typedef enum +{ + MSS_MC_INVALID = 0, // Used for configuration-function errors + MSS_MC_MONO = 1, // For compatibility with S32 channel param + MSS_MC_STEREO = 2, + MSS_MC_USE_SYSTEM_CONFIG = 0x10, // Leave space between entries for new variations + MSS_MC_HEADPHONES = 0x20, // with similar quality levels/speaker counts + MSS_MC_DOLBY_SURROUND = 0x30, + MSS_MC_SRS_CIRCLE_SURROUND = 0x40, + MSS_MC_40_DTS = 0x48, + MSS_MC_40_DISCRETE = 0x50, + MSS_MC_51_DTS = 0x58, + MSS_MC_51_DISCRETE = 0x60, + MSS_MC_61_DISCRETE = 0x70, + MSS_MC_71_DISCRETE = 0x80, + MSS_MC_81_DISCRETE = 0x90, + MSS_MC_DIRECTSOUND3D = 0xA0, + MSS_MC_EAX2 = 0xC0, + MSS_MC_EAX3 = 0xD0, + MSS_MC_EAX4 = 0xE0, + MSS_MC_FORCE_32 = 0x7fffffff +} +MSS_MC_SPEC; + + +typedef struct _DIG_DRIVER // Handle to digital audio driver +{ + U32 tag; // HDIG + + HTIMER backgroundtimer; // Background timer handle + + U32 num_mixes; // incrementing number of mixes + + S32 mix_ms; // rough ms per mix + + + F32 master_volume; // Master sample volume 0-1.0 + + S32 DMA_rate; // Hardware sample rate + S32 hw_format; // DIG_F code in use + S32 n_active_samples; // # of samples being processed + + MSS_MC_SPEC channel_spec; // Original "channels" value passed to AIL_open_digital_driver() + + D3DSTATE D3D; // 3D listener parms for all platforms + + +#if defined(IS_PSP2) || defined(IS_PSP) || defined(IS_XENON) || defined(IS_IPHONE) || defined(IS_MAC) || defined(IS_LINUX) || defined(IS_3DS) || defined(IS_WIIU) || defined(__RADWINRTAPI__) || defined(__RADSEKRIT2__) || defined(__RADANDROID__) // generic dig platforms +#define IS_GENERICDIG + void* dig_ss; // Sound system ptr (embed in mss.h?) + void* dig_heap; // Sound system heap. +#endif + +#ifdef IS_XENON + void* x2_voiceptr; //! \todo get rid of this? Only expose dig_ss? +#endif + + S32 quiet; // # of consecutive quiet sample periods + S32 playing; // Playback active if non-zero + + S32 bytes_per_channel; // # of bytes per channel (always 1 or 2 for 8- or 16-bit hardware output) + S32 samples_per_buffer; // # of samples per build buffer / half-buffer + S32 physical_channels_per_sample; // # of channels per *physical* sample (1 or 2, or more in discrete MC mode) + S32 logical_channels_per_sample; // # of logical channels per sample (may differ from physical channel count in matrix formats) + +#ifdef IS_LINUX + S32 released; // has the sound manager been released? +#endif + + HSAMPLE samples; // Pointer to list of SAMPLEs + + U32 *sample_status; // SMP_ flags: _FREE, _DONE, _PLAYING, moved out of SAMPLEs for faster iteration + S32 n_samples; // # of SAMPLEs + + SINTa system_data[8]; // Miscellaneous system data + + HSAMPLE bus_samples[MAX_BUSSES]; // Sample handles the bus will route through. + S32 bus_active_count[MAX_BUSSES]; // Number of samples mixed on the bus last mix. + void* bus_ptrs[MAX_BUSSES]; // Buffers for each bus to mix in to. + + void* pushed_states[MILES_MAX_STATES]; + U8 state_index; + + // + // Build buffers + // + // In multichannel mode, source samples may be mixed into more than one + // build buffer + // + + MSS_BB build[MAX_SPEAKERS+EXTRA_BUILD_BUFFERS]; + S32 n_build_buffers; // # of build buffers actually used for output processing + + S32 hardware_buffer_size; // Size of each output buffer + + S32 enable_limiter; + S32 limiter_atten; // attenuation level from last hw copy. + + S32 scheduled_sample_count; // # of samples that are waiting to be started at an exact time. + + AILMIXERCB mixcb; // callback for each mix. + +#if defined(IS_WINDOWS) && !defined(__RADWINRTAPI__) + + // + // waveOut-specific interface data + // + + HWAVEOUT hWaveOut; // Wave output driver + + U32 reset_works; // TRUE if OK to do waveOutReset + U32 request_reset; // If nonzero, do waveOutReset ASAP + + LPWAVEHDR first; // Pointer to first WAVEHDR in chain + S32 n_buffers; // # of output WAVEHDRs in chain + + LPWAVEHDR volatile *return_list; // Circular list of returned WAVEHDRs + S32 volatile return_head; // Head of WAVEHDR list (insertion point) + S32 volatile return_tail; // Tail of WAVEHDR list (retrieval point) + + // + // DirectSound-specific interface data + // + + UINTa guid; // The guid id of the ds driver + AILLPDIRECTSOUND pDS; // DirectSound output driver (don't + // use with Smacker directly anymore!) + + U32 ds_priority; // priority opened with + + S32 emulated_ds; // is ds emulated or not? + AILLPDIRECTSOUNDBUFFER lppdsb; // primary buffer or null + + UINTa dsHwnd; // HWND used with DirectSound + + AILLPDIRECTSOUNDBUFFER * lpbufflist; // List of pointers to secondary buffers + HSAMPLE *samp_list; // HSAMPLE associated with each buffer + S32 *sec_format; // DIG_F_ format for secondary buffer + S32 max_buffs; // Max. allowable # of secondary buffers + + // + // Driver output configuration + // + // Note: # of "logical" (source) channels per sample = dig->channels_per_sample + // # of "physical" (DAC) channels per sample = dig->wformat.wf.nChannels + // + // These may be different if a matrix format (e.g., Dolby/SRS) + // is in use! + // + + MPCMWAVEFORMAT wformat; // format from waveout open + C8 wfextra[32]; // Extension to PCMWAVEFORMAT (e.g., WAVE_FORMAT_EXTENSIBLE) + + // + // Misc. data + // + + S32 released; // has the sound manager been released? + + HDIGDRIVER next; // Pointer to next HDIGDRIVER in use + + // + // Vars for waveOut emulation + // + + S32 DS_initialized; + + AILLPDIRECTSOUNDBUFFER DS_sec_buff; // Secondary buffer (or NULL if none) + AILLPDIRECTSOUNDBUFFER DS_out_buff; // Output buffer (may be sec or prim) + S32 DS_buffer_size; // Size of entire output buffer + + S32 DS_frag_cnt; // Total fragment count and size, and + S32 DS_frag_size; // last fragment occupied by play cursor + S32 DS_last_frag; + S32 DS_last_write; + S32 DS_last_timer; + S32 DS_skip_time; + + S32 DS_use_default_format; // 1 to force use of default DS primary buffer format + + U32 position_error; // last status from position report (can be used + // to watch for headset removal) + U32 last_ds_play; + U32 last_ds_write; + U32 last_ds_move; + +#endif + +#ifdef IS_X86 + S32 use_MMX; // Use MMX with this driver if TRUE +#endif + + U64 mix_total; + U64 last_polled; + U32 last_percent; + + void * MC_buffer; + // + // Digital driver pipeline filter stages + // + + DPINFO pipeline[N_DIGDRV_STAGES]; + +#ifdef MSS_VFLT_SUPPORTED + struct _FLTPROVIDER *voice_filter; + SS_STREAM_CB stream_callback; +#endif + + struct _FLTPROVIDER *matrix_filter; + + // + // Reverb + // If no busses are active, 0 is still used as the base reverb. + // + REVERB_SETTINGS reverb[MAX_BUSSES]; + +#ifdef IS_PS3 + HDIGDRIVER next; // Pointer to next HDIGDRIVER in use + + void * hw_buf; + U32 hw_datarate; + U32 hw_align; + U32 port; + S32 hw_buffer_size; + S32 snd_frag_cnt; + S32 snd_frag_size; + S32 snd_last_frag; + S32 snd_last_write; + S32 snd_skip_time; + U32 snd_last_play; + U32 snd_last_move; + S32 snd_last_timer; +#endif + +#ifdef IS_GENERICDIG + HDIGDRIVER next; +#endif + +#if defined(IS_WINDOWS) + S32 no_wom_done; // don't process WOM_DONEs on this driver + U32 wom_done_buffers; +#endif + +#if defined(HOST_SPU_PROCESS) || defined(MSS_SPU_PROCESS) + U32 spu_num; + S32 spu_on; + U64 spu_total; + U64 spu_last_polled; + U32 spu_last_percent; + #ifdef IS_PS3 + U32 align[ 2 ]; + #else + U32 align[ 1 ]; + #endif +#endif + + U64 adpcm_time; + U64 deinterlace_time; + U64 mix_time; + U64 rev_time; + U64 reformat_time; + U64 lowpass_time; + U64 filter_time; + U64 copy_time; + U64 sob_time; + U64 eob_time; + U64 eos_time; + U64 spu_wait_time; + U64 asi_times[4]; + + HSAMPLE adpcm_sam; + HSAMPLE deinterlace_sam; + HSAMPLE mix_sam; + HSAMPLE rev_sam; + HSAMPLE reformat_sam; + HSAMPLE lowpass_sam; + HSAMPLE filter_sam; + HSAMPLE asi_sams[4]; + + U32 adpcm_num; + U32 deinterlace_num; + U32 mix_num; + U32 rev_num; + U32 reformat_num; + U32 lowpass_num; + U32 filter_num; + U32 asi_nums[4]; + + + // these clauses have to be at the end of the structure!! +#ifdef IS_WII + HDIGDRIVER next; // Pointer to next HDIGDRIVER in use + + U32 hw_datarate; + S32 hw_buffer_size; + S32 each_buffer_size; + S32 snd_frag_cnt; + S32 snd_frag_size; + S32 snd_last_frag; + S32 snd_last_write; + S32 snd_skip_time; + U32 snd_last_play; + U32 snd_last_move; + S32 snd_last_timer; + + void * buffer[ 2 ]; + U32 physical[ 2 ]; + + #ifdef AX_OUTPUT_BUFFER_DOUBLE + AXVPB* voice[ 2 ]; + #endif + +#endif + +#ifdef XAUDIOFRAMESIZE_NATIVE + XAUDIOPACKET packet; +#endif + +} DIG_DRIVER; + +#ifdef MILES_CHECK_OFFSETS + RR_COMPILER_ASSERT((RR_MEMBER_OFFSET(DIG_DRIVER, filter_num) & 3) == 0); +#endif + +typedef struct // MIDI status log structure + { + S32 program [NUM_CHANS]; // Program Change + S32 pitch_l [NUM_CHANS]; // Pitch Bend LSB + S32 pitch_h [NUM_CHANS]; // Pitch Bend MSB + + S32 c_lock [NUM_CHANS]; // Channel Lock + S32 c_prot [NUM_CHANS]; // Channel Lock Protection + S32 c_mute [NUM_CHANS]; // Channel Mute + S32 c_v_prot [NUM_CHANS]; // Voice Protection + S32 bank [NUM_CHANS]; // Patch Bank Select + S32 gm_bank_l [NUM_CHANS]; // GM Bank Select + S32 gm_bank_m [NUM_CHANS]; // GM Bank Select + S32 indirect [NUM_CHANS]; // ICA indirect controller value + S32 callback [NUM_CHANS]; // Callback Trigger + + S32 mod [NUM_CHANS]; // Modulation + S32 vol [NUM_CHANS]; // Volume + S32 pan [NUM_CHANS]; // Panpot + S32 exp [NUM_CHANS]; // Expression + S32 sus [NUM_CHANS]; // Sustain + S32 reverb [NUM_CHANS]; // Reverb + S32 chorus [NUM_CHANS]; // Chorus + + S32 bend_range[NUM_CHANS]; // Bender Range (data MSB, RPN 0 assumed) + + S32 RPN_L [NUM_CHANS]; // RPN # LSB + S32 RPN_M [NUM_CHANS]; // RPN # MSB + } +CTRL_LOG; + +typedef struct _SEQUENCE // XMIDI sequence state table +{ + char tag[4]; // HSEQ + + HMDIDRIVER driver; // Driver for playback + + U32 status; // SEQ_ flagsstruct + + void const *TIMB; // XMIDI IFF chunk pointers + void const *RBRN; + void const *EVNT; + + U8 const *EVNT_ptr; // Current event pointer + + U8 *ICA; // Indirect Controller Array + + AILPREFIXCB prefix_callback; // XMIDI Callback Prefix handler + AILTRIGGERCB trigger_callback; // XMIDI Callback Trigger handler + AILBEATCB beat_callback; // XMIDI beat/bar change handler + AILSEQUENCECB EOS; // End-of-sequence callback function + + S32 loop_count; // 0=one-shot, -1=indefinite, ... + + S32 interval_count; // # of intervals until next event + S32 interval_num; // # of intervals since start + + S32 volume; // Sequence volume 0-127 + S32 volume_target; // Target sequence volume 0-127 + S32 volume_accum; // Accumulated volume period + S32 volume_period; // Period for volume stepping + + S32 tempo_percent; // Relative tempo percentage 0-100 + S32 tempo_target; // Target tempo 0-100 + S32 tempo_accum; // Accumulated tempo period + S32 tempo_period; // Period for tempo stepping + S32 tempo_error; // Error counter for tempo DDA + + S32 beat_count; // Sequence playback position + S32 measure_count; + + S32 time_numerator; // Sequence timing data + S32 time_fraction; + S32 beat_fraction; + S32 time_per_beat; + + U8 const *FOR_ptrs[FOR_NEST]; // Loop stack + S32 FOR_loop_count [FOR_NEST]; + + S32 chan_map [NUM_CHANS]; // Physical channel map for sequence + + CTRL_LOG shadow; // Controller values for sequence + + S32 note_count; // # of notes "on" + + S32 note_chan [MAX_NOTES]; // Channel for queued note (-1=free) + S32 note_num [MAX_NOTES]; // Note # for queued note + S32 note_time [MAX_NOTES]; // Remaining duration in intervals + + SINTa user_data [8]; // Miscellaneous user data + SINTa system_data[8]; // Miscellaneous system data + +} SEQUENCE; + +#if defined(IS_MAC) || defined(IS_LINUX) || defined(IS_XENON) || defined(IS_PS3) || defined(IS_WII) || defined(IS_PSP) || defined(IS_PSP2) || defined(__RADWINRTAPI__) || defined(__RADSEKRIT2__) || defined(__RADANDROID__) + +struct MIDIHDR; +struct MIDIOUT; +typedef struct MIDIOUT* HMIDIOUT; +typedef HMIDIOUT* LPHMIDIOUT; + +#endif + +typedef struct _MDI_DRIVER // Handle to XMIDI driver +{ + char tag[4]; // HMDI + + HTIMER timer; // XMIDI quantization timer + S32 interval_time; // XMIDI quantization timer interval in uS + + HSEQUENCE sequences; // Pointer to list of SEQUENCEs + S32 n_sequences; // # of SEQUENCEs + + S32 lock [NUM_CHANS]; // 1 if locked, 2 if protected, else 0 + HSEQUENCE locker[NUM_CHANS]; // HSEQUENCE which locked channel + HSEQUENCE owner [NUM_CHANS]; // HSEQUENCE which owned locked channel + HSEQUENCE user [NUM_CHANS]; // Last sequence to use channel + S32 state [NUM_CHANS]; // Lock state prior to being locked + + S32 notes [NUM_CHANS]; // # of active notes in channel + + AILEVENTCB event_trap; // MIDI event trap callback function + AILTIMBRECB timbre_trap; // Timbre request callback function + + S32 master_volume; // Master XMIDI note volume 0-127 + + SINTa system_data[8]; // Miscellaneous system data + +#if (defined(IS_WINDOWS) && !defined(__RADWINRTAPI__)) || defined(IS_MAC) || defined(IS_LINUX) + + S32 released; // has the hmidiout handle been released + U32 deviceid; // ID of the MIDI device + U8 *sysdata; // SysEx buffer + +#endif + +#if defined(IS_XENON) || defined(IS_WII) || defined(IS_PS3) || defined(IS_PSP) || defined(IS_3DS) || defined(IS_IPHONE) || defined(IS_PSP2) || defined(IS_WIIU) || defined(__RADWINRTAPI__) || defined(__RADSEKRIT2__) || defined(__RADANDROID__) + HMDIDRIVER next; // Pointer to next HMDIDRIVER in use +#endif + +#ifdef IS_LINUX + struct MIDIHDR *mhdr; // SysEx header + HMDIDRIVER next; // Pointer to next HMDIDRIVER in use + HMIDIOUT hMidiOut; // MIDI output driver +#endif + +#if defined(IS_WINDOWS) && !defined(__RADWINRTAPI__) + + struct midihdr_tag *mhdr; // SysEx header + + HMDIDRIVER next; // Pointer to next HMDIDRIVER in use + + HMIDIOUT hMidiOut; // MIDI output driver + +#else + + #if defined(IS_MAC) + struct MIDIHDR *mhdr; // SysEx header + HMDIDRIVER next; // Pointer to next HMDIDRIVER in use + HMIDIOUT hMidiOut; // MIDI output driver + #endif + +#endif + +} MDI_DRIVER; + +#if defined(IS_WIN32API) || defined(IS_WII) + #pragma pack(push, 1) +#endif + +typedef MSS_STRUCT // XMIDI TIMB IFF chunk + { + S8 name[4]; + + U8 msb; + U8 lsb; + U8 lsb2; + U8 lsb3; + + U16 n_entries; + + U16 timbre[1]; + } +TIMB_chunk; + +typedef MSS_STRUCT // XMIDI RBRN IFF entry + { + S16 bnum; + U32 offset; + } +RBRN_entry; + +#if defined(IS_WIN32API) || defined(IS_WII) + #pragma pack(pop) +#endif + +typedef struct // Wave library entry +{ + S32 bank; // XMIDI bank, MIDI patch for sample + S32 patch; + + S32 root_key; // Root MIDI note # for sample (or -1) + + U32 file_offset; // Offset of wave data from start-of-file + U32 size; // Size of wave sample in bytes + + S32 format; // DIG_F format (8/16 bits, mono/stereo) + S32 playback_rate; // Playback rate in hertz +} +WAVE_ENTRY; + +typedef struct // Virtual "wave synthesizer" descriptor +{ + HMDIDRIVER mdi; // MIDI driver for use with synthesizer + HDIGDRIVER dig; // Digital driver for use with synthesizer + + WAVE_ENTRY *library; // Pointer to wave library + + AILEVENTCB prev_event_fn; // Previous MIDI event trap function + AILTIMBRECB prev_timb_fn; // Previous timbre request trap function + + CTRL_LOG controls; // MIDI controller states + + WAVE_ENTRY *wave [NUM_CHANS];// Pointer to WAVE_ENTRY for each channel + + HSAMPLE S [MAX_W_VOICES]; // List of HSAMPLE voices + S32 n_voices; // Actual # of voices allocated to synth + + S32 chan [MAX_W_VOICES]; // MIDI channel for each voice, or -1 + S32 note [MAX_W_VOICES]; // MIDI note number for voice + S32 root [MAX_W_VOICES]; // MIDI root note for voice + S32 rate [MAX_W_VOICES]; // Playback rate for voice + S32 vel [MAX_W_VOICES]; // MIDI note velocity for voice + U32 time [MAX_W_VOICES]; // Timestamp for voice + + U32 event; // Event counter for LRU timestamps +} +WAVE_SYNTH; + +typedef WAVE_SYNTH * HWAVESYNTH;// Handle to virtual wave synthesizer + + +// +// DIG_DRIVER list +// + +extern HDIGDRIVER DIG_first; + +// +// MDI_DRIVER list +// + +extern HMDIDRIVER MDI_first; + +// +// Miscellaneous system services +// + +#define FILE_READ_WITH_SIZE ((void*)(SINTa)-1) + + +typedef void * (AILCALLBACK *AILMEMALLOCCB)(UINTa size); +typedef void (AILCALLBACK *AILMEMFREECB)(void *); + +#define AIL_mem_alloc_lock_trk(size) AIL_mem_alloc_lock_info( size, __FILE__, __LINE__ ) +#define AIL_file_read_trk(file,dest) AIL_file_read_info( file, dest, __FILE__, __LINE__ ) +#define AIL_file_size_trk(file) AIL_file_size_info( file, __FILE__, __LINE__ ) + +//#define MSS_NONTRACKED +#ifdef MSS_NONTRACKED + DXDEC void * AILCALL AIL_mem_alloc_lock(UINTa size); + DXDEC void * AILCALL AIL_file_read(char const * filename, void * dest ); + DXDEC S32 AILCALL AIL_file_size(char const * filename ); +#else + #define AIL_mem_alloc_lock(size) AIL_mem_alloc_lock_trk(size) + #define AIL_file_read(file,dest) AIL_file_read_trk(file,dest) + #define AIL_file_size(file) AIL_file_size_trk(file) +#endif + +DXDEC void * AILCALL AIL_mem_alloc_lock_info(UINTa size, char const * file, U32 line); +DXDEC void AILCALL AIL_mem_free_lock (void *ptr); + + +DXDEC S32 AILCALL AIL_file_error (void); + +DXDEC S32 AILCALL AIL_file_size_info(char const *filename, + char const * caller, + U32 line); + +DXDEC void * AILCALL AIL_file_read_info(char const *filename, + void *dest, + char const * caller, + U32 line); + +DXDEC S32 AILCALL AIL_file_write (char const *filename, + void const *buf, + U32 len); + +DXDEC S32 AILCALL AIL_WAV_file_write + (char const *filename, + void const *buf, + U32 len, + S32 rate, + S32 format); + +DXDEC S32 AILCALL AIL_file_append (char const *filename, + void const *buf, U32 len); + +DXDEC AILMEMALLOCCB AILCALL AIL_mem_use_malloc(AILMEMALLOCCB fn); +DXDEC AILMEMFREECB AILCALL AIL_mem_use_free (AILMEMFREECB fn); + + +#define MSSBreakPoint RR_BREAK + + +// +// Compiler-independent CRTL helper functions for PS2 +// Exported here for use in demo programs as well as MSS itself +// + +#if defined(IS_PSP) + + DXDEC F32 AILCALL AIL_sin(F32 x); + DXDEC F32 AILCALL AIL_cos(F32 x); + DXDEC F32 AILCALL AIL_tan( F32 x ); + DXDEC F32 AILCALL AIL_acos(F32 x); + DXDEC F32 AILCALL AIL_atan(F32 x); + DXDEC F32 AILCALL AIL_ceil( F32 x ); + DXDEC F32 AILCALL AIL_floor( F32 x ); + DXDEC F32 AILCALL AIL_fsqrt( F32 x ); + DXDEC F32 AILCALL AIL_fabs ( F32 x ); + DXDEC F32 AILCALL AIL_log10( F32 x ); + DXDEC F32 AILCALL AIL_log( F32 x ); + DXDEC F32 AILCALL AIL_pow( F32 x, F32 p ); + DXDEC F32 AILCALL AIL_frexpf( F32 x, S32 *pw2 ); + DXDEC F32 AILCALL AIL_ldexpf( F32 x, S32 pw2 ); + #define AIL_exp(x) AIL_pow(2.718281828F,(x)) + +#else + + #ifdef IS_WATCOM + #define AIL_pow powf + #define AIL_tan tanf + #else + #define AIL_tan tan + #define AIL_pow pow + #endif + + #define AIL_sin sin + #define AIL_cos cos + #define AIL_acos acos + #define AIL_atan atan + #define AIL_ceil ceil + #define AIL_floor floor + + #if defined(IS_PS3) && !defined(IS_SPU) + DXDEC F32 AILCALL AIL_fsqrt( F32 val ); + #else + #define AIL_fsqrt(arg) ((F32) sqrt(arg)) + #endif + + #define AIL_fabs fabs + #define AIL_log10 log10 + #define AIL_log log + #define AIL_frexpf(a1,a2) ((F32) frexp(a1,a2)) + #define AIL_ldexpf(a1,a2) ((F32) ldexp(a1,a2)) + #define AIL_exp exp + +#endif + +// +// High-level support services +// + +DXDEC S32 AILCALL AIL_startup (void); + +DXDEC SINTa AILCALL AIL_get_preference (U32 number); + +DXDEC void AILCALL AIL_shutdown (void); + +DXDEC SINTa AILCALL AIL_set_preference (U32 number, + SINTa value); + +DXDEC char *AILCALL AIL_last_error (void); + +DXDEC void AILCALL AIL_set_error (char const * error_msg); + +#ifdef IS_WIIU +DXDEC void AILCALL AIL_set_wiiu_file_client (void* ptr_to_fsclient, void* ptr_to_fscmdblock); +#endif + +#ifdef __RADIPHONE__ +// +// On iOS, audio session interruptions stop the audio queues, and we have to manually restart them. +// +// This should be called whenever you get an Interruption Ended msg via your Audio Session callback. +// +DXDEC void AILCALL AIL_ios_post_audio_session_interrupt_end(HDIGDRIVER dig); +#endif + +// +// Low-level support services +// + +#ifdef IS_X86 + +DXDEC U32 AILCALL AIL_MMX_available (void); + +#endif + +#define AIL_lock AIL_lock_mutex +#define AIL_unlock AIL_unlock_mutex + +DXDEC void AILCALL AIL_lock_mutex (void); +DXDEC void AILCALL AIL_unlock_mutex (void); + +#define AIL_delay AIL_sleep +DXDEC void AILCALL AIL_sleep (U32 ms); + +DXDEC AILTRACECB AILCALL AIL_configure_logging (char const * filename, + AILTRACECB cb, + S32 level); + + +// +// Process services +// + +DXDEC HTIMER AILCALL AIL_register_timer (AILTIMERCB fn); + +DXDEC UINTa AILCALL AIL_set_timer_user (HTIMER timer, + UINTa user); + +DXDEC void AILCALL AIL_set_timer_period (HTIMER timer, + U32 microseconds); + +DXDEC void AILCALL AIL_set_timer_frequency (HTIMER timer, + U32 hertz); + +DXDEC void AILCALL AIL_set_timer_divisor (HTIMER timer, + U32 PIT_divisor); + +DXDEC void AILCALL AIL_start_timer (HTIMER timer); +DXDEC void AILCALL AIL_start_all_timers (void); + +DXDEC void AILCALL AIL_stop_timer (HTIMER timer); +DXDEC void AILCALL AIL_stop_all_timers (void); + +DXDEC void AILCALL AIL_release_timer_handle (HTIMER timer); +DXDEC void AILCALL AIL_release_all_timers (void); + +DXDEC S32 AILCALL AIL_timer_thread_handle(void* o_handle); + +#ifdef IS_MAC + #if defined(__PROCESSES__) + DXDEC ProcessSerialNumber AIL_Process(void); + #endif +#endif + +// +// high-level digital services +// + +#define AIL_OPEN_DIGITAL_FORCE_PREFERENCE 1 +#define AIL_OPEN_DIGITAL_NEED_HW_3D 2 +#define AIL_OPEN_DIGITAL_NEED_FULL_3D 4 +#define AIL_OPEN_DIGITAL_NEED_LIGHT_3D 8 +#define AIL_OPEN_DIGITAL_NEED_HW_REVERB 16 +#define AIL_OPEN_DIGITAL_NEED_REVERB 32 +#define AIL_OPEN_DIGITAL_USE_IOP_CORE0 64 + +#define AIL_OPEN_DIGITAL_USE_SPU0 (1<<24) +#define AIL_OPEN_DIGITAL_USE_SPU1 (2<<24) +#define AIL_OPEN_DIGITAL_USE_SPU2 (3<<24) +#define AIL_OPEN_DIGITAL_USE_SPU3 (4<<24) +#define AIL_OPEN_DIGITAL_USE_SPU4 (5<<24) +#define AIL_OPEN_DIGITAL_USE_SPU5 (6<<24) +#define AIL_OPEN_DIGITAL_USE_SPU6 (7<<24) + +#define AIL_OPEN_DIGITAL_USE_SPU( num ) ( ( num + 1 ) << 24 ) + +#ifdef IS_GENERICDIG + + struct _RadSoundSystem; + typedef S32 (*RADSS_OPEN_FUNC)(struct _RadSoundSystem* i_SoundSystem, U32 i_MinBufferSizeInMs, U32 i_Frequency, U32 i_ChannelCount, U32 i_MaxLockSize, U32 i_Flags); + + DXDEC HDIGDRIVER AILCALL AIL_open_generic_digital_driver(U32 frequency, S32 bits, S32 channel, U32 flags, RADSS_OPEN_FUNC dig_open); + + #ifdef IS_WIN32 + DXDEC RADSS_OPEN_FUNC AILCALL RADSS_DSInstallDriver(UINTa, UINTa); + DXDEC RADSS_OPEN_FUNC AILCALL RADSS_WOInstallDriver(UINTa, UINTa); + + #define AIL_open_digital_driver(frequency, bits, channel, flags) \ + AIL_open_generic_digital_driver(frequency, bits, channel, flags, RADSS_DSInstallDriver(0, 0)) + + #elif defined(IS_3DS) + DXDEC RADSS_OPEN_FUNC AILCALL RADSS_3DSInstallDriver(UINTa, UINTa); + + #define AIL_open_digital_driver(frequency, bits, channel, flags) \ + AIL_open_generic_digital_driver(frequency, bits, channel, flags, RADSS_3DSInstallDriver(0, 0)) + + #elif defined(__RADANDROID__) + + DXDEC void AILCALL AIL_set_asset_manager(void* asset_manager); + + DXDEC RADSS_OPEN_FUNC AILCALL RADSS_SLESInstallDriver(UINTa, UINTa); + + #define AIL_open_digital_driver(frequency, bits, channel, flags) \ + AIL_open_generic_digital_driver(frequency, bits, channel, flags, RADSS_SLESInstallDriver(0, 0)) + + + #elif defined(IS_PSP2) + DXDEC RADSS_OPEN_FUNC AILCALL RADSS_PSP2InstallDriver(UINTa, UINTa); + + #define AIL_open_digital_driver(frequency, bits, channel, flags) \ + AIL_open_generic_digital_driver(frequency, bits, channel, flags, RADSS_PSP2InstallDriver(0, 0)) + + #elif defined(__RADSEKRIT2__) + DXDEC RADSS_OPEN_FUNC AILCALL RADSS_SonyInstallDriver(UINTa, UINTa); + + #define AIL_open_digital_driver(frequency, bits, channel, flags) \ + AIL_open_generic_digital_driver(frequency, bits, channel, flags, RADSS_SonyInstallDriver(0, 0)) + + #elif defined(IS_PSP) + DXDEC RADSS_OPEN_FUNC AILCALL RADSS_PSPInstallDriver(UINTa, UINTa); + + #define AIL_OPEN_DIGITAL_USE_SIMPLEAUDIO ~0U + + #define AIL_open_digital_driver(frequency, bits, channel, flags) \ + AIL_open_generic_digital_driver(frequency, bits, channel, flags, RADSS_PSPInstallDriver(0, 0)) + + #elif defined(IS_XENON) || defined(__RADWINRTAPI__) + DXDEC RADSS_OPEN_FUNC AILCALL RADSS_XAudio2InstallDriver(UINTa, UINTa); + + #define AIL_open_digital_driver(frequency, bits, channel, flags) \ + AIL_open_generic_digital_driver(frequency, bits, channel, flags, RADSS_XAudio2InstallDriver(0, 0)) + + #elif defined(IS_WIIU) + DXDEC RADSS_OPEN_FUNC AILCALL RADSS_AXInstallDriver(UINTa, UINTa); + + #define AIL_open_digital_driver(frequency, bits, channel, flags) \ + AIL_open_generic_digital_driver(frequency, bits, channel, flags, RADSS_AXInstallDriver(0, 0)) + + #elif defined(IS_MAC) || defined(IS_IPHONE) + DXDEC RADSS_OPEN_FUNC AILCALL RADSS_OalInstallDriver(UINTa, UINTa); + DXDEC RADSS_OPEN_FUNC AILCALL RADSS_CAInstallDriver(UINTa, UINTa); + + #define AIL_open_digital_driver(frequency, bits, channel, flags) \ + AIL_open_generic_digital_driver(frequency, bits, channel, flags, RADSS_CAInstallDriver(0, 0)) + + #elif defined(IS_LINUX) + DXDEC RADSS_OPEN_FUNC AILCALL RADSS_OalInstallDriver(UINTa, UINTa); + + #define AIL_open_digital_driver(frequency, bits, channel, flags) \ + AIL_open_generic_digital_driver(frequency, bits, channel, flags, RADSS_OalInstallDriver(0, 0)) + #endif +#else // IS_GENERICDIG + +DXDEC HDIGDRIVER AILCALL AIL_open_digital_driver( U32 frequency, + S32 bits, + S32 channel, + U32 flags ); + +#endif // not IS_GENERICDIG + +DXDEC void AILCALL AIL_close_digital_driver( HDIGDRIVER dig ); + +#ifdef IS_LINUX + +#define AIL_MSS_version(str,len) \ +{ \ + strncpy(str, MSS_VERSION, len); \ +} + +DXDEC S32 AILCALL AIL_digital_handle_release(HDIGDRIVER drvr); + +DXDEC S32 AILCALL AIL_digital_handle_reacquire + (HDIGDRIVER drvr); +#elif defined( IS_WINDOWS ) + +#define AIL_MSS_version(str,len) \ +{ \ + HINSTANCE l=LoadLibrary(MSSDLLNAME); \ + if ((UINTa)l<=32) \ + *(str)=0; \ + else { \ + LoadString(l,1,str,len); \ + FreeLibrary(l); \ + } \ +} + +DXDEC S32 AILCALL AIL_digital_handle_release(HDIGDRIVER drvr); + +DXDEC S32 AILCALL AIL_digital_handle_reacquire + (HDIGDRIVER drvr); + +#elif defined( IS_MAC ) + +#if defined(__RESOURCES__) + + typedef MSS_STRUCT MSS_VersionType_ + { + Str255 version_name; + } MSS_VersionType; + + #define AIL_MSS_version(str,len) \ + { \ + long _res = HOpenResFile(0,0,"\p" MSSDLLNAME,fsRdPerm); \ + if (_res==-1) \ + { \ + str[0]=0; \ + } \ + else \ + { \ + Handle _H; \ + short _Err; \ + long _cur= CurResFile(); \ + UseResFile(_res); \ + _H = GetResource('vers', 2); \ + _Err = ResError(); \ + if((_Err != noErr) || (_H==0)) \ + { \ + str[0]=0; \ + UseResFile(_cur); \ + CloseResFile(_res); \ + } \ + else \ + { \ + if (GetHandleSize(_H)==0) \ + { \ + str[0]=0; \ + UseResFile(_cur); \ + CloseResFile(_res); \ + } \ + else \ + { \ + MSS_VersionType * _vt = (MSS_VersionType*)*_H; \ + if ((U32)_vt->version_name[6]>4) \ + _vt->version_name[6]-=4; \ + else \ + _vt->version_name[6]=0; \ + if (((U32)len) <= ((U32)_vt->version_name[6])) \ + _vt->version_name[6] = (U8)len-1; \ + memcpy( str, _vt->version_name+11, _vt->version_name[6] ); \ + str[_vt->version_name[6]]=0; \ + UseResFile(_cur); \ + CloseResFile(_res); \ + } \ + ReleaseResource(_H); \ + } \ + } \ + } + + #endif + + DXDEC S32 AILCALL AIL_digital_handle_release(HDIGDRIVER drvr); + + DXDEC S32 AILCALL AIL_digital_handle_reacquire + (HDIGDRIVER drvr); + +#endif + +DXDEC void AILCALL AIL_debug_log (char const * ifmt, ...); + +DXDEC S32 AILCALL AIL_sprintf(char *dest, + char const *fmt, ...); + +DXDEC char* AILCALL AIL_set_redist_directory(char const*dir); + +DXDEC S32 AILCALL AIL_background_CPU_percent (void); + +DXDEC S32 AILCALL AIL_digital_CPU_percent (HDIGDRIVER dig); + +#ifdef HOST_SPU_PROCESS +DXDEC S32 AILCALL AIL_digital_SPU_percent (HDIGDRIVER dig); +#endif + +DXDEC S32 AILCALL AIL_digital_latency (HDIGDRIVER dig); + +DXDEC HSAMPLE AILCALL AIL_allocate_sample_handle + (HDIGDRIVER dig); + + +EXPGROUP(Digital Audio Services) + +#define MILES_PUSH_REVERB 1 +#define MILES_PUSH_VOLUME 2 +#define MILES_PUSH_3D 4 +#define MILES_PUSH_RESET 8 + +DXDEC EXPAPI void AILCALL AIL_push_system_state(HDIGDRIVER dig, U32 flags, S16 crossfade_ms); +/* + Pushes the current system state, allowing for a temporary "clean" driver to use, and then + revert from. + + $:dig The driver to push + $:flags Logical "or" of options controlling the extent of the push. See discussion. + $:crossfade_ms The number of milliseconds to fade the transition over. [0, 32767] + + By default (ie flags == 0), effectively nothing happens. Since the operation neither affects + any subsystems nor resets the playing samples, a push immediately followed by a pop should + have no audible effects. + + However, any samples started during the push will be stopped (via $AIL_end_fade_sample) when the system is popped. + Streams will return SMP_DONE via $AIL_stream_status. It is up to the client code to perform any cleanup required. + + The flags can alter the above behavior in the following ways: + + $* MILES_PUSH_RESET - This flag causes the system to revert to a "new" state when pushed. Without any + other flags this will only be apparent with samples - any playing samples will cease to be processed + (though they will still report SMP_PLAYING). When the system is popped, these samples will resume. + + $* MILES_PUSH_REVERB - When present, reverb state will be affected in addition to sample state. + If MILES_PUSH_RESET is present, the reverb will be cleared to zero on push. Otherwise, it will be retained, + and only affected when popped. + + $* MILES_PUSH_3D - When present, 3d listener state will be affected in addition to sample state. + If MILES_PUSH_RESET is present, the 3d listener state will be reverted to the same state as a new driver. Otherwise + it will be retained and only affected when popped. + + $* MILES_PUSH_VOLUME - When present, master volume will be affected in addition to sample state. + If MILES_PUSH_RESET is present, the master volume will be set to 1.0f, otherwise it will be retained and only + affected when popped. + + $- + + If you want more control over whether a sample will be affected by a push or a pop operation, + see $AIL_set_sample_level_mask. + +*/ + +DXDEC EXPAPI void AILCALL AIL_pop_system_state(HDIGDRIVER dig, S16 crossfade_ms); +/* + Pops the current system state and returns the system to the way it + was before the last push. + + $:dig The driver to pop. + $:crossfade_ms The number of milliseconds to crossfade the transition over - [0, 32767] + + See $AIL_push_system_state for documentation. +*/ + +DXDEC EXPAPI U8 AILCALL AIL_system_state_level(HDIGDRIVER dig); +/* + Returns the current level the system has been pushed to. + + $:dig The driver to inspect + $:return A value between 0 and MILES_MAX_STATES, representing the depth of the current system stack. +*/ + +DXDEC EXPAPI void AILCALL AIL_set_sample_level_mask(HSAMPLE S, U8 mask); +/* + Sets the system levels at which a sample will play. + + $:S The sample to set the mask for. + $:mask The bitmask of levels for which the sample will play. + + Under normal push/pop operations, a sample's mask is set when it is + started to the level the system is at. If the system is pushed + without a reset, then the mask is adjusted to include the new level. + When a system is popped, if the sample is going to continue playing, + the state mask is adjusted to remove the level the system is popping + from. + + If you have a sample playing on a higher system level that needs + to continue after a pop, you can adjust the sample's mask by using + this function in conjunction with $AIL_system_state_level and + $AIL_sample_level_mask: + + ${ + AIL_set_sample_level_mask(S, AIL_sample_level_mask(S) |= (1 << (AIL_system_state_level(dig) - 1))); + $} +*/ + +DXDEC EXPAPI U8 AILCALL AIL_sample_level_mask(HSAMPLE S); +/* + Return the mask used to determine if the sample will play at a given system level. + + $:S The sample to inspect. + $:return The level mask for the sample. + + See $AIL_set_sample_level_mask. +*/ + +DXDEC EXPAPI U64 AILCALL AIL_digital_mixed_samples(HDIGDRIVER dig); +/* + Returns the number of samples that have been mixed in to the hardware. + + Used for timing samples for start via $AIL_schedule_start_sample. +*/ + +#define AIL_digital_samples_per_second(dig) (dig->DMA_rate) + + +DXDEC EXPAPI void AILCALL AIL_enable_limiter(HDIGDRIVER dig, S32 on_off); +/* + Enables a basic limiter to prevent clipping. + + $:dig The driver to enable the limiter on. + $:on_off If non-zero, the limiter will be enabled, otherwise it will be disabled. + + By default limiters are off. Currently they are not configurable. They kick on around + -10 db, and with a 0db signal will attenuate by about -18 db. Limiters run prior to + the 16 bit clamp. + + See also $AIL_bus_enable_limiter. +*/ + +EXPGROUP(bus_section) + +DXDEC EXPAPI HSAMPLE AILCALL AIL_allocate_bus(HDIGDRIVER dig); +/* + Allocates a bus to mix samples to. + + $:dig The HDIGDRIVER to allocate the bus on. + $:return The HSAMPLE for the new bus. + + A bus allows you to treat a group of samples as one sample. With the bus sample you can + do almost all of the things you can do with a normal sample handle. The only exception + is you can't adjust the playback rate of the sample. + + Use $AIL_bus_sample_handle to get the HSAMPLE associated with a bus. + + Each call to AIL_allocate_bus adds a new bus, up to a total bus count of MAX_BUSSES. After + the first call, two busses exist - the main bus and the first aux bus. The HSAMPLE returned + is for the first aux bus (index 1) +*/ + +DXDEC EXPAPI void AILCALL AIL_bus_enable_limiter(HDIGDRIVER dig, S32 bus_index, S32 on_off); +/* + Enables a basic limiter to prevent clipping. + + $:dig The driver containing the bus to enable the limiter on. + $:bus_index The index of the bus to enable the limiter on. + $:on_off If non-zero, the limiter will be enabled, otherwise it will be disabled. + + By default limiters are off. Currently they are not configurable. They kick on around + -10 db, and with a 0db signal will attenuate by about -18 db. Limiters run prior to + the 16 bit clamp. + + See also $AIL_enable_limiter. +*/ + +DXDEC EXPAPI HSAMPLE AILCALL AIL_bus_sample_handle(HDIGDRIVER dig, S32 bus_index); +/* + Returns the HSAMPLE associated with a bus. + + $:dig The HDIGDRIVER the bus resides within. + $:bus_index The index of the bus to return the HSAMPLE for. + $:return The HSAMPLE for the bus index. + + If the bus has not been allocated, or no busses have been allocated, this returns 0. This + means that for the "Main Bus" - index 0 - it will still return zero if no additional busses + have been allocated. +*/ + +DXDEC EXPAPI void AILCALL AIL_set_sample_bus(HSAMPLE S, S32 bus_index); +/* + Assigns an HSAMPLE to a bus. + + $:S The HSAMPLE to assign. + $:bus_index The bus index to assign the sample to. + + If the given bus has not been allocated, this function has no effect. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_sample_bus(HSAMPLE S); +/* + Returns the bus an HSAMPLE is assigned to. + + $:S The HSAMPLE to check. + $:return The index of the bus the sample is assigned. + + All samples by default are assigned to bus 0. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_install_bus_compressor(HDIGDRIVER dig, S32 bus_index, SAMPLESTAGE filter_stage, S32 input_bus_index); +/* + Installs the Compressor filter on to a bus, using another bus as the input for + compression/limiting. + + $:dig The driver the busses exist on. + $:bus_index The index of the bus the compressor will affect. + $:filter_stage The SAMPLESTAGE the compressor will use on the bus HSAMPLE. + $:input_bus_index The bus index the compressor will use as input. + + This installs a side chain compressor in to a given bus. It acts exactly like + any other filter you would put on an HSAMPLE, except the input_bus_index bus pipe's + its signal strength to the filter, allowing it to attenuate the bus_index bus based + on another bus's contents. + + To control the compressor parameters, access the bus's HSAMPLE via $AIL_bus_sample_handle and + use $AIL_sample_stage_property exactly as you would any other filter. The filter's properties + are documented under $(Compressor Filter) +*/ + +DXDEC void AILCALL AIL_set_speaker_configuration + (HDIGDRIVER dig, + MSSVECTOR3D *array, + S32 n_channels, + F32 falloff_power); + +DXDEC MSSVECTOR3D * + AILCALL AIL_speaker_configuration + (HDIGDRIVER dig, + S32 *n_physical_channels, + S32 *n_logical_channels, + F32 *falloff_power, + MSS_MC_SPEC *channel_spec); + +DXDEC void AILCALL AIL_set_listener_relative_receiver_array + (HDIGDRIVER dig, + MSS_RECEIVER_LIST *array, + S32 n_receivers); + +DXDEC MSS_RECEIVER_LIST * + AILCALL AIL_listener_relative_receiver_array + (HDIGDRIVER dig, + S32 *n_receivers); +DXDEC void AILCALL AIL_set_speaker_reverb_levels + (HDIGDRIVER dig, + F32 *wet_array, + F32 *dry_array, + MSS_SPEAKER const *speaker_index_array, + S32 n_levels); + +DXDEC S32 AILCALL AIL_speaker_reverb_levels (HDIGDRIVER dig, + F32 * *wet_array, + F32 * *dry_array, + MSS_SPEAKER const * *speaker_index_array); + + +DXDEC +void AILCALL AIL_set_sample_speaker_scale_factors (HSAMPLE S, //) + MSS_SPEAKER const * dest_speaker_indexes, + F32 const * levels, + S32 n_levels ); +DXDEC +void AILCALL AIL_sample_speaker_scale_factors (HSAMPLE S, //) + MSS_SPEAKER const * dest_speaker_indexes, + F32 * levels, + S32 n_levels ); + +DXDEC +S32 AILEXPORT AIL_set_sample_is_3D (HSAMPLE S, //) + S32 onoff); + +//DXDEC F32 AILEXPORT AIL_calculate_sample_final_attenuation(HSAMPLE S); +/* + Returns the attenuation that a sample will have. + + $:S Sample to compute. +*/ + +DXDEC +S32 AILEXPORT AIL_calculate_3D_channel_levels (HDIGDRIVER dig, //) + F32 *channel_levels, + MSS_SPEAKER const * *speaker_array, + MSSVECTOR3D *src_pos, + MSSVECTOR3D *src_face, + MSSVECTOR3D *src_up, + F32 src_inner_angle, + F32 src_outer_angle, + F32 src_outer_volume, + F32 src_max_dist, + F32 src_min_dist, + MSSVECTOR3D *listen_pos, + MSSVECTOR3D *listen_face, + MSSVECTOR3D *listen_up, + F32 rolloff_factor, + MSSVECTOR3D *doppler_velocity, + F32 *doppler_shift); + + +DXDEC void AILCALL AIL_release_sample_handle (HSAMPLE S); + +DXDEC S32 AILCALL AIL_init_sample (HSAMPLE S, + S32 format); + +DXDEC S32 AILCALL AIL_set_sample_file (HSAMPLE S, + void const *file_image, + S32 block); + +DXDEC S32 AILCALL AIL_set_sample_info (HSAMPLE S, + AILSOUNDINFO const * info); + +DXDEC S32 AILCALL AIL_set_named_sample_file (HSAMPLE S, + C8 const *file_type_suffix, + void const *file_image, + U32 file_size, + S32 block); + +DXDEC HPROVIDER AILCALL AIL_set_sample_processor (HSAMPLE S, + SAMPLESTAGE pipeline_stage, + HPROVIDER provider); + +DXDEC HPROVIDER AILCALL AIL_set_digital_driver_processor + (HDIGDRIVER dig, + DIGDRVSTAGE pipeline_stage, + HPROVIDER provider); + +DXDEC HPROVIDER AILCALL AIL_sample_processor (HSAMPLE S, + SAMPLESTAGE pipeline_stage); + +DXDEC HPROVIDER AILCALL AIL_digital_driver_processor + (HDIGDRIVER dig, + DIGDRVSTAGE pipeline_stage); + +DXDEC void AILCALL AIL_set_sample_adpcm_block_size + (HSAMPLE S, + U32 blocksize); + +DXDEC void AILCALL AIL_set_sample_address (HSAMPLE S, + void const *start, + U32 len); + +DXDEC void AILCALL AIL_start_sample (HSAMPLE S); + +EXPGROUP(Digital Audio Services) + +DXDEC EXPAPI void AILCALL AIL_schedule_start_sample(HSAMPLE S, U64 mix_time_to_start); +/* + Marks the specified sample to begin at the exact time specified. + + $:S The sample to start + $:mix_time_to_start The time to start the sample, in samples. + + Once set, the sample will have $AIL_start_sample called automatically + when the mixer reaches the specified time. The sample's delay will + be automatically adjusted such that the sample starts mid-block. + + ${ + // Get the current time. + U64 mix_time = AIL_digital_mixed_samples(dig); + + // Schedule to start 1 second out + mix_time += AIL_digital_samples_per_second(dig); + AIL_schedule_start_sample(S, mix_time ); + $} +*/ + +DXDEC EXPAPI U64 AILCALL AIL_sample_schedule_time(HSAMPLE S); +/* + Returns the mix time the sample is scheduled to start at, or 0 if not scheduled. + + $:S The sample to query. +*/ + +DXDEC void AILCALL AIL_stop_sample (HSAMPLE S); + +DXDEC void AILCALL AIL_end_fade_sample (HSAMPLE S); + +DXDEC void AILCALL AIL_resume_sample (HSAMPLE S); + +DXDEC void AILCALL AIL_end_sample (HSAMPLE S); + +DXDEC EXPAPI void AILCALL AIL_set_sample_id(HSAMPLE S, S32 id); +/* + Set an ID on a sample for use in synchronized control. + + $:S The sample to alter + $:id The id to use. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_sample_id(HSAMPLE S); +/* + Return the current ID for a sample. + + $:S Sample to access +*/ + +DXDEC EXPAPI void AILCALL AIL_start_sample_group(HDIGDRIVER dig, S32 start_id, S32 set_to_id); +/* + Start a group of samples at the same time. + + $:dig The driver the samples are allocated from. + $:start_id The ID to start + $:set_to_id The ID to set the samples to once they have started. + + This function atomically calls $AIL_start_sample on all the samples to ensure the samples start in sync. +*/ + +DXDEC EXPAPI void AILCALL AIL_stop_sample_group(HDIGDRIVER dig, S32 stop_id, S32 set_to_id); +/* + Stops a group of samples at the same time. + + $:dig The driver the samples are allocated from. + $:stop_id The ID to stop + $:set_to_id The ID to set the samples to once they have stopped. + + This function atomically calls $AIL_stop_sample on all the samples to ensure they stop at the same point. +*/ + +DXDEC EXPAPI void AILCALL AIL_resume_sample_group(HDIGDRIVER dig, S32 resume_id, S32 set_to_id); +/* + Resumes a group of samples at the same time. + + $:dig The driver the samples are allocated from. + $:resume_id The ID to resume + $:set_to_id The ID to set the samples to once they have resumed. + + This function atomically calls $AIL_resume_sample on all the samples to ensure the samples start in sync. +*/ + +DXDEC EXPAPI void AILCALL AIL_end_sample_group(HDIGDRIVER dig, S32 end_id); +/* + Ends a group of samples at the same time. + + $:dig The driver the samples are allocated from. + $:end_id The ID to end + + This function atomically calls $AIL_end_sample on all the samples. +*/ + +DXDEC void AILCALL AIL_set_sample_playback_rate + (HSAMPLE S, + S32 playback_rate); + +DXDEC void AILCALL AIL_set_sample_playback_rate_factor + (HSAMPLE S, + F32 playback_rate_factor); + +DXDEC void AILCALL AIL_set_sample_playback_delay + (HSAMPLE S, + S32 playback_delay); + +DXDEC void AILCALL AIL_set_sample_volume_pan (HSAMPLE S, + F32 volume, + F32 pan); + +DXDEC void AILCALL AIL_set_sample_volume_levels(HSAMPLE S, + F32 left_level, + F32 right_level); + +DXDEC void AILCALL AIL_set_sample_channel_levels (HSAMPLE S, + MSS_SPEAKER const *source_speaker_indexes, + MSS_SPEAKER const *dest_speaker_indexes, + F32 const *levels, + S32 n_levels); + +DXDEC void AILCALL AIL_set_sample_reverb_levels(HSAMPLE S, + F32 dry_level, + F32 wet_level); + +DXDEC void AILCALL AIL_set_sample_low_pass_cut_off(HSAMPLE S, + S32 /*-1 or MSS_SPEAKER*/ channel, + F32 cut_off); + +DXDEC void AILCALL AIL_set_sample_loop_count (HSAMPLE S, + S32 loop_count); + +DXDEC void AILCALL AIL_set_sample_loop_block (HSAMPLE S, + S32 loop_start_offset, + S32 loop_end_offset); + +DXDEC EXPAPI S32 AILCALL AIL_set_sample_loop_samples(HSAMPLE S, S32 loop_start_samples, S32 loop_end_samples); +/* + Defines the loop points on a sample in samples rather than bytes. + + $:S The sample to alter. + $:loop_start_samples The sample count in to the file to start the looping. + $:loop_end_samples The sample count in the file to end the looping. + $:return 1 if successful, 0 otherwise. Check $AIL_last_error for details. + + For uncompressed samples, this largely reverts to $AIL_set_sample_loop_block, since the mapping + is straightforward. For compressed formats (like bink audio or mp3), looping in sample space is + non trivial and must be handled on a format-by-format basis. For the moment, only Bink Audio + supports this functionality - all other ASI formats will return failure. + + If a loop's length is too short, it may be extended. +*/ + + +DXDEC S32 AILCALL AIL_sample_loop_block (HSAMPLE S, + S32 *loop_start_offset, + S32 *loop_end_offset); + +DXDEC U32 AILCALL AIL_sample_status (HSAMPLE S); + +DXDEC U32 AILCALL AIL_sample_mixed_ms (HSAMPLE S); + +DXDEC S32 AILCALL AIL_sample_playback_rate (HSAMPLE S); + +DXDEC F32 AILCALL AIL_sample_playback_rate_factor (HSAMPLE S); + +DXDEC S32 AILCALL AIL_sample_playback_delay (HSAMPLE S); + +DXDEC void AILCALL AIL_sample_volume_pan (HSAMPLE S, F32* volume, F32* pan); + +DXDEC S32 AILCALL AIL_sample_channel_count (HSAMPLE S, U32 *mask); + +DXDEC void AILCALL AIL_sample_channel_levels (HSAMPLE S, + MSS_SPEAKER const *source_speaker_indexes, + MSS_SPEAKER const *dest_speaker_indexes, + F32 *levels, + S32 n_levels); + +DXDEC void AILCALL AIL_sample_volume_levels (HSAMPLE S, + F32 *left_level, + F32 *right_level); + +DXDEC void AILCALL AIL_sample_reverb_levels (HSAMPLE S, + F32 *dry_level, + F32 *wet_level); + +DXDEC F32 AILCALL AIL_sample_output_levels (HSAMPLE S, + MSS_SPEAKER const *source_speaker_indexes, + MSS_SPEAKER const *dest_speaker_indexes, + F32 *levels, + S32 n_levels); + +DXDEC F32 AILCALL AIL_sample_low_pass_cut_off(HSAMPLE S, S32 /*-1 or MSS_SPEAKER*/ channel); + +DXDEC S32 AILCALL AIL_sample_loop_count (HSAMPLE S); + +DXDEC void AILCALL AIL_set_digital_master_volume_level + (HDIGDRIVER dig, + F32 master_volume); + +DXDEC F32 AILCALL AIL_digital_master_volume_level (HDIGDRIVER dig); + +DXDEC void AILCALL AIL_set_sample_51_volume_pan( HSAMPLE S, + F32 volume, + F32 pan, + F32 fb_pan, + F32 center_level, + F32 sub_level ); + +DXDEC void AILCALL AIL_sample_51_volume_pan ( HSAMPLE S, + F32* volume, + F32* pan, + F32* fb_pan, + F32* center_level, + F32* sub_level ); + +DXDEC void AILCALL AIL_set_sample_51_volume_levels( HSAMPLE S, + F32 f_left_level, + F32 f_right_level, + F32 b_left_level, + F32 b_right_level, + F32 center_level, + F32 sub_level ); + +DXDEC void AILCALL AIL_sample_51_volume_levels ( HSAMPLE S, + F32* f_left_level, + F32* f_right_level, + F32* b_left_level, + F32* b_right_level, + F32* center_level, + F32* sub_level ); +DXDEC void AILCALL AIL_set_digital_master_reverb + (HDIGDRIVER dig, + S32 bus_index, + F32 reverb_decay_time, + F32 reverb_predelay, + F32 reverb_damping); + +DXDEC void AILCALL AIL_digital_master_reverb + (HDIGDRIVER dig, + S32 bus_index, + F32* reverb_time, + F32* reverb_predelay, + F32* reverb_damping); + +DXDEC void AILCALL AIL_set_digital_master_reverb_levels + (HDIGDRIVER dig, + S32 bus_index, + F32 dry_level, + F32 wet_level); + +DXDEC void AILCALL AIL_digital_master_reverb_levels + (HDIGDRIVER dig, + S32 bus_index, + F32 * dry_level, + F32 * wet_level); + + +// +// low-level digital services +// + +DXDEC S32 AILCALL AIL_minimum_sample_buffer_size(HDIGDRIVER dig, + S32 playback_rate, + S32 format); + +DXDEC S32 AILCALL AIL_set_sample_buffer_count (HSAMPLE S, + S32 n_buffers); + +DXDEC S32 AILCALL AIL_sample_loaded_len (HSAMPLE S); + +DXDEC S32 AILCALL AIL_sample_buffer_count (HSAMPLE S); + +DXDEC S32 AILCALL AIL_sample_buffer_available (HSAMPLE S); + +DXDEC S32 AILCALL AIL_load_sample_buffer (HSAMPLE S, + S32 buff_num, + void const *buffer, + U32 len); + +DXDEC void AILCALL AIL_request_EOB_ASI_reset (HSAMPLE S, + U32 buff_num, + S32 new_stream_position); + +DXDEC S32 AILCALL AIL_sample_buffer_info (HSAMPLE S, //) + S32 buff_num, + U32 *pos, + U32 *len, + S32 *head, + S32 *tail); + +DXDEC U32 AILCALL AIL_sample_granularity (HSAMPLE S); + +DXDEC void AILCALL AIL_set_sample_position (HSAMPLE S, + U32 pos); + +DXDEC U32 AILCALL AIL_sample_position (HSAMPLE S); + +DXDEC AILSAMPLECB AILCALL AIL_register_SOB_callback + (HSAMPLE S, + AILSAMPLECB SOB); + +DXDEC AILSAMPLECB AILCALL AIL_register_EOB_callback + (HSAMPLE S, + AILSAMPLECB EOB); + +DXDEC AILSAMPLECB AILCALL AIL_register_EOS_callback + (HSAMPLE S, + AILSAMPLECB EOS); + +DXDEC AILMIXERCB AILCALL AIL_register_mix_callback(HDIGDRIVER dig, AILMIXERCB mixcb); + +DXDEC AILFALLOFFCB AILCALL AIL_register_falloff_function_callback + (HSAMPLE S, + AILFALLOFFCB falloff_cb); + +DXDEC void AILCALL AIL_set_sample_user_data (HSAMPLE S, + U32 index, + SINTa value); + +DXDEC SINTa AILCALL AIL_sample_user_data (HSAMPLE S, + U32 index); + +DXDEC S32 AILCALL AIL_active_sample_count (HDIGDRIVER dig); + +DXDEC void AILCALL AIL_digital_configuration (HDIGDRIVER dig, + S32 *rate, + S32 *format, + char *string); + +DXDEC S32 AILCALL AIL_platform_property (void *object, + MSS_PLATFORM_PROPERTY property, + void *before_value, + void const *new_value, + void *after_value); + + +DXDEC void AILCALL AIL_set_sample_ms_position (HSAMPLE S, //) + S32 milliseconds); + +DXDEC U32 AILCALL AIL_sample_ms_lookup (HSAMPLE S, //) + S32 milliseconds, + S32* actualms); + +DXDEC void AILCALL AIL_sample_ms_position (HSAMPLE S, //) + S32 * total_milliseconds, + S32 * current_milliseconds); + +// +// Digital input services +// + +#if defined(IS_WINDOWS) + #define MSS_HAS_INPUT 1 +#elif defined(IS_MAC) + #define MSS_HAS_INPUT 1 +#else + #define MSS_HAS_INPUT 0 +#endif + +#if MSS_HAS_INPUT + +DXDEC HDIGINPUT AILCALL AIL_open_input (AIL_INPUT_INFO *info); + +DXDEC void AILCALL AIL_close_input (HDIGINPUT dig); + +DXDEC AIL_INPUT_INFO * + AILCALL AIL_get_input_info (HDIGINPUT dig); + +DXDEC S32 AILCALL AIL_set_input_state (HDIGINPUT dig, + S32 enable); +#endif + + +// +// High-level XMIDI services +// + +DXDEC HMDIDRIVER AILCALL AIL_open_XMIDI_driver( U32 flags ); + +#define AIL_OPEN_XMIDI_NULL_DRIVER 1 + +DXDEC void AILCALL AIL_close_XMIDI_driver( HMDIDRIVER mdi ); + +#if defined(IS_MAC) || defined(IS_LINUX) + +DXDEC S32 AILCALL AIL_MIDI_handle_release + (HMDIDRIVER mdi); + +DXDEC S32 AILCALL AIL_MIDI_handle_reacquire + (HMDIDRIVER mdi); + +#elif defined( IS_WINDOWS ) + +DXDEC S32 AILCALL AIL_midiOutOpen(HMDIDRIVER *drvr, + LPHMIDIOUT *lphMidiOut, + S32 dwDeviceID); + +DXDEC void AILCALL AIL_midiOutClose (HMDIDRIVER mdi); + +DXDEC S32 AILCALL AIL_MIDI_handle_release + (HMDIDRIVER mdi); + +DXDEC S32 AILCALL AIL_MIDI_handle_reacquire + (HMDIDRIVER mdi); + +#endif + +DXDEC HSEQUENCE AILCALL AIL_allocate_sequence_handle + (HMDIDRIVER mdi); + +DXDEC void AILCALL AIL_release_sequence_handle + (HSEQUENCE S); + +DXDEC S32 AILCALL AIL_init_sequence (HSEQUENCE S, + void const *start, + S32 sequence_num); + +DXDEC void AILCALL AIL_start_sequence (HSEQUENCE S); + +DXDEC void AILCALL AIL_stop_sequence (HSEQUENCE S); + +DXDEC void AILCALL AIL_resume_sequence (HSEQUENCE S); + +DXDEC void AILCALL AIL_end_sequence (HSEQUENCE S); + +DXDEC void AILCALL AIL_set_sequence_tempo (HSEQUENCE S, + S32 tempo, + S32 milliseconds); + +DXDEC void AILCALL AIL_set_sequence_volume (HSEQUENCE S, + S32 volume, + S32 milliseconds); + +DXDEC void AILCALL AIL_set_sequence_loop_count + (HSEQUENCE S, + S32 loop_count); + +DXDEC U32 AILCALL AIL_sequence_status (HSEQUENCE S); + +DXDEC S32 AILCALL AIL_sequence_tempo (HSEQUENCE S); + +DXDEC S32 AILCALL AIL_sequence_volume (HSEQUENCE S); + +DXDEC S32 AILCALL AIL_sequence_loop_count (HSEQUENCE S); + +DXDEC void AILCALL AIL_set_XMIDI_master_volume + (HMDIDRIVER mdi, + S32 master_volume); + +DXDEC S32 AILCALL AIL_XMIDI_master_volume (HMDIDRIVER mdi); + + +// +// Low-level XMIDI services +// + +DXDEC S32 AILCALL AIL_active_sequence_count (HMDIDRIVER mdi); + +DXDEC S32 AILCALL AIL_controller_value (HSEQUENCE S, + S32 channel, + S32 controller_num); + +DXDEC S32 AILCALL AIL_channel_notes (HSEQUENCE S, + S32 channel); + +DXDEC void AILCALL AIL_sequence_position (HSEQUENCE S, + S32 *beat, + S32 *measure); + +DXDEC void AILCALL AIL_branch_index (HSEQUENCE S, + U32 marker); + +DXDEC AILPREFIXCB AILCALL AIL_register_prefix_callback + (HSEQUENCE S, + AILPREFIXCB callback); + +DXDEC AILTRIGGERCB AILCALL AIL_register_trigger_callback + (HSEQUENCE S, + AILTRIGGERCB callback); + +DXDEC AILSEQUENCECB AILCALL AIL_register_sequence_callback + (HSEQUENCE S, + AILSEQUENCECB callback); + +DXDEC AILBEATCB AILCALL AIL_register_beat_callback (HSEQUENCE S, + AILBEATCB callback); + +DXDEC AILEVENTCB AILCALL AIL_register_event_callback (HMDIDRIVER mdi, + AILEVENTCB callback); + +DXDEC AILTIMBRECB AILCALL AIL_register_timbre_callback + (HMDIDRIVER mdi, + AILTIMBRECB callback); + +DXDEC void AILCALL AIL_set_sequence_user_data (HSEQUENCE S, + U32 index, + SINTa value); + +DXDEC SINTa AILCALL AIL_sequence_user_data (HSEQUENCE S, + U32 index); + +DXDEC void AILCALL AIL_register_ICA_array (HSEQUENCE S, + U8 *array); + +DXDEC S32 AILCALL AIL_lock_channel (HMDIDRIVER mdi); + +DXDEC void AILCALL AIL_release_channel (HMDIDRIVER mdi, + S32 channel); + +DXDEC void AILCALL AIL_map_sequence_channel (HSEQUENCE S, + S32 seq_channel, + S32 new_channel); + +DXDEC S32 AILCALL AIL_true_sequence_channel (HSEQUENCE S, + S32 seq_channel); + +DXDEC void AILCALL AIL_send_channel_voice_message + (HMDIDRIVER mdi, + HSEQUENCE S, + S32 status, + S32 data_1, + S32 data_2); + +DXDEC void AILCALL AIL_send_sysex_message (HMDIDRIVER mdi, + void const *buffer); + +DXDEC HWAVESYNTH + AILCALL AIL_create_wave_synthesizer (HDIGDRIVER dig, + HMDIDRIVER mdi, + void const *wave_lib, + S32 polyphony); + +DXDEC void AILCALL AIL_destroy_wave_synthesizer (HWAVESYNTH W); + +DXDEC void AILCALL AIL_set_sequence_ms_position (HSEQUENCE S, //) + S32 milliseconds); + +DXDEC void AILCALL AIL_sequence_ms_position(HSEQUENCE S, //) + S32 *total_milliseconds, + S32 *current_milliseconds); + + + +// +// red book functions +// + +#ifdef IS_WINDOWS + +#pragma pack(push, 1) + +typedef MSS_STRUCT _REDBOOK { + U32 DeviceID; + U32 paused; + U32 pausedsec; + U32 lastendsec; +} REDBOOK; + +#pragma pack(pop) + +typedef MSS_STRUCT _REDBOOK* HREDBOOK; + +#define REDBOOK_ERROR 0 +#define REDBOOK_PLAYING 1 +#define REDBOOK_PAUSED 2 +#define REDBOOK_STOPPED 3 + + +DXDEC HREDBOOK AILCALL AIL_redbook_open(U32 which); + +DXDEC HREDBOOK AILCALL AIL_redbook_open_drive(S32 drive); + +DXDEC void AILCALL AIL_redbook_close(HREDBOOK hand); + +DXDEC void AILCALL AIL_redbook_eject(HREDBOOK hand); + +DXDEC void AILCALL AIL_redbook_retract(HREDBOOK hand); + +DXDEC U32 AILCALL AIL_redbook_status(HREDBOOK hand); + +DXDEC U32 AILCALL AIL_redbook_tracks(HREDBOOK hand); + +DXDEC U32 AILCALL AIL_redbook_track(HREDBOOK hand); + +DXDEC void AILCALL AIL_redbook_track_info(HREDBOOK hand,U32 tracknum, + U32* startmsec,U32* endmsec); + +DXDEC U32 AILCALL AIL_redbook_id(HREDBOOK hand); + +DXDEC U32 AILCALL AIL_redbook_position(HREDBOOK hand); + +DXDEC U32 AILCALL AIL_redbook_play(HREDBOOK hand,U32 startmsec, U32 endmsec); + +DXDEC U32 AILCALL AIL_redbook_stop(HREDBOOK hand); + +DXDEC U32 AILCALL AIL_redbook_pause(HREDBOOK hand); + +DXDEC U32 AILCALL AIL_redbook_resume(HREDBOOK hand); + +DXDEC F32 AILCALL AIL_redbook_volume_level(HREDBOOK hand); + +DXDEC F32 AILCALL AIL_redbook_set_volume_level(HREDBOOK hand, F32 volume); + +#endif + +DXDEC U32 AILCALL AIL_ms_count(void); +DXDEC U32 AILCALL AIL_us_count(void); +DXDEC U64 AILCALL AIL_ms_count64(void); +DXDEC U64 AILCALL AIL_us_count64(void); +DXDEC U64 AILCALL AIL_get_time(void); +DXDEC U64 AILCALL AIL_time_to_ms(U64 time); +DXDEC U64 AILCALL AIL_ms_to_time(U64 ms); + +DXDEC void AILCALL MilesUseTelemetry( void * context ); +DXDEC void AILCALL MilesUseTmLite( void* context ); + +// +// +// + +#define MSSIO_FLAGS_DONT_CLOSE_HANDLE 1 +#define MSSIO_FLAGS_QUERY_SIZE_ONLY 2 +#define MSSIO_FLAGS_DONT_USE_OFFSET 4 + +#define MSSIO_STATUS_COMPLETE 1 +#define MSSIO_STATUS_ERROR_FAILED_OPEN 0x1003 +#define MSSIO_STATUS_ERROR_FAILED_READ 0x1004 +#define MSSIO_STATUS_ERROR_SHUTDOWN 0x1005 +#define MSSIO_STATUS_ERROR_CANCELLED 0x1006 +#define MSSIO_STATUS_ERROR_MEMORY_ALLOC_FAIL 0x1007 +#define MSSIO_STATUS_ERROR_MASK 0x1000 + +// returns percent full (1.0 = 100%) +typedef F32 (AILCALLBACK *MilesAsyncStreamCallback)(void* i_User); + +struct MilesAsyncRead +{ + char FileName[256]; + U64 Offset; + S64 Count; + void* Buffer; + void* StreamUserData; + MilesAsyncStreamCallback StreamCB; + char const * caller; + U32 caller_line; + UINTa FileHandle; + S32 Flags; + S32 ReadAmt; // current read amt. + S32 AdditionalBuffer; + S32 volatile Status; // This is only valid after a call to MilesAsyncFileWait or MilesAsyncFileCancel has succeeded. + char Internal[48+128]; +}; + +DXDEC S32 AILCALL MilesAsyncFileRead(struct MilesAsyncRead* i_Request); +DXDEC S32 AILCALL MilesAsyncFileCancel(struct MilesAsyncRead* i_Request); // 1 if the request has completed, 0 otherwise. Use Wait if needed. +DXDEC S32 AILCALL MilesAsyncFileStatus(struct MilesAsyncRead* i_Request, U32 i_MS); // 1 if complete, 0 if timeout exceeded. +DXDEC S32 AILCALL MilesAsyncStartup(); +DXDEC S32 AILCALL MilesAsyncShutdown(); +DXDEC S32 AILCALL AIL_IO_thread_handle(void* o_Handle); +DXDEC void AILCALL MilesAsyncSetPaused(S32 i_IsPaused); + +typedef S32 (AILCALLBACK * MilesAsyncFileRead_callback)(struct MilesAsyncRead* i_Request); +typedef S32 (AILCALLBACK * MilesAsyncFileCancel_callback)(struct MilesAsyncRead* i_Request); // 1 if the request has completed, 0 otherwise. Use Wait if needed. +typedef S32 (AILCALLBACK * MilesAsyncFileStatus_callback)(struct MilesAsyncRead* i_Request, U32 i_MS); // 1 if complete, 0 if timeout exceeded. +typedef S32 (AILCALLBACK * MilesAsyncStartup_callback)(); +typedef S32 (AILCALLBACK * MilesAsyncShutdown_callback)(); +typedef void (AILCALLBACK * MilesAsyncSetPaused_callback)(S32 i_IsPaused); +typedef S32 (AILCALLBACK * AIL_IO_thread_handle_callback)(void* o_Handle); + +DXDEC void AILCALL AIL_set_async_callbacks( + MilesAsyncFileRead_callback read, + MilesAsyncFileCancel_callback cancel, + MilesAsyncFileStatus_callback status, + MilesAsyncStartup_callback startup, + MilesAsyncShutdown_callback shutdown, + MilesAsyncSetPaused_callback setpaused, + AIL_IO_thread_handle_callback threadhandle); + +// +// +// + +typedef struct _STREAM* HSTREAM; // Handle to stream + +typedef void (AILCALLBACK* AILSTREAMCB) (HSTREAM stream); + +#define MSS_STREAM_CHUNKS 8 + +typedef struct _STREAM +{ + S32 block_oriented; // 1 if this is an ADPCM or ASI-compressed stream + S32 using_ASI; // 1 if using ASI decoder to uncompress stream data + ASISTAGE *ASI; // handy pointer to our ASI coded + + HSAMPLE samp; // the sample handle + + UINTa fileh; // the open file handle + + U8* bufs[MSS_STREAM_CHUNKS]; // the data buffers + S32 reset_ASI[MSS_STREAM_CHUNKS]; // should we reset the ASI at the end of the buffer? + S32 reset_seek_pos[MSS_STREAM_CHUNKS]; // new stream position after reset + S32 bufstart[MSS_STREAM_CHUNKS]; // offset of where this buffer started + S32 loadedsizes[MSS_STREAM_CHUNKS]; // sizes of the data to be started + + struct MilesAsyncRead asyncs[MSS_STREAM_CHUNKS]; + S32 asyncs_loaded[MSS_STREAM_CHUNKS]; // 0=unloaded, 1=loading, 2=loaded, but not started + S32 next_read_offset; // offset to pass to the next read, so the seek occurs internally. -1 to not seek. + + S32 into_Miles_index; // index of buffer that we will async into next + S32 read_IO_index; // index of buffer to be loaded into Miles next + + S32 bufsize; // size of each buffer + + U32 datarate; // datarate in bytes per second + S32 filerate; // original datarate of the file + S32 filetype; // file format type + U32 filemask; // channel mask for stream file + S32 totallen; // total length of the sound data + + S32 substart; // subblock loop start + S32 sublen; // subblock loop len + + U32 blocksize; // ADPCM block size + + S32 loadedsome; // have we done any loads? + + U32 startpos; // point that the sound data begins + U32 async_pos; // position if the last async completed + + U32 loopsleft; // how many loops are left + + U32 error; // read error has occurred + + S32 preload; // preload the file into the first buffer + U32 preloadpos; // position to use in preload + U32 noback; // no background processing + S32 alldone; // alldone + S32 primeamount; // amount to load after a seek + S32 primeleft; // amount to read before starting + + S32 playcontrol; // control: 0=stopped, 1=started, |8=paused, |16=sample paused + + AILSTREAMCB callback; // end of stream callback + + SINTa user_data[8]; // Miscellaneous user data + void* next; // pointer to next stream + + S32 autostreaming; // are we autostreaming this stream + + F32 level; // io percent full + F32 last_level; // old io percent + F32 percent_mult; // factor to scale by + S32 stream_count; // unique number of the stream + + S32 docallback; // set when it time to poll for a callback + + S32 was_popped; // set to 1 if the stream needs to be freed due to a system push/pop - causes SMP_DONE to be stream_status +} MSTREAM_TYPE; + + +DXDEC HSTREAM AILCALL AIL_open_stream(HDIGDRIVER dig, char const * filename, S32 stream_mem); + +DXDEC void AILCALL AIL_close_stream(HSTREAM stream); + +DXDEC HSAMPLE AILCALL AIL_stream_sample_handle(HSTREAM stream); + +DXDEC S32 AILCALL AIL_service_stream(HSTREAM stream, S32 fillup); + +DXDEC void AILCALL AIL_start_stream(HSTREAM stream); + +DXDEC void AILCALL AIL_pause_stream(HSTREAM stream, S32 onoff); + +DXDEC S32 AILCALL AIL_stream_loop_count(HSTREAM stream); + +DXDEC void AILCALL AIL_set_stream_loop_count(HSTREAM stream, S32 count); + +DXDEC void AILCALL AIL_set_stream_loop_block (HSTREAM S, + S32 loop_start_offset, + S32 loop_end_offset); + +DXDEC S32 AILCALL AIL_stream_status(HSTREAM stream); + +DXDEC F32 AILCALL AIL_stream_filled_percent(HSTREAM stream); + +DXDEC void AILCALL AIL_set_stream_position(HSTREAM stream,S32 offset); + +DXDEC S32 AILCALL AIL_stream_position(HSTREAM stream); + +DXDEC void AILCALL AIL_stream_info(HSTREAM stream, S32* datarate, S32* sndtype, S32* length, S32* memory); + +DXDEC AILSTREAMCB AILCALL AIL_register_stream_callback(HSTREAM stream, AILSTREAMCB callback); + +DXDEC void AILCALL AIL_auto_service_stream(HSTREAM stream, S32 onoff); + +DXDEC void AILCALL AIL_set_stream_user_data (HSTREAM S, + U32 index, + SINTa value); + +DXDEC SINTa AILCALL AIL_stream_user_data (HSTREAM S, + U32 index); + +DXDEC void AILCALL AIL_set_stream_ms_position (HSTREAM S, + S32 milliseconds); + +DXDEC void AILCALL AIL_stream_ms_position (HSTREAM S, //) + S32 * total_milliseconds, + S32 * current_milliseconds); + +//! \todo MSS_FILE not needed anymore? +typedef char MSS_FILE; + +typedef U32 (AILCALLBACK*AIL_file_open_callback) (MSS_FILE const* Filename, + UINTa* FileHandle); + +typedef void (AILCALLBACK*AIL_file_close_callback) (UINTa FileHandle); + +#define AIL_FILE_SEEK_BEGIN 0 +#define AIL_FILE_SEEK_CURRENT 1 +#define AIL_FILE_SEEK_END 2 + +typedef S32 (AILCALLBACK*AIL_file_seek_callback) (UINTa FileHandle, + S32 Offset, + U32 Type); + +typedef U32 (AILCALLBACK*AIL_file_read_callback) (UINTa FileHandle, + void* Buffer, + U32 Bytes); + +DXDEC void AILCALL AIL_set_file_callbacks (AIL_file_open_callback opencb, + AIL_file_close_callback closecb, + AIL_file_seek_callback seekcb, + AIL_file_read_callback readcb); + +DXDEC void AILCALL AIL_file_callbacks(AIL_file_open_callback* opencb, + AIL_file_close_callback* closecb, + AIL_file_seek_callback* seekcb, + AIL_file_read_callback* readcb); + +#ifdef IS_32 + +typedef void* (AILCALLBACK *AIL_file_async_read_callback) (UINTa FileHandle, + void* Buffer, + U32 Bytes); + +typedef S32 (AILCALLBACK*AIL_file_async_status_callback) (void* async, + S32 wait, + U32* BytesRead); + +DXDEC void AILCALL AIL_set_file_async_callbacks (AIL_file_open_callback opencb, + AIL_file_close_callback closecb, + AIL_file_seek_callback seekcb, + AIL_file_async_read_callback areadcb, + AIL_file_async_status_callback statuscb); + +#endif + +// +// High-level DLS functions +// + +typedef struct _DLSFILEID { + SINTa id; + struct _DLSFILEID* next; +} DLSFILEID; + +typedef struct _DLSFILEID* HDLSFILEID; + +typedef struct _DLSDEVICE { + VOIDFUNC* pGetPref; + VOIDFUNC* pSetPref; + VOIDFUNC* pMSSOpen; + VOIDFUNC* pOpen; + VOIDFUNC* pClose; + VOIDFUNC* pLoadFile; + VOIDFUNC* pLoadMem; + VOIDFUNC* pUnloadFile; + VOIDFUNC* pUnloadAll; + VOIDFUNC* pGetInfo; + VOIDFUNC* pCompact; + VOIDFUNC* pSetAttr; + SINTa DLSHandle; + U32 format; + U32 buffer_size; + void* buffer[2]; + HSAMPLE sample; + HMDIDRIVER mdi; + HDIGDRIVER dig; + HDLSFILEID first; +#if defined(__RADNT__) + + #ifdef MSS_STATIC_RIB + #error "Bad defines - can't have a static rib on NT" + #endif + HMODULE lib; +#elif defined(MSS_STATIC_RIB) + char* DOSname; +#endif +} DLSDEVICE; + +typedef struct _DLSDEVICE* HDLSDEVICE; + +typedef struct _AILDLSINFO { + char Description[128]; + S32 MaxDLSMemory; + S32 CurrentDLSMemory; + S32 LargestSize; + S32 GMAvailable; + S32 GMBankSize; +} AILDLSINFO; + +#ifdef MSS_STATIC_RIB + +typedef struct _AILSTATICDLS { + char* description; + VOIDFUNC* pDLSOpen; + VOIDFUNC* pMSSOpen; + VOIDFUNC* pOpen; + VOIDFUNC* pClose; + VOIDFUNC* pLoadFile; + VOIDFUNC* pLoadMem; + VOIDFUNC* pUnloadFile; + VOIDFUNC* pUnloadAll; + VOIDFUNC* pGetInfo; + VOIDFUNC* pCompact; + VOIDFUNC* pSetAttr; +} AILSTATICDLS; + +#endif // MSS_STATIC_RIB + + +DXDEC HDLSDEVICE AILCALL AIL_DLS_open(HMDIDRIVER mdi, HDIGDRIVER dig, +#ifdef MSS_STATIC_RIB + AILSTATICDLS const * staticdls, +#elif defined(__RADNT__) + char const * libname, +#endif + U32 flags, U32 rate, S32 bits, S32 channels); + +// +// Parameters for the dwFlag used in DLSClose() and flags in AIL_DLS_close +// + +#define RETAIN_DLS_COLLECTION 0x00000001 +#define RETURN_TO_BOOTUP_STATE 0x00000002 +#define RETURN_TO_GM_ONLY_STATE 0x00000004 +#define DLS_COMPACT_MEMORY 0x00000008 + +DXDEC void AILCALL AIL_DLS_close(HDLSDEVICE dls, U32 flags); + +DXDEC HDLSFILEID AILCALL AIL_DLS_load_file(HDLSDEVICE dls, char const* filename, U32 flags); + +DXDEC HDLSFILEID AILCALL AIL_DLS_load_memory(HDLSDEVICE dls, void const* memfile, U32 flags); + +// +// other parameters for AIL_DLS_unload +// + +#define AIL_DLS_UNLOAD_MINE 0 +#define AIL_DLS_UNLOAD_ALL ((HDLSFILEID)(UINTa)(SINTa)-1) + +DXDEC void AILCALL AIL_DLS_unload(HDLSDEVICE dls, HDLSFILEID dlsid); + +DXDEC void AILCALL AIL_DLS_compact(HDLSDEVICE dls); + +DXDEC void AILCALL AIL_DLS_get_info(HDLSDEVICE dls, AILDLSINFO* info, S32* PercentCPU); + +DXDEC HSAMPLE AILCALL AIL_DLS_sample_handle(HDLSDEVICE dls); + + +// +// Quick-integration service functions and data types +// + +typedef struct +{ + U32 const *data; + S32 size; + S32 type; + void *handle; + S32 status; + void* next; + S32 speed; + F32 volume; + F32 extravol; + F32 dry; + F32 wet; + F32 cutoff; + HDLSFILEID dlsid; + void* dlsmem; + void* dlsmemunc; + S32 milliseconds; + S32 length; + SINTa userdata; +} +AUDIO_TYPE; + + +#define QSTAT_DONE 1 // Data has finished playing +#define QSTAT_LOADED 2 // Data has been loaded, but not yet played +#define QSTAT_PLAYING 3 // Data is currently playing + +typedef AUDIO_TYPE * HAUDIO; // Generic handle to any audio data type + +#define AIL_QUICK_USE_WAVEOUT 2 +#define AIL_QUICK_MIDI_AND_DLS 2 +#define AIL_QUICK_DLS_ONLY 3 +#define AIL_QUICK_MIDI_AND_VORTEX_DLS 4 +#define AIL_QUICK_MIDI_AND_SONICVIBES_DLS 5 + +DXDEC S32 AILCALL + AIL_quick_startup ( + S32 use_digital, + S32 use_MIDI, + U32 output_rate, + S32 output_bits, + S32 output_channels); + +DXDEC void AILCALL AIL_quick_shutdown (void); + +DXDEC void AILCALL AIL_quick_handles (HDIGDRIVER* pdig, + HMDIDRIVER* pmdi, + HDLSDEVICE* pdls ); + +DXDEC HAUDIO AILCALL AIL_quick_load (char const *filename); + +DXDEC HAUDIO AILCALL AIL_quick_load_mem (void const *mem, + U32 size); + +DXDEC HAUDIO AILCALL AIL_quick_load_named_mem (void const *mem, + char const *filename, + U32 size); + +DXDEC HAUDIO AILCALL AIL_quick_copy (HAUDIO audio); + +DXDEC void AILCALL AIL_quick_unload (HAUDIO audio); + +DXDEC S32 AILCALL AIL_quick_play (HAUDIO audio, + U32 loop_count); + +DXDEC void AILCALL AIL_quick_halt (HAUDIO audio); + +DXDEC S32 AILCALL AIL_quick_status (HAUDIO audio); + +DXDEC HAUDIO AILCALL AIL_quick_load_and_play (char const *filename, + U32 loop_count, + S32 wait_request); + +DXDEC void AILCALL AIL_quick_set_speed (HAUDIO audio, S32 speed); + +DXDEC void AILCALL AIL_quick_set_volume (HAUDIO audio, F32 volume, F32 extravol); + +DXDEC void AILCALL AIL_quick_set_reverb_levels (HAUDIO audio, + F32 dry_level, + F32 wet_level); + +DXDEC void AILCALL AIL_quick_set_low_pass_cut_off(HAUDIO S, + S32 channel, + F32 cut_off); + +DXDEC void AILCALL AIL_quick_set_ms_position(HAUDIO audio,S32 milliseconds); + +DXDEC S32 AILCALL AIL_quick_ms_position(HAUDIO audio); + +DXDEC S32 AILCALL AIL_quick_ms_length(HAUDIO audio); + + +#define AIL_QUICK_XMIDI_TYPE 1 +#define AIL_QUICK_DIGITAL_TYPE 2 +#define AIL_QUICK_DLS_XMIDI_TYPE 3 +#define AIL_QUICK_MPEG_DIGITAL_TYPE 4 +#define AIL_QUICK_OGG_VORBIS_TYPE 5 +#define AIL_QUICK_V12_VOICE_TYPE 6 +#define AIL_QUICK_V24_VOICE_TYPE 7 +#define AIL_QUICK_V29_VOICE_TYPE 8 +#define AIL_QUICK_OGG_SPEEX_TYPE 9 +#define AIL_QUICK_S8_VOICE_TYPE 10 +#define AIL_QUICK_S16_VOICE_TYPE 11 +#define AIL_QUICK_S32_VOICE_TYPE 12 +#define AIL_QUICK_BINKA_TYPE 13 + +DXDEC S32 AILCALL AIL_quick_type(HAUDIO audio); + +DXDEC S32 AILCALL AIL_WAV_info(void const* WAV_image, AILSOUNDINFO* info); + +DXDEC S32 AILCALL AIL_WAV_marker_count(void const *WAV_image); + +DXDEC S32 AILCALL AIL_WAV_marker_by_index(void const *WAV_image, S32 n, C8 const **name); + +DXDEC S32 AILCALL AIL_WAV_marker_by_name(void const *WAV_image, C8 *name); + +DXDEC S32 AILCALL AIL_size_processed_digital_audio( + U32 dest_rate, + U32 dest_format, + S32 num_srcs, + AILMIXINFO const * src); + +DXDEC S32 AILCALL AIL_process_digital_audio( + void *dest_buffer, + S32 dest_buffer_size, + U32 dest_rate, + U32 dest_format, + S32 num_srcs, + AILMIXINFO* src); + +#define AIL_LENGTHY_INIT 0 +#define AIL_LENGTHY_SET_PROPERTY 1 +#define AIL_LENGTHY_UPDATE 2 +#define AIL_LENGTHY_DONE 3 + +typedef S32 (AILCALLBACK* AILLENGTHYCB)(U32 state,UINTa user); + +typedef S32 (AILCALLBACK* AILCODECSETPROP)(char const* property,void const * value); + +DXDEC S32 AILCALL AIL_compress_ASI(AILSOUNDINFO const * info, //) + char const* filename_ext, + void** outdata, + U32* outsize, + AILLENGTHYCB callback); + +DXDEC S32 AILCALL AIL_decompress_ASI(void const* indata, //) + U32 insize, + char const* filename_ext, + void** wav, + U32* wavsize, + AILLENGTHYCB callback); + +DXDEC S32 AILCALL AIL_compress_ADPCM(AILSOUNDINFO const * info, + void** outdata, U32* outsize); + +DXDEC S32 AILCALL AIL_decompress_ADPCM(AILSOUNDINFO const * info, + void** outdata, U32* outsize); + +DXDEC S32 AILCALL AIL_compress_DLS(void const* dls, + char const* compression_extension, + void** mls, U32* mlssize, + AILLENGTHYCB callback); + +DXDEC S32 AILCALL AIL_merge_DLS_with_XMI(void const* xmi, void const* dls, + void** mss, U32* msssize); + +DXDEC S32 AILCALL AIL_extract_DLS( void const *source_image, //) + U32 source_size, + void * *XMI_output_data, + U32 *XMI_output_size, + void * *DLS_output_data, + U32 *DLS_output_size, + AILLENGTHYCB callback); + +#define AILFILTERDLS_USINGLIST 1 + +DXDEC S32 AILCALL AIL_filter_DLS_with_XMI(void const* xmi, void const* dls, + void** dlsout, U32* dlssize, + S32 flags, AILLENGTHYCB callback); + +#define AILMIDITOXMI_USINGLIST 1 +#define AILMIDITOXMI_TOLERANT 2 + +DXDEC S32 AILCALL AIL_MIDI_to_XMI (void const* MIDI, + U32 MIDI_size, + void* *XMIDI, + U32 * XMIDI_size, + S32 flags); + +#define AILDLSLIST_ARTICULATION 1 +#define AILDLSLIST_DUMP_WAVS 2 + +#if defined(IS_WIN32) || defined(IS_MAC) || defined(IS_LINUX) + +DXDEC S32 AILCALL AIL_list_DLS (void const* DLS, + char** lst, + U32 * lst_size, + S32 flags, + C8 * title); + +#define AILMIDILIST_ROLANDSYSEX 1 +#define AILMIDILIST_ROLANDUN 2 +#define AILMIDILIST_ROLANDAB 4 + +DXDEC S32 AILCALL AIL_list_MIDI (void const* MIDI, + U32 MIDI_size, + char** lst, + U32 * lst_size, + S32 flags); +#endif + +#define AILFILETYPE_UNKNOWN 0 +#define AILFILETYPE_PCM_WAV 1 +#define AILFILETYPE_ADPCM_WAV 2 +#define AILFILETYPE_OTHER_WAV 3 +#define AILFILETYPE_VOC 4 +#define AILFILETYPE_MIDI 5 +#define AILFILETYPE_XMIDI 6 +#define AILFILETYPE_XMIDI_DLS 7 +#define AILFILETYPE_XMIDI_MLS 8 +#define AILFILETYPE_DLS 9 +#define AILFILETYPE_MLS 10 +#define AILFILETYPE_MPEG_L1_AUDIO 11 +#define AILFILETYPE_MPEG_L2_AUDIO 12 +#define AILFILETYPE_MPEG_L3_AUDIO 13 +#define AILFILETYPE_OTHER_ASI_WAV 14 +#define AILFILETYPE_XBOX_ADPCM_WAV 15 +#define AILFILETYPE_OGG_VORBIS 16 +#define AILFILETYPE_V12_VOICE 17 +#define AILFILETYPE_V24_VOICE 18 +#define AILFILETYPE_V29_VOICE 19 +#define AILFILETYPE_OGG_SPEEX 20 +#define AILFILETYPE_S8_VOICE 21 +#define AILFILETYPE_S16_VOICE 22 +#define AILFILETYPE_S32_VOICE 23 +#define AILFILETYPE_BINKA 24 + +DXDEC S32 AILCALL AIL_file_type(void const* data, U32 size); + +DXDEC S32 AILCALL AIL_file_type_named(void const* data, char const* filename, U32 size); + +DXDEC S32 AILCALL AIL_find_DLS (void const* data, U32 size, + void** xmi, U32* xmisize, + void** dls, U32* dlssize); +typedef struct +{ + // + // File-level data accessible to app + // + // This is valid after AIL_inspect_MP3() is called (even if the file contains no valid frames) + // + + U8 *MP3_file_image; // Original MP3_file_image pointer passed to AIL_inspect_MP3() + S32 MP3_image_size; // Original MP3_image_size passed to AIL_inspect_MP3() + + U8 *ID3v2; // ID3v2 tag, if not NULL + S32 ID3v2_size; // Size of tag in bytes + + U8 *ID3v1; // ID3v1 tag, if not NULL (always 128 bytes long if present) + + U8 *start_MP3_data; // Pointer to start of data area in file (not necessarily first valid frame) + U8 *end_MP3_data; // Pointer to last valid byte in MP3 data area (before ID3v1 tag, if any) + + // + // Information about current frame being inspected, valid if AIL_enumerate_MP3_frames() returns + // TRUE + // + + S32 sample_rate; // Sample rate in Hz (normally constant across all frames in file) + S32 bit_rate; // Bits/second for current frame + S32 channels_per_sample; // 1 or 2 + S32 samples_per_frame; // Always 576 or 1152 samples in each MP3 frame, depending on rate + + S32 byte_offset; // Offset of frame from start_MP3_data (i.e., suitable for use as loop point) + S32 next_frame_expected; // Anticipated offset of next frame to be enumerated, if any + S32 average_frame_size; // Average source bytes per frame, determined solely by bit rate and sample rate + S32 data_size; // # of data-only bytes in this particular frame + S32 header_size; // 4 or 6 bytes, depending on CRC + S32 side_info_size; // Valid for layer 3 side info only + S32 ngr; // Always 2 for MPEG1, else 1 + S32 main_data_begin; // Always 0 in files with no bit reservoir + S32 hpos; // Current bit position in header/side buffer + + S32 MPEG1; // Data copied directly from frame header, see ISO docs for info... + S32 MPEG25; + S32 layer; + S32 protection_bit; + S32 bitrate_index; + S32 sampling_frequency; + S32 padding_bit; + S32 private_bit; + S32 mode; + S32 mode_extension; + S32 copyright; + S32 original; + S32 emphasis; + + // + // LAME/Xing info tag data + // + + S32 Xing_valid; + S32 Info_valid; + U32 header_flags; + S32 frame_count; + S32 byte_count; + S32 VBR_scale; + U8 TOC[100]; + S32 enc_delay; + S32 enc_padding; + + // + // Private (undocumented) data used during frame enumeration + // + + U8 *ptr; + S32 bytes_left; + + S32 check_valid; + S32 check_MPEG1; + S32 check_MPEG25; + S32 check_layer; + S32 check_protection_bit; + S32 check_sampling_frequency; + S32 check_mode; + S32 check_copyright; + S32 check_original; +} +MP3_INFO; + +DXDEC void AILCALL AIL_inspect_MP3 (MP3_INFO *inspection_state, + U8 *MP3_file_image, + S32 MP3_image_size); + +DXDEC S32 AILCALL AIL_enumerate_MP3_frames (MP3_INFO *inspection_state); + +typedef struct +{ + // + // File-level data accessible to app + // + // This is valid after AIL_inspect_Ogg() is called (even if the file contains no valid pages) + // + + U8 *Ogg_file_image; // Originally passed to AIL_inspect_Ogg() + S32 Ogg_image_size; // Originally passed to AIL_inspect_Ogg() + + U8 *start_Ogg_data; // Pointer to start of data area in file + U8 *end_Ogg_data; // Pointer to last valid byte in data area + + // Information lifted from the header after AIL_inspect_Ogg() is called. + S32 channel_count; + S32 sample_rate; + + // + // Information about current page being inspected, valid if AIL_enumerate_Ogg_pages() returns + // TRUE + // + + S32 page_num; // 32-bit page sequence number from OggS header at byte offset 16 + + S32 sample_count; // Total # of samples already generated by encoder at the time the current page was written + + S32 byte_offset; // Offset of page from start_Ogg_data (i.e., suitable for use as loop point) + S32 next_page_expected; // Anticipated offset of next page to be enumerated, if any + + // + // Private (undocumented) data used during page enumeration + // + + U8 *ptr; + S32 bytes_left; +} +OGG_INFO; + +DXDEC void AILCALL AIL_inspect_Ogg (OGG_INFO *inspection_state, + U8 *Ogg_file_image, + S32 Ogg_file_size); + +DXDEC S32 AILCALL AIL_enumerate_Ogg_pages (OGG_INFO *inspection_state); + +typedef struct +{ + const char* file_image; + S32 image_size; + + S32 channel_count; + S32 sample_rate; + + S32 total_samples; + S32 samples_per_frame; + + const char* current_frame; + + // output data - byte offset for current frame. + S32 byte_offset; +} BINKA_INFO; + +DXDEC U32 AILCALL AIL_inspect_BinkA(BINKA_INFO* state, char const* file_image, S32 file_size); +DXDEC S32 AILCALL AIL_enumerate_BinkA_frames(BINKA_INFO* state); + +// +// RAD room types - currently the same as EAX +// + +enum +{ + ENVIRONMENT_GENERIC, // factory default + ENVIRONMENT_PADDEDCELL, + ENVIRONMENT_ROOM, // standard environments + ENVIRONMENT_BATHROOM, + ENVIRONMENT_LIVINGROOM, + ENVIRONMENT_STONEROOM, + ENVIRONMENT_AUDITORIUM, + ENVIRONMENT_CONCERTHALL, + ENVIRONMENT_CAVE, + ENVIRONMENT_ARENA, + ENVIRONMENT_HANGAR, + ENVIRONMENT_CARPETEDHALLWAY, + ENVIRONMENT_HALLWAY, + ENVIRONMENT_STONECORRIDOR, + ENVIRONMENT_ALLEY, + ENVIRONMENT_FOREST, + ENVIRONMENT_CITY, + ENVIRONMENT_MOUNTAINS, + ENVIRONMENT_QUARRY, + ENVIRONMENT_PLAIN, + ENVIRONMENT_PARKINGLOT, + ENVIRONMENT_SEWERPIPE, + ENVIRONMENT_UNDERWATER, + ENVIRONMENT_DRUGGED, + ENVIRONMENT_DIZZY, + ENVIRONMENT_PSYCHOTIC, + + ENVIRONMENT_COUNT // total number of environments +}; + +// +// enumerated values for EAX +// + +#ifndef EAX_H_INCLUDED + +enum +{ + EAX_ENVIRONMENT_GENERIC, // factory default + EAX_ENVIRONMENT_PADDEDCELL, + EAX_ENVIRONMENT_ROOM, // standard environments + EAX_ENVIRONMENT_BATHROOM, + EAX_ENVIRONMENT_LIVINGROOM, + EAX_ENVIRONMENT_STONEROOM, + EAX_ENVIRONMENT_AUDITORIUM, + EAX_ENVIRONMENT_CONCERTHALL, + EAX_ENVIRONMENT_CAVE, + EAX_ENVIRONMENT_ARENA, + EAX_ENVIRONMENT_HANGAR, + EAX_ENVIRONMENT_CARPETEDHALLWAY, + EAX_ENVIRONMENT_HALLWAY, + EAX_ENVIRONMENT_STONECORRIDOR, + EAX_ENVIRONMENT_ALLEY, + EAX_ENVIRONMENT_FOREST, + EAX_ENVIRONMENT_CITY, + EAX_ENVIRONMENT_MOUNTAINS, + EAX_ENVIRONMENT_QUARRY, + EAX_ENVIRONMENT_PLAIN, + EAX_ENVIRONMENT_PARKINGLOT, + EAX_ENVIRONMENT_SEWERPIPE, + EAX_ENVIRONMENT_UNDERWATER, + EAX_ENVIRONMENT_DRUGGED, + EAX_ENVIRONMENT_DIZZY, + EAX_ENVIRONMENT_PSYCHOTIC, + + EAX_ENVIRONMENT_COUNT // total number of environments +}; + +#define EAX_REVERBMIX_USEDISTANCE (-1.0F) + +#endif + +#define MSS_BUFFER_HEAD (-1) + +// +// Auxiliary 2D interface calls +// + +DXDEC HDIGDRIVER AILCALL AIL_primary_digital_driver (HDIGDRIVER new_primary); + +// +// 3D-related calls +// + +DXDEC S32 AILCALL AIL_room_type (HDIGDRIVER dig, + S32 bus_index); + +DXDEC void AILCALL AIL_set_room_type (HDIGDRIVER dig, + S32 bus_index, + S32 room_type); + +DXDEC F32 AILCALL AIL_3D_rolloff_factor (HDIGDRIVER dig); + +DXDEC void AILCALL AIL_set_3D_rolloff_factor (HDIGDRIVER dig, + F32 factor); + +DXDEC F32 AILCALL AIL_3D_doppler_factor (HDIGDRIVER dig); + +DXDEC void AILCALL AIL_set_3D_doppler_factor (HDIGDRIVER dig, + F32 factor); + +DXDEC F32 AILCALL AIL_3D_distance_factor (HDIGDRIVER dig); + +DXDEC void AILCALL AIL_set_3D_distance_factor (HDIGDRIVER dig, + F32 factor); + +DXDEC void AILCALL AIL_set_sample_obstruction (HSAMPLE S, + F32 obstruction); + +DXDEC void AILCALL AIL_set_sample_occlusion (HSAMPLE S, + F32 occlusion); + +DXDEC void AILCALL AIL_set_sample_exclusion (HSAMPLE S, + F32 exclusion); + +DXDEC F32 AILCALL AIL_sample_obstruction (HSAMPLE S); + +DXDEC F32 AILCALL AIL_sample_occlusion (HSAMPLE S); + +DXDEC F32 AILCALL AIL_sample_exclusion (HSAMPLE S); + +EXPGROUP(3D Digital Audio Services) + +DXDEC EXPAPI void AILCALL AIL_set_sample_3D_volume_falloff(HSAMPLE S, MSSGRAPHPOINT* graph, S32 pointcount); +/* + Sets a sample's volume falloff graph. + + $:S Sample to affect + $:graph The array of points to use as the graph. + $:pointcount The number of points passed in. Must be less than or equal to MILES_MAX_FALLOFF_GRAPH_POINTS. Passing 0 removes the graph. + + This marks a sample as having a volume falloff graph. If a sample has a volume graph, it no + longer attenuates as per the default falloff function, and as such, its "minimum distance" no + longer has any effect. However, the "max distance" still clamps the sample to full attenuation. + + A graph with only one point is treated as a line, returning graph[0].Y always. + + Otherwise, the graph is evaluated as follows: + + + + The distance to the listener is evaluated. + + The two points with X values bounding "distance" are located. + + If the distance is past the last graph point, graph[pointcount-1].Y is returned. + + If either the output tangent type of the previous point, or the input tangent type of the next point are + MILES_TANGENT_STEP, previous->Y is returned. + + Otherwise, the segment is evaluated as a hermite curve. ITX and ITY are ignore if ITYpe is MILES_TANGENT_LINEAR, + and likewise OTX and OTY are ignored if OType is MILES_TANGENT_LINEAR. +*/ + +DXDEC EXPAPI void AILCALL AIL_set_sample_3D_lowpass_falloff(HSAMPLE S, MSSGRAPHPOINT* graph, S32 pointcount); +/* + Sets a sample's low pass cutoff falloff graph. + + $:S Sample to affect + $:graph The array of points to use as the graph. + $:pointcount The number of points passed in. Must be less than or equal to MILES_MAX_FALLOFF_GRAPH_POINTS. Passing 0 removes the graph. + + This marks a sample as having a low pass cutoff that varies as a function of distance to the listener. If + a sample has such a graph, $AIL_set_sample_low_pass_cut_off will be called constantly, and thus shouldn't be + called otherwise. + + The graph is evaluated the same as $AIL_set_sample_3D_volume_falloff. +*/ + +DXDEC EXPAPI void AILCALL AIL_set_sample_3D_exclusion_falloff(HSAMPLE S, MSSGRAPHPOINT* graph, S32 pointcount); +/* + Sets a sample's exclusion falloff graph. + + $:S Sample to affect + $:graph The array of points to use as the graph. + $:pointcount The number of points passed in. Must be less than or equal to MILES_MAX_FALLOFF_GRAPH_POINTS. Passing 0 removes the graph. + + This marks a sample as having an exclusion that varies as a function of distance to the listener. If + a sample has such a graph, auto_3D_wet_atten will be disabled to prevent double affects, as exclusion + affects reverb wet level. + + The graph is evaluated the same as $AIL_set_sample_3D_volume_falloff. +*/ + +DXDEC EXPAPI void AILCALL AIL_set_sample_3D_spread_falloff(HSAMPLE S, MSSGRAPHPOINT* graph, S32 pointcount); +/* + Sets a sample's spread falloff graph. + + $:S Sample to affect + $:graph The array of points to use as the graph. + $:pointcount The number of points passed in. Must be less than or equal to MILES_MAX_FALLOFF_GRAPH_POINTS. Passing 0 removes the graph. + + This marks a sample as having a spread that varies as a function of distance to the listener. See + $AIL_set_sample_3D_spread. + + The graph is evaluated the same as $AIL_set_sample_3D_volume_falloff. +*/ + +DXDEC EXPAPI void AILCALL AIL_set_sample_3D_position_segments(HSAMPLE S, MSSVECTOR3D* points, S32 point_count); +/* + Sets a sample's position as a series of line segments. + + $:S Sample to affect + $:points The 3D points representing the line segments. 0 reverts to classic point based positioning. All + segments are connected - N points represents N - 1 chained line segments. + $:point_count Size of points array. Minimum 2 (unless removing), max MILES_MAX_SEGMENT_COUNT + + This marks a sample as having a position that is not a single point. When 3D attenuation is computed, + the closest point to the listener is found by walking each segment. That position is then used in all + other computations (cones, falloffs, etc). Spatialization is done using all segments as a directional + source. + + If there is neither spread falloff nor volume falloff specified, spread will be automatically applied + when the listener is within min_distance to the closest point. See $AIL_set_sample_3D_spread_falloff + and $AIL_set_sample_3D_volume_falloff. + +*/ + +DXDEC EXPAPI void AILCALL AIL_set_sample_3D_spread(HSAMPLE S, F32 spread); +/* + Sets a sample's "spread" value. + + $:S Sample to affect. + $:spread The value to set the spread to. + + Spread is how much the directionality of a sample "spreads" to more speakers - emulating + the effect a sound has when it occupies more than a point source. For instance, a sound + point source that sits directly to the left of the listener would have a very strong left + speaker signal, and a fairly weak right speaker signal. Via spread, the signal would be + more even, causing the source to feel as though it is coming from an area, rather than + a point source. + + A spread of 1 will effectively negate any spatialization effects other than distance attenuation. +*/ + +DXDEC void AILCALL AIL_set_sample_3D_distances (HSAMPLE S, + F32 max_dist, + F32 min_dist, + S32 auto_3D_wet_atten); + + +DXDEC void AILCALL AIL_sample_3D_distances (HSAMPLE S, + F32 * max_dist, + F32 * min_dist, + S32 * auto_3D_wet_atten); + +DXDEC void AILCALL AIL_set_sample_3D_cone (HSAMPLE S, + F32 inner_angle, + F32 outer_angle, + F32 outer_volume_level); + +DXDEC void AILCALL AIL_sample_3D_cone (HSAMPLE S, + F32* inner_angle, + F32* outer_angle, + F32* outer_volume_level); + +DXDEC void AILCALL AIL_set_sample_3D_position (HSAMPLE obj, + F32 X, + F32 Y, + F32 Z); + +DXDEC void AILCALL AIL_set_sample_3D_velocity (HSAMPLE obj, + F32 dX_per_ms, + F32 dY_per_ms, + F32 dZ_per_ms, + F32 magnitude); + +DXDEC void AILCALL AIL_set_sample_3D_velocity_vector (HSAMPLE obj, + F32 dX_per_ms, + F32 dY_per_ms, + F32 dZ_per_ms); + +DXDEC void AILCALL AIL_set_sample_3D_orientation (HSAMPLE obj, + F32 X_face, + F32 Y_face, + F32 Z_face, + F32 X_up, + F32 Y_up, + F32 Z_up); + +DXDEC S32 AILCALL AIL_sample_3D_position (HSAMPLE obj, + F32 *X, + F32 *Y, + F32 *Z); + +DXDEC void AILCALL AIL_sample_3D_velocity (HSAMPLE obj, + F32 *dX_per_ms, + F32 *dY_per_ms, + F32 *dZ_per_ms); + +DXDEC void AILCALL AIL_sample_3D_orientation (HSAMPLE obj, + F32 *X_face, + F32 *Y_face, + F32 *Z_face, + F32 *X_up, + F32 *Y_up, + F32 *Z_up); + +DXDEC void AILCALL AIL_update_sample_3D_position (HSAMPLE obj, + F32 dt_milliseconds); + +DXDEC void AILCALL AIL_set_listener_3D_position (HDIGDRIVER dig, + F32 X, + F32 Y, + F32 Z); + +DXDEC void AILCALL AIL_set_listener_3D_velocity (HDIGDRIVER dig, + F32 dX_per_ms, + F32 dY_per_ms, + F32 dZ_per_ms, + F32 magnitude); + +DXDEC void AILCALL AIL_set_listener_3D_velocity_vector (HDIGDRIVER dig, + F32 dX_per_ms, + F32 dY_per_ms, + F32 dZ_per_ms); + +DXDEC void AILCALL AIL_set_listener_3D_orientation (HDIGDRIVER dig, + F32 X_face, + F32 Y_face, + F32 Z_face, + F32 X_up, + F32 Y_up, + F32 Z_up); + +DXDEC void AILCALL AIL_listener_3D_position (HDIGDRIVER dig, + F32 *X, + F32 *Y, + F32 *Z); + +DXDEC void AILCALL AIL_listener_3D_velocity (HDIGDRIVER dig, + F32 *dX_per_ms, + F32 *dY_per_ms, + F32 *dZ_per_ms); + +DXDEC void AILCALL AIL_listener_3D_orientation (HDIGDRIVER dig, + F32 *X_face, + F32 *Y_face, + F32 *Z_face, + F32 *X_up, + F32 *Y_up, + F32 *Z_up); + +DXDEC void AILCALL AIL_update_listener_3D_position (HDIGDRIVER dig, + F32 dt_milliseconds); + +#if defined( HOST_SPU_PROCESS ) + +DXDEC S32 AILCALL MilesStartAsyncThread( S32 thread_num, void const * param ); + +DXDEC S32 AILCALL MilesRequestStopAsyncThread( S32 thread_num ); + +DXDEC S32 AILCALL MilesWaitStopAsyncThread( S32 thread_num ); + +#endif + + +//----------------------------------------------------------------------------- +// +// MSS 8 Bank API +// +//----------------------------------------------------------------------------- + +EXPGROUP(Miles High Level Event System) + +// misc character maxes. +#define MSS_MAX_ASSET_NAME_BYTES 512 +#define MSS_MAX_PATH_BYTES 512 + +#ifdef DOCS_ONLY + +EXPTYPE typedef struct MSSSOUNDBANK {}; +/* + Internal structure. + + Use $HMSOUNDBANK instead. +*/ + +#endif + +EXPTYPE typedef struct SoundBank *HMSOUNDBANK; +/* + Describes a handle to an open sound bank. + + This handle typedef refers to an open soundbank which is usually obtained from the $AIL_add_soundbank function. +*/ + +EXPGROUP(highlevel_util) + +DXDEC EXPAPI HMSOUNDBANK AILCALL AIL_open_soundbank(char const *filename, char const* name); +/* + Open a sound bank. If you are using the event execution engine, use the add soundbank function + provided there. + + $:return 0 on fail, or a valid HMSOUNDBANK. + $:filename The filename of the soundbank to open. + + Opens a sound bank for use with the MSS8 high level functions. The sound bank must be + closed with $AIL_close_soundbank. Use $AIL_add_soundbank if the Miles Event system is used. +*/ + +DXDEC EXPAPI void AILCALL AIL_close_soundbank(HMSOUNDBANK bank); +/* + Close a soundbank previously opened with $AIL_open_soundbank. + + $:bank Soundbank to close. + + Close a soundbank previously opened with $AIL_open_soundbank. Presets/events loaded from + this soundbank are no longer valid. +*/ + +DXDEC EXPAPI char const * AILCALL AIL_get_soundbank_filename(HMSOUNDBANK bank); +/* + Return the filename used to open the given soundbank. + + $:bank Soundbank to query. + + $:return A pointer to the filename for the given soundbank, or 0 if bank is invalid. + + Returns a pointer to the filename for a soundbank. This pointer should not be deleted. +*/ + +DXDEC EXPAPI char const * AILCALL AIL_get_soundbank_name(HMSOUNDBANK bank); +/* + Return the name of the given soundbank. + + $:bank Soundbank to query. + + $:return A pointer to the name of the sound bank, or 0 if the bank is invalid. + + The name of the bank is the name used in asset names. This is distinct from the + file name of the bank. + + The return value should not be deleted. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_get_soundbank_mem_usage(HMSOUNDBANK bank); +/* + Returns the amount of data used by the soundbank management structures. + + $:bank Soundbank to query. + $:return Total memory allocated. + + Returns the memory used via AIL_mem_alloc_lock during the creation of this structure. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_presets(HMSOUNDBANK bank, HMSSENUM* next, char const* list, char const** name); +/* + Enumerate the sound presets stored in a soundbank. + + $:bank Containing soundbank. + $:next Enumeration token. Prior to first call, initialize to MSS_FIRST + $:list Optional filter. If specified, presets will only enumerate from the given preset sound preset list. + $:name The pointer to the currently enumerated preset name. This should not be deleted. + + $:return Returns 0 when enumeration is complete. + + Enumerates the sound presets available inside of a bank file. Example usage: + + ${ + HMSSENUM Token = MSS_FIRST; + const char* PresetName = 0; + while (AIL_enumerate_sound_presets(MyBank, &Token, 0, &PresetName)) + { + printf("Found a preset named %s!", PresetName); + + $AIL_apply_sound_preset(MySample, MyBank, PresetName); + } + $} + + Note that name should NOT be deleted by the caller - this points at memory owned by + Miles. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_enumerate_environment_presets(HMSOUNDBANK bank, HMSSENUM* next, char const* list, char const** name); +/* + Enumerate the environment presets stored in a soundbank. + + $:bank Containing soundbank. + $:next Enumeration token. Prior to first call, initialize to MSS_FIRST + $:list Optional filter. If specified, presets will only enumerate from the given environment preset list. + $:name The pointer to the currently enumerated preset name. This should not be deleted. + $:return Returns 0 when enumeration is complete. + + Enumerates the environment presets available inside of a bank file. Example usage: + + ${ + HMSSENUM Token = MSS_FIRST; + const char* PresetName = 0; + while (AIL_enumerate_environment_presets(MyBank, &Token, 0, &PresetName)) + { + printf("Found a preset named %s!", PresetName); + + AIL_apply_environment_preset(MyDriver, MyBank, PresetName); + } + $} + + Note that name should NOT be deleted by the caller - this points at memory owned by + Miles. +*/ + + +DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_assets(HMSOUNDBANK bank, HMSSENUM* next, char const** name); +/* + Enumerate sounds stored in a soundbank. + + $:bank Containing soundbank. + $:next Enumeration token. Prior to first call, initialize to MSS_FIRST + $:name The pointer to the currently enumerated sound name. This should not be deleted. + $:return Returns 0 when enumeration is complete. + + Enumerates the sounds available inside of a bank file. Example usage: + + ${ + HMSSENUM Token = MSS_FIRST; + const char* SoundName = 0; + while (AIL_enumerate_sound_assets(MyBank, &Token, &SoundName)) + { + char filename[MSS_MAX_PATH_BYTES]; + AIL_sound_asset_filename(MyBank, SoundName, filename); + + printf("Found a sound named %s!", SoundName); + + S32* pData = (S32*)AIL_file_read(filename, FILE_READ_WITH_SIZE); + AIL_mem_free_lock(pData); + } + $} + + Note that name should NOT be deleted by the caller - this points at memory owned by + Miles. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_enumerate_events(HMSOUNDBANK bank, HMSSENUM* next, char const * list, char const ** name); +/* + Enumerate the events stored in a soundbank. + + $:bank Soundbank to enumerate within. + $:next Enumeration token. Prior to first call, initialize to MSS_FIRST + $:list Optional filter. If specified, event will only enumerate from the given event list. + $:name The pointer to the currently enumerated preset name. This should not be deleted. + $:return Returns 0 when enumeration is complete. + + Enumerates the events available inside of a bank file. Example usage: + + ${ + HMSSENUM Token = MSS_FIRST; + const char* EventName = 0; + while (AIL_enumerate_events(MyBank, &Token, 0, &EventName)) + { + printf("Found an event named %s!", EventName); + + const U8* EventContents = 0; + AIL_get_event_contents(MyBank, EventName, &EventContents); + + AIL_enqueue_event(EventContents, 0, 0, 0, 0); + } + $} + + Note that name should NOT be deleted by the caller - this points at memory owned by + Miles. +*/ + +DXDEC EXPAPI void* AILCALL AIL_find_environment_preset(HMSOUNDBANK bank, char const *name); +/* + Returns the raw environment data associated with the given name. + + $:bank The bank to look within + $:name The name of the asset to search for, including bank name. + + $:return Raw environment data. This should not be deleted. + + This function is designed to be used with $AIL_apply_raw_environment_preset. +*/ + +DXDEC EXPAPI void* AILCALL AIL_find_sound_preset(HMSOUNDBANK bank, char const* name); +/* + Returns the raw preset data associated with the given name. + + $:bank The bank to look within + $:name The name of the asset to search for, including bank name. + + $:return Raw preset data. This should not be deleted. + + This function is designed to be used with $AIL_apply_raw_sound_preset. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_apply_raw_sound_preset(HSAMPLE sample, void* preset); +/* + Applies the sound preset to the given sample. + + $:sample The sample to modify. + $:preset The raw preset data to apply, returned from $AIL_find_sound_preset + + Updates sample properties based on the desired settings specified in the given preset. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_apply_sound_preset(HSAMPLE sample, HMSOUNDBANK bank, char const *name); +/* + Apply the sound preset to the given sample. + + $:sample The sample that will have its properties updated by the preset. + $:bank The sound bank containing the named preset. + $:name The name of the preset to apply. + $:return Returns 0 on fail - check for sample/bank validity, and that the preset is in the correct bank. + + This will alter the properties on a given sample, based on the given preset. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_unapply_raw_sound_preset(HSAMPLE sample, void* preset); +/* + Returns the properties altered by the preset to their default state. + + $:sample The sample to update. + $:preset The raw preset data to unapply, returned from $AIL_find_sound_preset +*/ + +DXDEC EXPAPI S32 AILCALL AIL_unapply_sound_preset(HSAMPLE sample, HMSOUNDBANK bank, char const *name); +/* + Restore the properties affected by the given preset to defaults. + + $:sample The sample that will have its properties updated by the preset. + $:bank The sound bank containing the named preset. + $:name The name of the preset to apply. + $:return Returns 0 on fail - check for sample/bank validity, and that the preset is in the correct bank. + + Presets may or may not affect any given property. Only the properties affected by the specified + preset will have their values restored to default. +*/ + +typedef S32 (*MilesResolveFunc)(void* context, char const* exp, S32 explen, EXPOUT void* output, S32 isfloat); +/* + Callback type for resolving variable expressions to values. + + $:context Value passed to AIL_resolve_raw_*_preset(). + $:exp The string expression to resolve. + $:explen Length of exp. + $:output Pointer to the memory to receive the result value. + $:isfloat nonzero if the output needs to be a float. + + The function callback should convert variable expressions in to an output value of the + requested type. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_resolve_raw_sound_preset(void* preset, void* context, MilesResolveFunc eval); +/* + Compute the value of properties for the current value of variables using the given lookup function. + + $:preset The raw preset as returns from $AIL_find_sound_preset. + $:context The context to pass in to the resolution function. + $:eval A function pointer to use for resolving expressions to values. + $:return 0 if the preset is invalid. + + This function converts variable expressions that were stored in the preset in to values + that can be used by the event system. The values are stored in the preset itself, all that + has to happen is this is called with a valid resolve function prior to calling + $AIL_apply_raw_sound_preset. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_resolve_raw_environment_preset(void* env, MilesResolveFunc eval); +/* + Compute the value of properties for the current value of variables using the given lookup function. + + $:env The raw preset as returns from $AIL_find_environment_preset. + $:context The context to pass in to the resolution function. + $:eval A function pointer to use for resolving expressions to values. + $:return 0 if the preset is invalid. + + This function converts variable expressions that were stored in the environment in to values + that can be used by the event system. The values are stored in the environment itself, all that + has to happen is this is called with a valid resolve function prior to calling + $AIL_apply_raw_environment_preset. +*/ + + +DXDEC EXPAPI S32 AILCALL AIL_apply_raw_environment_preset(HDIGDRIVER dig, void* environment); +/* + Applies the environment to the given driver. + + $:dig The driver to modify. + $:environment The raw environment data to apply, returned from $AIL_find_environment_preset + + Updates driver properties based on the desired settings specified in the given environment. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_apply_environment_preset(HDIGDRIVER dig, HMSOUNDBANK bank, char const *name); +/* + Apply the environment preset to the given driver. + + $:dig The driver that will have its properties updated by the preset. + $:bank The sound bank containing the named preset. + $:name The name of the preset to apply. + $:return Returns 0 on fail - check for sample/bank validity, and that the preset is in the correct bank. + + This will alter properties on a given driver, based on the given preset. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_unapply_raw_environment_preset(HDIGDRIVER dig, void* environment); +/* + Returns the properties the environment affects to default state. + + $:dig The driver to modify. + $:environment The raw environment data to unapply, returned from $AIL_find_environment_preset +*/ + +DXDEC EXPAPI S32 AILCALL AIL_unapply_environment_preset(HDIGDRIVER dig, HMSOUNDBANK bank, char const *name); +/* + Restore the properties affected by the given preset to defaults. + + $:dig The driver that will have its properties updated by the preset. + $:bank The sound bank containing the named preset. + $:name The name of the preset to apply. + $:return Returns 0 on fail - check for sample/bank validity, and that the preset is in the correct bank. + + Presets may or may not affect any given property. Only the properties affected by the specified + preset will have its value restored to default. +*/ + +EXPTYPE typedef struct _MILESBANKSOUNDINFO +{ + // If this changes at all, compiled banks must be versioned... + S32 ChannelCount; + U32 ChannelMask; + S32 Rate; + S32 DataLen; + S32 SoundLimit; + S32 IsExternal; + U32 DurationMs; + S32 StreamBufferSize; + S32 IsAdpcm; + S32 AdpcmBlockSize; + F32 MixVolumeDAC; +} MILESBANKSOUNDINFO; +/* + Structure containing all metadata associated with a sound asset. + + $:ChannelCount The number of channels the sound assets contains. + $:ChannelMask The channel mask for the sound asset. + $:Rate The sample rate for the sound asset. + $:DataLen The byte count the asset requires if fully loaded. + $:SoundLimit The maximum number of instances of this sound that is allowed to play at once. + $:IsExternal Nonzero if the sound is stored external to the sound bank. See the eventexternal sample. + $:DurationMs The length of the sound asset, in milliseconds. + $:StreamBufferSize If the sound is played as a stream, this is the buffer to use for this sound. + $:IsAdpcm Nonzero if the asset is an adpcm sound, and needs to be initialized as such. + $:AdpcmBlockSize The adpcm block size if the asset is adpcm encoded. + $:MixVolumeDAC The attenuation to apply to all instances of this sound, as a DAC scalar. + + See $AIL_sound_asset_info. +*/ + + +DXDEC EXPAPI S32 AILCALL AIL_sound_asset_info(HMSOUNDBANK bank, char const* name, char* out_name, MILESBANKSOUNDINFO* out_info); +/* + Return the meta data associated with a sound assets in a sound bank. + + $:bank The soundbank containing the sound asset. + $:name The name of the sound asset to find. + $:out_name Optional - Pointer to a buffer that is filled with the sound filename to use for loading. + $:out_info Pointer to a $MILESBANKSOUNDINFO structure that is filled with meta data about the sound asset. + $:return Returns the byte size of the buffer required for out_name. + + This function must be called in order to resolve the sound asset name to + something that can be used by miles. To ensure safe buffer containment, call + once with out_name as null to get the size needed. + + For external deployment see the eventexternal example program. +*/ + +DXDEC EXPAPI SINTa AILCALL AIL_get_marker_list(HMSOUNDBANK bank, char const* sound_name); +/* + Return an opaque value representing the list of markers attached to a given sound name. + + $:bank The bank containing the sound asset. + $:sound_name The name of the sound asset. + + $:return on fail/nonexistent list, or a nonzero opaque value to be passed to $AIL_find_marker_in_list. + + Returns the marker list for a given sound asset. This value should just be passed directly to $AIL_find_marker_in_list + to retrieve the offset for a marker by name. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_find_marker_in_list(SINTa marker_list, char const * marker_name, S32* is_samples); +/* + Returns the byte offset into a sample corresponding to the given marker name. + + $:marker_list The marker list returned from $AIL_get_marker_list. + $:marker_name The name of the marker to look up. + $:is_samples returns whether the marker is at a sample location instead of a byte location. + + $:return -1 if the marker was not found, or the byte offset of the marker. + + Looks up an offset to use in functions such as $AIL_set_sample_position. marker_list can be retrieved with + $AIL_get_marker_list. +*/ + +// ---------------------------- +// End MSS8 declarations +// ---------------------------- + +// +// Event routines +// +typedef struct _MEMDUMP* HMEMDUMP; +#define HMSSEVENTCONSTRUCT HMEMDUMP + +/*! + function + { + ExcludeOn = 1 + + Name = "AIL_create_event", "Creates an empty event to be filled with steps." + + ReturnType = "HMSSEVENTCONSTRUCT", "An empty event to be passed to the various step addition functions, or 0 if out of memory." + + Discussion = "Primarily designed for offline use, this function is the first step in + creating an event that can be consumed by the MilesEvent system. Usage is as follows: + + HMSSEVENTCONSTRUCT hEvent = AIL_create_event(); + + // misc add functions + AIL_add_start_sound_event_step(hEvent, ...); + AIL_add_control_sounds_event_step(hEvent, ...); + // etc + + char* pEvent = AIL_close_event(hEvent); + + // Do something with the event + + AIL_mem_free_lock(pEvent); + + Note that if immediately passed to AIL_enqueue_event(), the memory must remain valid until the following + $AIL_complete_event_queue_processing. + + Events are generally tailored to the MilesEvent system, even though there is nothing preventing you + from writing your own event system, or creation ui. + " + } +*/ +DXDEC HMSSEVENTCONSTRUCT AILCALL AIL_create_event(void); + +/*! + function + { + ExcludeOn = 1 + + Name = "AIL_close_event", "Returns a completed event, ready for enqueueing in to the MilesEvent system." + + In = "HMSSEVENTCONSTRUCT", "i_Event", "The event to complete." + + ReturnType = "char*", "An allocated event string that can be passed to AIL_next_event_step or enqueued in the + MilesEvent system via AIL_enqueue_event." + + Discussion = "The returned pointer must be deleted via AIL_mem_free_lock(). Note that if the MilesEvent system + is used, the event pointer must remain valid through the following $AIL_complete_event_queue_processing call." + + } +*/ +DXDEC U8* AILCALL AIL_close_event(HMSSEVENTCONSTRUCT i_Event); + +EXPTYPEBEGIN typedef S32 MILES_START_STEP_EVICTION_TYPE; +#define MILES_START_STEP_PRIORITY 0 +#define MILES_START_STEP_DISTANCE 1 +#define MILES_START_STEP_VOLUME 2 +#define MILES_START_STEP_OLDEST 3 +EXPTYPEEND +/* + Determines the behavior of a sound if it encounters a limit trying to play. + + $:MILES_START_STEP_PRIORITY Evict a sound less than our priority. + $:MILES_START_STEP_DISTANCE Evict the farthest sound from the listener. + $:MILES_START_STEP_VOLUME Evict the quietest sound after mixing, using the loudest channel as the qualifier. + $:MILES_START_STEP_OLDEST Evict the sound that has been playing the longest. + + See also $AIL_add_start_sound_event_step. +*/ + +EXPTYPEBEGIN typedef S32 MILES_START_STEP_SELECTION_TYPE; +#define MILES_START_STEP_RANDOM 0 +#define MILES_START_STEP_NO_REPEATS 1 +#define MILES_START_STEP_IN_ORDER 2 +#define MILES_START_STEP_RANDOM_ALL_BEFORE_REPEAT 3 +#define MILES_START_STEP_BLENDED 4 +#define MILES_START_STEP_SELECT_MASK 0x7 +#define MILES_START_STEP_SELECT_BITS 3 +EXPTYPEEND +/* + Determines the usage of the sound names list in the $AIL_add_start_sound_event_step. + + $:MILES_START_STEP_RANDOM Randomly select from the list, and allow the same + sound to play twice in a row. This is the only selection type that doesn't require + a state variable. + $:MILES_START_STEP_NO_REPEATS Randomly select from the list, but prevent the last sound from being the same. + $:MILES_START_STEP_IN_ORDER Play the list in order, looping. + $:MILES_START_STEP_RANDOM_ALL_BEFORE_REPEAT Randomly select from the list, but don't allow duplicates until all sounds have been played. + $:MILES_START_STEP_BLENDED Play *all* of the sounds, using the state variable as both the variable name to poll, + and the name of the blend function to look up. The blend should have been specified prior to execution of + this step in the runtime, see $AIL_add_setblend_event_step. + $:MILES_START_STEP_SELECT_MASK Expect a value from the game to determine which sound to play, added in to the other selection type. +*/ + +/*! + function + { + ExcludeOn = 1 + + Name = "AIL_add_start_sound_event_step", "Adds a step to a given event to start a sound with the given specifications." + + In = "HMSSEVENTCONSTRUCT", "i_Event", "The event to add the step to." + In = "const char*", "i_SoundNames", "The names and associated weights for the event step to choose from. + If there are multiple names listed, the sound will be chosen at random based on the given weights. This + string is of the form 'BankName1/SoundName1:Weight1:BankName2/SoundName2:Weight2:' etc. The string must always + terminate in a ':'. Weight must be between 0 and 200. To provide a null sound to randomly choose to not play anything, use + an empty string as an entry." + + In = "const char*", "i_PresetName", "[optional] The name of the preset, of the form 'PresetList/PresetName'" + In = "U8", "i_PresetIsDynamic", "Nonzero if the preset should poll the value of variables every frame, instead of only when applied." + In = "const char*", "i_EventName", "[optional] The name of the event to execute upon completion of the sound, of the form 'PresetList/PresetName'" + In = "const char*", "i_StartMarker", "[optional] The name of a marker to use as the loop start point." + In = "const char*", "i_EndMarker", "[optional] The name of a marker to use as the loop end point." + In = "const char*", "i_StateVar", "[optional] The name of a variable to use for storing state associated with this start sound step." + In = "char const*", "i_VarInit", "[optional] A list of variable names, mins, and maxes to use for randomizing the sound instance state." + In = "const char*", "i_Labels", "[optional] A comma delimited list of labels to assign to the sound." + In = "U32", "i_Streaming", "If nonzero, the sound will be set up and started as a stream." + In = "U8", "i_CanLoad", "If nonzero, the sound is allowed to hit the disk instead of only accessing cached sounds. If true, this might cause a hitch." + In = "U16", "i_Delay", "The minimum delay in ms to apply to the sound before start." + In = "U16", "i_DelayMax", "The maximum delay in ms to apply to the sound before start." + In = "U8", "i_Priority", "The priority to assign to the sound. If a sound encounters a limit based on its labels, it will evict any sound + with a priority strictly less than the given priority." + In = "U8", "i_LoopCount", "The loop count as per AIL_set_sample_loop_count." + In = "const char*", "i_StartOffset", "[optional] The name of the marker to use as the sound's initial offset." + In = "F32", "i_VolMin", "The min volume value to randomly select for initial volume for the sound. In LinLoud." + In = "F32", "i_VolMax", "The max volume value to randomly select for initial volume for the sound. In LinLoud." + In = "F32", "i_PitchMin", "The min pitch to randomly select from for initial playback. In sT." + In = "F32", "i_PitchMax", "The max pitch to randomly select from for initial playback. In sT." + In = "F32", "i_FadeInTime", "The time to fade the sound in over. Interpolation is linear in loudness." + In = "U8", "i_EvictionType", "The basis for deciding what sound will get kicked out if a limit is hit when trying to play this sound. See $MILES_START_STEP_EVICTION_TYPE." + In = "U8", "i_SelectType", "The method to use for selecting the sound to play from the sound name list. See $MILES_START_SOUND_SELECTION_TYPE." + + ReturnType = "S32", "Returns 1 on success." + + Discussion = "Adds an event that can start a sound. If the sound names list contains multiple entries, one will be selected + randomly based on the given weights and the selection type. Weights are effectively ratios for likelihood. A sound with 100 weight will be twice as likely + as a sound with 50 weight. Some times you may want to have an event that only *might* play a sound. To do this, add a empty sound name + with an associated weight. + " + } +*/ +DXDEC +S32 +AILCALL +AIL_add_start_sound_event_step( + HMSSEVENTCONSTRUCT i_Event, + const char* i_SoundNames, + const char* i_PresetName, + U8 i_PresetIsDynamic, + const char* i_EventName, + const char* i_StartMarker, const char* i_EndMarker, + char const* i_StateVar, char const* i_VarInit, + const char* i_Labels, U32 i_Streaming, U8 i_CanLoad, + U16 i_Delay, U16 i_DelayMax, U8 i_Priority, U8 i_LoopCount, + const char* i_StartOffset, + F32 i_VolMin, F32 i_VolMax, F32 i_PitchMin, F32 i_PitchMax, + F32 i_FadeInTime, + U8 i_EvictionType, + U8 i_SelectType + ); + +/*! + function + { + ExcludeOn = 1 + + Name = "AIL_add_cache_sounds_event_step", "Adds a step to an event to load a list of sounds in to memory for play." + + In = "HMSSEVENTCONSTRUCT", "i_Event", "The event to add on to." + In = "const char*", "bankName", "The bank filename containing all of the sounds." + In = "const char*", "i_Sounds", "A list of colon separated sounds to load from the bank file." + + ReturnType = "S32", "Returns 1 on success." + + Discussion = "In general events are not allowed to hit the disk in order to prevent unexpected hitching during + gameplay. In order to facilitate that, sounds need to be preloaded by this event. Each cache step can only + load sounds from a single bank file, so for multiple bank files, multiple steps will be needed. + + In order to release the data loaded by this event, AIL_add_uncache_sounds_event_step() needs to + be called with the same parameters. + + If you are using MilesEvent, the data is refcounted so the sound will not be freed until all + samples using it complete." + } +*/ +DXDEC +S32 +AILCALL +AIL_add_cache_sounds_event_step( + HMSSEVENTCONSTRUCT i_Event, const char* bankName, const char* i_Sounds); + + +/*! + function + { + ExcludeOn = 1 + + Name = "AIL_add_uncache_sounds_event_step", "Adds a step to an event to free a list of sounds previously loaded in to memory for play." + + In = "HMSSEVENTCONSTRUCT", "i_Event", "The event to add on to." + In = "const char*", "bankName", "The bank filename containing all of the sounds." + In = "const char*", "i_Sounds", "A list of colon separated sounds from the bank file to uncache." + + ReturnType = "S32", "Returns 1 on success." + + Discussion = "This event released sounds loaded via AIL_add_cache_sounds_event_step()" + } +*/ +DXDEC +S32 +AILCALL +AIL_add_uncache_sounds_event_step( + HMSSEVENTCONSTRUCT i_Event, const char* bankName, const char* i_Sounds); + + +EXPTYPEBEGIN typedef S32 MILES_CONTROL_STEP_TYPE; +#define MILES_CONTROL_STEP_STOP 3 +#define MILES_CONTROL_STEP_STOP_NO_EVENTS 4 +#define MILES_CONTROL_STEP_PASS 0 +#define MILES_CONTROL_STEP_PAUSE 1 +#define MILES_CONTROL_STEP_RESUME 2 +#define MILES_CONTROL_STEP_STOP_FADE 5 + +EXPTYPEEND +/* + Determines how the playhead is adjusted during a $AIL_add_control_sounds_event_step. + + $:MILES_CONTROL_STEP_STOP Stop the affected sounds. + $:MILES_CONTROL_STEP_PASS Do not change the playhead. + $:MILES_CONTROL_STEP_PAUSE Pause the affected sounds. + $:MILES_CONTROL_STEP_RESUME Resume the affected sounds. + $:MILES_CONTROL_STEP_STOP_NO_EVENTS Stop the affected sounds, and prevent their completion events from playing. + $:MILES_CONTROL_STEP_STOP_FADE Stop the sound after fading the sound out linearly in loudness. +*/ + +#define MILES_CONTROL_STEP_IGNORELOOP 255 + +/*! + function + { + ExcludeOn = 1 + + Name = "AIL_add_control_sounds_event_step", "Adds a step to an event to control sample playback by label." + + In = "HMSSEVENTCONSTRUCT", "i_Event", "The event to add on to." + In = "const char*", "i_Labels", "[optional] A comma seperated list of labels to control." + In = "const char*", "i_MarkerStart", "[optional] If exists, sets the loop start to the marker's offset." + In = "const char*", "i_MarkerEnd", "[optional] If exists, sets the loop end to the marker's offset." + In = "const char*", "i_Position", "[optional] If exists, sets the current playback position to the marker's offset." + In = "const char*", "i_PresetName", "[optional] The name of the preset to apply, of the form Bank/PresetList/PresetName." + In = "U8", "i_PresetApplyType", "If nonzero, the preset is applied dynamically(the variables are polled every frame)." + In = "U8", "i_LoopCount", "If the loop count is not to be affected, pass MILES_CONTROL_STEP_IGNORELOOP. Otherwise, the sample's loop count will be set to this value." + In = "U8", "i_Type", "The control type requested. See $MILES_CONTROL_STEP_TYPE." + + ReturnType = "S32", "Returns 1 on success." + + Discussion = "Controls playback of current instances. The sounds are matched either on name or label. If + i_Labels is null, all sounds will be controlled. + " + } +*/ +DXDEC +S32 +AILCALL +AIL_add_control_sounds_event_step( + HMSSEVENTCONSTRUCT i_Event, + const char* i_Labels, const char* i_MarkerStart, const char* i_MarkerEnd, const char* i_Position, + const char* i_PresetName, + U8 i_PresetApplyType, + F32 i_FadeOutTime, + U8 i_LoopCount, U8 i_Type); + + +/*! + function + { + ExcludeOn = 1 + + Name = "AIL_add_apply_environment_event_step", "Adds a step to an event to apply an environment preset." + + In = "HMSSEVENTCONSTRUCT", "i_Event", "The event to add on to." + In = "const char*", "i_EnvName", "The name of the environment preset to apply, of the form EnvList/EnvName." + In = "U8", "i_IsDynamic", "If nonzero, any variables in the environment are polled every frame." + + ReturnType = "S32", "Returns 1 on success." + + Discussion = "Applies the specified environment preset to the current HDIGDRIVER." + } +*/ +DXDEC S32 AILCALL AIL_add_apply_environment_event_step(HMSSEVENTCONSTRUCT i_Event, const char* i_EnvName, U8 i_IsDynamic); + +/*! + function + { + ExcludeOn = 1 + + Name = "AIL_add_comment_event_step", "Adds a step that represents a comment to the user of the editing tool." + + In = "HMSSEVENTCONSTRUCT", "i_Event", "The event to add on to." + In = "const char*", "i_Comment", "A string to display in the editing tool." + + ReturnType = "S32", "Returns 1 on success." + + Discussion = "This event is ignored in the runtime, and only exist for editing convenience." + } +*/ +DXDEC S32 AILCALL AIL_add_comment_event_step(HMSSEVENTCONSTRUCT i_Event, const char* i_Comment); + +EXPTYPEBEGIN typedef S32 MILES_RAMP_TYPE; +#define MILES_RAMPTYPE_VOLUME 0 +#define MILES_RAMPTYPE_WET 1 +#define MILES_RAMPTYPE_LOWPASS 2 +#define MILES_RAMPTYPE_RATE 3 +EXPTYPEEND +/* + The different values the ramps can affect. + + $:MILES_RAMPTYPE_VOLUME The ramp will adjust the sample's volume, and will interpolate in loudness level. Target is in dB. + $:MILES_RAMPTYPE_WET The ramp will affect the sample's reverb wet level, and will interpolate in loudness. Target is in dB. + $:MILES_RAMPTYPE_LOWPASS The ramp will affect the sample's low pass cutoff. Interpolation and target are in Hz. + $:MILES_RAMPTYPE_RATE The ramp will affect the sample's playback rate. Interpolation and target are in sT. +*/ + +EXPTYPEBEGIN typedef S32 MILES_INTERP_TYPE; +#define MILES_INTERP_LINEAR 0 +#define MILES_INTERP_EXP 1 +#define MILES_INTERP_SCURVE 2 +EXPTYPEEND +/* + The different ways the interpolation occurs for a ramp. + + $:MILES_INTERP_LINEAR The ramp will lerp between the current value and the target. + $:MILES_INTERP_EXP The ramp will move toward the target slowly at first, then faster as it closes on its total time. + $:MILES_INTERP_SCURVE The ramp will quickly move to about halfway, then slowly move, then move more quickly as it ends. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_add_ramp_event_step( + HMSSEVENTCONSTRUCT i_Event, char const* i_Name, char const* i_Labels, + F32 i_Time, char const* i_Target, U8 i_Type, U8 i_ApplyToNew, U8 i_InterpolationType); +/* + Add an event step that updates or creates a new ramp in the runtime. + + $:i_Event The event to add the step to. + $:i_Name The name of the ramp. If this name already exists, the ramp will shift its target to the new value. + $:i_Labels The label query determining the sounds the ramp will affect. + $:i_Time The length the time in seconds the ramp will take to reach its target. + $:i_Target The target value, or a variable expression representing the target value. The target's type is + dependent on i_Type. + $:i_Type One of the $MILES_RAMP_TYPE values. + $:i_ApplyToNew If 1, the ramp will affect sounds that start after the ramp is created. If not, it will only affect sounds that + are playing when the ramp is created. This value can not be changed once the ramp has been created. + $:i_InterpolationType The method the ramp will affect the target values. One of $MILES_INTERP_TYPE values. + + Ramps are means of interpolating aspects of samples. They are removed from the system if they are targeted to + a value for their type that is a non-op - meaning 0 dB, 0 sT, or >24000 Hz. + + Ramps use the current value as the start point for the interpolation. They stay at the target point, + so you can use the same ramp name to adjust a sound's volume down, and later ramp it back up. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_add_setblend_event_step(HMSSEVENTCONSTRUCT i_Event, + char const* i_Name, S32 i_SoundCount, F32 const* i_InMin, F32 const* i_InMax, + F32 const* i_OutMin, F32 const* i_OutMax, F32 const* i_MinP, F32 const* i_MaxP); +/* + Defines a named blend function to be referenced by a blended sound later. + + $:i_Event The event to add the step to. + $:i_Name The name of the blend. This is the name that will be + referenced by the state variable in start sound, as well as the variable name + to set by the game to update the blend for an instance. + $:i_SoundCount The number of sounds this blend will affect. Max 10. + $:i_InMin Array of length i_SoundCount representing the value of the blend variable the sound will start to fade in. + $:i_InMax Array of length i_SoundCount representing the value of the blend variable the sound will reach full volume. + $:i_OutMin Array of length i_SoundCount representing the value of the blend variable the sound will start to fade out. + $:i_OutMax Array of length i_SoundCount representing the value of the blend variable the sound will cease to be audible. + $:i_MinP Array of length i_SoundCount representing the pitch of the sound when it starts to fade in. + $:i_MaxP Array of length i_SoundCount representing the pitch of the sound when it has completed fading out. + + This step only sets up the lookup for when a blended sound is actually started. When a blended sound plays, every frame it + polls its state variable, then searches for a blend of the same name. If it finds both, then it uses its index in + the start sounds list to find its relevant values from the blended sound definition. + + Once it has the correct values, it uses them to affect the sample as stated in the parameter docs above. +*/ + +/*! + function + { + ExcludeOn = 1 + + Name = "AIL_add_sound_limit_event_step", "Adds a step that defines the maximum number of playing sounds per label." + + In = "HMSSEVENTCONSTRUCT", "i_Event", "The event to add on to." + In = "const char*", "i_SoundLimits", "A string of the form `"label count:anotherlabel count`"." + + ReturnType = "S32", "Returns 1 on success." + + Discussion = "Defines limits for instances of sounds on a per label basis. Sounds with multiple labels + must fit under the limits for all of their labels. By default sounds are not limited other than the + Miles max sample count." + } +*/ +DXDEC S32 AILCALL +AIL_add_sound_limit_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_LimitName, const char* i_SoundLimits); + +/*! + function + { + ExcludeOn = 1 + + Name = "AIL_add_persist_preset_event_step", "Adds a preset that applies to current sound instances, and continues to be applied to new sounds as they are started." + In = "HMSSEVENTCONSTRUCT", "i_Event", "The event to add on to." + In = "const char*", "i_PresetName", "The name of the preset, of the form PresetList/PresetName. See discussion." + In = "const char*", "i_PersistName", "The name of this persisted preset, for future removal." + In = "const char*", "i_Labels", "The labels to apply this preset to." + In = "U8", "i_IsDynamic", "If nonzero, the preset polls its variables every frame." + + ReturnType = "S32", "Returns 1 on success." + + Discussion = "Defines a preset by name that remains in the system, testing against all started sounds for label match. If a + match occurs, then the preset is applied to the new sound, before the preset specified in the startsound step itself. + + In order to remove a persisted preset, refer to it by name, but leave all other parameters null. + + Example: + + // Persist a preset for players. + AIL_add_persist_preset_event_step(hEvent, , `"Bank/PlayerEffects/Underwater`", `"Underwater`", `"player`"); + + // Remove the above preset. + AIL_add_persist_preset_event_step(hEvent, 0, `"Underwater`", 0);" + } +*/ +DXDEC S32 AILCALL +AIL_add_persist_preset_event_step(HMSSEVENTCONSTRUCT i_Event, const char* i_PresetName, const char* i_PersistName, + const char* i_Labels, U8 i_IsDynamic + ); + +DXDEC EXPAPI S32 AILCALL AIL_get_event_contents(HMSOUNDBANK bank, char const * name, U8 const** event); +/* + Return the event data for an event, by name. + + $:bank Soundbank containing the event. + $:name Name of the event to retrieve. + $:event Returns an output pointer to the event contents. Note that this string isn't null terminated, and + thus shouldn't be checked via strlen, etc. + $:return Returns 0 on fail. + + Normally, event contents are meant to be handled by the Miles high-level system via $AIL_enqueue_event, + rather than inspected directly. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_add_clear_state_event_step(HMSSEVENTCONSTRUCT i_Event); +/* + Clears all persistent state in the runtime. + + $:i_Event The event to add the step to. + + This removes all state that can stick around after an event in done executing. Ramps, Blends, Persisted + Preset, etc. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_add_exec_event_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_EventName); +/* + Adds a step to run another named event. + + $:i_Event The event to add the step to. + $:i_EventName The name of the event, of the form "Bank/Path/To/Event". + + When this step is encountered, the event is enqueued, so it will be executed the following frame (currently). It has the same parent + event mechanics as a completion event, so the QueuedId for a sound started by it will be for the event + that fired this step. +*/ + + +DXDEC EXPAPI S32 AILCALL AIL_add_enable_limit_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_LimitName); +/* + Adds a step to set the currently active limit. + + $:i_Event The event to add the step to. + $:i_EventName The name of the limit, as defined by a set_limits event. + +*/ + +DXDEC EXPAPI S32 AILCALL AIL_add_set_lfo_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_Name, char const* i_Base, char const* i_Amp, char const* i_Freq, S32 i_Invert, S32 i_Polarity, S32 i_Waveform, S32 i_DutyCycle, S32 i_IsLFO); +/* + Adds a step to define a variable that oscillates over time. + + $:i_Event The event to add the step to. + $:i_Name The nane of the variable to oscillate. + $:i_Base The value to oscillate around, or a variable name to use as the base. + $:i_Amp The maximum value to reach, or a variable name to use as the amplitude. + $:i_Freq The rate at which the oscillation occurs, or a variable name to use as the rate. Rate should not exceed game tick rate / 2. + $:i_Invert Whether the waveform should be inverted. + $:i_Polarity Bipolar (1) or Unipolar (0) - whether the waveform goes around the base or only above it. + $:i_Waveform Sine wave (0), Triangle (1), Saw (2), or Square(3) + $:i_DutyCycle Only valid for square, determines what percent of the wave is "on". (0-100) + $:i_IsLFO If zero, Base is the default value to assign the variable when the settings are applied, and the rest of the parameters are ignored. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_add_move_var_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_Name, const F32 i_Times[2], const S32 i_InterpolationTypes[2], const F32 i_Values[3]); +/* + Adds a step to set and move a variable over time on a curve. + + $:i_Event The event to add the step to. + $:i_Name The variable to move. + $:i_Times The midpoint and final times for the curves + $:i_InterpolationTypes The curve type for the two curves - Curve In (0), Curve Out (1), S-Curve (2), Linear (3) + $:i_Values The initial, midpoint, and final values for the variable. + + The variable is locked to this curve over the timeperiod - no interpolation from a previous value is done. + + If an existing move var exists when the new one is added, the old one is replaced. +*/ + +enum EVENT_STEPTYPE +{ + EVENT_STEPTYPE_STARTSOUND = 1, + EVENT_STEPTYPE_CONTROLSOUNDS, + EVENT_STEPTYPE_APPLYENV, + EVENT_STEPTYPE_COMMENT, + EVENT_STEPTYPE_CACHESOUNDS, + EVENT_STEPTYPE_PURGESOUNDS, + EVENT_STEPTYPE_SETLIMITS, + EVENT_STEPTYPE_PERSIST, + EVENT_STEPTYPE_VERSION, + EVENT_STEPTYPE_RAMP, + EVENT_STEPTYPE_SETBLEND, + EVENT_STEPTYPE_CLEARSTATE, + EVENT_STEPTYPE_EXECEVENT, + EVENT_STEPTYPE_ENABLELIMIT, + EVENT_STEPTYPE_SETLFO, + EVENT_STEPTYPE_MOVEVAR +}; + +//! Represents an immutable string that is not null terminated, and shouldn't be deleted. +struct _MSSSTRINGC +{ + const char* str; + S32 len; +}; +typedef struct _MSSSTRINGC MSSSTRINGC; + + +/*! + Represents a single step that needs to be executed for an event. + + All of the members in the structures share the same definition as + their counterpart params in the functions that added them during + event construction. +*/ +struct EVENT_STEP_INFO +{ + //! type controls which struct in the union is accessed. + enum EVENT_STEPTYPE type; + union + { + struct + { + MSSSTRINGC soundname; + MSSSTRINGC presetname; + MSSSTRINGC eventname; + MSSSTRINGC labels; + MSSSTRINGC markerstart; + MSSSTRINGC markerend; + MSSSTRINGC startoffset; + MSSSTRINGC statevar; + MSSSTRINGC varinit; + U32 stream; + F32 volmin,volmax,pitchmin,pitchmax; + F32 fadeintime; + U16 delaymin; + U16 delaymax; + U8 canload; + U8 priority; + U8 loopcount; + U8 evictiontype; + U8 selecttype; + U8 presetisdynamic; + } start; + + struct + { + MSSSTRINGC labels; + MSSSTRINGC markerstart; + MSSSTRINGC markerend; + MSSSTRINGC position; + MSSSTRINGC presetname; + F32 fadeouttime; + U8 presetapplytype; + U8 loopcount; + U8 type; + } control; + + struct + { + MSSSTRINGC envname; + U8 isdynamic; + } env; + + struct + { + MSSSTRINGC comment; + } comment; + + struct + { + MSSSTRINGC lib; + const char** namelist; + S32 namecount; + } load; + + struct + { + MSSSTRINGC limits; + MSSSTRINGC name; + } limits; + + struct + { + MSSSTRINGC name; + MSSSTRINGC presetname; + MSSSTRINGC labels; + U8 isdynamic; + } persist; + + struct + { + MSSSTRINGC name; + MSSSTRINGC labels; + MSSSTRINGC target; + F32 time; + U8 type; + U8 apply_to_new; + U8 interpolate_type; + } ramp; + + struct + { + MSSSTRINGC name; + F32 inmin[10]; + F32 inmax[10]; + F32 outmin[10]; + F32 outmax[10]; + F32 minp[10]; + F32 maxp[10]; + U8 count; + } blend; + + struct + { + MSSSTRINGC eventname; + } exec; + + struct + { + MSSSTRINGC limitname; + } enablelimit; + + struct + { + MSSSTRINGC name; + MSSSTRINGC base; + MSSSTRINGC amplitude; + MSSSTRINGC freq; + S32 invert; + S32 polarity; + S32 waveform; + S32 dutycycle; + S32 islfo; + } setlfo; + + struct + { + MSSSTRINGC name; + F32 time[2]; + S32 interpolate_type[2]; + F32 value[3]; + } movevar; + }; +}; + +/*! + function + { + ExcludeOn = 1 + + Name = "AIL_next_event_step", "Retrieves the next step in the event buffer, parsing it in to a provided buffer." + + In = "const U8*", "i_EventString", "The event returned by $AIL_close_event, or a previous call to $AIL_next_event_step" + Out = "const EVENT_STEP_INFO*", "o_Step", "A pointer to the step struct will be stored here." + In = "void*", "i_Buffer", "A working buffer for the function to use for parsing." + In = "S32", "i_BufferSize", "The size in bytes of the working buffer." + + ReturnType = "U8 char*", "Returns 0 on fail or when the event string has been exhausted of steps. Otherwise, returns + the string location of the next event step in the buffer." + + Discussion = "This function parses the event string in to a struct for usage by the user. This function should only be + used by the MilesEvent system. It returns the pointer to the next step to be passed to this function to get the + next step. In this manner it can be used in a loop: + + // Create an event to stop all sounds. + HMSSEVENTCONSTRUCT hEvent = AIL_create_event(); + AIL_add_control_sound_event_step(hEvent, 0, 0, 0, 0, 0, 0, 255, 3); + char* pEvent = AIL_close_event(hEvent); + + char EventBuffer[4096]; + EVENT_STEP_INFO* pStep = 0; + char* pCurrentStep = pEvent; + + while (pCurrentStep) + { + pStep = 0; + pCurrentStep = AIL_next_event_step(pCurrentStep, &pStep, EventBuffer, 4096); + if (pStep == 0) + { + // Error, or an empty event. If $AIL_last_error is an empty string, then it was an empty event. + break; + } + + // Handle event step. + switch (pStep->type) + { + default: break; + } + } + + AIL_mem_free_lock(pEvent); + " + } +*/ +DXDEC const U8* AILCALL AIL_next_event_step(const U8* i_EventString, struct EVENT_STEP_INFO** o_Step, void* i_Buffer, S32 i_BufferSize); + + +// Old style names. +#define AIL_find_event MilesFindEvent +#define AIL_clear_event_queue MilesClearEventQueue +#define AIL_register_random MilesRegisterRand +#define AIL_enumerate_sound_instances MilesEnumerateSoundInstances +#define AIL_enumerate_preset_persists MilesEnumeratePresetPersists +#define AIL_enqueue_event MilesEnqueueEvent +#define AIL_enqueue_event_system MilesEnqueueEventContext +#define AIL_enqueue_event_by_name MilesEnqueueEventByName +#define AIL_begin_event_queue_processing MilesBeginEventQueueProcessing +#define AIL_complete_event_queue_processing MilesCompleteEventQueueProcessing +#define AIL_startup_event_system MilesStartupEventSystem +#define AIL_shutdown_event_system MilesShutdownEventSystem +#define AIL_add_soundbank MilesAddSoundBank +#define AIL_release_soundbank MilesReleaseSoundBank +#define AIL_set_sound_label_limits MilesSetSoundLabelLimits +#define AIL_text_dump_event_system MilesTextDumpEventSystem +#define AIL_event_system_state MilesGetEventSystemState +#define AIL_get_event_length MilesGetEventLength +#define AIL_stop_sound_instances MilesStopSoundInstances +#define AIL_pause_sound_instances MilesPauseSoundInstances +#define AIL_resume_sound_instances MilesResumeSoundInstances +#define AIL_start_sound_instance MilesStartSoundInstance +#define AIL_set_event_error_callback MilesSetEventErrorCallback +#define AIL_set_event_bank_functions MilesSetBankFunctions +#define AIL_get_event_bank_functions MilesGetBankFunctions + +#define AIL_set_variable_int MilesSetVarI +#define AIL_set_variable_float MilesSetVarF +#define AIL_variable_int MilesGetVarI +#define AIL_variable_float MilesGetVarF + +#define AIL_set_sound_start_offset MilesSetSoundStartOffset +#define AIL_requeue_failed_asyncs MilesRequeueAsyncs +#define AIL_add_event_system MilesAddEventSystem + +#define AIL_audition_local_host MilesAuditionLocalHost +#define AIL_audition_connect MilesAuditionConnect +#define AIL_audition_startup MilesAuditionStartup +#define AIL_audition_shutdown MilesAuditionShutdown +EXPGROUP(Miles High Level Event System) + +EXPTYPE typedef void* HEVENTSYSTEM; +/* + The type used to distinguish between running event systems. + + Only used if multiple event systems are running. See the eventmultiple example. +*/ + +DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_startup_event_system(HDIGDRIVER dig, S32 command_buf_len, EXPOUT char* memory_buf, S32 memory_len); +/* + Initializes the Miles Event system and associates it with an open digital driver. + + $:dig The digital sound driver that this event system should use. + $:command_buf_len An optional number of bytes to use for the command buffer. If you pass 0, a reasonable default will be used (currently 5K). + $:memory_buf An optional pointer to a memory buffer buffer that the event system will use for all event allocations. + Note that the sound data itself is not stored in this buffer - it is only for internal buffers, the command buffer, and instance data. + Use 0 to let Miles to allocate this buffer itself. + $:memory_len If memory_buf is non-null, then this parameter provides the length. If memory_buf is null, the Miles will + allocate this much memory for internal buffers. If both memory_buf and memory_len are null, the Miles will allocate reasonable default (currently 64K). + $:return Returns 0 on startup failure. + + This function starts up the Miles Event System, which is used to trigger events throughout your game. + You call it after $AIL_open_digital_driver. +*/ + +DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_add_event_system(HDIGDRIVER dig); +/* + Creates an additional event system attached to a different driver, in the event that you need to trigger events + tied to different sound devices. + + $:dig The digital sound driver to attach the new event system to. + $:return A handle to the event system to use in various high level functions. + + Both systems will access the same set of loaded soundbanks, and are updated when $AIL_begin_event_queue_processing is called. + + To enqueue events to the new system, use $AIL_enqueue_event_system. + + To iterate the sounds for the new system, pass the $HEVENTSYSTEM as the first parameter to $AIL_enumerate_sound_instances. + + To access or set global variables for the new system, pass the $HEVENTSYSTEM as the context in the variable access functions. + + See also the eventmultiple.cpp example program. +*/ + +DXDEC EXPAPI void AILCALL AIL_shutdown_event_system( void ); +/* + Shuts down the Miles event system. + + This function will closes everything in the event system - it ignores reference counts. It will free + all event memory, sound banks, and samples used by the system. +*/ + +DXDEC EXPAPI HMSOUNDBANK AILCALL AIL_add_soundbank(char const * filename, char const* name); +/* + Open and add a sound bank for use with the event system. + + $:filename Filename of the bank to load. + $:name The name of the soundbank to load - this is only used for auditioning. + $:return The handle to the newly loaded soundbank (zero on failure). + + This function opens the sound bank and makes it available to the event system. The filename + is the name on the media, and the name is the symbolic name you used in the Miles Sound Studio. + You might, for example, be using a soundbank with a platform extension, like: 'gamebank_ps3.msscmp', + and while using the name 'gamebank' for authoring and auditioning. + + Sound data is not loaded when this function is called - it is only loaded when the relevant Cache Sounds + is played, or a sound requiring it plays. + + This function will access the disc, so you will usually call it at level load time. + + If you are using the Auditioner, $AIL_audition_startup and $AIL_audition_connect must be called prior + to this function. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_release_soundbank(HMSOUNDBANK bank); +/* + Releases a sound bank from the event system. + + $:bank The bank to close. + $:return Returns non-zero for success (zero on failure). + + This function closes a given soundbank. Any data references in the event system need to be removed beforehand - with + $AIL_enqueue_event_by_name usage this should only be pending sounds with completion events. + + Any other data references still existing (queued events, persisted presets, etc) will report errors when used, + but will not crash. + + Releasing a sound bank does not free any cached sounds loaded from the bank - any sounds from the bank should be freed + via a Purge Sounds event step. If this does not occur, the sound data will still be loaded, but the + sound metadata will be gone, so Start Sound events will not work. Purge Sounds will still work. + + This is different from Miles 8, which would maintain a reference count for all data. +*/ + +DXDEC U8 const * AILCALL AIL_find_event(HMSOUNDBANK bank,char const* event_name); +/* + (EXPAPI removed to prevent release in docs) + + Searches for an event by name in the event system. + + $:bank The soundbank to search within, or 0 to search all open banks (which is the normal case). + $:event_name The name of the event to find. This name should be of the form "soundbank/event_list/event_name". + $:return A pointer to the event contents (or 0, if the event isn't found). + + This function is normally used as the event parameter for $AIL_enqueue_event. It + searches one or all open soundbanks for a particular event name. + + This is deprecated. If you know the event name, you should use $AIL_enqueue_event_by_name, or $AIL_enqueue_event with + MILESEVENT_ENQUEUE_BY_NAME. + + Events that are not enqueued by name can not be tracked by the Auditioner. +*/ + +DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_system(HEVENTSYSTEM system, U8 const * event, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags, U64 apply_to_ID ); +/* + Enqueue an event to a specific system. Used only if you have multiple event systems running. + + $:system The event system to attach the event to. + $:return See $AIL_enqueue_event for return description. + + For full information on the parameters, see $AIL_enqueue_event. +*/ + +DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_by_name(char const* name); +/* + Enqueue an event by name. + + $:name The full name of the event, eg "soundbank/path/to/event". + $:return See $AIL_enqueue_event for return description. + + This is the most basic way to enqueue an event. It enqueues an event by name, and as a result the event will be tracked by the auditioner. + + For when you need more control over the event, but still want it to be tracked by the auditioner, it is equivalent + to calling $AIL_enqueue_event_end_named($AIL_enqueue_event_start(), name) + + For introduction to the auditioning system, see $integrating_events. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_start(); +/* + Start assembling a packet to use for enqueuing an event. + + $:return A token used for passing to functions that add data to the event. + + This is used to pass more data to an event that will be executed. For instance, if + an event is going to spatialize a sound, but there's no need to move the sound over the course of + its lifetime, you can add positional data to the event via $AIL_enqueue_event_position. When a + sound is started it will use that for its initial position, and there is no need to do any + game object <-> event id tracking. + + ${ + // Start the enqueue. + S32 enqueue_token = AIL_enqueue_event_start(); + + // Tell all sounds started by the event to position at (100, 100, 100) + AIL_enqueue_event_position(&enqueue_token, 100, 100, 100); + + // Complete the token and enqueue the event to the command buffer. + AIL_enqueue_event_end_named(enqueue_token); + $} + + The enqueue process is still completely thread safe. No locks are used, however only 8 + enqueues can be "assembling" at the same time - if more than that occur, the $AIL_enqueue_event_start + will yield the thread until a slot is open. + + The ONLY time that should happen is if events enqueues are started but never ended: + + ${ + // Start the enqueue + S32 enqueue_token = AIL_enqueue_event_start(); + + // Try to get the game position + Vector3* position = GetPositionOfSomething(my_game_object); + if (position == 0) + return; // OOPS! enqueue_token was leaked here, never to be reclaimed. + + $} + + Each event has a limit to the amount of data that can be attached to it. Currently this + amount is 512 bytes - which should cover all use cases. If any enqueue functions return 0, + then this amount has been reached. The ErrorHandler will be called as well, with $AIL_last_error + reporting that the enqueue buffer was filled. +*/ + +DXDEC EXPAPI void AILCALL AIL_enqueue_event_cancel(S32 token); +/* + Clears a enqueue token without passing it to the command buffer + + $:token A token created with $AIL_enqueue_event_start. + + Used to handle the case where you decided to not actually enqueue the event you've assembled. + + In general it's better to handle anything that can fail before actually starting + to create the enqueue. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_position(S32* token, F32 x, F32 y, F32 z); +/* + Pass an initial position to an event to use for sound spatialization. + + $:token A token created with $AIL_enqueue_event_start. + $:return 0 if the enqueue buffer is full + + If the event queued starts a sound, the sound's position will be set to the given coordinates. + + Setting the position of a sample automatically enables 3D spatialization. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_velocity(S32* token, F32 vx, F32 vy, F32 vz, F32 mag); +/* + Pass an initial velocity to an event to use for sound spatialization. + + $:token A token created with $AIL_enqueue_event_start. + $:return 0 if the enqueue buffer is full + + If the event queued starts a sound, the sound's velocity will be set to the given vector. + + Setting the velocity of a sample does NOT automatically enable 3D spatialization. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, S32 user_buffer_len, S32 user_buffer_is_ptr); +/* + Attaches a user buffer to the event. + + $:token A token created with $AIL_enqueue_event_start. + $:user_buffer Pointer to a user buffer to pass with the event. If user_buffer_is_ptr is 1, the pointer is copied + directly and user_buffer_len is ignored. + $:user_buffer_len The size of the user_buffer to attach to the event. + $:user_buffer_is_ptr If 1, the pointer is copied and user_buffer_len is ignored. + $:return 0 if the enqueue buffer is full + + User buffers are helpful for bridging the gap between game objects and sound objects. + + There are two use cases available in this function + + $* Pointer If user_buffer_is_ptr is 1, then the value passed to user_buffer is copied directly as the + user buffer contents, and then exposed during sound enumeration. This is equivalent in spirit to + the void* value that often accompanies callbacks. In this case, user_buffer_len is ignored, as + user_buffer is never dereferenced. + $* Buffer If user_buffer_is_ptr is 0, then user_buffer_len bytes are copied from user_buffer and + carried with the event. During sound enumeration this buffer is made available, and you never have to + worry about memory management. + $- + + Pointer- + ${ + struct useful_data + { + S32 game_stat; + S32 needed_info; + }; + + useful_data* data = (useful_data*)malloc(sizeof(useful_data)); + data->game_stat = 1; + data->needed_info = 2; + + // Pointer - the "data" pointer will be copied directly, so we can't free() "data" until after the sound + // completes and we're done using it in the enumeration loop. + S32 ptr_token = AIL_enqueue_event_start(); + AIL_enqueue_event_buffer(&ptr_token, data, 0, 1); + AIL_enqueue_event_end_named(ptr_token, "mybank/myevent"); + $} + + Buffer- + ${ + struct useful_data + { + S32 game_stat; + S32 needed_info; + }; + + useful_data data; + data.game_stat = 1; + data.needed_info = 2; + + // Buffer - the "data" structure will be copied internally, so we can free() the data - or just use + // a stack variable like this + S32 buf_token = AIL_enqueue_event_start(); + AIL_enqueue_event_buffer(&buf_token, &data, sizeof(data), 0); + AIL_enqueue_event_end_named(buf_token, "mybank/myevent"); + $} + + As noted in $AIL_enqueue_event_start(), there's only 512 bytes available to an enqueue, so that + places an upper limit on the amount of data you can pass along. If the data is huge, then you + should use user_buffer_is_ptr. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_variablef(S32* token, char const* name, F32 value); +/* + Attaches a variable's value to the event enqueue. + + $:token A token created with $AIL_enqueue_event_start + $:name The variable name to set. + $:value The value of the variable to set. + $:return 0 if the enqueue buffer is full + + When a sound starts, the given variable will be set to the given value prior to any possible + references being used by presets. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_filter(S32* token, U64 apply_to_ID); +/* + Limits the effects of the event to sounds started by the given ID. + + $:token A token created with $AIL_enqueue_event_start + $:apply_to_ID The ID to use for filtering. This can be either a sound or event ID. For an + event, it will apply to all sounds started by the event, and any events queued by that event. + $:return 0 if the enqueue buffer is full + + IDs are assigned to events and sounds - for events, it is returned via the $AIL_enqueue_event_end_named function + (or any other enqueue function). For sounds, you can access the assigned id during the enumeration process. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_context(S32* token, HEVENTSYSTEM system); +/* + Causes the event to run on a separate running event system. + + $:token A token created with $AIL_enqueue_event_start + $:system An event system $AIL_add_event_system + $:return 0 if the enqueue buffer is full + + If you are running multiple event systems, this is required to get events + to queue on the additional event systems. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_selection(S32* token, U32 selection); +/* + Passes in a selection value for start sound events to use for picking sounds. + + $:token A token created with $AIL_enqueue_event_start. + $:selection The value to use for selecting the sound to play. + $:return 0 if the enqueue buffer is full + + The selection index is used to programatically select a sound from the + loaded banks. The index passed in replaces any numeric value at the end + of the sound name existing in any start sound event step. For example, if + a start sound event plays "mybank/sound1", and the event is queued with + a selection, then the selection will replace the "1" with the number passed in: + + ${ + // Enqueue with a selection of 5 + S32 token = AIL_enqueue_event_start(); + AIL_enqueue_event_selection(&token, 50; + AIL_enqueue_event_end_named(token, "mybank/myevent"); + $} + + Assuming mybank/myevent starts sound "mybank/sound1", the sound + that will actually be played will be "mybank/sound5". If the sound does + not exist, it is treated the same as if any other sound was not found. + + The selection process replaces ALL trailing numbers with a representation + of the selection index using the same number of digits, meaning in the above + example, "mybank/sound123" would have become "mybank/sound005". +*/ + +DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_end_named(S32 token, char const* event_name); +/* + Completes assembling the event and queues it to the command buffer to be run during next tick. + + $:token A token created with $AIL_enqueue_event_start. + $:event_name The name of the event to run. + $:return A unique ID for the event that can be used to identify sounds started by this event, + or for filtering future events to the sounds started by this event. + + This function takes all of the data accumulated via the various enqueue functions and assembles + it in to the command buffer to be run during the next $AIL_begin_event_queue_processing. + + As with all of the enqueue functions it is completely thread-safe. + + Upon completion of this function, the enqueue slot is release and available for another + $AIL_enqueue_event_start. +*/ + +DXDEC EXPAPI U64 AILCALL AIL_enqueue_event(U8 const * event_or_name, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags, U64 apply_to_ID ); +/* + Enqueue an event to be processed by the next $AIL_begin_event_queue_processing function. + + $:event_or_name Pointer to the event contents to queue, or the name of the event to find and queue. + If an event, the contents must be valid until the next call to $AIL_begin_event_queue_processing. + If a name, the string is copied internally and does not have any lifetime requirements, and MILES_ENQUEUE_BY_NAME must be present in enqueue_flags. + $:user_buffer Pointer to a user buffer. Depending on $(AIL_enqueue_event::enqueue_flags), this pointer can be saved directly, or its contents copied into the sound instance. + This data is then accessible later, when enumerating the instances. + $:user_buffer_len Size of the buffer pointed to by user_buffer. + $:enqueue_flags Optional $MILESEVENTENQUEUEFLAGS logically OR'd together that control how to enqueue this event (default is 0). + $:apply_to_ID Optional value that is used for events that affect sound instances. Normally, + when Miles triggers one of these event steps, it matches the name and labels stored with the event step. However, if + you specify an apply_to_ID value, then event step will only run on sounds that matches this QueuedID,InstanceID,or EventID too. This is how you + execute events only specific sound instances. QueuedIDs are returned from each call $AIL_enqueue_event. + InstanceIDs and EventIDs are returned from $AIL_enumerate_sound_instances. + $:return On success, returns QueuedID value that is unique to this queued event for the rest of this + program run (you can use this ID to uniquely identify sounds triggered from this event). + + This function enqueues an event to be triggered - this is how you begin execution of an event. First, you + queue it, and then later (usually once a game frame), you call $AIL_begin_event_queue_processing to + execute an event. + + This function is very lightweight. It does nothing more than post the event and data to a + command buffer that gets executed via $AIL_begin_event_queue_processing. + + The user_buffer parameter can be used in different ways. If no flags are passed in, then + Miles will copy the data from user_buffer (user_buffer_len bytes long) and store the data with + the queued sound - you can then free the user_buffer data completely! This lets Miles keep track + of all your sound related memory directly and is the normal way to use the system (it is very + convenient once you get used to it). + + If you instead pass the MILESEVENT_ENQUEUE_BUFFER_PTR flag, then user_buffer pointer will + simply be associated with each sound that this event may start. In this case, user_buffer_len + is ignored. + + In both cases, when you later enumerate the sound instances, you can access your sound data + with the $(MILESEVENTSOUNDINFO::UserBuffer) field. + + You can call this function from any number threads - it's designed to be called from anywhere in your game. + + If you want events you queue to be captured by Miles Studio, then they have to be passed by name. This can be done + by either using the convenience function $AIL_enqueue_event_by_name, or by using the MILESEVENT_ENQUEUE_BY_NAME flag and + passing the name in event_or_name. For introduction to the auditioning system, see $integrating_events. +*/ + +EXPTYPEBEGIN typedef S32 MILESEVENTENQUEUEFLAGS; +#define MILESEVENT_ENQUEUE_BUFFER_PTR 0x1 +#define MILESEVENT_ENQUEUE_FREE_EVENT 0x2 +#define MILESEVENT_ENQUEUE_BY_NAME 0x4 +// 0x8 can't be used, internal. +EXPTYPEEND +/* + The available flags to pass in $AIL_enqueue_event or $AIL_enqueue_event_system. + + $:MILESEVENT_ENQUEUE_BUFFER_PTR The user_buffer parameter passed in should not be duplicated, and instead + should just tranparently pass the pointer on to the event, so that the $(MILESEVENTSOUNDINFO::UserBuffer) + during sound iteration is just the same pointer. user_buffer_len is ignored in this case. + + $:MILESEVENT_ENQUEUE_FREE_EVENT The ownership of the memory for the event is passed to the event system. If this + is present, once the event completes $AIL_mem_free_lock will be called on the raw pointer passed in to $AIL_enqueue_event or + $AIL_enqueue_event_system. This is rarely used. + + $:MILESEVENT_ENQUEUE_BY_NAME The event passed in is actually a string. The event system will then look for this event + in the loaded sound banks during queue processing. +*/ + + +DXDEC EXPAPI S32 AILCALL AIL_begin_event_queue_processing( void ); +/* + Begin execution of all of the enqueued events. + + $:return Return 0 on failure. The only failures are unrecoverable errors in the queued events + (out of memory, bank file not found, bad data, etc). You can get the specific error by + calling $AIL_last_error. + + This function executes all the events currently in the queue. This is where all major + processing takes place in the event system. + + Once you execute this functions, then sound instances will be in one of three states: + + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PENDING)[MILESEVENT_SOUND_STATUS_PENDING] - these are new sound instances that were + created by events that had a "Start Sound Step". Note that these instances aren't audible yet, + so that you have a chance to modify game driven properties (like the 3D position) + on the sound before Miles begins to play it. + + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PLAYING)[MILESEVENT_SOUND_STATUS_PLAYING] - these are sound instances that were previously + started and are continuing to play (you might update the 3D position for these, for example). + + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_COMPLETE)[MILESEVENT_SOUND_STATUS_COMPLETE] - these are sound instances that finished playing + since the last this frame (you might use this status to free any game related memory, for example). + + You will normally enumerate the active sound instances in-between calls to $AIL_begin_event_queue_processing + and $AIL_complete_event_queue_processing with $AIL_enumerate_sound_instances. + + $AIL_complete_event_queue_processing must be called after this function to commit + all the changes. + + Example usage: +${ + // enqueue an event + $AIL_enqueue_event( EventThatStartsSounds, game_data_ptr, 0, MILESEVENT_ENQUEUE_BUFFER_PTR, 0 ); + + // now process that event + $AIL_begin_event_queue_processing( ); + + // next, enumerate the pending and complete sounds for game processing + MILESEVENTSOUNDINFO Info; + + HMSSENUM SoundEnum = MSS_FIRST; + while ( $AIL_enumerate_sound_instances( &SoundEnum, MILESEVENT_SOUND_STATUS_PENDING | MILESEVENT_SOUND_STATUS_COMPLETE, 0, &Info ) ) + { + game_type * game_data = (game_type*) Info.UserBuffer; // returns the game_data pointer from the enqueue + + if ( Info.Status == MILESEVENT_SOUND_STATUS_PENDING ) + { + // setup initial state + AIL_set_sample_3D_position( Info.Sample, game_data->x, game_data->y, game_data->z ); + } + else if ( Info.Status == MILESEVENT_SOUND_STATUS_COMPLETE ) + { + // Free some state we have associated with the sound now that its done. + game_free( game_data ); + } + } + + $AIL_complete_event_queue_processing( ); + $} + + Note that if any event step drastically fails, the rest of the command queue is + skipped, and this function returns 0! For this reason, you shouldn't assume + that a start sound event will always result in a completed sound later. + + Therefore, you should allocate memory that you want associated with a sound instance + during the enumeration loop, rather than at enqueue time. Otherwise, you + need to detect that the sound didn't start and then free the memory (which can be complicated). +*/ + +// Returned by AIL_enumerate_sound_instances() +EXPTYPE typedef struct _MILESEVENTSOUNDINFO +{ + U64 QueuedID; + U64 InstanceID; + U64 EventID; + HSAMPLE Sample; + HSTREAM Stream; + void* UserBuffer; + S32 UserBufferLen; + S32 Status; + U32 Flags; + S32 UsedDelay; + F32 UsedVolume; + F32 UsedPitch; + char const* UsedSound; + S32 HasCompletionEvent; +} MILESEVENTSOUNDINFO; +/* + Sound instance data that is associated with each active sound instance. + + $:QueuedID A unique ID that identifies the queued event that started this sound. Returned from each call to $AIL_enqueue_event. + $:EventID A unique ID that identifies the actual event that started this sound. This is the same as QueuedID unless the sound + was started by a completion event or a event exec step. In that case, the QueuedID represents the ID returned from + $AIL_enqueue_event, and EventID represents the completion event. + $:InstanceID A unique ID that identified this specific sound instance (note that one QueuedID can trigger multiple InstanceIDs). + $:Sample The $HSAMPLE for this playing sound. + $:Stream The $HSTREAM for this playing sound (if it is being streamed, zero otherwise). + $:UserBuffer A pointer to the user data for this sound instance. + $:UserBufferLen The length in bytes of the user data (if known by Miles). + $:Status One of the $MILESEVENTSOUNDSTATUS status values. + $:Flags One or more of the $MILESEVENTSOUNDFLAG flags. + $:UsedDelay The value actually used as a result of the randomization of delay for this instance + $:UsedVolume The value actually used as a result of the randomization of pitch for this instance + $:UsedPitch The value actually used as a result of the randomization of volume for this instance + $:UsedSound The name of the sound used as a result of randomization. This pointer should NOT be deleted + and is only valid for the until the next call in to Miles. + $:HasCompletionEvent Nonzero if the sound will fire an event upon completion. + + This structure is returned by the $AIL_enumerate_sound_instances function. It + returns information about an active sound instance. +*/ + +DXDEC EXPAPI void AILCALL AIL_set_variable_int(UINTa context, char const* name, S32 value); +/* + Sets a named variable that the designer can reference in the tool. + + $:context The context the variable is set for. Can be either a $HEVENTSYSTEM + to set a global variable for a specific system, 0 to set a global variable + for the default system, or an $HMSSENUM from $AIL_enumerate_sound_instances. + $:name The name of the variable to set. + $:value The value of the variable to set. + + Variables are tracked per sound instance and globally, and when a variable is needed + by an event, it will check the relevant sound instance first, before falling back to + the global variable list: + + ${ + $HMSSENUM FirstSound = MSS_FIRST; + $MILESEVENTSOUNDINFO Info; + + // Grab the first sound, whatever it is. + $AIL_enumerate_sound_instances(0, &FirstSound, 0, 0, 0, &Info); + + // Set a variable on that sound. + $AIL_set_variable_int(FirstSound, "MyVar", 10); + + // Set a global variable by the same name. + $AIL_set_variable_int(0, "MyVar", 20); + + // A preset referencing "MyVar" for FirstSound will get 10. Any other sound will + // get 20. + $} + +*/ + +DXDEC EXPAPI void AILCALL AIL_set_variable_float(UINTa context, char const* name, F32 value); +/* + Sets a named variable that the designer can reference in the tool. + + $:context The context the variable is set for. Can be either a $HEVENTSYSTEM + to set a global variable for a specific system, 0 to set a global variable + for the default system, or an $HMSSENUM from $AIL_enumerate_sound_instances. + $:name The name of the variable to set. + $:value The value of the variable to set. + + Variables are tracked per sound instance and globally, and when a variable is needed + by an event, it will check the relevant sound instance first, before falling back to + the global variable list. + + ${ + $HMSSENUM FirstSound = MSS_FIRST; + $MILESEVENTSOUNDINFO Info; + + // Grab the first sound, whatever it is. + $AIL_enumerate_sound_instances(0, &FirstSound, 0, 0, 0, &Info); + + // Set a variable on that sound. + $AIL_set_variable_float(FirstSound, "MyVar", 10.0); + + // Set a global variable by the same name. + $AIL_set_variable_float(0, "MyVar", 20.0); + + // A preset referencing "MyVar" for FirstSound will get 10. Any other sound will + // get 20. + $} +*/ + +DXDEC EXPAPI S32 AILCALL AIL_variable_int(UINTa context, char const* name, S32* value); +/* + Retrieves a named variable. + + $:context The context to start the lookup at, same as $AIL_set_variable_int. + $:name The name to look up. + $:value Pointer to an int to store the value in. + $:return 1 if the variable was found, 0 otherwise. + + This function follows the same lookup pattern as the runtime - if the context is a + sound instance, it checks the instance before falling back to global variables. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_variable_float(UINTa context, char const* name, F32* value); +/* + Retrieves a named variable. + + $:context The context to start the lookup at, same as $AIL_set_variable_float. + $:name The name to look up. + $:value Pointer to a float to store the value in. + $:return 1 if the variable was found, 0 otherwise. + + This function follows the same lookup pattern as the runtime - if the context is a + sound instance, it checks the instance before falling back to global variables. +*/ + +DXDEC EXPAPI void AILCALL AIL_requeue_failed_asyncs(); +/* + Requeues any failed asynchronous loads for sound sources. + + Use this function when a disc error causes a slew of failed caches. Any sound source that + has failed due to asynchronous load will get retried. +*/ + +DXDEC EXPAPI void AILCALL AIL_set_sound_start_offset(HMSSENUM sound, S32 offset, S32 isms); +/* + Specify the starting position for a pending sound. + + $:sound The enumeration from $AIL_enumerate_sound_instances representing the desired sound. + The sound must be in the pending state. + $:offset The offset to use for the starting position of the sound. + $:isms If nonzero, the offset is in milliseconds, otherwise bytes. + + Use this function instead of manipulating the sample position directly via low level Miles calls prior to + the sound starting. Generally you don't need to do this manually, since the sound designer should do + this, however if you need to restart a sound that stopped - for example a stream that went to error - + you will have to set the start position via code. + + However, since there can be a delay between the time the sound is first seen in the sound iteration and + the time it gets set to the data, start positions set via the low level miles calls can get lost, so + use this. + + See the eventstreamerror.cpp example program for usage. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_instances(HEVENTSYSTEM system, HMSSENUM* next, S32 statuses, char const* label_query, U64 search_for_ID, EXPOUT MILESEVENTSOUNDINFO* info); +/* + Enumerated the active sound instances managed by the event system. + + $:next Enumeration token - initialize to MSS_FIRST before the first call. You can pass 0 here, if you just want the first instance that matches. + $:statuses Or-ed list of status values to enumerate. Use 0 for all status types. + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. + $:search_for_ID Match only instances that have a QueuedID,InstanceID,or EventID that matches this value. Use 0 to skip ID matching. + $:info Returns the data for each sound instance. + $:return Returns 0 when enumeration is complete. + + Enumerates the sound instances. This will generally be used between + calls to $AIL_begin_event_queue_processing and $AIL_complete_event_queue_processing to + manage the sound instances. + + The label_query is a list of labels to match, separated by commas. By default, comma-separated + values only have to match at least one label. So, if you used "level1, wind", then all sound instances + that had either "level1" or "wind" would match. If you want to match all labels, + then use the + sign first (for example, "+level1, +wind" would only match sound instances that + had both "level1" and "wind"). You can also use the - sign before a label to not + match that label (so, "level1, -wind" would match all "level1" labeled sound instances that didn't have + a "wind" label). Finally, you can also use * and ? to match wildcard style labels (so, "gun*" + would match any sound instance with a label that starts with "gun"). + + Valid status flags are: + + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PENDING)[MILESEVENT_SOUND_STATUS_PENDING] - these are new sound instances that were + created by events that had a "Start Sound Step". Note that these instances aren't audible yet, + so that you have a chance to modify game driven properties (like the 3D position) + on the sound before Miles begins to play it. + + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PLAYING)[MILESEVENT_SOUND_STATUS_PLAYING] - these are sound instances that were previously + started and are continuing to play (you might update the 3D position for these, for example). + + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_COMPLETE)[MILESEVENT_SOUND_STATUS_COMPLETE] - these are sound instances that finished playing + since the last this frame (you might use this status to free any game related memory, for example). + + Example Usage: +${ + HMSSENUM SoundEnum = MSS_FIRST; + MILESEVENTSOUNDINFO Info; + + while ( $AIL_enumerate_sound_instances( &SoundEnum, 0, 0, &Info ) ) + { + if ( Info.Status != MILESEVENT_SOUND_STATUS_COMPLETE ) + { + game_SoundState* game_data= (game_SoundState*)( Info.UserBuffer ); + $AIL_set_sample_is_3D( Info.Sample, 1 ); + $AIL_set_sample_3D_position( Info.Sample, game_data->x, game_data->y, game_date->z ); + } + } + +$} +*/ + +EXPTYPEBEGIN typedef S32 MILESEVENTSOUNDSTATUS; +#define MILESEVENT_SOUND_STATUS_PENDING 0x1 +#define MILESEVENT_SOUND_STATUS_PLAYING 0x2 +#define MILESEVENT_SOUND_STATUS_COMPLETE 0x4 +EXPTYPEEND +/* + Specifies the status of a sound instance. + + $:MILESEVENT_SOUND_STATUS_PENDING New sound instances that were + created by events that had a "Start Sound Step". Note that these instances aren't audible yet, + so that you have a chance to modify game driven properties (like the 3D position) + on the sound before Miles begins to play it. + + $:MILESEVENT_SOUND_STATUS_PLAYING Sound instances that were previously + started and are continuing to play (you might update the 3D position for these, for example). + + $:MILESEVENT_SOUND_STATUS_COMPLETE Sound instances that finished playing + since the last this frame (you might use this status to free any game related memory, for example). + + These are the status values that each sound instance can have. Use $AIL_enumerate_sound_instances to retrieve them. +*/ + +EXPTYPEBEGIN typedef U32 MILESEVENTSOUNDFLAG; +#define MILESEVENT_SOUND_FLAG_MISSING_SOUND 0x1 +#define MILESEVENT_SOUND_FLAG_EVICTED 0x2 +#define MILESEVENT_SOUND_FLAG_WAITING_ASYNC 0x4 +#define MILESEVENT_SOUND_FLAG_PENDING_ASYNC 0x8 +#define MILESEVENT_SOUND_FLAG_FAILED_HITCH 0x10 +#define MILESEVENT_SOUND_FLAG_FAILED_ASYNC 0x20 +EXPTYPEEND +/* + Specifies the status of a sound instance. + + $:MILESEVENT_SOUND_FLAG_MISSING_SOUND The event system tried to look up the sound requested from a Start Sound event + and couldn't find anything in the loaded banks. + $:MILESEVENT_SOUND_FLAG_EVICTED The sound was evicted due to a sound instance limit being hit. Another sound was selected + as being higher priority, and this sound was stopped as a result. This can be the result of either a Label Sound Limit, + or a limit on the sound itself. + $:MILESEVENT_SOUND_FLAG_WAITING_ASYNC The sound is pending because the data for it is currently being loaded. + The sound will start when sufficient data has been loaded to hopefully avoid a skip. + $:MILESEVENT_SONUD_FLAG_PENDING_ASYNC The sound has started playing, but the data still isn't completely loaded, and it's possible + that the sound playback will catch up to the read position under poor I/O conditions. + $:MILESEVENT_SOUND_FLAG_FAILED_HITCH The sound meta data was found, but the sound was not in memory, and the Start Sound event + was marked as "Must Be Cached". To prevent this, either clear the flag in the event, which will cause a start delay as the + sound data is asynchronously loaded, or specify the sound in a Cache Sounds step prior to attempting to start it. + $:MILESEVENT_SOUND_FLAG_FAILED_ASYNC The sound tried to load and the asynchronous I/O operation failed - most likely either the media + was removed during load, or the file was not found. + + These are the flag values that each sound instance can have. Use $AIL_enumerate_sound_instances to retrieve them. Instances + may have more than one flag, logically 'or'ed together. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_complete_event_queue_processing( void ); +/* + Completes the queue processing (which is started with $AIL_begin_event_queue_processing ). + + $:return Returns 0 on failure. + + This function must be called as a pair with $AIL_begin_event_queue_processing. + + In $AIL_begin_event_queue_processing, all the new sound instances are queued up, but they haven't + started playing yet. Old sound instances that have finished playing are still valid - they + haven't been freed yet. $AIL_complete_event_queue_processing actually starts the sound instances + and frees the completed ones - it's the 2nd half of the event processing. + + Usually you call $AIL_enumerate_sound_instances before this function to manage all the sound + instances. +*/ + +DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 apply_to_ID); +/* + Allows the programmer to manually enqueue a stop sound event into the event system. + + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. + $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that + tells Miles to stop only those instances who's QueuedID,InstanceID,or EventID matches this value. + $:return Returns a non-zero queue ID on success. + + Enqueues an event to stop all sounds matching the specified label query (see $AIL_enumerate_sound_instances + for a description of the label_query format). + + Usually the programmer should trigger a named event that the sound designed can fill out to stop the necessary sounds, + however, if a single sound (for example associated with an enemy that the player just killed) needs to be stopped, + this function accomplishes that, and is captured by the auditioner for replay. +*/ + +DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 apply_to_ID); +/* + Allows the programmer to manually enqueue a pause sound event into the event system. + + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. + $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that + tells Miles to pause only those instances who's QueuedID,InstanceID,or EventID matches this value. + $:return Returns a non-zero queue ID on success. + + Enqueues an event to pause all sounds matching the specified label query (see $AIL_enumerate_sound_instances + for a description of the label_query format). + + Usually the programmer should trigger a named event that the sound designed can fill out to pause the necessary sounds, + however, if a single sound (for example associated with an enemy that has been put in to stasis) needs to be paused, + this function accomplishes that, and is captured by the auditioner for replay. +*/ + +DXDEC EXPAPI U64 AILCALL AIL_resume_sound_instances(char const * label_query, U64 apply_to_ID); +/* + Allows the programmer to manually enqueue a resume sound event into the event system. + + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. + $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that + tells Miles to resume only those instances who's QueuedID,InstanceID,or EventID matches this value. + $:return Returns a non-zero enqueue ID on success. + + Enqueues an event to resume all sounds matching the specified label query (see $AIL_enumerate_sound_instances + for a description of the label_query format). + + Usually the programmer should trigger a named event that the sound designed can fill out to resume the necessary sounds, + however, if a single sound (for example associated with an enemy that has been restored from stasis) needs to be resumed, + this function accomplishes that, and is captured by the auditioner for replay. +*/ + +DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * sound, U8 loop_count, + S32 should_stream, char const * labels, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags ); +/* + Allows the programmer to manually enqueue a start sound event into the event system. + + $:bank The bank containing the sound to start. + $:sound The name of the sound file to start, including bank name, e.g. "BankName/SoundName" + $:loop_count The loop count to assign to the sound. 0 for infinite, 1 for play once, or just the number of times to loop. + $:stream Non-zero if the sound playback should stream off the disc. + $:labels An optional comma-delimited list of labels to assign to the sound playback. + $:user_buffer See the user_buffer description in $AIL_enqueue_event. + $:user_buffer_len See the user_buffer_len description in $AIL_enqueue_event. + $:enqueue_flags See the enqueue_flags description in $AIL_enqueue_event. + $:return Returns a non-zero EnqueueID on success. + + Enqueues an event to start the specified sound asset. + + Usually the programmer should trigger an event that the sound designer has specifically + create to start the appropriate sounds, but this function gives the programmer + manual control, if necessary. This function is not captured by the auditioner. +*/ + +DXDEC EXPAPI void AILCALL AIL_clear_event_queue( void ); +/* + Removes all pending events that you have enqueued. + + This function will clears the list of all events that you have previously enqueued. +*/ + + +DXDEC EXPAPI S32 AILCALL AIL_set_sound_label_limits(HEVENTSYSTEM system, char const* sound_limits); +/* + Sets the maximum number of sounds that matches a particular label. + + $:sound_limits A string that defines one or more limits on a label by label basis. The string should + be of the form "label1name label1count:label2name label2count". + $:return Returns 0 on failure (usually a bad limit string). + + Every time an event triggers a sound to be played, the sound limits are checked, and, if exceeded, a sound is dropped (based + on the settings in the event step). + + Usually event limits are set by a sound designer via an event, but this lets the programmer override the limits at runtime. + Note that this replaces those events, it does not supplement. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_enumerate_preset_persists(HEVENTSYSTEM system, HMSSENUM* next, EXPOUT char const ** name); +/* + Enumerates the current persisted presets that active in the system. + + $:system The system to enumerate the persists for, or 0 to use the default system. + $:next Enumeration token - initialize to MSS_FIRST before the first call. + $:name Pointer to a char* that receives the name of the persist. NOTE + that this pointer can change frame to frame and should be immediately copied to a client-allocated + buffer if persistence is desired. + $:return Returns 0 when enumeration is complete. + + This function lets you enumerate all the persisting presets that are currently active in the system. It + is mostly a debugging aid. +*/ + +DXDEC EXPAPI char * AILCALL AIL_text_dump_event_system(void); +/* + Returns a big string describing the current state of the event system. + + $:return String description of current systems state. + + This function is a debugging aid - it can be used to show all of the active allocations, + active sounds, etc. + + You must delete the pointer returned from this function with $AIL_mem_free_lock. +*/ + +EXPTYPE typedef struct _MILESEVENTSTATE +{ + S32 CommandBufferSize; + S32 HeapSize; + S32 HeapRemaining; + S32 LoadedSoundCount; + S32 PlayingSoundCount; + S32 LoadedBankCount; + S32 PersistCount; + + S32 SoundBankManagementMemory; + S32 SoundDataMemory; +} MILESEVENTSTATE; +/* + returns the current state of the Miles Event System. + + $:CommandBufferSize The size of the command buffer in bytes. See also the $AIL_startup_event_system. + $:HeapSize The total size of memory used by the event system for management structures, and is allocated during startup. This does not include loaded file sizes. + $:HeapRemaining The number of bytes in HeapSize that is remaining. + $:LoadedSoundCount The number of sounds loaded and ready to play via cache event steps. + $:PlayingSoundCount The number of sounds currently playing via start sound event steps. + $:LoadedBankCount The number of sound banks loaded in the system via cache event steps, or AIL_add_soundbank. + $:PersistCount The number of presets persisted via the persist event step. + $:SoundBankManagementMemory The number of bytes used for the management of the loaded sound banks. + $:SoundDataMemory The number of bytes used in file sizes - remember this is not included in HeapSize. Streaming overhead is not included in this number, only fully loaded sounds. + + This structure returns debugging info about the event system. It is used with $AIL_event_system_state. +*/ + +EXPGROUP(Miles High Level Callbacks) + +EXPAPI typedef void AILCALLBACK MilesBankFreeAll( void ); +/* + callback to free all user managed bank memory. +*/ + +EXPAPI typedef void * AILCALLBACK MilesBankGetPreset( char const * name ); +/* + callback to retrieve a sound preset. +*/ + +EXPAPI typedef void * AILCALLBACK MilesBankGetEnvironment( char const * name ); +/* + callback to retrieve an environment preset. +*/ +EXPAPI typedef S32 AILCALLBACK MilesBankGetSound(char const* SoundAssetName, char* SoundFileName, MILESBANKSOUNDINFO* o_SoundInfo ); +/* + callback to return whether the sound asset is in the bank, and, if so, what the final data filename is. + + In order to externally deploy sound files, you will need to register your own GetSound callback. This is detailed in the + eventexternal example program. + + This returns the len of the buffer required for the output file name if SoundFileName is zero. +*/ + +EXPAPI typedef void * AILCALLBACK MilesBankGetEvent( char const * name ); +/* + callback to retrieve an event. +*/ + +EXPAPI typedef void * AILCALLBACK MilesBankGetMarkerList( char const * name ); +/* + callback to retrieve a sound marker list. +*/ + +EXPAPI typedef S32 AILCALLBACK MilesBankGetLoadedCount( void ); +/* + callback to retrieve the number of loaded sound banks. +*/ + +EXPAPI typedef S32 AILCALLBACK MilesBankGetMemUsage( void ); +/* + callback to retrieve the total memory in use. +*/ + +EXPAPI typedef char const * AILCALLBACK MilesBankGetLoadedName( S32 index ); +/* + callback to retrieve the file name of a sound index. +*/ + + +EXPTYPE typedef struct _MILESBANKFUNCTIONS +{ + MilesBankFreeAll * FreeAll; + MilesBankGetPreset * GetPreset; + MilesBankGetEnvironment * GetEnvironment; + MilesBankGetSound * GetSound; + MilesBankGetEvent * GetEvent; + MilesBankGetMarkerList * GetMarkerList; + MilesBankGetLoadedCount * GetLoadedCount; + MilesBankGetMemUsage * GetMemUsage; + MilesBankGetLoadedName * GetLoadedName; +} MILESBANKFUNCTIONS; +/* + specifies callbacks for each of the Miles event system. + + $:FreeAll Callback that tells you to free all user-side bank memory. + $:GetPreset Callback to retrieve a sound preset. + $:GetEnvironment Callback to retrieve an environment preset. + $:GetSound Callback to return the actual filename of a sound asset. + $:GetEvent Callback to retrieve a sound event. + $:GetMarkerList Callback to retrieve a sound marker list. + $:GetLoadedCount Callback to retrieve a count of loaded sound banks. + $:GetMemUsage Callback to retrieve the amount of memory in use. + $:GetLoadedName Callback to retrieve the filename for a sound asset index. + + This structure is used to provide overrides for all of the high-level loading + functionality. +*/ + +EXPGROUP(Miles High Level Event System) + +DXDEC EXPAPI void AILCALL AIL_set_event_sample_functions(HSAMPLE (*CreateSampleCallback)(char const* SoundName, char const* SoundFileName, HDIGDRIVER dig, void* UserBuffer, S32 UserBufferLen), void (*ReleaseSampleCallback)(HSAMPLE)); +/* + Allows you to manage sound data availability and sample handles. + + $:CreateSampleCallback Function that will be called when a sample handle is needed. + $:ReleaseSampleCallback Function that will be called when a sample is no longer needed. + + A created sample is required to have all data pointers necessary to play - e.g. + the event system needs to be able to just do a AIL_start_sample() on the returned + handle and have it work. + + In the callback, SoundName is the name of the asset in Miles Studio, and SoundFileName + is the value returned from Container_GetSound() (see also $AIL_set_event_bank_functions). + +*/ + +DXDEC EXPAPI void AILCALL AIL_set_event_bank_functions(MILESBANKFUNCTIONS const * Functions); +/* + Allows you to override the internal bank file resource management.. + + $:Functions A pointer to a structure containing all the callback functions. + + This function is used to completely override the high-level resource management system. + It's not for overriding the IO - it's when you need much higher-level of control. Primarily + targeted internally for the Auditioner to use, it also is used when deploying sound files + externally. +*/ + +DXDEC EXPAPI MILESBANKFUNCTIONS const* AILCALL AIL_get_event_bank_functions(); +/* + Returns the current functions used to retrieve and poll bank assets. +*/ + + +typedef S32 AILCALLBACK AuditionStatus(); +typedef S32 AILCALLBACK AuditionPump(); +typedef void* AILCALLBACK AuditionOpenBank(char const* i_FileName); +typedef S32 AILCALLBACK AuditionOpenComplete(void* i_Bank); +typedef void AILCALLBACK AuditionCloseBank(void* i_Bank); + +typedef void AILCALLBACK AuditionSuppress(S32 i_IsSuppressed); +typedef void AILCALLBACK AuditionFrameStart(); +typedef void AILCALLBACK AuditionFrameEnd(); +typedef void AILCALLBACK AuditionDefragStart(); +typedef void AILCALLBACK AuditionSetBlend(U64 i_EventId, char const* i_Name); +typedef void AILCALLBACK AuditionSetPersist(U64 i_EventId, char const* i_Name, char const* i_Preset); +typedef void AILCALLBACK AuditionEvent(char const* i_EventName, U64 i_EventId, U64 i_Filter, S32 i_Exists, void* i_InitBlock, S32 i_InitBlockLen); +typedef void AILCALLBACK AuditionSound(U64 i_EventId, U64 i_SoundId, char const* i_Sound, char const* i_Labels, float i_Volume, S32 i_Delay, float i_Pitch); +typedef void AILCALLBACK AuditionSoundComplete(U64 i_SoundId); +typedef void AILCALLBACK AuditionSoundPlaying(U64 i_SoundId); +typedef void AILCALLBACK AuditionSoundFlags(U64 i_SoundId, S32 i_Flags); +typedef void AILCALLBACK AuditionSoundLimited(U64 i_SoundId, char const* i_Label); +typedef void AILCALLBACK AuditionSoundEvicted(U64 i_SoundId, U64 i_ForSound, S32 i_Reason); +typedef void AILCALLBACK AuditionControl(U64 i_EventId, char const* i_Labels, U8 i_ControlType, U64 i_Filter); +typedef void AILCALLBACK AuditionSoundBus(U64 i_SoundId, U8 i_BusIndex); + +typedef void AILCALLBACK AuditionError(U64 i_Id, char const* i_Details); + +typedef void AILCALLBACK AuditionAsyncQueued(U64 i_RelevantId, S32 i_AsyncId, char const* i_Asset); +typedef void AILCALLBACK AuditionAsyncLoad(S32 i_AsyncId, S32 i_ExpectedData); +typedef void AILCALLBACK AuditionAsyncError(S32 i_AsyncId); +typedef void AILCALLBACK AuditionAsyncComplete(S32 i_AsyncId, S32 i_DataLoaded); +typedef void AILCALLBACK AuditionAsyncCancel(S32 i_AsyncId); +typedef void AILCALLBACK AuditionListenerPosition(float x, float y, float z); +typedef void AILCALLBACK AuditionSoundPosition(U64 i_Sound, float x, float y, float z); +typedef void AILCALLBACK AuditionSendCPU(HDIGDRIVER i_Driver); +typedef void AILCALLBACK AuditionUpdateDataCount(S32 i_CurrentDataLoaded); +typedef void AILCALLBACK AuditionSendCount(S32 i_Count); +typedef void AILCALLBACK AuditionHandleSystemLoad(S32 i_Avail, S32 i_Total); +typedef void AILCALLBACK AuditionVarState(char const* i_Var, U64 i_SoundId, S32 i_Int, void* i_4ByteValue); +typedef void AILCALLBACK AuditionRampState(char const* i_Ramp, U64 i_SoundId, S32 i_Type, float i_Current); +typedef void AILCALLBACK AuditionSoundState(U64 i_SoundId, float i_FinalVol, float i_3DVol, float i_BlendVol, float i_BlendPitch, float i_RampVol, float i_RampWet, float i_RampLp, float i_RampRate); + +typedef void AILCALLBACK AuditionClearState(); +typedef void AILCALLBACK AuditionCompletionEvent(U64 i_CompletionEventId, U64 i_ParentSoundId); +typedef void AILCALLBACK AuditionAddRamp(U64 i_ParentSoundId, S32 i_Type, char const* i_Name, char const* i_Query, U64 i_EventId); + +typedef struct _MILESAUDITIONFUNCTIONS +{ + AuditionStatus* Status; + AuditionPump* Pump; + AuditionOpenBank* OpenBank; + AuditionOpenComplete* OpenComplete; + AuditionCloseBank* CloseBank; + + AuditionSuppress* Suppress; + AuditionFrameStart* FrameStart; + AuditionFrameEnd* FrameEnd; + AuditionDefragStart* DefragStart; + AuditionSetBlend* SetBlend; + AuditionSetPersist* SetPersist; + AuditionEvent* Event; + AuditionSound* Sound; + AuditionSoundComplete* SoundComplete; + AuditionSoundPlaying* SoundPlaying; + AuditionSoundFlags* SoundFlags; + AuditionSoundLimited* SoundLimited; + AuditionSoundEvicted* SoundEvicted; + AuditionControl* Control; + AuditionSoundBus* SoundBus; + + AuditionError* Error; + + AuditionAsyncQueued* AsyncQueued; + AuditionAsyncLoad* AsyncLoad; + AuditionAsyncError* AsyncError; + AuditionAsyncComplete* AsyncComplete; + AuditionAsyncCancel* AsyncCancel; + AuditionListenerPosition* ListenerPosition; + AuditionSoundPosition* SoundPosition; + AuditionSendCPU* SendCPU; + AuditionSendCount* SendCount; + AuditionUpdateDataCount* UpdateDataCount; + AuditionHandleSystemLoad* HandleSystemLoad; + AuditionVarState* VarState; + AuditionRampState* RampState; + AuditionSoundState* SoundState; + + AuditionClearState* ClearState; + AuditionCompletionEvent* CompletionEvent; + AuditionAddRamp* AddRamp; +} MILESAUDITIONFUNCTIONS; + +DXDEC void AILCALL MilesEventSetAuditionFunctions(MILESAUDITIONFUNCTIONS const* i_Functions); + +// Auditioner lib functions. +EXPGROUP(auditioning) + +EXPTYPEBEGIN typedef S32 MILESAUDITIONCONNECTRESULT; +#define MILES_CONNECTED 0 +#define MILES_CONNECT_FAILED 1 +#define MILES_HOST_NOT_FOUND 2 +#define MILES_SERVER_ERROR 3 +EXPTYPEEND +/* + Return values for $AIL_audition_connect. + + $:MILES_CONNECTED The Auditioner connected and successfully executed the handshake. + $:MILES_CONNECT_FAILED The Auditioner couldn't connect - either the IP wasn't valid, or Miles Sound Studio wasn't accepting connections. + $:MILES_HOST_NOT_FOUND The given host name could not be resolved to an IP. + $:MILES_SERVER_ERROR We connected, but the server was either another app on the same port, or the server version was incorrect. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_audition_connect(char const* i_Address); +/* + Connect to a currently running Miles Sound Studio. + + $:i_Address The IP or host name of the computer running Miles Sound Studio. Use $AIL_audition_local_host to connect to the same machine as the runtime. + $:return One of $MILESAUDITIONCONNECTRESULT + + The is a synchronous connection attempt to Miles Sound Studio - it will not return until it is happy with the connection + and the server, or a failure occurs. + + This must be called before any $AIL_add_soundbank calls. +*/ + +DXDEC EXPAPI char const* AILCALL AIL_audition_local_host(); +/* + Return the host name of the local machine. +*/ + +// Defines - must match values in studio/Common.h +EXPTYPEBEGIN typedef S32 MILESAUDITIONLANG; +#define MILES_LANG_ENGLISH 1 +#define MILES_LANG_FRENCH 2 +#define MILES_LANG_GERMAN 3 +#define MILES_LANG_SPANISH 4 +#define MILES_LANG_ITALIAN 5 +#define MILES_LANG_JAPANESE 6 +#define MILES_LANG_KOREAN 7 +#define MILES_LANG_CHINESE 8 +#define MILES_LANG_RUSSIAN 9 +EXPTYPEEND +/* + Values representing the various languages the high level tool allows. + + $:MILES_LANG_ENGLISH English + $:MILES_LANG_FRENCH French + $:MILES_LANG_GERMAN German + $:MILES_LANG_SPANISH Spanish + $:MILES_LANG_ITALIAN Italian + $:MILES_LANG_JAPANESE Japanese + $:MILES_LANG_KOREAN Korean + $:MILES_LANG_CHINESE Chinese + $:MILES_LANG_RUSSIAN Russian + + Values representing the various languages the high level tool allows. +*/ + +EXPTYPEBEGIN typedef S32 MILESAUDITIONPLAT; +#define MILES_PLAT_WIN 1 +#define MILES_PLAT_MAC 2 +#define MILES_PLAT_PS3 3 +#define MILES_PLAT_360 4 +#define MILES_PLAT_3DS 5 +#define MILES_PLAT_PSP 6 +#define MILES_PLAT_IPHONE 7 +#define MILES_PLAT_LINUX 8 +#define MILES_PLAT_WII 9 +#define MILES_PLAT_PSP2 10 +#define MILES_PLAT_WIIU 11 +#define MILES_PLAT_SEKRIT 12 +#define MILES_PLAT_SEKRIT2 13 +#define MILES_PLAT_WIN64 14 +#define MILES_PLAT_LINUX64 15 +#define MILES_PLAT_MAC64 16 +#define MILES_PLAT_WINRT32 17 +#define MILES_PLAT_WINRT64 18 +#define MILES_PLAT_WINPH32 19 +#define MILES_PLAT_ANDROID 20 + +EXPTYPEEND +/* + Values representing the various platforms the high level tool allows. + + $:MILES_PLAT_WIN Microsoft Win32/64 + $:MILES_PLAT_MAC Apple OSX + $:MILES_PLAT_PS3 Sony PS3 + $:MILES_PLAT_360 Microsoft XBox360 + $:MILES_PLAT_3DS Nintendo 3DS + $:MILES_PLAT_PSP Sony PSP + $:MILES_PLAT_IPHONE Apple iDevices + $:MILES_PLAT_LINUX Linux Flavors + $:MILES_PLAT_WII Nintendo Wii + $:MILES_PLAT_PSP2 Sony NGP + + Values representing the various platforms the high level tool allows. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_audition_startup(S32 i_ProfileOnly, S32 i_Language, S32 i_Platform); +/* + Binds the Auditioner to the Miles Event Runtime. + + $:i_ProfileOnly Specify 0 to use assets from the connected Miles Sound Studio, and 1 to use assets from disc. + $:i_Language One of $MILESAUDITIONLANG, or zero to use Default assets. See comments below. + $:i_Platform One of $MILESAUDITIONPLAT, or zero to use the current platform. See comments below. + + The Auditioner can run in one of two modes - the first is standard mode, where all assets + are loaded from the server, and profiling data is sent back to the server. The second is + Profiling mode, where the assets are loaded exactly as they would be under normal execution, + but all of the profiling data is sent to the server. + + The $(AIL_audition_startup::i_Language) and the $(AIL_audition_startup::i_Platform) are used to determine what assets Miles Sound Studio sends + the Auditioner, and as a result are not used in Profiling Mode. Otherwise these are equivalent to + the options selected for compiling banks. + + This must be called before any $AIL_add_soundbank calls. +*/ + +DXDEC EXPAPI void AILCALL AIL_audition_shutdown(); +/* + Removes the Auditioner from the Miles Event Runtime. +*/ + +EXPGROUP(Miles High Level Event System) + +DXDEC EXPAPI void AILCALL AIL_event_system_state(HEVENTSYSTEM system, MILESEVENTSTATE* state); +/* + Returns an information structure about the current state of the Miles Event System. + + $:system The system to retrieve information for, or zero for the default system. + $:state A pointer to a structure to receive the state information. + + This function is a debugging aid - it returns information for the event system. +*/ + +DXDEC EXPAPI U32 AILCALL AIL_event_system_command_queue_remaining(); +/* + Returns the number of bytes remaining in the command buffer. + + This can be invalid for a number of reasons - first, if the + command buffer will need to wrap for the next queue, the effective + bytes remaining will be lower. Second, if an enqueue occurs on another + thread in the interim, the value will be outdated. +*/ + +DXDEC EXPAPI S32 AILCALL AIL_get_event_length(char const* i_EventName); +/* + Returns the length of the first sound referenced in the named event, in milliseconds. + + $:i_EventName The name of an event that starts a sound. + $:return The length in milliseconds, or 0 if there is an error, or the event has no sound references, or the sound was not found. + + This looks up the given event and searches for the first Start Sound event step, then + uses the first sound name in its list to look up the length. As such, if the start sound + step has multiple sounds, the rest will be ignored. +*/ + +// Callback for the error handler. +EXPAPI typedef void AILCALLBACK AILEVENTERRORCB(S64 i_RelevantId, char const* i_Resource); +/* + The function prototype to use for a callback that will be made when the event system + encounters an unrecoverable error. + + $:i_RelevantId The ID of the asset that encountered the error, as best known. EventID or SoundID. + $:i_Resource A string representing the name of the resource the error is in regards to, or 0 if unknown. + + The error description can be retrieved via $AIL_last_error. +*/ + + + +EXPAPI typedef S32 AILCALLBACK MSS_USER_RAND( void ); +/* + The function definition to use when defining your own random function. + + You can define a function with this prototype and pass it to $AIL_register_random + if you want to tie the Miles random calls in with your game's (for logging and such). +*/ + +DXDEC EXPAPI void AILCALL AIL_set_event_error_callback(AILEVENTERRORCB * i_ErrorCallback); +/* + Set the error handler for the event system. + + $:i_ErrorHandler The function to call when an error is encountered. + + Generally the event system handles errors gracefully - the only noticeable effect + is that a given sound won't play, or a preset doesn't get set. As a result, the errors + can sometimes be somewhat invisible. This function allows you to see what went wrong, + when it went wrong. + + The basic usage is to have the callback check $AIL_last_error() for the overall category of + failure. The parameter passed to the callback might provide some context, but it can and will + be zero on occasion. Generally it will represent the resource string that is being worked on when the error + occurred. + + Note that there are two out of memory errors - one is the event system ran out of memory - meaning + the value passed in to $AIL_startup_event_system was insufficient for the current load, and + the other is the memory used for sound data - allocated via $AIL_mem_alloc_lock - ran out. +*/ + + +DXDEC EXPAPI void AILCALL AIL_register_random(MSS_USER_RAND * rand_func); +/* + Sets the function that Miles will call to obtain a random number. + + Use this function to set your own random function that the Miles Event System will call when it needs a random number. + This lets you control the determinism of the event system. +*/ + + + + +#ifdef MSS_FLT_SUPPORTED + +// +// Filter result codes +// + +typedef SINTa FLTRESULT; + +#define FLT_NOERR 0 // Success -- no error +#define FLT_NOT_ENABLED 1 // FLT not enabled +#define FLT_ALREADY_STARTED 2 // FLT already started +#define FLT_INVALID_PARAM 3 // Invalid parameters used +#define FLT_INTERNAL_ERR 4 // Internal error in FLT driver +#define FLT_OUT_OF_MEM 5 // Out of system RAM +#define FLT_ERR_NOT_IMPLEMENTED 6 // Feature not implemented +#define FLT_NOT_FOUND 7 // FLT supported device not found +#define FLT_NOT_INIT 8 // FLT not initialized +#define FLT_CLOSE_ERR 9 // FLT not closed correctly + +//############################################################################ +//## ## +//## Interface "MSS pipeline filter" (some functions shared by ## +//## "MSS voice filter") ## +//## ## +//############################################################################ + +typedef FLTRESULT (AILCALL *FLT_STARTUP)(void); + +typedef FLTRESULT (AILCALL *FLT_SHUTDOWN)(void); + +typedef C8 * (AILCALL *FLT_ERROR)(void); + +typedef HDRIVERSTATE (AILCALL *FLT_OPEN_DRIVER) (MSS_ALLOC_TYPE * palloc, + MSS_FREE_TYPE * pfree, + UINTa user, + HDIGDRIVER dig, void * memory); + +typedef FLTRESULT (AILCALL *FLT_CLOSE_DRIVER) (HDRIVERSTATE state); + +typedef void (AILCALL *FLT_PREMIX_PROCESS) (HDRIVERSTATE driver); + +typedef S32 (AILCALL *FLT_POSTMIX_PROCESS) (HDRIVERSTATE driver, void *output_buffer); + +//############################################################################ +//## ## +//## Interface "Pipeline filter sample services" ## +//## ## +//############################################################################ + +typedef HSAMPLESTATE (AILCALL * FLTSMP_OPEN_SAMPLE) (HDRIVERSTATE driver, + HSAMPLE S, + void * memory); + +typedef FLTRESULT (AILCALL * FLTSMP_CLOSE_SAMPLE) (HSAMPLESTATE state); + +typedef void (AILCALL * FLTSMP_SAMPLE_PROCESS) (HSAMPLESTATE state, + void * source_buffer, + void * dest_buffer, // may be the same as src + S32 n_samples, + S32 is_stereo ); + +typedef S32 (AILCALL * FLTSMP_SAMPLE_PROPERTY) (HSAMPLESTATE state, + HPROPERTY property, + void* before_value, + void const* new_value, + void* after_value + ); + +//############################################################################ +//## ## +//## Interface "MSS output filter" ## +//## ## +//############################################################################ + +typedef S32 (AILCALL * VFLT_ASSIGN_SAMPLE_VOICE) (HDRIVERSTATE driver, + HSAMPLE S); + +typedef void (AILCALL * VFLT_RELEASE_SAMPLE_VOICE) (HDRIVERSTATE driver, + HSAMPLE S); + +typedef S32 (AILCALL * VFLT_START_SAMPLE_VOICE) (HDRIVERSTATE driver, + HSAMPLE S); + +//############################################################################ +//## ## +//## Interface "Voice filter driver services" ## +//## ## +//############################################################################ + +typedef S32 (AILCALL * VDRV_DRIVER_PROPERTY) (HDRIVERSTATE driver, + HPROPERTY property, + void* before_value, + void const* new_value, + void* after_value + ); + +typedef S32 (AILCALL * VDRV_FORCE_UPDATE) (HDRIVERSTATE driver); + +//############################################################################ +//## ## +//## Interface "Voice filter sample services" ## +//## ## +//############################################################################ + +typedef S32 (AILCALL * VSMP_SAMPLE_PROPERTY) (HSAMPLE S, + HPROPERTY property, + void* before_value, + void const* new_value, + void* after_value + ); + +// +// Pipeline filter calls +// + +DXDEC HPROVIDER AILCALL AIL_digital_output_filter (HDIGDRIVER dig); + +DXDEC S32 AILCALL AIL_enumerate_filters (HMSSENUM *next, + HPROVIDER *dest, + C8 * *name); +DXDEC HDRIVERSTATE + AILCALL AIL_open_filter (HPROVIDER lib, + HDIGDRIVER dig); + +DXDEC void AILCALL AIL_close_filter (HDRIVERSTATE filter); + +DXDEC S32 AILCALL AIL_find_filter (C8 const *name, + HPROVIDER *ret); + +DXDEC S32 AILCALL AIL_enumerate_filter_properties + (HPROVIDER lib, + HMSSENUM * next, + RIB_INTERFACE_ENTRY * dest); + +DXDEC S32 AILCALL AIL_filter_property (HPROVIDER lib, + C8 const* name, + void* before_value, + void const* new_value, + void* after_value + ); + +DXDEC S32 AILCALL AIL_enumerate_output_filter_driver_properties + (HPROVIDER lib, + HMSSENUM * next, + RIB_INTERFACE_ENTRY * dest); + +DXDEC S32 AILCALL AIL_output_filter_driver_property + (HDIGDRIVER dig, + C8 const * name, + void* before_value, + void const* new_value, + void* after_value + ); + +DXDEC S32 AILCALL AIL_enumerate_output_filter_sample_properties + (HPROVIDER lib, + HMSSENUM * next, + RIB_INTERFACE_ENTRY * dest); + +DXDEC S32 AILCALL AIL_enumerate_filter_sample_properties + (HPROVIDER lib, + HMSSENUM * next, + RIB_INTERFACE_ENTRY * dest); + +DXDEC S32 AILCALL AIL_enumerate_sample_stage_properties + (HSAMPLE S, + SAMPLESTAGE stage, + HMSSENUM * next, + RIB_INTERFACE_ENTRY * dest); + +DXDEC S32 AILCALL AIL_sample_stage_property + (HSAMPLE S, + SAMPLESTAGE stage, + C8 const * name, + S32 channel, + void* before_value, + void const* new_value, + void* after_value + ); + +#define AIL_filter_sample_property(S,name,beforev,newv,afterv) AIL_sample_stage_property((S),SP_FILTER_0,(name),-1,(beforev),(newv),(afterv)) + +typedef struct _FLTPROVIDER +{ + S32 provider_flags; + S32 driver_size; + S32 sample_size; + + PROVIDER_PROPERTY PROVIDER_property; + + FLT_STARTUP startup; + FLT_ERROR error; + FLT_SHUTDOWN shutdown; + FLT_OPEN_DRIVER open_driver; + FLT_CLOSE_DRIVER close_driver; + FLT_PREMIX_PROCESS premix_process; + FLT_POSTMIX_PROCESS postmix_process; + + FLTSMP_OPEN_SAMPLE open_sample; + FLTSMP_CLOSE_SAMPLE close_sample; + FLTSMP_SAMPLE_PROCESS sample_process; + FLTSMP_SAMPLE_PROPERTY sample_property; + + VFLT_ASSIGN_SAMPLE_VOICE assign_sample_voice; + VFLT_RELEASE_SAMPLE_VOICE release_sample_voice; + VFLT_START_SAMPLE_VOICE start_sample_voice; + + VDRV_DRIVER_PROPERTY driver_property; + VDRV_FORCE_UPDATE force_update; + + VSMP_SAMPLE_PROPERTY output_sample_property; + + HDIGDRIVER dig; + HPROVIDER provider; + HDRIVERSTATE driver_state; + + struct _FLTPROVIDER *next; +} FLTPROVIDER; + +// +// Values for "Flags" property exported by all MSS Pipeline Filter and MSS Output Filter +// providers +// + +#define FPROV_ON_SAMPLES 0x0001 // Pipeline filter that operates on input samples (and is enumerated by AIL_enumerate_filters) +#define FPROV_ON_POSTMIX 0x0002 // Pipeline filter that operates on the post mixed output (capture filter) +#define FPROV_MATRIX 0x0004 // This is a matrix output filter (e.g., SRS/Dolby) +#define FPROV_VOICE 0x0008 // This is a per-voice output filter (e.g., DirectSound 3D) +#define FPROV_3D 0x0010 // Output filter uses S3D substructure for positioning +#define FPROV_OCCLUSION 0x0020 // Output filter supports occlusion (doesn't need per-sample lowpass) +#define FPROV_EAX 0x0040 // Output filter supports EAX-compatible environmental reverb +#define FPROV_SIDECHAIN 0x0080 // Filter has an "Input" property on the 3rd index for side chaining. + +#define FPROV_SPU_MASK 0xff0000 // Mask here the SPU INDEX STARTS +#define FPROV_SPU_INDEX( val ) ( ( val >> 16 ) & 0xff ) +#define FPROV_MAKE_SPU_INDEX( val ) ( val << 16 ) + + + +#ifdef IS_WIN32 + +#define MSS_EAX_AUTO_GAIN 1 +#define MSS_EAX_AUTOWAH 2 +#define MSS_EAX_CHORUS 3 +#define MSS_EAX_DISTORTION 4 +#define MSS_EAX_ECHO 5 +#define MSS_EAX_EQUALIZER 6 +#define MSS_EAX_FLANGER 7 +#define MSS_EAX_FSHIFTER 8 +#define MSS_EAX_VMORPHER 9 +#define MSS_EAX_PSHIFTER 10 +#define MSS_EAX_RMODULATOR 11 +#define MSS_EAX_REVERB 12 + +typedef struct EAX_SAMPLE_SLOT_VOLUME +{ + S32 Slot; // 0, 1, 2, 3 + S32 Send; + S32 SendHF; + S32 Occlusion; + F32 OcclusionLFRatio; + F32 OcclusionRoomRatio; + F32 OcclusionDirectRatio; +} EAX_SAMPLE_SLOT_VOLUME; + +typedef struct EAX_SAMPLE_SLOT_VOLUMES +{ + U32 NumVolumes; // 0, 1, or 2 + EAX_SAMPLE_SLOT_VOLUME volumes[ 2 ]; +} EAX_SAMPLE_SLOT_VOLUMES; + +// Use this structure for EAX REVERB +typedef struct EAX_REVERB +{ + S32 Effect; // set to MSS_EAX_REVERB + S32 Volume; // -10000 to 0 + U32 Environment; // one of the ENVIRONMENT_ enums + F32 EnvironmentSize; // environment size in meters + F32 EnvironmentDiffusion; // environment diffusion + S32 Room; // room effect level (at mid frequencies) + S32 RoomHF; // relative room effect level at high frequencies + S32 RoomLF; // relative room effect level at low frequencies + F32 DecayTime; // reverberation decay time at mid frequencies + F32 DecayHFRatio; // high-frequency to mid-frequency decay time ratio + F32 DecayLFRatio; // low-frequency to mid-frequency decay time ratio + S32 Reflections; // early reflections level relative to room effect + F32 ReflectionsDelay; // initial reflection delay time + F32 ReflectionsPanX; // early reflections panning vector + F32 ReflectionsPanY; // early reflections panning vector + F32 ReflectionsPanZ; // early reflections panning vector + S32 Reverb; // late reverberation level relative to room effect + F32 ReverbDelay; // late reverberation delay time relative to initial reflection + F32 ReverbPanX; // late reverberation panning vector + F32 ReverbPanY; // late reverberation panning vector + F32 ReverbPanZ; // late reverberation panning vector + F32 EchoTime; // echo time + F32 EchoDepth; // echo depth + F32 ModulationTime; // modulation time + F32 ModulationDepth; // modulation depth + F32 AirAbsorptionHF; // change in level per meter at high frequencies + F32 HFReference; // reference high frequency + F32 LFReference; // reference low frequency + F32 RoomRolloffFactor; // like DS3D flRolloffFactor but for room effect + U32 Flags; // modifies the behavior of properties +} EAX_REVERB; + +// Use this structure for EAX AUTOGAIN +typedef struct EAX_AUTOGAIN +{ + S32 Effect; // set to MSS_EAX_AUTO_GAIN + S32 Volume; // -10000 to 0 + U32 OnOff; // Switch Compressor on or off (1 or 0) +} EAX_AUTOGAIN; + +// Use this structure for EAX AUTOWAH +typedef struct EAX_AUTOWAH +{ + S32 Effect; // set to MSS_EAX_AUTOWAH + S32 Volume; // -10000 to 0 + F32 AttackTime; // Attack time (seconds) + F32 ReleaseTime; // Release time (seconds) + S32 Resonance; // Resonance (mB) + S32 PeakLevel; // Peak level (mB) +} EAX_AUTOWAH; + +// Use this structure for EAX CHORUS +typedef struct EAX_CHORUS +{ + S32 Effect; // set to MSS_EAX_CHORUS + S32 Volume; // -10000 to 0 + U32 Waveform; // Waveform selector - 0 = sinusoid, 1 = triangle + S32 Phase; // Phase (Degrees) + F32 Rate; // Rate (Hz) + F32 Depth; // Depth (0 to 1) + F32 Feedback; // Feedback (-1 to 1) + F32 Delay; // Delay (seconds) +} EAX_CHORUS; + +// Use this structure for EAX DISTORTION +typedef struct EAX_DISTORTION +{ + S32 Effect; // set to MSS_EAX_DISTORTION + S32 Volume; // -10000 to 0 + F32 Edge; // Controls the shape of the distortion (0 to 1) + S32 Gain; // Controls the post distortion gain (mB) + F32 LowPassCutOff; // Controls the cut-off of the filter pre-distortion (Hz) + F32 EQCenter; // Controls the center frequency of the EQ post-distortion (Hz) + F32 EQBandwidth; // Controls the bandwidth of the EQ post-distortion (Hz) +} EAX_DISTORTION; + +// Use this structure for EAX ECHO +typedef struct EAX_ECHO +{ + S32 Effect; // set to MSS_EAX_ECHO + S32 Volume; // -10000 to 0 + F32 Delay; // Controls the initial delay time (seconds) + F32 LRDelay; // Controls the delay time between the first and second taps (seconds) + F32 Damping; // Controls a low-pass filter that dampens the echoes (0 to 1) + F32 Feedback; // Controls the duration of echo repetition (0 to 1) + F32 Spread; // Controls the left-right spread of the echoes +} EAX_ECHO; + +// Use this structure for EAXEQUALIZER_ALLPARAMETERS +typedef struct EAX_EQUALIZER +{ + S32 Effect; // set to MSS_EAX_EQUALIZER + S32 Volume; // -10000 to 0 + S32 LowGain; // (mB) + F32 LowCutOff; // (Hz) + S32 Mid1Gain; // (mB) + F32 Mid1Center; // (Hz) + F32 Mid1Width; // (octaves) + F32 Mid2Gain; // (mB) + F32 Mid2Center; // (Hz) + F32 Mid2Width; // (octaves) + S32 HighGain; // (mB) + F32 HighCutOff; // (Hz) +} EAX_EQUALIZER; + +// Use this structure for EAX FLANGER +typedef struct EAX_FLANGER +{ + S32 Effect; // set to MSS_EAX_FLANGER + S32 Volume; // -10000 to 0 + U32 Waveform; // Waveform selector - 0 = sinusoid, 1 = triangle + S32 Phase; // Phase (Degrees) + F32 Rate; // Rate (Hz) + F32 Depth; // Depth (0 to 1) + F32 Feedback; // Feedback (0 to 1) + F32 Delay; // Delay (seconds) +} EAX_FLANGER; + + +// Use this structure for EAX FREQUENCY SHIFTER +typedef struct EAX_FSHIFTER +{ + S32 Effect; // set to MSS_EAX_FSHIFTER + S32 Volume; // -10000 to 0 + F32 Frequency; // (Hz) + U32 LeftDirection; // direction - 0 = down, 1 = up, 2 = off + U32 RightDirection; // direction - 0 = down, 1 = up, 2 = off +} EAX_FSHIFTER; + +// Use this structure for EAX VOCAL MORPHER +typedef struct EAX_VMORPHER +{ + S32 Effect; // set to MSS_EAX_VMORPHER + S32 Volume; // -10000 to 0 + U32 PhonemeA; // phoneme: 0 to 29 - A E I O U AA AE AH AO EH ER IH IY UH UW B D G J K L M N P R S T V Z + S32 PhonemeACoarseTuning; // (semitones) + U32 PhonemeB; // phoneme: 0 to 29 - A E I O U AA AE AH AO EH ER IH IY UH UW B D G J K L M N P R S T V Z + S32 PhonemeBCoarseTuning; // (semitones) + U32 Waveform; // Waveform selector - 0 = sinusoid, 1 = triangle, 2 = sawtooth + F32 Rate; // (Hz) +} EAX_VMORPHER; + + +// Use this structure for EAX PITCH SHIFTER +typedef struct EAX_PSHIFTER +{ + S32 Effect; // set to MSS_EAX_PSHIFTER + S32 Volume; // -10000 to 0 + S32 CoarseTune; // Amount of pitch shift (semitones) + S32 FineTune; // Amount of pitch shift (cents) +} EAX_PSHIFTER; + +// Use this structure for EAX RING MODULATOR +typedef struct EAX_RMODULATOR +{ + S32 Effect; // set to MSS_EAX_RMODULATOR + S32 Volume; // -10000 to 0 + F32 Frequency; // Frequency of modulation (Hz) + F32 HighPassCutOff; // Cut-off frequency of high-pass filter (Hz) + U32 Waveform; // Waveform selector - 0 = sinusoid, 1 = triangle, 2 = sawtooth +} EAX_RMODULATOR; + +#endif + +#else // MSS_FLT_SUPPORTED + +typedef struct _FLTPROVIDER +{ + U32 junk; +} FLTPROVIDER; + +#endif // MSS_FLT_SUPPORTED + +#endif // MSS_BASIC + +RADDEFEND + +#endif // MSS_H diff --git a/Minecraft.Client/Durango/Miles/include/rrCore.h b/Minecraft.Client/Durango/Miles/include/rrCore.h new file mode 100644 index 00000000..e88b5f8c --- /dev/null +++ b/Minecraft.Client/Durango/Miles/include/rrCore.h @@ -0,0 +1,2322 @@ +/// ======================================================================== +// (C) Copyright 1994- 2014 RAD Game Tools, Inc. Global types header file +// ======================================================================== + +#ifndef __RADRR_COREH__ +#define __RADRR_COREH__ +#define RADCOPYRIGHT "Copyright (C) 1994-2014, RAD Game Tools, Inc." + +// __RAD16__ means 16 bit code (Win16) +// __RAD32__ means 32 bit code (DOS, Win386, Win32s, Mac AND Win64) +// __RAD64__ means 64 bit code (x64) + +// Note oddness - __RAD32__ essentially means "at *least* 32-bit code". +// So, on 64-bit systems, both __RAD32__ and __RAD64__ will be defined. + +// __RADDOS__ means DOS code (16 or 32 bit) +// __RADWIN__ means Windows API (Win16, Win386, Win32s, Win64, Xbox, Xenon) +// __RADWINEXT__ means Windows 386 extender (Win386) +// __RADNT__ means Win32 or Win64 code +// __RADWINRTAPI__ means Windows RT API (Win 8, Win Phone, ARM, Durango) +// __RADMAC__ means Macintosh +// __RADCARBON__ means Carbon +// __RADMACH__ means MachO +// __RADXBOX__ means the XBox console +// __RADXENON__ means the Xenon console +// __RADDURANGO__ or __RADXBOXONE__ means Xbox One +// __RADNGC__ means the Nintendo GameCube +// __RADWII__ means the Nintendo Wii +// __RADWIIU__ means the Nintendo Wii U +// __RADNDS__ means the Nintendo DS +// __RADTWL__ means the Nintendo DSi (__RADNDS__ also defined) +// __RAD3DS__ means the Nintendo 3DS +// __RADPS2__ means the Sony PlayStation 2 +// __RADPSP__ means the Sony PlayStation Portable +// __RADPS3__ means the Sony PlayStation 3 +// __RADPS4__ means the Sony PlayStation 4 +// __RADANDROID__ means Android NDK +// __RADNACL__ means Native Client SDK +// __RADNTBUILDLINUX__ means building Linux on NT +// __RADLINUX__ means actually building on Linux (most likely with GCC) +// __RADPSP2__ means NGP +// __RADBSD__ means a BSD-style UNIX (OS X, FreeBSD, OpenBSD, NetBSD) +// __RADPOSIX__ means POSIX-compliant +// __RADQNX__ means QNX +// __RADIPHONE__ means iphone +// __RADIPHONESIM__ means iphone simulator + +// __RADX86__ means Intel x86 +// __RADMMX__ means Intel x86 MMX instructions are allowed +// __RADX64__ means Intel/AMD x64 (NOT IA64=Itanium) +// __RAD68K__ means 68K +// __RADPPC__ means PowerPC +// __RADMIPS__ means Mips (only R5900 right now) +// __RADARM__ mean ARM processors + +// __RADLITTLEENDIAN__ means processor is little-endian (x86) +// __RADBIGENDIAN__ means processor is big-endian (680x0, PPC) + +// __RADNOVARARGMACROS__ means #defines can't use ... + + #ifdef WINAPI_FAMILY + // If this is #defined, we might be in a Windows Store App. But + // VC++ by default #defines this to a symbolic name, not an integer + // value, and those names are defined in "winapifamily.h". So if + // WINAPI_FAMILY is #defined, #include the header so we can parse it. + #include + #define RAD_WINAPI_IS_APP (!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) + #else + #define RAD_WINAPI_IS_APP 0 + #endif + + #ifndef __RADRES__ + // Theoretically, this is to pad structs on platforms that don't support pragma pack or do it poorly. (PS3, PS2) + // In general it is assumed that your padding is set via pragma, so this is just a struct. + #define RADSTRUCT struct + + #ifdef __GNUC_MINOR__ + // make a combined GCC version for testing : + + #define __RAD_GCC_VERSION__ (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100 \ + + __GNUC_PATCHLEVEL__) + + /* Test for GCC > 3.2.0 */ + // #if GCC_VERSION > 30200 + #endif + + #if defined(__RADX32__) + + #define __RADX86__ + #define __RADMMX__ + #define __RAD32__ + #define __RADLITTLEENDIAN__ + #define RADINLINE inline + #define RADRESTRICT __restrict + + // known platforms under the RAD generic build type + #if defined(_WIN32) || defined(_Windows) || defined(WIN32) || defined(__WINDOWS__) || defined(_WINDOWS) + #define __RADNT__ + #define __RADWIN__ + #elif (defined(__MWERKS__) && !defined(__INTEL__)) || defined(__MRC__) || defined(THINK_C) || defined(powerc) || defined(macintosh) || defined(__powerc) || defined(__APPLE__) || defined(__MACH__) + #define __RADMAC__ + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + #elif defined(__linux__) + #define __RADLINUX__ + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + #endif + +#elif defined(ANDROID) + #define __RADANDROID__ + #define __RAD32__ + #define __RADLITTLEENDIAN__ + #ifdef __i386__ + #define __RADX86__ + #else + #define __RADARM__ + #endif + #define RADINLINE inline + #define RADRESTRICT __restrict + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + +#elif defined(__QNX__) + #define __RAD32__ + #define __RADQNX__ + +#ifdef __arm__ + #define __RADARM__ +#elif defined __i386__ + #define __RADX86__ +#else + #error Unknown processor +#endif + #define __RADLITTLEENDIAN__ + #define RADINLINE inline + #define RADRESTRICT __restrict + + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) +#elif defined(__linux__) && defined(__arm__) //This should pull in Raspberry Pi as well + + #define __RAD32__ + #define __RADLINUX__ + #define __RADARM__ + #define __RADLITTLEENDIAN__ + #define RADINLINE inline + #define RADRESTRICT __restrict + + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + +#elif defined(__native_client__) + #define __RADNACL__ + #define __RAD32__ + #define __RADLITTLEENDIAN__ + #define __RADX86__ + #define RADINLINE inline + #define RADRESTRICT __restrict + + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + + #elif defined(_DURANGO) || defined(_SEKRIT) || defined(_SEKRIT1) || defined(_XBOX_ONE) + + #define __RADDURANGO__ 1 + #define __RADXBOXONE__ 1 + #if !defined(__RADSEKRIT__) // keep sekrit around for a bit for compat + #define __RADSEKRIT__ 1 + #endif + + #define __RADWIN__ + #define __RAD32__ + #define __RAD64__ + #define __RADX64__ + #define __RADMMX__ + #define __RADX86__ + #define __RAD64REGS__ + #define __RADLITTLEENDIAN__ + #define RADINLINE __inline + #define RADRESTRICT __restrict + #define __RADWINRTAPI__ + + #elif defined(__ORBIS__) + + #define __RADPS4__ + #if !defined(__RADSEKRIT2__) // keep sekrit2 around for a bit for compat + #define __RADSEKRIT2__ 1 + #endif + #define __RAD32__ + #define __RAD64__ + #define __RADX64__ + #define __RADMMX__ + #define __RADX86__ + #define __RAD64REGS__ + #define __RADLITTLEENDIAN__ + #define RADINLINE inline + #define RADRESTRICT __restrict + + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + + #elif defined(WINAPI_FAMILY) && RAD_WINAPI_IS_APP + + #define __RADWINRTAPI__ + #define __RADWIN__ + #define RADINLINE __inline + #define RADRESTRICT __restrict + + #if defined(_M_IX86) // WinRT on x86 + + #define __RAD32__ + #define __RADX86__ + #define __RADMMX__ + #define __RADLITTLEENDIAN__ + + #elif defined(_M_X64) // WinRT on x64 + #define __RAD32__ + #define __RAD64__ + #define __RADX86__ + #define __RADX64__ + #define __RADMMX__ + #define __RAD64REGS__ + #define __RADLITTLEENDIAN__ + + #elif defined(_M_ARM) // WinRT on ARM + + #define __RAD32__ + #define __RADARM__ + #define __RADLITTLEENDIAN__ + + #else + + #error Unrecognized WinRT platform! + + #endif + + #elif defined(_WIN64) + + #define __RADWIN__ + #define __RADNT__ + // See note at top for why both __RAD32__ and __RAD64__ are defined. + #define __RAD32__ + #define __RAD64__ + #define __RADX64__ + #define __RADMMX__ + #define __RADX86__ + #define __RAD64REGS__ + #define __RADLITTLEENDIAN__ + #define RADINLINE __inline + #define RADRESTRICT __restrict + + #elif defined(GENERIC_ARM) + + #define __RAD32__ + #define __RADARM__ + #define __RADLITTLEENDIAN__ + #define __RADFIXEDPOINT__ + #define RADINLINE inline + #if (defined(__GCC__) || defined(__GNUC__)) + #define RADRESTRICT __restrict + #else + #define RADRESTRICT // __restrict not supported on cw + #endif + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + + #elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it + + #define __RADWIIU__ + #define __RAD32__ + #define __RADPPC__ + #define __RADBIGENDIAN__ + #define RADINLINE inline + #define RADRESTRICT __restrict + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + + + #elif defined(HOLLYWOOD_REV) || defined(REVOLUTION) + + #define __RADWII__ + #define __RAD32__ + #define __RADPPC__ + #define __RADBIGENDIAN__ + #define RADINLINE inline + #define RADRESTRICT __restrict + + #elif defined(NN_PLATFORM_CTR) + + #define __RAD3DS__ + #define __RAD32__ + #define __RADARM__ + #define __RADLITTLEENDIAN__ + #define RADINLINE inline + #define RADRESTRICT + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + + #elif defined(GEKKO) + + #define __RADNGC__ + #define __RAD32__ + #define __RADPPC__ + #define __RADBIGENDIAN__ + #define RADINLINE inline + #define RADRESTRICT // __restrict not supported on cw + + #elif defined(SDK_ARM9) || defined(SDK_TWL) || (defined(__arm) && defined(__MWERKS__)) + + #define __RADNDS__ + #define __RAD32__ + #define __RADARM__ + #define __RADLITTLEENDIAN__ + #define __RADFIXEDPOINT__ + #define RADINLINE inline + #if (defined(__GCC__) || defined(__GNUC__)) + #define RADRESTRICT __restrict + #else + #define RADRESTRICT // __restrict not supported on cw + #endif + + #if defined(SDK_TWL) + #define __RADTWL__ + #endif + + #elif defined(R5900) + + #define __RADPS2__ + #define __RAD32__ + #define __RADMIPS__ + #define __RADLITTLEENDIAN__ + #define RADINLINE inline + #define RADRESTRICT __restrict + #define __RAD64REGS__ + #define U128 u_long128 + + #if !defined(__MWERKS__) + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + #endif + + #elif defined(__psp__) + + #define __RADPSP__ + #define __RAD32__ + #define __RADMIPS__ + #define __RADLITTLEENDIAN__ + #define RADINLINE inline + #define RADRESTRICT __restrict + + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + + #elif defined(__psp2__) + + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + + #define __RADPSP2__ + #define __RAD32__ + #define __RADARM__ + #define __RADLITTLEENDIAN__ + #define RADINLINE inline + #define RADRESTRICT __restrict + + // need packed attribute for struct with snc? + #elif defined(__CELLOS_LV2__) + + // CB change : 10-29-10 : RAD64REGS on PPU but NOT SPU + + #ifdef __SPU__ + #define __RADSPU__ + #define __RAD32__ + #define __RADCELL__ + #define __RADBIGENDIAN__ + #define RADINLINE inline + #define RADRESTRICT __restrict + #else + #define __RAD64REGS__ + #define __RADPS3__ + #define __RADPPC__ + #define __RAD32__ + #define __RADCELL__ + #define __RADBIGENDIAN__ + #define RADINLINE inline + #define RADRESTRICT __restrict + #define __RADALTIVEC__ + #endif + + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + + #ifndef __LP32__ + #error "PS3 32bit ABI support only" + #endif + #elif (defined(__MWERKS__) && !defined(__INTEL__)) || defined(__MRC__) || defined(THINK_C) || defined(powerc) || defined(macintosh) || defined(__powerc) || defined(__APPLE__) || defined(__MACH__) + #ifdef __APPLE__ + #include "TargetConditionals.h" + #endif + + #if ((defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) || (defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR)) + + // iPhone/iPad/iOS + #define __RADIPHONE__ + #define __RADMACAPI__ + + #define __RAD32__ + #if defined(__x86_64__) + #define __RAD64__ + #endif + + #define __RADLITTLEENDIAN__ + #define RADINLINE inline + #define RADRESTRICT __restrict + #define __RADMACH__ + + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + + #if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR + #if defined( __x86_64__) + #define __RADX64__ + #else + #define __RADX86__ + #endif + #define __RADIPHONESIM__ + #elif defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE + #define __RADARM__ + #endif + #else + + // An actual MacOSX machine + #define __RADMAC__ + #define __RADMACAPI__ + + #if defined(powerc) || defined(__powerc) || defined(__ppc__) + #define __RADPPC__ + #define __RADBIGENDIAN__ + #define __RADALTIVEC__ + #define RADRESTRICT + #elif defined(__i386__) + #define __RADX86__ + #define __RADMMX__ + #define __RADLITTLEENDIAN__ + #define RADRESTRICT __restrict + #elif defined(__x86_64__) + #define __RAD32__ + #define __RAD64__ + #define __RADX86__ + #define __RADX64__ + #define __RAD64REGS__ + #define __RADMMX__ + #define __RADLITTLEENDIAN__ + #define RADRESTRICT __restrict + #else + #define __RAD68K__ + #define __RADBIGENDIAN__ + #define __RADALTIVEC__ + #define RADRESTRICT + #endif + + #define __RAD32__ + + #if defined(__MWERKS__) + #if (defined(__cplusplus) || ! __option(only_std_keywords)) + #define RADINLINE inline + #endif + #ifdef __MACH__ + #define __RADMACH__ + #endif + #elif defined(__MRC__) + #if defined(__cplusplus) + #define RADINLINE inline + #endif + #elif defined(__GNUC__) || defined(__GNUG__) || defined(__MACH__) + #define RADINLINE inline + #define __RADMACH__ + + #undef RADRESTRICT /* could have been defined above... */ + #define RADRESTRICT __restrict + + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + #endif + + #ifdef __RADX86__ + #ifndef __RADCARBON__ + #define __RADCARBON__ + #endif + #endif + + #ifdef TARGET_API_MAC_CARBON + #if TARGET_API_MAC_CARBON + #ifndef __RADCARBON__ + #define __RADCARBON__ + #endif + #endif + #endif + #endif + #elif defined(__linux__) + + #define __RADLINUX__ + #define __RADMMX__ + #define __RADLITTLEENDIAN__ + #define __RADX86__ + #ifdef __x86_64 + #define __RAD32__ + #define __RAD64__ + #define __RADX64__ + #define __RAD64REGS__ + #else + #define __RAD32__ + #endif + #define RADINLINE inline + #define RADRESTRICT __restrict + + #undef RADSTRUCT + #define RADSTRUCT struct __attribute__((__packed__)) + + #else + + #if _MSC_VER >= 1400 + #undef RADRESTRICT + #define RADRESTRICT __restrict + #else + #define RADRESTRICT + #define __RADNOVARARGMACROS__ + #endif + + #if defined(_XENON) || ( defined(_XBOX_VER) && (_XBOX_VER == 200) ) + // Remember that Xenon also defines _XBOX + #define __RADPPC__ + #define __RADBIGENDIAN__ + #define __RADALTIVEC__ + #else + #define __RADX86__ + #define __RADMMX__ + #define __RADLITTLEENDIAN__ + #endif + + #ifdef __MWERKS__ + #define _WIN32 + #endif + + #ifdef __DOS__ + #define __RADDOS__ + #define S64_DEFINED // turn off these types + #define U64_DEFINED + #define S64 double //should error + #define U64 double //should error + #define __RADNOVARARGMACROS__ + #endif + + #ifdef __386__ + #define __RAD32__ + #endif + + #ifdef _Windows //For Borland + #ifdef __WIN32__ + #define WIN32 + #else + #define __WINDOWS__ + #endif + #endif + + #ifdef _WINDOWS //For MS + #ifndef _WIN32 + #define __WINDOWS__ + #endif + #endif + + #ifdef _WIN32 + #if defined(_XENON) || ( defined(_XBOX_VER) && (_XBOX_VER == 200) ) + // Remember that Xenon also defines _XBOX + #define __RADXENON__ + #define __RAD64REGS__ + #elif defined(_XBOX) + #define __RADXBOX__ + #elif !defined(__RADWINRTAPI__) + #define __RADNT__ + #endif + #define __RADWIN__ + #define __RAD32__ + #else + #ifdef __NT__ + #if defined(_XENON) || (_XBOX_VER == 200) + // Remember that Xenon also defines _XBOX + #define __RADXENON__ + #define __RAD64REGS__ + #elif defined(_XBOX) + #define __RADXBOX__ + #else + #define __RADNT__ + #endif + #define __RADWIN__ + #define __RAD32__ + #else + #ifdef __WINDOWS_386__ + #define __RADWIN__ + #define __RADWINEXT__ + #define __RAD32__ + #define S64_DEFINED // turn off these types + #define U64_DEFINED + #define S64 double //should error + #define U64 double //should error + #else + #ifdef __WINDOWS__ + #define __RADWIN__ + #define __RAD16__ + #else + #ifdef WIN32 + #if defined(_XENON) || (_XBOX_VER == 200) + // Remember that Xenon also defines _XBOX + #define __RADXENON__ + #elif defined(_XBOX) + #define __RADXBOX__ + #else + #define __RADNT__ + #endif + #define __RADWIN__ + #define __RAD32__ + #endif + #endif + #endif + #endif + #endif + + #ifdef __WATCOMC__ + #define RADINLINE + #else + #define RADINLINE __inline + #endif + #endif + + #if defined __RADMAC__ || defined __RADIPHONE__ + #define __RADBSD__ + #endif + + #if defined __RADBSD__ || defined __RADLINUX__ + #define __RADPOSIX__ + #endif + + #if (!defined(__RADDOS__) && !defined(__RADWIN__) && !defined(__RADMAC__) && \ + !defined(__RADNGC__) && !defined(__RADNDS__) && !defined(__RADXBOX__) && \ + !defined(__RADXENON__) && !defined(__RADDURANGO__) && !defined(__RADPS4__) && !defined(__RADLINUX__) && !defined(__RADPS2__) && \ + !defined(__RADPSP__) && !defined(__RADPSP2__) && !defined(__RADPS3__) && !defined(__RADSPU__) && \ + !defined(__RADWII__) && !defined(__RADIPHONE__) && !defined(__RADX32__) && !defined(__RADARM__) && \ + !defined(__RADWIIU__) && !defined(__RADANDROID__) && !defined(__RADNACL__) && !defined (__RADQNX__) ) + #error "RAD.H did not detect your platform. Define DOS, WINDOWS, WIN32, macintosh, powerpc, or appropriate console." + #endif + + + #ifdef __RADFINAL__ + #define RADTODO(str) { char __str[0]=str; } + #else + #define RADTODO(str) + #endif + + #ifdef __RADX32__ + #if defined(_MSC_VER) + #define RADLINK __stdcall + #define RADEXPLINK __stdcall + #else + #define RADLINK __attribute__((stdcall)) + #define RADEXPLINK __attribute__((stdcall)) + #endif + #define RADEXPFUNC RADDEFFUNC + + #elif (defined(__RADNGC__) || defined(__RADWII__) || defined( __RADPS2__) || \ + defined(__RADPSP__) || defined(__RADPSP2__) || defined(__RADPS3__) || \ + defined(__RADSPU__) || defined(__RADNDS__) || defined(__RADIPHONE__) || \ + (defined(__RADARM__) && !defined(__RADWINRTAPI__)) || defined(__RADWIIU__) || defined(__RADPS4__) ) + + #define RADLINK + #define RADEXPLINK + #define RADEXPFUNC RADDEFFUNC + #define RADASMLINK + + #elif defined(__RADANDROID__) + #define RADLINK + #define RADEXPLINK + #define RADEXPFUNC RADDEFFUNC + #define RADASMLINK + #elif defined(__RADNACL__) + #define RADLINK + #define RADEXPLINK + #define RADEXPFUNC RADDEFFUNC + #define RADASMLINK + #elif defined(__RADLINUX__) || defined (__RADQNX__) + + #ifdef __RAD64__ + #define RADLINK + #define RADEXPLINK + #else + #define RADLINK __attribute__((cdecl)) + #define RADEXPLINK __attribute__((cdecl)) + #endif + + #define RADEXPFUNC RADDEFFUNC + #define RADASMLINK + + #elif defined(__RADMAC__) + + // this define is for CodeWarrior 11's stupid new libs (even though + // we don't use longlong's). + + #define __MSL_LONGLONG_SUPPORT__ + + #define RADLINK + #define RADEXPLINK + + #if defined(__CFM68K__) || defined(__MWERKS__) + #ifdef __RADINDLL__ + #define RADEXPFUNC RADDEFFUNC __declspec(export) + #else + #define RADEXPFUNC RADDEFFUNC __declspec(import) + #endif + #else + #if defined(__RADMACH__) && !defined(__MWERKS__) + #ifdef __RADINDLL__ + #define RADEXPFUNC RADDEFFUNC __attribute__((visibility("default"))) + #else + #define RADEXPFUNC RADDEFFUNC + #endif + #else + #define RADEXPFUNC RADDEFFUNC + #endif + #endif + #define RADASMLINK + + #else + + #ifdef __RADNT__ + #ifndef _WIN32 + #define _WIN32 + #endif + #ifndef WIN32 + #define WIN32 + #endif + #endif + + #ifdef __RADWIN__ + #ifdef __RAD32__ + + #ifdef __RADXBOX__ + + #define RADLINK __stdcall + #define RADEXPLINK __stdcall + #define RADEXPFUNC RADDEFFUNC + + #elif defined(__RADXENON__) || defined(__RADDURANGO__) + + #define RADLINK __stdcall + #define RADEXPLINK __stdcall + + #define RADEXPFUNC RADDEFFUNC + + #elif defined(__RADWINRTAPI__) + + #define RADLINK __stdcall + #define RADEXPLINK __stdcall + + #if ( defined(__RADINSTATICLIB__) || defined(__RADNOEXPORTS__ ) || ( defined(__RADNOEXEEXPORTS__) && ( !defined(__RADINDLL__) ) && ( !defined(__RADINSTATICLIB__) ) ) ) + #define RADEXPFUNC RADDEFFUNC + #else + #ifndef __RADINDLL__ + #define RADEXPFUNC RADDEFFUNC __declspec(dllimport) + #else + #define RADEXPFUNC RADDEFFUNC __declspec(dllexport) + #endif + #endif + + #elif defined(__RADNTBUILDLINUX__) + + #define RADLINK __cdecl + #define RADEXPLINK __cdecl + #define RADEXPFUNC RADDEFFUNC + + #else + #ifdef __RADNT__ + + #define RADLINK __stdcall + #define RADEXPLINK __stdcall + + #if ( defined(__RADINSTATICLIB__) || defined(__RADNOEXPORTS__ ) || ( defined(__RADNOEXEEXPORTS__) && ( !defined(__RADINDLL__) ) && ( !defined(__RADINSTATICLIB__) ) ) ) + #define RADEXPFUNC RADDEFFUNC + #else + #ifndef __RADINDLL__ + #define RADEXPFUNC RADDEFFUNC __declspec(dllimport) + #ifdef __BORLANDC__ + #if __BORLANDC__<=0x460 + #undef RADEXPFUNC + #define RADEXPFUNC RADDEFFUNC + #endif + #endif + #else + #define RADEXPFUNC RADDEFFUNC __declspec(dllexport) + #endif + #endif + #else + #define RADLINK __pascal + #define RADEXPLINK __far __pascal + #define RADEXPFUNC RADDEFFUNC + #endif + #endif + #else + #define RADLINK __pascal + #define RADEXPLINK __far __pascal __export + #define RADEXPFUNC RADDEFFUNC + #endif + #else + #define RADLINK __pascal + #define RADEXPLINK __pascal + #define RADEXPFUNC RADDEFFUNC + #endif + + #define RADASMLINK __cdecl + + #endif + + #if !defined(__RADXBOX__) && !defined(__RADXENON__) && !defined(__RADDURANGO__) && !defined(__RADXBOXONE__) + #ifdef __RADWIN__ + #ifndef _WINDOWS + #define _WINDOWS + #endif + #endif + #endif + + #ifdef __RADLITTLEENDIAN__ + #ifdef __RADBIGENDIAN__ + #error both endians !? + #endif + #endif + + #if !defined(__RADLITTLEENDIAN__) && !defined(__RADBIGENDIAN__) + #error neither endian! + #endif + + + //----------------------------------------------------------------- + + #ifndef RADDEFFUNC + + #ifdef __cplusplus + #define RADDEFFUNC extern "C" + #define RADDEFSTART extern "C" { + #define RADDEFEND } + #define RADDEFINEDATA extern "C" + #define RADDECLAREDATA extern "C" + #define RADDEFAULT( val ) =val + + #define RR_NAMESPACE rr + #define RR_NAMESPACE_START namespace RR_NAMESPACE { + #define RR_NAMESPACE_END }; + #define RR_NAMESPACE_USE using namespace RR_NAMESPACE; + + #else + #define RADDEFFUNC + #define RADDEFSTART + #define RADDEFEND + #define RADDEFINEDATA + #define RADDECLAREDATA extern + #define RADDEFAULT( val ) + + #define RR_NAMESPACE + #define RR_NAMESPACE_START + #define RR_NAMESPACE_END + #define RR_NAMESPACE_USE + + #endif + + #endif + + // probably s.b: RAD_DECLARE_ALIGNED(type, name, alignment) + #if (defined(__RADWII__) || defined(__RADWIIU__) || defined(__RADPSP__) || defined(__RADPSP2__) || \ + defined(__RADPS3__) || defined(__RADSPU__) || defined(__RADPS4__) || \ + defined(__RADLINUX__) || defined(__RADMAC__)) || defined(__RADNDS__) || defined(__RAD3DS__) || \ + defined(__RADIPHONE__) || defined(__RADANDROID__) || defined (__RADQNX__) + #define RAD_ALIGN(type,var,num) type __attribute__ ((aligned (num))) var + #elif (defined(__RADNGC__) || defined(__RADPS2__)) + #define RAD_ALIGN(type,var,num) __attribute__ ((aligned (num))) type var + #elif (defined(_MSC_VER) && (_MSC_VER >= 1300)) || defined(__RADWINRTAPI__) + #define RAD_ALIGN(type,var,num) type __declspec(align(num)) var + #else + // NOTE: / / is a guaranteed parse error in C/C++. + #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / + #endif + + // WARNING : RAD_TLS should really only be used for debug/tools stuff + // it's not reliable because even if we are built as a lib, our lib can + // be put into a DLL and then it doesn't work + #if defined(__RADNT__) || defined(__RADXENON__) + #ifndef __RADINDLL__ + // note that you can't use this in windows DLLs + #define RAD_TLS(type,var) __declspec(thread) type var + #endif + #elif defined(__RADPS3__) || defined(__RADLINUX__) || defined(__RADMAC__) + // works on PS3/gcc I believe : + #define RAD_TLS(type,var) __thread type var + #else + // RAD_TLS not defined + #endif + + // Note that __RAD16__/__RAD32__/__RAD64__ refers to the size of a pointer. + // The size of integers is specified explicitly in the code, i.e. u32 or whatever. + + #define RAD_S8 signed char + #define RAD_U8 unsigned char + + #if defined(__RAD64__) + // Remember that __RAD32__ will also be defined! + #if defined(__RADX64__) + // x64 still has 32-bit ints! + #define RAD_U32 unsigned int + #define RAD_S32 signed int + // But pointers are 64 bits. + #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) + #define RAD_SINTa __w64 signed __int64 + #define RAD_UINTa __w64 unsigned __int64 + #else // non-vc.net compiler or /Wp64 turned off + #define RAD_UINTa unsigned long long + #define RAD_SINTa signed long long + #endif + #else + #error Unknown 64-bit processor (see radbase.h) + #endif + #elif defined(__RAD32__) + #define RAD_U32 unsigned int + #define RAD_S32 signed int + // Pointers are 32 bits. + + #if ( ( defined(_MSC_VER) && (_MSC_VER >= 1300 ) ) && ( defined(_Wp64) && ( _Wp64 ) ) ) + #define RAD_SINTa __w64 signed long + #define RAD_UINTa __w64 unsigned long + #else // non-vc.net compiler or /Wp64 turned off + #ifdef _Wp64 + #define RAD_SINTa signed long + #define RAD_UINTa unsigned long + #else + #define RAD_SINTa signed int + #define RAD_UINTa unsigned int + #endif + #endif + #else + #define RAD_U32 unsigned long + #define RAD_S32 signed long + // Pointers in 16-bit land are still 32 bits. + #define RAD_UINTa unsigned long + #define RAD_SINTa signed long + #endif + + #define RAD_F32 float + #if defined(__RADPS2__) || defined(__RADPSP__) + typedef RADSTRUCT RAD_F64 // do this so that we don't accidentally use doubles + { // while using the same space + RAD_U32 vals[ 2 ]; + } RAD_F64; + #define RAD_F64_OR_32 float // type is F64 if available, otherwise F32 + #else + #define RAD_F64 double + #define RAD_F64_OR_32 double // type is F64 if available, otherwise F32 + #endif + + #if (defined(__RADMAC__) || defined(__MRC__) || defined( __RADNGC__ ) || \ + defined(__RADLINUX__) || defined( __RADWII__ ) || defined(__RADWIIU__) || \ + defined(__RADNDS__) || defined(__RADPSP__) || defined(__RADPS3__) || defined(__RADPS4__) || \ + defined(__RADSPU__) || defined(__RADIPHONE__) || defined(__RADNACL__) || defined( __RADANDROID__) || defined( __RADQNX__ ) ) + #define RAD_U64 unsigned long long + #define RAD_S64 signed long long + #elif defined(__RADPS2__) + #define RAD_U64 unsigned long + #define RAD_S64 signed long + #elif defined(__RADARM__) + #define RAD_U64 unsigned long long + #define RAD_S64 signed long long + #elif defined(__RADX64__) || defined(__RAD32__) + #define RAD_U64 unsigned __int64 + #define RAD_S64 signed __int64 + #else + // 16-bit + typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s + { // while using the same space + RAD_U32 vals[ 2 ]; + } RAD_U64; + typedef RADSTRUCT RAD_S64 // do this so that we don't accidentally use S64s + { // while using the same space + RAD_S32 vals[ 2 ]; + } RAD_S64; + #endif + + #if defined(__RAD32__) + #define PTR4 + #define RAD_U16 unsigned short + #define RAD_S16 signed short + #else + #define PTR4 __far + #define RAD_U16 unsigned int + #define RAD_S16 signed int + #endif + + //------------------------------------------------- + // RAD_PTRBITS and such defined here without using sizeof() + // so that they can be used in align() and other macros + + #ifdef __RAD64__ + + #define RAD_PTRBITS 64 + #define RAD_PTRBYTES 8 + #define RAD_TWOPTRBYTES 16 + + #else + + #define RAD_PTRBITS 32 + #define RAD_PTRBYTES 4 + #define RAD_TWOPTRBYTES 8 + + #endif + + + //------------------------------------------------- + // UINTr = int the size of a register + + #ifdef __RAD64REGS__ + + #define RAD_UINTr RAD_U64 + #define RAD_SINTr RAD_S64 + + #else + + #define RAD_UINTr RAD_U32 + #define RAD_SINTr RAD_S32 + + #endif + + //=========================================================================== + + /* + // CB : meh this is enough of a mess that it's probably best to just let each + #if defined(__RADX86__) && defined(_MSC_VER) && _MSC_VER >= 1300 + #define __RADX86INTRIN2003__ + #endif + */ + + // RADASSUME(expr) tells the compiler that expr is always true + // RADUNREACHABLE must never be reachable - even in event of error + // eg. it's okay for compiler to generate completely invalid code after RADUNREACHABLE + + #ifdef _MSC_VER + #define RADFORCEINLINE __forceinline + #if _MSC_VER >= 1300 + #define RADNOINLINE __declspec(noinline) + #else + #define RADNOINLINE + #endif + #define RADUNREACHABLE __assume(0) + #define RADASSUME(exp) __assume(exp) + #elif defined(__clang__) + #ifdef _DEBUG + #define RADFORCEINLINE inline + #else + #define RADFORCEINLINE inline __attribute((always_inline)) + #endif + #define RADNOINLINE __attribute__((noinline)) + + #define RADUNREACHABLE __builtin_unreachable() + + #if __has_builtin(__builtin_assume) + #define RADASSUME(exp) __builtin_assume(exp) + #else + #define RADASSUME(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) __builtin_unreachable(); ) + #endif + #elif (defined(__GCC__) || defined(__GNUC__)) || defined(ANDROID) + #ifdef _DEBUG + #define RADFORCEINLINE inline + #else + #define RADFORCEINLINE inline __attribute((always_inline)) + #endif + #define RADNOINLINE __attribute__((noinline)) + + #if __RAD_GCC_VERSION__ >= 40500 + #define RADUNREACHABLE __builtin_unreachable() + #define RADASSUME(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) __builtin_unreachable(); ) + #else + #define RADUNREACHABLE RAD_INFINITE_LOOP( RR_BREAK(); ) + #define RADASSUME(exp) + #endif + #elif defined(__CWCC__) + #define RADFORCEINLINE inline + #define RADNOINLINE __attribute__((never_inline)) + #define RADUNREACHABLE + #define RADASSUME(x) (void)0 + #else + // ? #define RADFORCEINLINE ? + #define RADFORCEINLINE inline + #define RADNOINLINE + #define RADASSUME(x) (void)0 + #endif + + //=========================================================================== + + // RAD_ALIGN_HINT tells the compiler how a given pointer is aligned + // it *must* be true, but the compiler may or may not use that information + // it is not for cases where the pointer is to an inherently aligned data type, + // it's when the compiler cannot tell the alignment but you have extra information. + // eg : + // U8 * ptr = rrMallocAligned(256,16); + // RAD_ALIGN_HINT(ptr,16,0); + + #ifdef __RADSPU__ + #define RAD_ALIGN_HINT(ptr,alignment,offset) __align_hint(ptr,alignment,offset); RR_ASSERT( ((UINTa)(ptr) & ((alignment)-1)) == (UINTa)(offset) ) + #else + #define RAD_ALIGN_HINT(ptr,alignment,offset) RADASSUME( ((UINTa)(ptr) & ((alignment)-1)) == (UINTa)(offset) ) + #endif + + //=========================================================================== + + // RAD_EXPECT is to tell the compiler the *likely* value of an expression + // different than RADASSUME in that expr might not have that value + // it's use for branch code layout and static branch prediction + // condition can technically be a variable but should usually be 0 or 1 + + #if (defined(__GCC__) || defined(__GNUC__)) || defined(__clang__) + + // __builtin_expect returns value of expr + #define RAD_EXPECT(expr,cond) __builtin_expect(expr,cond) + + #else + + #define RAD_EXPECT(expr,cond) (expr) + + #endif + + // helpers for doing an if ( ) with expect : + // if ( RAD_LIKELY(expr) ) { ... } + + #define RAD_LIKELY(expr) RAD_EXPECT(expr,1) + #define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0) + + //=========================================================================== + + // __RADX86ASM__ means you can use __asm {} style inline assembly + #if defined(__RADX86__) && !defined(__RADX64__) && defined(_MSC_VER) + #define __RADX86ASM__ + #endif + + //------------------------------------------------- + // typedefs : + + #ifndef RADNOTYPEDEFS + + #ifndef S8_DEFINED + #define S8_DEFINED + typedef RAD_S8 S8; + #endif + + #ifndef U8_DEFINED + #define U8_DEFINED + typedef RAD_U8 U8; + #endif + + #ifndef S16_DEFINED + #define S16_DEFINED + typedef RAD_S16 S16; + #endif + + #ifndef U16_DEFINED + #define U16_DEFINED + typedef RAD_U16 U16; + #endif + + #ifndef S32_DEFINED + #define S32_DEFINED + typedef RAD_S32 S32; + #endif + + #ifndef U32_DEFINED + #define U32_DEFINED + typedef RAD_U32 U32; + #endif + + #ifndef S64_DEFINED + #define S64_DEFINED + typedef RAD_S64 S64; + #endif + + #ifndef U64_DEFINED + #define U64_DEFINED + typedef RAD_U64 U64; + #endif + + #ifndef F32_DEFINED + #define F32_DEFINED + typedef RAD_F32 F32; + #endif + + #ifndef F64_DEFINED + #define F64_DEFINED + typedef RAD_F64 F64; + #endif + + #ifndef F64_OR_32_DEFINED + #define F64_OR_32_DEFINED + typedef RAD_F64_OR_32 F64_OR_32; + #endif + + // UINTa and SINTa are the ints big enough for an address + + #ifndef SINTa_DEFINED + #define SINTa_DEFINED + typedef RAD_SINTa SINTa; + #endif + + #ifndef UINTa_DEFINED + #define UINTa_DEFINED + typedef RAD_UINTa UINTa; + #endif + + #ifndef UINTr_DEFINED + #define UINTr_DEFINED + typedef RAD_UINTr UINTr; + #endif + + #ifndef SINTr_DEFINED + #define SINTr_DEFINED + typedef RAD_SINTr SINTr; + #endif + + #elif !defined(RADNOTYPEDEFINES) + + #ifndef S8_DEFINED + #define S8_DEFINED + #define S8 RAD_S8 + #endif + + #ifndef U8_DEFINED + #define U8_DEFINED + #define U8 RAD_U8 + #endif + + #ifndef S16_DEFINED + #define S16_DEFINED + #define S16 RAD_S16 + #endif + + #ifndef U16_DEFINED + #define U16_DEFINED + #define U16 RAD_U16 + #endif + + #ifndef S32_DEFINED + #define S32_DEFINED + #define S32 RAD_S32 + #endif + + #ifndef U32_DEFINED + #define U32_DEFINED + #define U32 RAD_U32 + #endif + + #ifndef S64_DEFINED + #define S64_DEFINED + #define S64 RAD_S64 + #endif + + #ifndef U64_DEFINED + #define U64_DEFINED + #define U64 RAD_U64 + #endif + + #ifndef F32_DEFINED + #define F32_DEFINED + #define F32 RAD_F32 + #endif + + #ifndef F64_DEFINED + #define F64_DEFINED + #define F64 RAD_F64 + #endif + + #ifndef F64_OR_32_DEFINED + #define F64_OR_32_DEFINED + #define F64_OR_32 RAD_F64_OR_32 + #endif + + // UINTa and SINTa are the ints big enough for an address (pointer) + #ifndef SINTa_DEFINED + #define SINTa_DEFINED + #define SINTa RAD_SINTa + #endif + + #ifndef UINTa_DEFINED + #define UINTa_DEFINED + #define UINTa RAD_UINTa + #endif + + #ifndef UINTr_DEFINED + #define UINTr_DEFINED + #define UINTr RAD_UINTr + #endif + + #ifndef SINTr_DEFINED + #define SINTr_DEFINED + #define SINTr RAD_SINTr + #endif + + #endif + + /// Some error-checking. + #if defined(__RAD64__) && !defined(__RAD32__) + // See top of file for why this is. + #error __RAD64__ must not be defined without __RAD32__ (see radbase.h) + #endif + +#ifdef _MSC_VER + // microsoft compilers + + #if _MSC_VER >= 1400 + #define RAD_STATEMENT_START \ + do { + + #define RAD_STATEMENT_END_FALSE \ + __pragma(warning(push)) \ + __pragma(warning(disable:4127)) \ + } while(0) \ + __pragma(warning(pop)) + + #define RAD_STATEMENT_END_TRUE \ + __pragma(warning(push)) \ + __pragma(warning(disable:4127)) \ + } while(1) \ + __pragma(warning(pop)) + + #else + #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #endif +#else + #define RAD_USE_STANDARD_LOOP_CONSTRUCT +#endif + +#ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_STATEMENT_START \ + do { + + #define RAD_STATEMENT_END_FALSE \ + } while ( (void)0,0 ) + + #define RAD_STATEMENT_END_TRUE \ + } while ( (void)1,1 ) + +#endif + +#define RAD_STATEMENT_WRAPPER( code ) \ + RAD_STATEMENT_START \ + code \ + RAD_STATEMENT_END_FALSE + +#define RAD_INFINITE_LOOP( code ) \ + RAD_STATEMENT_START \ + code \ + RAD_STATEMENT_END_TRUE + + +// Must be placed after variable declarations for code compiled as .c +#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later +# define RR_UNUSED_VARIABLE(x) (void) x +#else +# define RR_UNUSED_VARIABLE(x) (void)(sizeof(x)) +#endif + +//----------------------------------------------- +// RR_UINT3264 is a U64 in 64-bit code and a U32 in 32-bit code +// eg. it's pointer sized and the same type as a U32/U64 of the same size +// +// @@ CB 05/21/2012 : I think RR_UINT3264 may be deprecated +// it was useful back when UINTa was /Wp64 +// but since we removed that maybe it's not anymore ? +// + +#ifdef __RAD64__ +#define RR_UINT3264 U64 +#else +#define RR_UINT3264 U32 +#endif + +//RR_COMPILER_ASSERT( sizeof(RR_UINT3264) == sizeof(UINTa) ); + +//-------------------------------------------------- + +// RR_LINESTRING is the current line number as a string +#define RR_STRINGIZE( L ) #L +#define RR_DO_MACRO( M, X ) M(X) +#define RR_STRINGIZE_DELAY( X ) RR_DO_MACRO( RR_STRINGIZE, X ) +#define RR_LINESTRING RR_STRINGIZE_DELAY( __LINE__ ) + +#define RR_CAT(X,Y) X ## Y + +// RR_STRING_JOIN joins strings in the preprocessor and works with LINESTRING +#define RR_STRING_JOIN(arg1, arg2) RR_STRING_JOIN_DELAY(arg1, arg2) +#define RR_STRING_JOIN_DELAY(arg1, arg2) RR_STRING_JOIN_IMMEDIATE(arg1, arg2) +#define RR_STRING_JOIN_IMMEDIATE(arg1, arg2) arg1 ## arg2 + +// RR_NUMBERNAME is a macro to make a name unique, so that you can use it to declare +// variable names and they won't conflict with each other +// using __LINE__ is broken in MSVC with /ZI , but __COUNTER__ is an MSVC extension that works + +#ifdef _MSC_VER + #define RR_NUMBERNAME(name) RR_STRING_JOIN(name,__COUNTER__) +#else + #define RR_NUMBERNAME(name) RR_STRING_JOIN(name,__LINE__) +#endif + +//-------------------------------------------------- +// current plan is to use "rrbool" with plain old "true" and "false" +// if true and false give us trouble we might have to go to rrtrue and rrfalse +// BTW there's a danger for evil bugs here !! If you're checking == true +// then the rrbool must be set to exactly "1" not just "not zero" !! + +#ifndef RADNOTYPEDEFS + #ifndef RRBOOL_DEFINED + #define RRBOOL_DEFINED + typedef S32 rrbool; + typedef S32 RRBOOL; + #endif +#elif !defined(RADNOTYPEDEFINES) + #ifndef RRBOOL_DEFINED + #define RRBOOL_DEFINED + #define rrbool S32 + #define RRBOOL S32 + #endif +#endif + +//-------------------------------------------------- +// Range macros + + #ifndef RR_MIN + #define RR_MIN(a,b) ( (a) < (b) ? (a) : (b) ) + #endif + + #ifndef RR_MAX + #define RR_MAX(a,b) ( (a) > (b) ? (a) : (b) ) + #endif + + #ifndef RR_ABS + #define RR_ABS(a) ( ((a) < 0) ? -(a) : (a) ) + #endif + + #ifndef RR_CLAMP + #define RR_CLAMP(val,lo,hi) RR_MAX( RR_MIN(val,hi), lo ) + #endif + +//-------------------------------------------------- +// Data layout macros + + #define RR_ARRAY_SIZE(array) ( sizeof(array)/sizeof(array[0]) ) + + // MEMBER_OFFSET tells you the offset of a member in a type + #ifdef __RAD3DS__ + #define RR_MEMBER_OFFSET(type,member) (unsigned int)(( (char *) &(((type *)0)->member) - (char *) 0 )) + #elif defined(__RADANDROID__) || defined(__RADPSP__) || defined(__RADPS3__) || defined(__RADSPU__) + // offsetof() gets mucked with by system headers on android, making things dependent on #include order. + #define RR_MEMBER_OFFSET(type,member) __builtin_offsetof(type, member) + #elif defined(__RADLINUX__) + #define RR_MEMBER_OFFSET(type,member) (offsetof(type, member)) + #else + #define RR_MEMBER_OFFSET(type,member) ( (size_t) (UINTa) &(((type *)0)->member) ) + #endif + + // MEMBER_SIZE tells you the size of a member in a type + #define RR_MEMBER_SIZE(type,member) ( sizeof( ((type *) 0)->member) ) + + // just to make gcc shut up about derefing null : + #define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) ) + #define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) ) + + // MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object + // you should then RR_ASSERT( &(ret->member) == ptr ); + #define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) ) + +//-------------------------------------------------- +// Cache / prefetch macros : + +// RR_PREFETCH for various platforms : +// +// RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan +// platforms that automatically prefetch sequential (eg. PC) should be a no-op here +// RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined +// (may be a no-op, may be a normal prefetch, may zero memory) +// warning : RR_PREFETCH_WRITE_INVALIDATE may write memory so don't do it past the end of buffers + +#ifdef __RADX86__ + +#define RR_PREFETCH_SEQUENTIAL(ptr,offset) // nop +#define RR_PREFETCH_WRITE_INVALIDATE(ptr,offset) // nop + +#elif defined(__RADXENON__) + +#define RR_PREFETCH_SEQUENTIAL(ptr,offset) __dcbt((int)(offset),(void *)(ptr)) +#define RR_PREFETCH_WRITE_INVALIDATE(ptr,offset) __dcbz128((int)(offset),(void *)(ptr)) + +#elif defined(__RADPS3__) + +#define RR_PREFETCH_SEQUENTIAL(ptr,offset) __dcbt((char *)(ptr) + (int)(offset)) +#define RR_PREFETCH_WRITE_INVALIDATE(ptr,offset) __dcbz((char *)(ptr) + (int)(offset)) + +#elif defined(__RADSPU__) + +#define RR_PREFETCH_SEQUENTIAL(ptr,offset) // intentional NOP +#define RR_PREFETCH_WRITE_INVALIDATE(ptr,offset) // nop + +#elif defined(__RADWII__) || defined(__RADWIIU__) + +#define RR_PREFETCH_SEQUENTIAL(ptr,offset) // intentional NOP for now +#define RR_PREFETCH_WRITE_INVALIDATE(ptr,offset) // nop + +#elif defined(__RAD3DS__) + +#define RR_PREFETCH_SEQUENTIAL(ptr,offset) __pld((char *)(ptr) + (int)(offset)) +#define RR_PREFETCH_WRITE_INVALIDATE(ptr,offset) __pldw((char *)(ptr) + (int)(offset)) + +#else + +// other platform +#define RR_PREFETCH_SEQUENTIAL(ptr,offset) // need_prefetch // compile error +#define RR_PREFETCH_WRITE_INVALIDATE(ptr,offset) // need_writezero // error + +#endif + +//-------------------------------------------------- +// LIGHTWEIGHT ASSERTS without rrAssert.h + +RADDEFSTART + +// set up RR_BREAK : + + #ifdef __RADNGC__ + + #define RR_BREAK() asm(" .long 0x00000001") + #define RR_CACHE_LINE_SIZE xxx + + #elif defined(__RADWII__) + + #define RR_BREAK() __asm__ volatile("trap") + #define RR_CACHE_LINE_SIZE 32 + + #elif defined(__RADWIIU__) + + #define RR_BREAK() asm("trap") + #define RR_CACHE_LINE_SIZE 32 + + #elif defined(__RAD3DS__) + + #define RR_BREAK() *((int volatile*)0)=0 + #define RR_CACHE_LINE_SIZE 32 + + #elif defined(__RADNDS__) + + #define RR_BREAK() asm("BKPT 0") + #define RR_CACHE_LINE_SIZE xxx + + #elif defined(__RADPS2__) + + #define RR_BREAK() __asm__ volatile("break") + #define RR_CACHE_LINE_SIZE 64 + + #elif defined(__RADPSP__) + + #define RR_BREAK() __asm__("break 0") + #define RR_CACHE_LINE_SIZE 64 + + #elif defined(__RADPSP2__) + + #define RR_BREAK() { __asm__ volatile("bkpt 0x0000"); } + #define RR_CACHE_LINE_SIZE 32 + + #elif defined (__RADQNX__) + #define RR_BREAK() __builtin_trap() + #define RR_CACHE_LINE_SIZE 32 + #elif defined (__RADARM__) && defined (__RADLINUX__) + #define RR_BREAK() __builtin_trap() + #define RR_CACHE_LINE_SIZE 32 + #elif defined(__RADSPU__) + + #define RR_BREAK() __asm volatile ("stopd 0,1,1") + #define RR_CACHE_LINE_SIZE 128 + + #elif defined(__RADPS3__) + + // #ifdef snPause // in LibSN.h + // snPause + // __asm__ volatile ( "tw 31,1,1" ) + + #define RR_BREAK() __asm__ volatile ( "tw 31,1,1" ) + //#define RR_BREAK() __asm__ volatile("trap"); + + #define RR_CACHE_LINE_SIZE 128 + + #elif defined(__RADMAC__) + + #if defined(__GNUG__) || defined(__GNUC__) + #ifdef __RADX86__ + #define RR_BREAK() __asm__ volatile ( "int $3" ) + #else + #define RR_BREAK() __builtin_trap() + #endif + #else + #ifdef __RADMACH__ + void DebugStr(unsigned char const *); + #else + void pascal DebugStr(unsigned char const *); + #endif + #define RR_BREAK() DebugStr("\pRR_BREAK() was called") + #endif + + #define RR_CACHE_LINE_SIZE 64 + + #elif defined(__RADIPHONE__) + #define RR_BREAK() __builtin_trap() + #define RR_CACHE_LINE_SIZE 32 + #elif defined(__RADXENON__) + #define RR_BREAK() __debugbreak() + #define RR_CACHE_LINE_SIZE 128 + #elif defined(__RADANDROID__) + #define RR_BREAK() __builtin_trap() + #define RR_CACHE_LINE_SIZE 32 + #elif defined(__RADPS4__) + #define RR_BREAK() __builtin_trap() + #define RR_CACHE_LINE_SIZE 64 + #elif defined(__RADNACL__) + #define RR_BREAK() __builtin_trap() + #define RR_CACHE_LINE_SIZE 64 + #else + // x86 : + #define RR_CACHE_LINE_SIZE 64 + + #ifdef __RADLINUX__ + #define RR_BREAK() __asm__ volatile ( "int $3" ) + #elif defined(__WATCOMC__) + + void RR_BREAK( void ); + #pragma aux RR_BREAK = "int 0x3"; + + #elif defined(__RADWIN__) && defined(_MSC_VER) && _MSC_VER >= 1300 + + #define RR_BREAK __debugbreak + + #else + + #define RR_BREAK() RAD_STATEMENT_WRAPPER( __asm {int 3} ) + + #endif + + #endif + +// simple RR_ASSERT : + +// CB 5-27-10 : use RR_DO_ASSERTS to toggle asserts on and off : +#if (defined(_DEBUG) && !defined(NDEBUG)) || defined(ASSERT_IN_RELEASE) + #define RR_DO_ASSERTS +#endif + +/********* + +rrAsserts : + +RR_ASSERT(exp) - the normal assert thing, toggled with RR_DO_ASSERTS +RR_ASSERT_ALWAYS(exp) - assert that you want to test even in ALL builds (including final!) +RR_ASSERT_RELEASE(exp) - assert that you want to test even in release builds (not for final!) +RR_ASSERT_LITE(exp) - normal assert is not safe from threads or inside malloc; use this instead +RR_DURING_ASSERT(exp) - wrap operations that compute stuff for assert in here +RR_DO_ASSERTS - toggle tells you if asserts are enabled or not + +RR_BREAK() - generate a debug break - always ! +RR_ASSERT_BREAK() - RR_BREAK for asserts ; disable with RAD_NO_BREAK + +RR_ASSERT_FAILURE(str) - just break with a messsage; like assert with no condition +RR_ASSERT_FAILURE_ALWAYS(str) - RR_ASSERT_FAILURE in release builds too +RR_CANT_GET_HERE() - put in spots execution should never go +RR_COMPILER_ASSERT(exp) - checks constant conditions at compile time + +RADTODO - note to search for nonfinal stuff +RR_PRAGMA_MESSAGE - message dealy, use with #pragma in MSVC + +*************/ + +//----------------------------------------------------------- + + +#if defined(__GNUG__) || defined(__GNUC__) || (defined(_MSC_VER) && _MSC_VER > 1200) + #define RR_FUNCTION_NAME __FUNCTION__ +#else + #define RR_FUNCTION_NAME 0 + + // __func__ is in the C99 standard +#endif + +//----------------------------------------------------------- + +// rrDisplayAssertion might just log, or it might pop a message box, depending on settings +// rrDisplayAssertion returns whether you should break or not +typedef rrbool (RADLINK fp_rrDisplayAssertion)(int * Ignored, const char * fileName,const int line,const char * function,const char * message); + +extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; + +// if I have func pointer, call it, else true ; true = do int 3 +#define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 ) + +//----------------------------------------------------------- + +// RAD_NO_BREAK : option if you don't like your assert to break +// CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional +#ifdef RAD_NO_BREAK +#define RR_ASSERT_BREAK() 0 +#else +#define RR_ASSERT_BREAK() RR_BREAK() +#endif + +// assert_always is on FINAL ! +#define RR_ASSERT_ALWAYS(exp) RAD_STATEMENT_WRAPPER( static int Ignored=0; if ( ! (exp) ) { if ( rrDisplayAssertion(&Ignored,__FILE__,__LINE__,RR_FUNCTION_NAME,#exp) ) RR_ASSERT_BREAK(); } ) + +// RR_ASSERT_FAILURE is like an assert without a condition - if you hit it, you're bad +#define RR_ASSERT_FAILURE_ALWAYS(str) RAD_STATEMENT_WRAPPER( static int Ignored=0; if ( rrDisplayAssertion(&Ignored,__FILE__,__LINE__,RR_FUNCTION_NAME,str) ) RR_ASSERT_BREAK(); ) + +#define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } ) + +//----------------------------------- +#ifdef RR_DO_ASSERTS + +#define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp) +#define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp) +#define RR_ASSERT_NO_ASSUME(exp) RR_ASSERT_ALWAYS(exp) +// RR_DURING_ASSERT is to set up expressions or declare variables that are only used in asserts +#define RR_DURING_ASSERT(exp) exp + +#define RR_ASSERT_FAILURE(str) RR_ASSERT_FAILURE_ALWAYS(str) + +// RR_CANT_GET_HERE is for like defaults in switches that should never be hit +#define RR_CANT_GET_HERE() RAD_STATEMENT_WRAPPER( RR_ASSERT_FAILURE("can't get here"); RADUNREACHABLE; ) + + +#else // RR_DO_ASSERTS //----------------------------------- + +#define RR_ASSERT(exp) (void)0 +#define RR_ASSERT_LITE(exp) (void)0 +#define RR_ASSERT_NO_ASSUME(exp) (void)0 + +#define RR_DURING_ASSERT(exp) (void)0 + +#define RR_ASSERT_FAILURE(str) (void)0 + +#define RR_CANT_GET_HERE() RADUNREACHABLE + +#endif // RR_DO_ASSERTS //----------------------------------- + +//================================================================= + +// RR_ASSERT_RELEASE is on in release build, but not final + +#ifndef __RADFINAL__ + +#define RR_ASSERT_RELEASE(exp) RR_ASSERT_ALWAYS(exp) +#define RR_ASSERT_LITE_RELEASE(exp) RR_ASSERT_LITE_ALWAYS(exp) + +#else + +#define RR_ASSERT_RELEASE(exp) (void)0 +#define RR_ASSERT_LITE_RELEASE(exp) (void)0 + +#endif + +// BH: This never gets compiled away except for __RADFINAL__ +#define RR_ASSERT_ALWAYS_NO_SHIP RR_ASSERT_RELEASE + +#define rrAssert RR_ASSERT +#define rrassert RR_ASSERT + +#ifdef _MSC_VER + // without this, our assert errors... + #if _MSC_VER >= 1300 + #pragma warning( disable : 4127) // conditional expression is constant + #endif +#endif + +//--------------------------------------- +// Get/Put from memory in little or big endian : +// +// val = RR_GET32_BE(ptr) +// RR_PUT32_BE(ptr,val) +// +// available here : +// RR_[GET/PUT][16/32]_[BE/LE][_UNALIGNED][_OFFSET] +// +// if you don't specify _UNALIGNED , then ptr & offset shoud both be aligned to type size +// _OFFSET is in *bytes* ! + +// you can #define RR_GET_RESTRICT to make all RR_GETs be RESTRICT +// if you set nothing they are not + +#ifdef RR_GET_RESTRICT +#define RR_GET_PTR_POST RADRESTRICT +#endif +#ifndef RR_GET_PTR_POST +#define RR_GET_PTR_POST +#endif + +// native version of get/put is always trivial : + +#define RR_GET16_NATIVE(ptr) *((const U16 * RR_GET_PTR_POST)(ptr)) +#define RR_PUT16_NATIVE(ptr,val) *((U16 * RR_GET_PTR_POST)(ptr)) = (val) + +// offset is in bytes +#define RR_U16_PTR_OFFSET(ptr,offset) ((U16 * RR_GET_PTR_POST)((char *)(ptr) + (offset))) +#define RR_GET16_NATIVE_OFFSET(ptr,offset) *( RR_U16_PTR_OFFSET((ptr),offset) ) +#define RR_PUT16_NATIVE_OFFSET(ptr,val,offset) *( RR_U16_PTR_OFFSET((ptr),offset)) = (val) + +#define RR_GET32_NATIVE(ptr) *((const U32 * RR_GET_PTR_POST)(ptr)) +#define RR_PUT32_NATIVE(ptr,val) *((U32 * RR_GET_PTR_POST)(ptr)) = (val) + +// offset is in bytes +#define RR_U32_PTR_OFFSET(ptr,offset) ((U32 * RR_GET_PTR_POST)((char *)(ptr) + (offset))) +#define RR_GET32_NATIVE_OFFSET(ptr,offset) *( RR_U32_PTR_OFFSET((ptr),offset) ) +#define RR_PUT32_NATIVE_OFFSET(ptr,val,offset) *( RR_U32_PTR_OFFSET((ptr),offset)) = (val) + +#define RR_GET64_NATIVE(ptr) *((const U64 * RR_GET_PTR_POST)(ptr)) +#define RR_PUT64_NATIVE(ptr,val) *((U64 * RR_GET_PTR_POST)(ptr)) = (val) + +// offset is in bytes +#define RR_U64_PTR_OFFSET(ptr,offset) ((U64 * RR_GET_PTR_POST)((char *)(ptr) + (offset))) +#define RR_GET64_NATIVE_OFFSET(ptr,offset) *( RR_U64_PTR_OFFSET((ptr),offset) ) +#define RR_PUT64_NATIVE_OFFSET(ptr,val,offset) *( RR_U64_PTR_OFFSET((ptr),offset)) = (val) + +//--------------------------------------------------- + +#ifdef __RADLITTLEENDIAN__ + +#define RR_GET16_LE RR_GET16_NATIVE +#define RR_PUT16_LE RR_PUT16_NATIVE +#define RR_GET16_LE_OFFSET RR_GET16_NATIVE_OFFSET +#define RR_PUT16_LE_OFFSET RR_PUT16_NATIVE_OFFSET + +#define RR_GET32_LE RR_GET32_NATIVE +#define RR_PUT32_LE RR_PUT32_NATIVE +#define RR_GET32_LE_OFFSET RR_GET32_NATIVE_OFFSET +#define RR_PUT32_LE_OFFSET RR_PUT32_NATIVE_OFFSET + +#define RR_GET64_LE RR_GET64_NATIVE +#define RR_PUT64_LE RR_PUT64_NATIVE +#define RR_GET64_LE_OFFSET RR_GET64_NATIVE_OFFSET +#define RR_PUT64_LE_OFFSET RR_PUT64_NATIVE_OFFSET + +#else + +#define RR_GET16_BE RR_GET16_NATIVE +#define RR_PUT16_BE RR_PUT16_NATIVE +#define RR_GET16_BE_OFFSET RR_GET16_NATIVE_OFFSET +#define RR_PUT16_BE_OFFSET RR_PUT16_NATIVE_OFFSET + +#define RR_GET32_BE RR_GET32_NATIVE +#define RR_PUT32_BE RR_PUT32_NATIVE +#define RR_GET32_BE_OFFSET RR_GET32_NATIVE_OFFSET +#define RR_PUT32_BE_OFFSET RR_PUT32_NATIVE_OFFSET + +#define RR_GET64_BE RR_GET64_NATIVE +#define RR_PUT64_BE RR_PUT64_NATIVE +#define RR_GET64_BE_OFFSET RR_GET64_NATIVE_OFFSET +#define RR_PUT64_BE_OFFSET RR_PUT64_NATIVE_OFFSET + +#endif + +//------------------------- +// non-native Get/Put implementations go here : + +#if defined(__RADX86__) +// good implementation for X86 : + +#if (_MSC_VER >= 1300) + +unsigned short __cdecl _byteswap_ushort (unsigned short _Short); +unsigned long __cdecl _byteswap_ulong (unsigned long _Long); +#pragma intrinsic(_byteswap_ushort, _byteswap_ulong) + +#define RR_BSWAP16 _byteswap_ushort +#define RR_BSWAP32 _byteswap_ulong + +unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +#pragma intrinsic(_byteswap_uint64) +#define RR_BSWAP64 _byteswap_uint64 + +#elif defined(_MSC_VER) // VC6 + +RADFORCEINLINE unsigned long RR_BSWAP16 (unsigned long _Long) +{ + __asm { + mov eax, [_Long] + rol ax, 8 + mov [_Long], eax; + } + return _Long; +} + +RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) +{ + __asm { + mov eax, [_Long] + bswap eax + mov [_Long], eax + } + return _Long; +} + +RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +{ + __asm { + mov eax, DWORD PTR _Long + mov edx, DWORD PTR _Long+4 + bswap eax + bswap edx + mov DWORD PTR _Long, edx + mov DWORD PTR _Long+4, eax + } + return _Long; +} + +#elif defined(__GNUC__) || defined(__clang__) + +// GCC has __builtin_bswap16, but Clang only seems to have added it recently. +// We use __builtin_bswap32/64 but 16 just uses the macro version. (No big +// deal if that turns into shifts anyway) +#define RR_BSWAP16(u16) ( (U16) ( ((u16) >> 8) | ((u16) << 8) ) ) +#define RR_BSWAP32 __builtin_bswap32 +#define RR_BSWAP64 __builtin_bswap64 + +#endif + +#define RR_GET16_BE(ptr) RR_BSWAP16(*((U16 *)(ptr))) +#define RR_PUT16_BE(ptr,val) *((U16 *)(ptr)) = (U16) RR_BSWAP16(val) +#define RR_GET16_BE_OFFSET(ptr,offset) RR_BSWAP16(*RR_U16_PTR_OFFSET(ptr,offset)) +#define RR_PUT16_BE_OFFSET(ptr,val,offset) *RR_U16_PTR_OFFSET(ptr,offset) = RR_BSWAP16(val) + +#define RR_GET32_BE(ptr) RR_BSWAP32(*((U32 *)(ptr))) +#define RR_PUT32_BE(ptr,val) *((U32 *)(ptr)) = RR_BSWAP32(val) +#define RR_GET32_BE_OFFSET(ptr,offset) RR_BSWAP32(*RR_U32_PTR_OFFSET(ptr,offset)) +#define RR_PUT32_BE_OFFSET(ptr,val,offset) *RR_U32_PTR_OFFSET(ptr,offset) = RR_BSWAP32(val) + +#define RR_GET64_BE(ptr) RR_BSWAP64(*((U64 *)(ptr))) +#define RR_PUT64_BE(ptr,val) *((U64 *)(ptr)) = RR_BSWAP64(val) +#define RR_GET64_BE_OFFSET(ptr,offset) RR_BSWAP64(*RR_U64_PTR_OFFSET(ptr,offset)) +#define RR_PUT64_BE_OFFSET(ptr,val,offset) *RR_U64_PTR_OFFSET(ptr,offset) = RR_BSWAP64(val) + +// end _MSC_VER + +#elif defined(__RADXENON__) // Xenon has built-in funcs for this + +unsigned short __loadshortbytereverse(int offset, const void *base); +unsigned long __loadwordbytereverse (int offset, const void *base); + +void __storeshortbytereverse(unsigned short val, int offset, void *base); +void __storewordbytereverse (unsigned int val, int offset, void *base); + +#define RR_GET16_LE(ptr) __loadshortbytereverse(0, ptr) +#define RR_PUT16_LE(ptr,val) __storeshortbytereverse((U16) (val), 0, ptr) + +#define RR_GET16_LE_OFFSET(ptr,offset) __loadshortbytereverse(offset, ptr) +#define RR_PUT16_LE_OFFSET(ptr,val,offset) __storeshortbytereverse((U16) (val), offset, ptr) + +#define RR_GET32_LE(ptr) __loadwordbytereverse(0, ptr) +#define RR_PUT32_LE(ptr,val) __storewordbytereverse((U32) (val), 0, ptr) + +#define RR_GET32_LE_OFFSET(ptr,offset) __loadwordbytereverse(offset, ptr) +#define RR_PUT32_LE_OFFSET(ptr,val,offset) __storewordbytereverse((U32) (val), offset, ptr) + +#define RR_GET64_LE(ptr) ( ((U64)RR_GET32_OFFSET_LE(ptr,4)<<32) | RR_GET32_LE(ptr) ) +#define RR_PUT64_LE(ptr,val) RR_PUT32_LE(ptr, (U32) (val)), RR_PUT32_OFFSET_LE(ptr, (U32) ((val)>>32),4) + +#elif defined(__RADPS3__) + +#include + +#define RR_GET16_LE(ptr) __lhbrx(ptr) +#define RR_PUT16_LE(ptr,val) __sthbrx(ptr, (U16) (val)) + +#define RR_GET16_LE_OFFSET(ptr,offset) __lhbrx(RR_U16_PTR_OFFSET(ptr, offset)) +#define RR_PUT16_LE_OFFSET(ptr,val,offset) __sthbrx(RR_U16_PTR_OFFSET(ptr, offset), (U16) (val)) + +#define RR_GET32_LE(ptr) __lwbrx(ptr) +#define RR_PUT32_LE(ptr,val) __stwbrx(ptr, (U32) (val)) + +#define RR_GET64_LE(ptr) __ldbrx(ptr) +#define RR_PUT64_LE(ptr,val) __stdbrx(ptr, (U32) (val)) + +#define RR_GET32_LE_OFFSET(ptr,offset) __lwbrx(RR_U32_PTR_OFFSET(ptr, offset)) +#define RR_PUT32_LE_OFFSET(ptr,val,offset) __stwbrx(RR_U32_PTR_OFFSET(ptr, offset), (U32) (val)) + +#elif defined(__RADWII__) + +#define RR_GET16_LE(ptr) __lhbrx(ptr, 0) +#define RR_PUT16_LE(ptr,val) __sthbrx((U16) (val), ptr, 0) + +#define RR_GET16_LE_OFFSET(ptr,offset) __lhbrx(ptr, offset) +#define RR_PUT16_LE_OFFSET(ptr,val,offset) __sthbrx((U16) (val), ptr, offset) + +#define RR_GET32_LE(ptr) __lwbrx(ptr, 0) +#define RR_PUT32_LE(ptr,val) __stwbrx((U32) (val), ptr, 0) + +#define RR_GET32_LE_OFFSET(ptr,offset) __lwbrx(ptr, offset) +#define RR_PUT32_LE_OFFSET(ptr,val,offset) __stwbrx((U32) (val), ptr, offset) + +#elif defined(__RAD3DS__) + +#define RR_GET16_BE(ptr) __rev16(*(U16 *) (ptr)) +#define RR_PUT16_BE(ptr,val) *(U16 *) (ptr) = __rev16(val) + +#define RR_GET16_BE_OFFSET(ptr,offset) __rev16(*RR_U16_PTR_OFFSET(ptr,offset)) +#define RR_PUT16_BE_OFFSET(ptr,offset,val) *RR_U16_PTR_OFFSET(ptr,offset) = __rev16(val) + +#define RR_GET32_BE(ptr) __rev(*(U32 *) (ptr)) +#define RR_PUT32_BE(ptr,val) *(U32 *) (ptr) = __rev(val) + +#define RR_GET32_BE_OFFSET(ptr,offset) __rev(*RR_U32_PTR_OFFSET(ptr,offset)) +#define RR_PUT32_BE_OFFSET(ptr,offset,val) *RR_U32_PTR_OFFSET(ptr,offset) = __rev(val) + +#elif defined(__RADIPHONE__) + +// iPhone does not seem to have intrinsics for this, so use generic fallback! + +// Bswap is just here for use of implementing get/put +// caller should use Get/Put , not bswap +#define RR_BSWAP16(u16) ( (U16) ( ((u16) >> 8) | ((u16) << 8) ) ) +#define RR_BSWAP32(u32) ( (U32) ( ((u32) >> 24) | (((u32)<<8) & 0x00FF0000) | (((u32)>>8) & 0x0000FF00) | ((u32) << 24) ) ) + +#define RR_GET16_BE(ptr) RR_BSWAP16(*((U16 *)(ptr))) +#define RR_PUT16_BE(ptr,val) *((U16 *)(ptr)) = RR_BSWAP16(val) + +#define RR_GET32_BE(ptr) RR_BSWAP32(*((U32 *)(ptr))) +#define RR_PUT32_BE(ptr,val) *((U32 *)(ptr)) = RR_BSWAP32(val) + +#elif defined(__RADWIIU__) + +#include + +#define RR_GET16_LE(ptr) (*(__bytereversed U16 *) (ptr)) +#define RR_PUT16_LE(ptr,val) *(__bytereversed U16 *) (ptr) = val + +#define RR_GET16_LE_OFFSET(ptr,offset) (*(__bytereversed U16 *)RR_U16_PTR_OFFSET(ptr,offset)) +#define RR_PUT16_LE_OFFSET(ptr,val,offset) *(__bytereversed U16 *)RR_U16_PTR_OFFSET(ptr,offset) = val + +#define RR_GET32_LE(ptr) (*(__bytereversed U32 *) (ptr)) +#define RR_PUT32_LE(ptr,val) *(__bytereversed U32 *) (ptr) = val + +#define RR_GET32_LE_OFFSET(ptr,offset) (*(__bytereversed U32 *)RR_U32_PTR_OFFSET(ptr,offset)) +#define RR_PUT32_LE_OFFSET(ptr,val,offset) *(__bytereversed U32 *)RR_U32_PTR_OFFSET(ptr,offset) = val + +#define RR_GET64_LE(ptr) (*(__bytereversed U64 *) (ptr)) +#define RR_PUT64_LE(ptr,val) *(__bytereversed U64 *) (ptr) = val + +#define RR_GET64_LE_OFFSET(ptr,offset) (*(__bytereversed U64 *)RR_U32_PTR_OFFSET(ptr,offset)) +#define RR_PUT64_LE_OFFSET(ptr,val,offset) *(__bytereversed U64 *)RR_U32_PTR_OFFSET(ptr,offset) = val + +#elif defined(__RADWINRTAPI__) && defined(__RADARM__) + +#include + +#define RR_BSWAP16(u16) _arm_rev16(u16) +#define RR_BSWAP32(u32) _arm_rev(u32) + +#define RR_GET16_BE(ptr) RR_BSWAP16(*((U16 *)(ptr))) +#define RR_PUT16_BE(ptr,val) *((U16 *)(ptr)) = RR_BSWAP16(val) + +#define RR_GET32_BE(ptr) RR_BSWAP32(*((U32 *)(ptr))) +#define RR_PUT32_BE(ptr,val) *((U32 *)(ptr)) = RR_BSWAP32(val) + +#elif defined(__RADPSP2__) + +// no rev16 exposed +#define RR_BSWAP16(u16) ( (U16) ( ((u16) >> 8) | ((u16) << 8) ) ) +#define RR_BSWAP32(u32) __builtin_rev(u32) + +#define RR_GET16_BE(ptr) RR_BSWAP16(*((U16 *)(ptr))) +#define RR_PUT16_BE(ptr,val) *((U16 *)(ptr)) = RR_BSWAP16(val) + +#define RR_GET32_BE(ptr) RR_BSWAP32(*((U32 *)(ptr))) +#define RR_PUT32_BE(ptr,val) *((U32 *)(ptr)) = RR_BSWAP32(val) + +#else // other platforms ? + +// fall back : + +// Bswap is just here for use of implementing get/put +// caller should use Get/Put , not bswap +#define RR_BSWAP16(u16) ( (U16) ( ((u16) >> 8) | ((u16) << 8) ) ) +#define RR_BSWAP32(u32) ( (U32) ( ((u32) >> 24) | (((u32)<<8) & 0x00FF0000) | (((u32)>>8) & 0x0000FF00) | ((u32) << 24) ) ) +#define RR_BSWAP64(u64) ( ((U64) RR_BSWAP32((U32) (u64)) << 32) | (U64) RR_BSWAP32((U32) ((u64) >> 32)) ) + +#ifdef __RADLITTLEENDIAN__ + +// comment out fallbacks so users will get errors +//#define RR_GET16_BE(ptr) RR_BSWAP16(*((U16 *)(ptr))) +//#define RR_PUT16_BE(ptr,val) *((U16 *)(ptr)) = RR_BSWAP16(val) +//#define RR_GET32_BE(ptr) RR_BSWAP32(*((U32 *)(ptr))) +//#define RR_PUT32_BE(ptr,val) *((U32 *)(ptr)) = RR_BSWAP32(val) + +#else + +// comment out fallbacks so users will get errors +//#define RR_GET16_LE(ptr) RR_BSWAP16(*((U16 *)(ptr))) +//#define RR_PUT16_LE(ptr,val) *((U16 *)(ptr)) = RR_BSWAP16(val) +//#define RR_GET32_LE(ptr) RR_BSWAP32(*((U32 *)(ptr))) +//#define RR_PUT32_LE(ptr,val) *((U32 *)(ptr)) = RR_BSWAP32(val) + +#endif + +#endif + +//=================================================================== +// @@ TEMP : Aliases for old names : remove me when possible : + +#define RR_GET32_OFFSET_LE RR_GET32_LE_OFFSET +#define RR_GET32_OFFSET_BE RR_GET32_BE_OFFSET +#define RR_PUT32_OFFSET_LE RR_PUT32_LE_OFFSET +#define RR_PUT32_OFFSET_BE RR_PUT32_BE_OFFSET +#define RR_GET16_OFFSET_LE RR_GET16_LE_OFFSET +#define RR_GET16_OFFSET_BE RR_GET16_BE_OFFSET +#define RR_PUT16_OFFSET_LE RR_PUT16_LE_OFFSET +#define RR_PUT16_OFFSET_BE RR_PUT16_BE_OFFSET + + +//=================================================================== +// UNALIGNED VERSIONS : + +#if defined(__RADX86__) || defined(__RADPPC__) // platforms where unaligned is fast : + +#define RR_GET32_BE_UNALIGNED(ptr) RR_GET32_BE(ptr) +#define RR_GET32_BE_UNALIGNED_OFFSET(ptr,offset) RR_GET32_BE_OFFSET(ptr,offset) +#define RR_GET16_BE_UNALIGNED(ptr) RR_GET16_BE(ptr) +#define RR_GET16_BE_UNALIGNED_OFFSET(ptr,offset) RR_GET16_BE_OFFSET(ptr,offset) + +#define RR_GET32_LE_UNALIGNED(ptr) RR_GET32_LE(ptr) +#define RR_GET32_LE_UNALIGNED_OFFSET(ptr,offset) RR_GET32_LE_OFFSET(ptr,offset) +#define RR_GET16_LE_UNALIGNED(ptr) RR_GET16_LE(ptr) +#define RR_GET16_LE_UNALIGNED_OFFSET(ptr,offset) RR_GET16_LE_OFFSET(ptr,offset) + +#elif defined(__RAD3DS__) + +// arm has a "__packed" qualifier to tell the compiler to do unaligned accesses +#define RR_U16_PTR_OFFSET_UNALIGNED(ptr,offset) ((__packed U16 * RR_GET_PTR_POST)((char *)(ptr) + (offset))) +#define RR_U32_PTR_OFFSET_UNALIGNED(ptr,offset) ((__packed U32 * RR_GET_PTR_POST)((char *)(ptr) + (offset))) + +#define RR_GET32_BE_UNALIGNED(ptr) __rev(*RR_U32_PTR_OFFSET_UNALIGNED(ptr,0)) +#define RR_GET32_BE_UNALIGNED_OFFSET(ptr,offset) __rev(*RR_U32_PTR_OFFSET_UNALIGNED(ptr,offset)) +#define RR_GET16_BE_UNALIGNED(ptr) __rev16(*RR_U16_PTR_OFFSET_UNALIGNED(ptr,0)) +#define RR_GET16_BE_UNALIGNED_OFFSET(ptr,offset) __rev16(*RR_U16_PTR_OFFSET_UNALIGNED(ptr,offset)) + +#define RR_GET32_LE_UNALIGNED(ptr) *RR_U32_PTR_OFFSET_UNALIGNED(ptr,0) +#define RR_GET32_LE_UNALIGNED_OFFSET(ptr,offset) *RR_U32_PTR_OFFSET_UNALIGNED(ptr,offset) +#define RR_GET16_LE_UNALIGNED(ptr) *RR_U16_PTR_OFFSET_UNALIGNED(ptr,0) +#define RR_GET16_LE_UNALIGNED_OFFSET(ptr,offset) *RR_U16_PTR_OFFSET_UNALIGNED(ptr,offset) + +#elif defined(__RADPSP2__) + +#define RR_U16_PTR_OFFSET_UNALIGNED(ptr,offset) ((U16 __unaligned * RR_GET_PTR_POST)((char *)(ptr) + (offset))) +#define RR_U32_PTR_OFFSET_UNALIGNED(ptr,offset) ((U32 __unaligned * RR_GET_PTR_POST)((char *)(ptr) + (offset))) + +#define RR_GET32_BE_UNALIGNED(ptr) RR_BSWAP32(*RR_U32_PTR_OFFSET_UNALIGNED(ptr,0)) +#define RR_GET32_BE_UNALIGNED_OFFSET(ptr,offset) RR_BSWAP32(*RR_U32_PTR_OFFSET_UNALIGNED(ptr,offset)) +#define RR_GET16_BE_UNALIGNED(ptr) RR_BSWAP16(*RR_U16_PTR_OFFSET_UNALIGNED(ptr,0)) +#define RR_GET16_BE_UNALIGNED_OFFSET(ptr,offset) RR_BSWAP16(*RR_U16_PTR_OFFSET_UNALIGNED(ptr,offset)) + +#define RR_GET32_LE_UNALIGNED(ptr) *RR_U32_PTR_OFFSET_UNALIGNED(ptr,0) +#define RR_GET32_LE_UNALIGNED_OFFSET(ptr,offset) *RR_U32_PTR_OFFSET_UNALIGNED(ptr,offset) +#define RR_GET16_LE_UNALIGNED(ptr) *RR_U16_PTR_OFFSET_UNALIGNED(ptr,0) +#define RR_GET16_LE_UNALIGNED_OFFSET(ptr,offset) *RR_U16_PTR_OFFSET_UNALIGNED(ptr,offset) + +#else +// Unaligned via bytes : + +#define RR_GET32_BE_UNALIGNED(ptr) ( \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr)))[0] << 24 ) | \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr)))[1] << 16 ) | \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr)))[2] << 8 ) | \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr)))[3] << 0 ) ) + +#define RR_GET32_BE_UNALIGNED_OFFSET(ptr,offset) ( \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr))+(offset))[0] << 24 ) | \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr))+(offset))[1] << 16 ) | \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr))+(offset))[2] << 8 ) | \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr))+(offset))[3] << 0 ) ) + +#define RR_GET16_BE_UNALIGNED(ptr) ( \ + ( (U16)(((const U8 * RR_GET_PTR_POST)(ptr)))[0] << 8 ) | \ + ( (U16)(((const U8 * RR_GET_PTR_POST)(ptr)))[1] << 0 ) ) + +#define RR_GET16_BE_UNALIGNED_OFFSET(ptr,offset) ( \ + ( (U16)(((const U8 * RR_GET_PTR_POST)(ptr))+(offset))[0] << 8 ) | \ + ( (U16)(((const U8 * RR_GET_PTR_POST)(ptr))+(offset))[1] << 0 ) ) + +#define RR_GET32_LE_UNALIGNED(ptr) ( \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr)))[3] << 24 ) | \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr)))[2] << 16 ) | \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr)))[1] << 8 ) | \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr)))[0] << 0 ) ) + +#define RR_GET32_LE_UNALIGNED_OFFSET(ptr,offset) ( \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr))+(offset))[3] << 24 ) | \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr))+(offset))[2] << 16 ) | \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr))+(offset))[1] << 8 ) | \ + ( (U32)(((const U8 * RR_GET_PTR_POST)(ptr))+(offset))[0] << 0 ) ) + +#define RR_GET16_LE_UNALIGNED(ptr) ( \ + ( (U16)(((const U8 * RR_GET_PTR_POST)(ptr)))[1] << 8 ) | \ + ( (U16)(((const U8 * RR_GET_PTR_POST)(ptr)))[0] << 0 ) ) + +#define RR_GET16_LE_UNALIGNED_OFFSET(ptr,offset) ( \ + ( (U16)(((const U8 * RR_GET_PTR_POST)(ptr))+(offset))[1] << 8 ) | \ + ( (U16)(((const U8 * RR_GET_PTR_POST)(ptr))+(offset))[0] << 0 ) ) + +#endif + +//=================================================================== +// RR_ROTL32 : 32-bit rotate +// + +#ifdef _MSC_VER + + unsigned long __cdecl _lrotl(unsigned long, int); + #pragma intrinsic(_lrotl) + + #define RR_ROTL32(x,k) _lrotl((unsigned long)(x),(int)(k)) + +#elif defined(__RADCELL__) || defined(__RADLINUX__) || defined(__RADWII__) || defined(__RADMACAPI__) || defined(__RADWIIU__) || defined(__RADPS4__) || defined(__RADPSP2__) + + // Compiler turns this into rotate correctly : + #define RR_ROTL32(u32,num) ( ( (u32) << (num) ) | ( (u32) >> (32 - (num))) ) + +#elif defined(__RAD3DS__) + + #define RR_ROTL32(u32,num) __ror(u32, (-(num))&31) + +#else + +// comment out fallbacks so users will get errors +// fallback implementation using shift and or : +//#define RR_ROTL32(u32,num) ( ( (u32) << (num) ) | ( (u32) >> (32 - (num))) ) + +#endif + + +//=================================================================== +// RR_ROTL64 : 64-bit rotate + +#if ( defined(_MSC_VER) && _MSC_VER >= 1300) + +unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +#pragma intrinsic(_rotl64) + +#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) + +#elif defined(__RADCELL__) + +// PS3 GCC turns this into rotate correctly : +#define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) ) + +#elif defined(__RADLINUX__) || defined(__RADMACAPI__) + +//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. +#define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) ) + +#else + +// comment out fallbacks so users will get errors +// fallback implementation using shift and or : +//#define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) ) + +#endif + +//=================================================================== + +RADDEFEND + +//=================================================================== + +// RR_COMPILER_ASSERT +#if defined(__cplusplus) && !defined(RR_COMPILER_ASSERT) + #if defined(_MSC_VER) && (_MSC_VER >=1400) + + // better version of COMPILER_ASSERT using boost technique + template struct RR_COMPILER_ASSERT_FAILURE; + + template <> struct RR_COMPILER_ASSERT_FAILURE<1> { enum { value = 1 }; }; + + template struct rr_compiler_assert_test{}; + + // __LINE__ macro broken when -ZI is used see Q199057 + #define RR_COMPILER_ASSERT( B ) \ + typedef rr_compiler_assert_test<\ + sizeof(RR_COMPILER_ASSERT_FAILURE< (B) ? 1 : 0 >)\ + > rr_compiler_assert_typedef_ + + #endif +#endif + +#ifndef RR_COMPILER_ASSERT + // this happens at declaration time, so if it's inside a function in a C file, drop {} around it + #define RR_COMPILER_ASSERT(exp) typedef char RR_STRING_JOIN(_dummy_array, __LINE__) [ (exp) ? 1 : -1 ] +#endif + +//=================================================================== +// some error checks : + + RR_COMPILER_ASSERT( sizeof(RAD_UINTa) == sizeof( RR_STRING_JOIN(RAD_U,RAD_PTRBITS) ) ); + RR_COMPILER_ASSERT( sizeof(RAD_UINTa) == RAD_PTRBYTES ); + RR_COMPILER_ASSERT( RAD_TWOPTRBYTES == 2* RAD_PTRBYTES ); + +//=================================================================== + + #endif // __RADRES__ + +//include "testconstant.inl" // uncomment and include to test statement constants + +#endif // __RADRR_COREH__ + + diff --git a/Minecraft.Client/Durango/Miles/lib/auddurango.LTCG.lib b/Minecraft.Client/Durango/Miles/lib/auddurango.LTCG.lib new file mode 100644 index 00000000..51cf3af7 Binary files /dev/null and b/Minecraft.Client/Durango/Miles/lib/auddurango.LTCG.lib differ diff --git a/Minecraft.Client/Durango/Miles/lib/auddurango.lib b/Minecraft.Client/Durango/Miles/lib/auddurango.lib new file mode 100644 index 00000000..8b124314 Binary files /dev/null and b/Minecraft.Client/Durango/Miles/lib/auddurango.lib differ diff --git a/Minecraft.Client/Durango/Miles/lib/binkadurango.LTCG.lib b/Minecraft.Client/Durango/Miles/lib/binkadurango.LTCG.lib new file mode 100644 index 00000000..6bbbf311 Binary files /dev/null and b/Minecraft.Client/Durango/Miles/lib/binkadurango.LTCG.lib differ diff --git a/Minecraft.Client/Durango/Miles/lib/binkadurango.lib b/Minecraft.Client/Durango/Miles/lib/binkadurango.lib new file mode 100644 index 00000000..372a3027 Binary files /dev/null and b/Minecraft.Client/Durango/Miles/lib/binkadurango.lib differ diff --git a/Minecraft.Client/Durango/Miles/lib/fltdurango.LTCG.lib b/Minecraft.Client/Durango/Miles/lib/fltdurango.LTCG.lib new file mode 100644 index 00000000..ec21e28a Binary files /dev/null and b/Minecraft.Client/Durango/Miles/lib/fltdurango.LTCG.lib differ diff --git a/Minecraft.Client/Durango/Miles/lib/fltdurango.lib b/Minecraft.Client/Durango/Miles/lib/fltdurango.lib new file mode 100644 index 00000000..6c9f4edd Binary files /dev/null and b/Minecraft.Client/Durango/Miles/lib/fltdurango.lib differ diff --git a/Minecraft.Client/Durango/Miles/lib/mssdurango.LTCG.lib b/Minecraft.Client/Durango/Miles/lib/mssdurango.LTCG.lib new file mode 100644 index 00000000..d0e5f7b9 Binary files /dev/null and b/Minecraft.Client/Durango/Miles/lib/mssdurango.LTCG.lib differ diff --git a/Minecraft.Client/Durango/Miles/lib/mssdurango.lib b/Minecraft.Client/Durango/Miles/lib/mssdurango.lib new file mode 100644 index 00000000..65ef946b Binary files /dev/null and b/Minecraft.Client/Durango/Miles/lib/mssdurango.lib differ diff --git a/Minecraft.Client/Durango/Miles/lib/mssdurangomidi.LTCG.lib b/Minecraft.Client/Durango/Miles/lib/mssdurangomidi.LTCG.lib new file mode 100644 index 00000000..a890cb3c Binary files /dev/null and b/Minecraft.Client/Durango/Miles/lib/mssdurangomidi.LTCG.lib differ diff --git a/Minecraft.Client/Durango/Miles/lib/mssdurangomidi.lib b/Minecraft.Client/Durango/Miles/lib/mssdurangomidi.lib new file mode 100644 index 00000000..9b073344 Binary files /dev/null and b/Minecraft.Client/Durango/Miles/lib/mssdurangomidi.lib differ diff --git a/Minecraft.Client/Durango/Minecraft_Macros.h b/Minecraft.Client/Durango/Minecraft_Macros.h new file mode 100644 index 00000000..4f1f096a --- /dev/null +++ b/Minecraft.Client/Durango/Minecraft_Macros.h @@ -0,0 +1,42 @@ + +#pragma once + +// 3 bit user index +// 5 bits alpha +// 1 bit decoration +// 3 bits poptime +// 8 bits unused // was 11 bits aux val but needed 15 bits for potions so moved to item bitmask +// 6 bits count +// 6 bits scale + +// uiCount is up to 64, but can't ever be 0, so to make it 6 bits, subtract one from the packing, and add one on the unpacking +#define MAKE_SLOTDISPLAY_DATA_BITMASK(uiUserIndex,uiAlpha,bDecorations,uiCount,uiScale,uiPopTime) ((((uiUserIndex&0x7)<<29) | (uiAlpha&0x1F)<<24) | (bDecorations?0x800000:0) | ((uiPopTime&0x7)<<20) | ((uiCount-1)<<6) | (uiScale&0x3F)) + +#define GET_SLOTDISPLAY_USERINDEX_FROM_DATA_BITMASK(uiBitmask) ((((unsigned int)uiBitmask)>>29)&0x7) +#define GET_SLOTDISPLAY_ALPHA_FROM_DATA_BITMASK(uiBitmask) ((((unsigned int)uiBitmask)>>24)&0x1F) +#define GET_SLOTDISPLAY_DECORATIONS_FROM_DATA_BITMASK(uiBitmask) ((((unsigned int)uiBitmask)&0x800000)?true:false) +//#define GET_SLOTDISPLAY_AUXVAL_FROM_DATA_BITMASK(uiBitmask) ((((unsigned long)uiBitmask)>>12)&0x7FF) +#define GET_SLOTDISPLAY_COUNT_FROM_DATA_BITMASK(uiBitmask) (((((unsigned int)uiBitmask)>>6)&0x3F)+1) +#define GET_SLOTDISPLAY_SCALE_FROM_DATA_BITMASK(uiBitmask) (((unsigned int)uiBitmask)&0x3F) +#define GET_SLOTDISPLAY_POPTIME_FROM_DATA_BITMASK(uiBitmask) ((((unsigned int)uiBitmask)>>20)&0x7) + +// 16 bits for id (either item id or xzp icon id) +// 15 bits for aux value +// 1 bit for foil +#define MAKE_SLOTDISPLAY_ITEM_BITMASK(uiId,uiAuxValue,bFoil) ( (uiId & 0xFFFF) | ((uiAuxValue & 0x7FFF) << 16) | (bFoil?0x80000000:0) ) + +#define GET_SLOTDISPLAY_ID_FROM_ITEM_BITMASK(uiBitmask) (((unsigned int)uiBitmask)&0xFFFF) +#define GET_SLOTDISPLAY_AUXVAL_FROM_ITEM_BITMASK(uiBitmask) ((((unsigned int)uiBitmask)>>16) & 0x7FFF) +#define GET_SLOTDISPLAY_FOIL_FROM_ITEM_BITMASK(uiBitmask) ((((unsigned int)uiBitmask)&0x80000000)?true:false) + + +// For encoding the players skin selection in their profile +// bDlcSkin = false is a players skin, bDlcSkin = true is a DLC skin +#define MAKE_SKIN_BITMASK(bDlcSkin, dwSkinId) ( (bDlcSkin?0x80000000:0) | (dwSkinId & 0x7FFFFFFF) ) +#define IS_SKIN_ID_IN_RANGE(dwSkinId) (dwSkinId <= 0x7FFFFFFF) + +#define GET_DLC_SKIN_ID_FROM_BITMASK(uiBitmask) (((DWORD)uiBitmask)&0x7FFFFFFF) +#define GET_UGC_SKIN_ID_FROM_BITMASK(uiBitmask) (((DWORD)uiBitmask)&0x7FFFFFE0) +#define GET_DEFAULT_SKIN_ID_FROM_BITMASK(uiBitmask) (((DWORD)uiBitmask)&0x0000001F) +#define GET_IS_DLC_SKIN_FROM_BITMASK(uiBitmask) ((((DWORD)uiBitmask)&0x80000000)?true:false) + diff --git a/Minecraft.Client/Durango/Network/ChatIntegrationLayer.cpp b/Minecraft.Client/Durango/Network/ChatIntegrationLayer.cpp new file mode 100644 index 00000000..232b4dd3 --- /dev/null +++ b/Minecraft.Client/Durango/Network/ChatIntegrationLayer.cpp @@ -0,0 +1,805 @@ +//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF +//// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO +//// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A +//// PARTICULAR PURPOSE. +//// +//// Copyright (c) Microsoft Corporation. All rights reserved +#include "stdafx.h" +#include "ChatIntegrationLayer.h" +#include "DQRNetworkManager.h" +#include + +using namespace Windows::Foundation; +using namespace Windows::Xbox::System; + +// To integrate the Chat DLL in your game, you can use this ChatIntegrationLayer class with modifications, +// or create your own design your own class using the code in this file a guide. +std::shared_ptr GetChatIntegrationLayer() +{ + static std::shared_ptr chatIntegrationLayerInstance; + if (chatIntegrationLayerInstance == nullptr) + { + chatIntegrationLayerInstance.reset( new ChatIntegrationLayer() ); + } + + return chatIntegrationLayerInstance; +} + +ChatIntegrationLayer::ChatIntegrationLayer() +{ + ZeroMemory( m_chatVoicePacketsStatistic, sizeof(m_chatVoicePacketsStatistic) ); +} + +void ChatIntegrationLayer::InitializeChatManager( + __in bool combineCaptureBuffersIntoSinglePacket, + __in bool useKinectAsCaptureSource, + __in bool applySoundEffectsToCapturedAudio, + __in bool applySoundEffectsToChatRenderedAudio, + DQRNetworkManager *pDQRNet + ) +{ + m_pDQRNet = pDQRNet; + { + Concurrency::critical_section::scoped_lock lock(m_chatPacketStatsLock); + ZeroMemory( m_chatVoicePacketsStatistic, sizeof(m_chatVoicePacketsStatistic) ); + } + + m_chatManager = ref new Microsoft::Xbox::GameChat::ChatManager(); + m_chatManager->ChatSettings->DiagnosticsTraceLevel = Microsoft::Xbox::GameChat::GameChatDiagnosticsTraceLevel::Verbose; + + // Optionally, change the default settings below as desired by commenting out and editing any of the following lines + // Otherwise these defaults are used. + // + // m_chatManager = ref new Microsoft::Xbox::GameChat::ChatManager( ChatSessionPeriod::ChatPeriodOf40Milliseconds ); + // m_chatManager->ChatSettings->AudioThreadPeriodInMilliseconds = 40; + // m_chatManager->ChatSettings->AudioThreadAffinityMask = XAUDIO2_DEFAULT_PROCESSOR; // <- this means is core 5, same as the default XAudio2 core + // m_chatManager->ChatSettings->AudioThreadPriority = THREAD_PRIORITY_TIME_CRITICAL; + // m_chatManager->ChatSettings->AudioEncodingQuality = Windows::Xbox::Chat::EncodingQuality::Normal; + // m_chatManager->ChatSettings->DiagnosticsTraceLevel = Microsoft::Xbox::GameChat::GameChatDiagnosticsTraceLevel::Verbose; + m_chatManager->ChatSettings->CombineCaptureBuffersIntoSinglePacket = combineCaptureBuffersIntoSinglePacket; // if unset, it defaults to TRUE + m_chatManager->ChatSettings->UseKinectAsCaptureSource = useKinectAsCaptureSource; // if unset, it defaults to FALSE + m_chatManager->ChatSettings->PreEncodeCallbackEnabled = applySoundEffectsToCapturedAudio; // if unset, it defaults to FALSE + m_chatManager->ChatSettings->PostDecodeCallbackEnabled = applySoundEffectsToChatRenderedAudio; // if unset, it defaults to FALSE + + InitializeCriticalSection(&m_csAddedUsers); + + std::weak_ptr weakPtrToThis = shared_from_this(); + +#ifdef PROFILE + m_chatManager->ChatSettings->PerformanceCountersEnabled = true; +#endif + + // Upon enter constrained mode, mute everyone. + // Upon leaving constrained mode, unmute everyone who was previously muted. + m_tokenResourceAvailabilityChanged = Windows::ApplicationModel::Core::CoreApplication::ResourceAvailabilityChanged += + ref new EventHandler< Platform::Object^ >( [weakPtrToThis] (Platform::Object^, Platform::Object^ ) + { + // Using a std::weak_ptr instead of 'this' to avoid dangling pointer if caller class is released. + // Simply unregistering the callback in the destructor isn't enough to prevent a dangling pointer + std::shared_ptr sharedPtrToThis(weakPtrToThis.lock()); + if( sharedPtrToThis != nullptr ) + { + if (Windows::ApplicationModel::Core::CoreApplication::ResourceAvailability == Windows::ApplicationModel::Core::ResourceAvailability::Constrained) + { + if( sharedPtrToThis->m_chatManager != nullptr ) + { + sharedPtrToThis->m_chatManager->MuteAllUsersFromAllChannels(); + } + } + else if(Windows::ApplicationModel::Core::CoreApplication::ResourceAvailability == Windows::ApplicationModel::Core::ResourceAvailability::Full) + { + if( sharedPtrToThis->m_chatManager != nullptr ) + { + sharedPtrToThis->m_chatManager->UnmuteAllUsersFromAllChannels(); + + // The title should remember who was muted so when the Resume even occurs + // to avoid unmuting users who has been previously muted. Simply re-mute them here + } + } + } + }); + + m_tokenOnDebugMessage = m_chatManager->OnDebugMessage += + ref new Windows::Foundation::EventHandler( + [weakPtrToThis] ( Platform::Object^, Microsoft::Xbox::GameChat::DebugMessageEventArgs^ args ) + { + // Using a std::weak_ptr instead of 'this' to avoid dangling pointer if caller class is released. + // Simply unregistering the callback in the destructor isn't enough to prevent a dangling pointer + std::shared_ptr sharedPtrToThis(weakPtrToThis.lock()); + if( sharedPtrToThis != nullptr ) + { + sharedPtrToThis->OnDebugMessageReceived(args); + } + }); + + m_tokenOnOutgoingChatPacketReady = m_chatManager->OnOutgoingChatPacketReady += + ref new Windows::Foundation::EventHandler( + [weakPtrToThis] ( Platform::Object^, Microsoft::Xbox::GameChat::ChatPacketEventArgs^ args ) + { + // Using a std::weak_ptr instead of 'this' to avoid dangling pointer if caller class is released. + // Simply unregistering the callback in the destructor isn't enough to prevent a dangling pointer + std::shared_ptr sharedPtrToThis(weakPtrToThis.lock()); + if( sharedPtrToThis != nullptr ) + { + sharedPtrToThis->OnOutgoingChatPacketReady(args); + } + }); + + m_tokenOnCompareUniqueConsoleIdentifiers = m_chatManager->OnCompareUniqueConsoleIdentifiers += + ref new Microsoft::Xbox::GameChat::CompareUniqueConsoleIdentifiersHandler( + [weakPtrToThis] ( Platform::Object^ obj1, Platform::Object^ obj2 ) + { + // Using a std::weak_ptr instead of 'this' to avoid dangling pointer if caller class is released. + // Simply unregistering the callback in the destructor isn't enough to prevent a dangling pointer + std::shared_ptr sharedPtrToThis(weakPtrToThis.lock()); + if( sharedPtrToThis != nullptr ) + { + return sharedPtrToThis->CompareUniqueConsoleIdentifiers(obj1, obj2); + } + else + { + return false; + } + }); + + m_tokenUserAudioDeviceAdded = WXS::User::AudioDeviceAdded += + ref new Windows::Foundation::EventHandler( + [weakPtrToThis] ( Platform::Object^, WXS::AudioDeviceAddedEventArgs^ value ) + { + std::shared_ptr sharedPtrToThis(weakPtrToThis.lock()); + if( sharedPtrToThis != nullptr ) + { + sharedPtrToThis->EvaluateDevicesForUser(value->User); + } + }); + + m_tokenUserAudioDeviceRemoved = WXS::User::AudioDeviceRemoved += + ref new Windows::Foundation::EventHandler( + [weakPtrToThis] ( Platform::Object^, WXS::AudioDeviceRemovedEventArgs^ value ) + { + std::shared_ptr sharedPtrToThis(weakPtrToThis.lock()); + if( sharedPtrToThis != nullptr ) + { + sharedPtrToThis->EvaluateDevicesForUser(value->User); + } + }); + + m_tokenUserAudioDeviceChanged = WXS::User::AudioDeviceChanged += + ref new Windows::Foundation::EventHandler( + [weakPtrToThis] ( Platform::Object^, WXS::AudioDeviceChangedEventArgs^ value ) + { + std::shared_ptr sharedPtrToThis(weakPtrToThis.lock()); + if( sharedPtrToThis != nullptr ) + { + sharedPtrToThis->EvaluateDevicesForUser(value->User); + } + }); + + //m_tokenSuspending = Windows::ApplicationModel::Core::CoreApplication::Suspending += + // ref new EventHandler< Windows::ApplicationModel::SuspendingEventArgs^ >( [weakPtrToThis] (Platform::Object^, Windows::ApplicationModel::SuspendingEventArgs^ args) + //{ + // // Upon Suspending, nothing needs to be done + //}); + + //m_tokenResuming = Windows::ApplicationModel::Core::CoreApplication::Resuming += + // ref new EventHandler< Platform::Object^ >( [weakPtrToThis] (Platform::Object^, Windows::ApplicationModel::SuspendingEventArgs^ args) + //{ + // // Upon Resuming, re-initialize the network, and reinitialize the chat session + //}); +} + + +void ChatIntegrationLayer::Shutdown() +{ + if( m_chatManager != nullptr ) + { + m_chatManager->OnDebugMessage -= m_tokenOnDebugMessage; + m_chatManager->OnOutgoingChatPacketReady -= m_tokenOnOutgoingChatPacketReady; + m_chatManager->OnCompareUniqueConsoleIdentifiers -= m_tokenOnCompareUniqueConsoleIdentifiers; + Windows::ApplicationModel::Core::CoreApplication::ResourceAvailabilityChanged -= m_tokenResourceAvailabilityChanged; + if( m_chatManager->ChatSettings->PreEncodeCallbackEnabled ) + { + m_chatManager->OnPreEncodeAudioBuffer -= m_tokenOnPreEncodeAudioBuffer; + } + if( m_chatManager->ChatSettings->PostDecodeCallbackEnabled ) + { + m_chatManager->OnPostDecodeAudioBuffer -= m_tokenOnPostDecodeAudioBuffer; + } + WXS::User::AudioDeviceAdded -= m_tokenUserAudioDeviceAdded; + WXS::User::AudioDeviceRemoved -= m_tokenUserAudioDeviceRemoved; + WXS::User::AudioDeviceChanged -= m_tokenUserAudioDeviceChanged; + + DeleteCriticalSection(&m_csAddedUsers); + + m_chatManager = nullptr; + } +} + +void ChatIntegrationLayer::OnDebugMessageReceived( + __in Microsoft::Xbox::GameChat::DebugMessageEventArgs^ args + ) +{ + // To integrate the Chat DLL in your game, + // change this to false and remove the LogComment calls, + // or integrate with your game's own UI/debug message logging system + bool outputToUI = false; + + if( outputToUI ) + { + if (args->ErrorCode == S_OK ) + { + m_pDQRNet->LogComment(L"GameChat: " + args->Message); + } + else + { + m_pDQRNet->LogCommentWithError(L"GameChat: " + args->Message, args->ErrorCode); + } + } + else + { + // The string appear in the Visual Studio Output window +#ifndef _CONTENT_PACKAGE + OutputDebugString( args->Message->Data() ); +#endif + } +} + +void ChatIntegrationLayer::GameUI_RecordPacketStatistic( + __in Microsoft::Xbox::GameChat::ChatMessageType messageType, + __in ChatPacketType chatPacketType + ) +{ + uint32 messageTypeInt = static_cast(messageType); + if( messageType > Microsoft::Xbox::GameChat::ChatMessageType::InvalidMessage ) + { + return; + } + + { + Concurrency::critical_section::scoped_lock lock(m_chatPacketStatsLock); + m_chatVoicePacketsStatistic[static_cast(chatPacketType)][messageTypeInt]++; + } +} + +int ChatIntegrationLayer::GameUI_GetPacketStatistic( + __in Microsoft::Xbox::GameChat::ChatMessageType messageType, + __in ChatPacketType chatPacketType + ) +{ + uint32 messageTypeInt = static_cast(messageType); + if( messageType > Microsoft::Xbox::GameChat::ChatMessageType::InvalidMessage ) + { + return 0; + } + + { + Concurrency::critical_section::scoped_lock lock(m_chatPacketStatsLock); + return m_chatVoicePacketsStatistic[static_cast(chatPacketType)][messageTypeInt]; + } +} + +void ChatIntegrationLayer::OnOutgoingChatPacketReady( + __in Microsoft::Xbox::GameChat::ChatPacketEventArgs^ args + ) +{ + byte *bytes; + int byteCount; + + GetBufferBytes(args->PacketBuffer, &bytes); + byteCount = args->PacketBuffer->Length; + unsigned int address = 0; + if( !args->SendPacketToAllConnectedConsoles ) + { + address = safe_cast(args->UniqueTargetConsoleIdentifier); + } + m_pDQRNet->SendBytesChat(address, bytes, byteCount, args->SendReliable, args->SendInOrder, args->SendPacketToAllConnectedConsoles); + + GameUI_RecordPacketStatistic( args->ChatMessageType, ChatPacketType::OutgoingPacket ); + +} + +void ChatIntegrationLayer::OnIncomingChatMessage( + unsigned int sessionAddress, + Platform::Array^ message + ) +{ + // To integrate the Chat DLL in your game, change the following code to use your game's network layer. + // Ignore the OnChatMessageReceived event as that is specific to this sample's simple network layer. + // Instead your title should upon receiving a packet, extract the chat message from it, and then call m_chatManager->ProcessIncomingChatMessage as shown below + // You will need to isolate chat messages to be unique from the rest of you game's other message types. + + // uniqueRemoteConsoleIdentifier is a Platform::Object^ and can be cast or unboxed to most types. + // What exactly you use doesn't matter, but optimally it would be something that uniquely identifies a console on in the session. + // A Windows::Xbox::Networking::SecureDeviceAssociation^ is perfect to use if you have access to it. + + // This is how you would convert from byte array to a IBuffer^ + // + // Windows::Storage::Streams::IBuffer^ destBuffer = ref new Windows::Storage::Streams::Buffer( sourceByteBufferSize ); + // byte* destBufferBytes = nullptr; + // GetBufferBytes( destBuffer, &destBufferBytes ); + // errno_t err = memcpy_s( destBufferBytes, destBuffer->Capacity, sourceByteBuffer, sourceByteBufferSize ); + // THROW_HR_IF(err != 0, E_FAIL); + // destBuffer->Length = sourceByteBufferSize; + + // This is how you would convert from an int to a Platform::Object^ + // Platform::Object obj = IntToPlatformObject(5); + + Windows::Storage::Streams::IBuffer^ chatMessage = ArrayToBuffer(message); + Platform::Object^ uniqueRemoteConsoleIdentifier = (Platform::Object^)sessionAddress; + + if( m_chatManager != nullptr ) + { + Microsoft::Xbox::GameChat::ChatMessageType chatMessageType = m_chatManager->ProcessIncomingChatMessage(chatMessage, uniqueRemoteConsoleIdentifier); + + GameUI_RecordPacketStatistic( chatMessageType, ChatPacketType::IncomingPacket ); + } +} + +// Only add people who intend to play. +void ChatIntegrationLayer::AddAllLocallySignedInUsersToChatClient( + __in uint8 channelIndex, + __in Windows::Foundation::Collections::IVectorView^ locallySignedInUsers + ) +{ + // To integrate the Chat DLL in your game, + // add all locally signed in users to the chat client + for each( Windows::Xbox::System::User^ user in locallySignedInUsers ) + { + if( user != nullptr ) + { +// LogComment(L"Adding Local User to Chat Client"); + AddLocalUserToChatChannel( channelIndex, user ); + } + } +} + +ChatIntegrationLayer::AddedUser::AddedUser(Windows::Xbox::System::IUser^ user, bool canCaptureAudio) +{ + m_user = user; + m_canCaptureAudio = canCaptureAudio; +} + + +void ChatIntegrationLayer::AddLocalUser( __in Windows::Xbox::System::IUser^ user ) +{ + // Check we haven't added already + for( int i = 0; i < m_addedUsers.size(); i++ ) + { + if( m_addedUsers[i]->m_user->XboxUserId == user->XboxUserId ) + { + return; + } + } + + bool kinectAvailable = false; + Windows::Kinect::KinectSensor^ sensor = Windows::Kinect::KinectSensor::GetDefault(); + if( sensor ) + { + sensor->Open(); + if( sensor->IsAvailable ) + { + kinectAvailable = true; + m_pDQRNet->LogComment(L"Evaluated that kinect is available\n"); + } + sensor->Close(); + } + + EnterCriticalSection(&m_csAddedUsers); + // First establish whether we have an appropriate audio device at this time + bool canCaptureAudio = false; + for each( WXS::IAudioDeviceInfo^ audioDevice in user->AudioDevices ) + { + m_pDQRNet->LogComment(L"Evaluating device " + audioDevice->DeviceCategory.ToString() + L" " + + audioDevice->DeviceType.ToString() + L" " + + audioDevice->Id + L" " + + audioDevice->Sharing.ToString() + L" " + + audioDevice->IsMicrophoneMuted.ToString() + L"\n"); + + // Consider shared devices only if kinect is actually available - every machine seems to claim a shared device whether kinect is attached or not + if( ( audioDevice->DeviceType == WXS::AudioDeviceType::Capture ) && ( kinectAvailable || ( audioDevice->Sharing != WXS::AudioDeviceSharing::Shared) ) ) + { + canCaptureAudio = true; + } + } + + // If we can capture audio initially, then register with the chat session. Otherwise we'll reevaluate this situation when audio devices change + if( canCaptureAudio ) + { + AddLocalUserToChatChannel( 0 , user ); + } + + // Add to vector of users that we are tracking in the chat system + m_addedUsers.push_back(new AddedUser(user, canCaptureAudio)); + LeaveCriticalSection(&m_csAddedUsers); +} + +// Remove from our list of tracked users, if the user is already there +void ChatIntegrationLayer::RemoveLocalUser( __in Windows::Xbox::System::IUser^ user ) +{ + EnterCriticalSection(&m_csAddedUsers); + for( auto it = m_addedUsers.begin(); it != m_addedUsers.end(); it++ ) + { + if( (*it)->m_user->XboxUserId == user->XboxUserId ) + { + delete (*it); + m_addedUsers.erase(it); + LeaveCriticalSection(&m_csAddedUsers); + return; + } + } + LeaveCriticalSection(&m_csAddedUsers); +} + +// This is called when the audio devices for a user change in any way, and establishes whether we can now capture audio. Any change in this status from before will cause the user to be added/removed from the chat session. +void ChatIntegrationLayer::EvaluateDevicesForUser(__in Windows::Xbox::System::IUser^ user ) +{ + bool kinectAvailable = false; + Windows::Kinect::KinectSensor^ sensor = Windows::Kinect::KinectSensor::GetDefault(); + if( sensor ) + { + sensor->Open(); + if( sensor->IsAvailable ) + { + kinectAvailable = true; + m_pDQRNet->LogComment(L"Evaluated that kinect is available\n"); + } + sensor->Close(); + } + + EnterCriticalSection(&m_csAddedUsers); + for( int i = 0; i < m_addedUsers.size(); i++ ) + { + AddedUser *addedUser = m_addedUsers[i]; + if( addedUser->m_user->XboxUserId == user->XboxUserId ) + { + bool canCaptureAudio = false; + for each( WXS::IAudioDeviceInfo^ audioDevice in addedUser->m_user->AudioDevices ) + { + // Consider shared devices only if kinect is actually available - every machine seems to claim a shared device whether kinect is attached or not + if( ( audioDevice->DeviceType == WXS::AudioDeviceType::Capture ) && ( kinectAvailable || ( audioDevice->Sharing != WXS::AudioDeviceSharing::Shared) ) ) + { + canCaptureAudio = true; + break; + } + } + if( canCaptureAudio != addedUser->m_canCaptureAudio ) + { + if( canCaptureAudio ) + { + AddLocalUserToChatChannel(0, addedUser->m_user ); + } + else + { + RemoveUserFromChatChannel(0, addedUser->m_user ); + } + addedUser->m_canCaptureAudio = canCaptureAudio; + LeaveCriticalSection(&m_csAddedUsers); + return; + } + } + } + LeaveCriticalSection(&m_csAddedUsers); +} + +void ChatIntegrationLayer::AddLocalUserToChatChannel( + __in uint8 channelIndex, + __in Windows::Xbox::System::IUser^ user + ) +{ + // Adds a local user to a specific channel. + + // This is helper function waits for the task to cm_chatManageromplete so shouldn't be called from the UI thread + // Remove the .wait() and return the result of concurrency::create_task() if you want to call it from the UI thread + // and chain PPL tasks together + + m_pDQRNet->LogComment( L">>>>>>>>>>>>> AddLocalUserToChatChannel" ); + if( m_chatManager != nullptr ) + { + auto asyncOp = m_chatManager->AddLocalUserToChatChannelAsync( channelIndex, user ); + concurrency::create_task( asyncOp ) + .then( [this] ( concurrency::task t ) + { + // Error handling + try + { + t.get(); + } + catch ( Platform::Exception^ ex ) + { + m_pDQRNet->LogCommentWithError( L"AddLocalUserToChatChannelAsync failed", ex->HResult ); + } + }) + .wait(); + } +} + +void ChatIntegrationLayer::RemoveRemoteConsole( + unsigned int address + ) +{ + // uniqueConsoleIdentifier is a Platform::Object^ and can be cast or unboxed to most types. + // What exactly you use doesn't matter, but optimally it would be something that uniquely identifies a console on in the session. + // A Windows::Xbox::Networking::SecureDeviceAssociation^ is perfect to use if you have access to it. + + // This is how you would convert from an int to a Platform::Object^ + // Platform::Object obj = IntToPlatformObject(5); + + // This is helper function waits for the task to complete so shouldn't be called from the UI thread + // Remove the .wait() and return the result of concurrency::create_task() if you want to call it from the UI thread + // and chain PPL tasks together + + Platform::Object^ uniqueRemoteConsoleIdentifier = (Platform::Object^)address; + + if( m_chatManager != nullptr ) + { + auto asyncOp = m_chatManager->RemoveRemoteConsoleAsync( uniqueRemoteConsoleIdentifier ); + concurrency::create_task( asyncOp ).then( [this] ( concurrency::task t ) + { + // Error handling + try + { + t.get(); + } + catch ( Platform::Exception^ ex ) + { + m_pDQRNet->LogCommentWithError( L"RemoveRemoteConsoleAsync failed", ex->HResult ); + } + }) + .wait(); + } +} + +void ChatIntegrationLayer::RemoveUserFromChatChannel( + __in uint8 channelIndex, + __in Windows::Xbox::System::IUser^ user + ) +{ + if( m_chatManager != nullptr ) + { + // This is helper function waits for the task to complete so shouldn't be called from the UI thread + // Remove the .wait() and return the result of concurrency::create_task() if you want to call it from the UI thread + // and chain PPL tasks together + + auto asyncOp = m_chatManager->RemoveLocalUserFromChatChannelAsync( channelIndex, user ); + concurrency::create_task( asyncOp ).then( [this] ( concurrency::task t ) + { + // Error handling + try + { + t.get(); + } + catch ( Platform::Exception^ ex ) + { + m_pDQRNet->LogCommentWithError( L"RemoveLocalUserFromChatChannelAsync failed", ex->HResult ); + } + }) + .wait(); + } +} + +void ChatIntegrationLayer::OnNewSessionAddressAdded( + __in unsigned int address + ) +{ + m_pDQRNet->LogCommentFormat( L">>>>>>>>>>>>> OnNewSessionAddressAdded (%d)",address ); + Platform::Object^ uniqueConsoleIdentifier = (Platform::Object^)address; + /// Call this when a new console connects. + /// This adds this console to the chat layer + if( m_chatManager != nullptr ) + { + m_chatManager->HandleNewRemoteConsole(uniqueConsoleIdentifier ); + } +} + +Windows::Foundation::Collections::IVectorView^ ChatIntegrationLayer::GetChatUsers() +{ + if( m_chatManager != nullptr ) + { + return m_chatManager->GetChatUsers(); + } + + return nullptr; +} + +bool ChatIntegrationLayer::HasMicFocus() +{ + if( m_chatManager != nullptr ) + { + return m_chatManager->HasMicFocus; + } + + return false; +} + +Platform::Object^ ChatIntegrationLayer::IntToPlatformObject( + __in int val + ) +{ + return (Platform::Object^)val; + + // You can also do the same using a PropertyValue. + //return Windows::Foundation::PropertyValue::CreateInt32(val); +} + +int ChatIntegrationLayer::PlatformObjectToInt( + __in Platform::Object^ uniqueRemoteConsoleIdentifier + ) +{ + return safe_cast( uniqueRemoteConsoleIdentifier ); + + // You can also do the same using a PropertyValue. + //return safe_cast(uniqueRemoteConsoleIdentifier)->GetInt32(); +} + +void ChatIntegrationLayer::HandleChatChannelChanged( + __in uint8 oldChatChannelIndex, + __in uint8 newChatChannelIndex, + __in Microsoft::Xbox::GameChat::ChatUser^ chatUser + ) +{ + // We remember if the local user was currently muted from all channels. And when we switch channels, + // we ensure that the state persists. For remote users, title should implement this themselves + // based on title game design if they want to persist the muting state. + + bool wasUserMuted = false; + IUser^ userBeingRemoved = nullptr; + + if (chatUser != nullptr && chatUser->IsLocal) + { + wasUserMuted = chatUser->IsMuted; + userBeingRemoved = chatUser->User; + if (userBeingRemoved != nullptr) + { + RemoveUserFromChatChannel(oldChatChannelIndex, userBeingRemoved); + AddLocalUserToChatChannel(newChatChannelIndex, userBeingRemoved); + } + } + + // If the local user was muted earlier, get the latest chat users and mute him again on the newly added channel. + if (wasUserMuted && userBeingRemoved != nullptr) + { + auto chatUsers = GetChatUsers(); + if (chatUsers != nullptr ) + { + for (UINT chatUserIndex = 0; chatUserIndex < chatUsers->Size; chatUserIndex++) + { + Microsoft::Xbox::GameChat::ChatUser^ chatUser = chatUsers->GetAt(chatUserIndex); + if( chatUser != nullptr && (chatUser->XboxUserId == userBeingRemoved->XboxUserId) ) + { + m_chatManager->MuteUserFromAllChannels(chatUser); + break; + } + } + } + } +} + +void ChatIntegrationLayer::ChangeChatUserMuteState( + __in Microsoft::Xbox::GameChat::ChatUser^ chatUser + ) +{ + /// Helper function to swap the mute state of a specific chat user + if( m_chatManager != nullptr && chatUser != nullptr) + { + if (chatUser->IsMuted) + { + m_chatManager->UnmuteUserFromAllChannels(chatUser); + } + else + { + m_chatManager->MuteUserFromAllChannels(chatUser); + } + } +} + +Microsoft::Xbox::GameChat::ChatUser^ ChatIntegrationLayer::GetChatUserByXboxUserId( + __in Platform::String^ xboxUserId + ) +{ + Windows::Foundation::Collections::IVectorView^ chatUsers = GetChatUsers(); + for each (Microsoft::Xbox::GameChat::ChatUser^ chatUser in chatUsers) + { + if (chatUser != nullptr && ( chatUser->XboxUserId == xboxUserId ) ) + { + return chatUser; + } + } + + return nullptr; +} + + +bool ChatIntegrationLayer::CompareUniqueConsoleIdentifiers( + __in Platform::Object^ uniqueRemoteConsoleIdentifier1, + __in Platform::Object^ uniqueRemoteConsoleIdentifier2 + ) +{ + if (uniqueRemoteConsoleIdentifier1 == nullptr || uniqueRemoteConsoleIdentifier2 == nullptr) + { + return false; + } + + // uniqueRemoteConsoleIdentifier is a Platform::Object^ and can be cast or unboxed to most types. + // We're using XRNS addresses, which are unsigned ints + unsigned int address1 = safe_cast(uniqueRemoteConsoleIdentifier1); + unsigned int address2 = safe_cast(uniqueRemoteConsoleIdentifier2); + return address1 == address2; +} + +Microsoft::Xbox::GameChat::ChatPerformanceCounters^ ChatIntegrationLayer::GetChatPerformanceCounters() +{ + if( m_chatManager != nullptr && + m_chatManager->ChatSettings != nullptr && + m_chatManager->ChatSettings->PerformanceCountersEnabled ) + { + return m_chatManager->ChatPerformanceCounters; + } + + return nullptr; +} + +void ChatIntegrationLayer::OnControllerPairingChanged( Windows::Xbox::Input::ControllerPairingChangedEventArgs^ args ) +{ +#if 0 + auto controller = args->Controller; + if ( controller ) + { + if ( controller->Type == L"Windows.Xbox.Input.Gamepad" ) + { + // Either add the user or sign one in + User^ user = args->User; + if ( user != nullptr ) + { + g_sampleInstance->GetLoggingUI()->LogCommentToUI("OnControllerPairingChanged: " + user->DisplayInfo->Gamertag); + AddLocalUserToChatChannel( + g_sampleInstance->GetUISelectionChatChannelIndex(), + user + ); + } + } + } +#endif +} + +void ChatIntegrationLayer::ToggleRenderTargetVolume() +{ + // Simple toggle logic to just show usage of LocalRenderTargetVolume property + static bool makeRenderTargetVolumeQuiet = false; + makeRenderTargetVolumeQuiet = !makeRenderTargetVolumeQuiet; + + auto chatUsers = GetChatUsers(); + if (chatUsers != nullptr ) + { + for (UINT chatUserIndex = 0; chatUserIndex < chatUsers->Size; chatUserIndex++) + { + Microsoft::Xbox::GameChat::ChatUser^ chatUser = chatUsers->GetAt(chatUserIndex); + if( chatUser != nullptr && chatUser->IsLocal ) + { + chatUser->LocalRenderTargetVolume = ( makeRenderTargetVolumeQuiet ) ? 0.1f : 1.0f; + } + } + } +} + + +void ChatIntegrationLayer::GetBufferBytes( __in Windows::Storage::Streams::IBuffer^ buffer, __out byte** ppOut ) +{ + if ( ppOut == nullptr || buffer == nullptr ) + { + throw ref new Platform::InvalidArgumentException(); + } + + *ppOut = nullptr; + + Microsoft::WRL::ComPtr srcBufferInspectable(reinterpret_cast( buffer )); + Microsoft::WRL::ComPtr srcBufferByteAccess; + srcBufferInspectable.As(&srcBufferByteAccess); + srcBufferByteAccess->Buffer(ppOut); +} + +Windows::Storage::Streams::IBuffer^ ChatIntegrationLayer::ArrayToBuffer( __in Platform::Array^ array ) +{ + Windows::Storage::Streams::DataWriter^ writer = ref new Windows::Storage::Streams::DataWriter(); + writer->WriteBytes(array); + return writer->DetachBuffer(); +} \ No newline at end of file diff --git a/Minecraft.Client/Durango/Network/ChatIntegrationLayer.h b/Minecraft.Client/Durango/Network/ChatIntegrationLayer.h new file mode 100644 index 00000000..80b4e10a --- /dev/null +++ b/Minecraft.Client/Durango/Network/ChatIntegrationLayer.h @@ -0,0 +1,244 @@ +//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF +//// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO +//// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A +//// PARTICULAR PURPOSE. +//// +//// Copyright (c) Microsoft Corporation. All rights reserved +#pragma once + +//#include "UserController.h" + +class DQRNetworkManager; + +enum ChatPacketType +{ + IncomingPacket = 0, + OutgoingPacket = 1 +}; + +class ChatIntegrationLayer + : public std::enable_shared_from_this // shared_from_this is needed to use a weak ref to 'this' when handling delegate callbacks +{ +public: + ChatIntegrationLayer(); + + DQRNetworkManager *m_pDQRNet; + /// + /// Initializes the chat manager + /// + void InitializeChatManager( + __in bool combineCaptureBuffersIntoSinglePacketEnabled, + __in bool useKinectAsCaptureSource, + __in bool applySoundEffectToCapture, + __in bool applySoundEffectToRender, + DQRNetworkManager *pDQRNet + ); + + /// + /// Shuts down the chat manager + /// + void Shutdown(); + + class AddedUser + { + public: + AddedUser(Windows::Xbox::System::IUser^ user, bool canCaptureAudio); + Windows::Xbox::System::IUser^ m_user; + bool m_canCaptureAudio; + }; + + void AddLocalUser( __in Windows::Xbox::System::IUser^ user ); + void RemoveLocalUser( __in Windows::Xbox::System::IUser^ user ); + void EvaluateDevicesForUser(__in Windows::Xbox::System::IUser^ user ); + + vector m_addedUsers; + CRITICAL_SECTION m_csAddedUsers; + +private: + /// + /// Adds a local user to a specific channel + /// This is helper function waits for the task to complete so shouldn't be called from the UI thread + /// + /// The channel to add the user to + /// The local user to add + void AddLocalUserToChatChannel( + __in uint8 channelIndex, + __in Windows::Xbox::System::IUser^ user + ); + + /// + /// Removes a local user from a specific channel + /// This is helper function waits for the task to complete so shouldn't be called from the UI thread + /// + /// The channel to remove the user from + /// The local user to remove + void RemoveUserFromChatChannel( + __in uint8 channelIndex, + __in Windows::Xbox::System::IUser^ user + ); +public: + + /// + /// Removes a remote console from chat + /// This is helper function waits for the task to complete so shouldn't be called from the UI thread + /// + /// A unique ID for the remote console + void RemoveRemoteConsole( + unsigned int address + ); + + /// + /// Handles incoming chat messages from the game's network layer + /// + /// A buffer containing the chat message + /// A unique ID for the remote console + void OnIncomingChatMessage( + unsigned int sessionAddress, + Platform::Array^ message + ); + + /// + /// Returns a list of chat users in the chat session + /// + Windows::Foundation::Collections::IVectorView^ GetChatUsers(); + + /// + /// Returns true if the game has mic focus. Otherwise another app has mic focus + /// + bool HasMicFocus(); + + /// + /// Helper function to swap the mute state of a specific chat user + /// + void ChangeChatUserMuteState( + __in Microsoft::Xbox::GameChat::ChatUser^ chatUser + ); + + /// + /// Helper function to change the channel of a specific chat user + /// + void HandleChatChannelChanged( + __in uint8 oldChatChannelIndex, + __in uint8 newChatChannelIndex, + __in Microsoft::Xbox::GameChat::ChatUser^ chatUser + ); + + /// + /// Call this when a new console connects. + /// This adds this console to the chat layer + /// + void OnNewSessionAddressAdded( + __in unsigned int address + ); + + /// + /// Adds a list of locally signed in users that have intent to play to the chat session on a specific channel index. + /// Avoid adding any user who is signed in that doesn't have intent to play otherwise users who are biometrically + /// signed in automatically will be added to the chat session + /// + /// The channel to add the users to + /// A list of locally signed in users that have intent to play + void AddAllLocallySignedInUsersToChatClient( + __in uint8 channelIndex, + __in Windows::Foundation::Collections::IVectorView^ locallySignedInUsers + ); + + /// + /// Handles when a debug message is received. Send this to the UI and OutputDebugString. Games should integrate with their existing log system. + /// + /// Contains the debug message to log + void OnDebugMessageReceived( + __in Microsoft::Xbox::GameChat::DebugMessageEventArgs^ args + ); + + /// + /// Send the chat packet to all connected consoles + /// + /// To integrate the Chat DLL in your game, change the following code to use your game's network layer. + /// You will need to isolate chat messages to be unique from the rest of you game's other message types. + /// When args->SendPacketToAllConnectedConsoles is true, your game should send the chat message to each connected console using the game's network layer. + /// It should send the chat message with Reliable UDP if args->SendReliable is true. + /// It should send the chat message in order (if that feature is available) if args->SendInOrder is true + /// + /// Describes the packet to send + void OnOutgoingChatPacketReady( + __in Microsoft::Xbox::GameChat::ChatPacketEventArgs^ args + ); + + /// + /// Example of how to cast an int to a Platform::Object^ + /// + Platform::Object^ IntToPlatformObject( + __in int val + ); + + /// + /// Example of how to cast an Platform::Object^ to an int + /// + int PlatformObjectToInt( + __in Platform::Object^ obj + ); + + /// + /// Helper function to get specific ChatUser by xboxUserId + /// + Microsoft::Xbox::GameChat::ChatUser^ GetChatUserByXboxUserId( + __in Platform::String^ xboxUserId + ); + + /// + /// Helper function to get specific ChatUser by xboxUserId + /// + bool ChatIntegrationLayer::CompareUniqueConsoleIdentifiers( + __in Platform::Object^ uniqueRemoteConsoleIdentifier1, + __in Platform::Object^ uniqueRemoteConsoleIdentifier2 + ); + + /// + /// Helper function to return the ChatPerformanceCounters^ from the ChatManager so perf numbers can be shown on the UI + /// These numbers will only be valid if m_chatManager->ChatSettings->PerformanceCountersEnabled is set to true. + /// + Microsoft::Xbox::GameChat::ChatPerformanceCounters^ GetChatPerformanceCounters(); + + /// + /// Returns a count of the number of chat packets of a specific type that have been either sent or received. + /// It is useful to monitor this number in the UI / logs to debug network issues. + /// + int GameUI_GetPacketStatistic( + __in Microsoft::Xbox::GameChat::ChatMessageType messageType, + __in ChatPacketType chatPacketType + ); + + void OnControllerPairingChanged( + __in Windows::Xbox::Input::ControllerPairingChangedEventArgs^ args + ); + + void ToggleRenderTargetVolume(); + +private: + void GetBufferBytes( __in Windows::Storage::Streams::IBuffer^ buffer, __out byte** ppOut ); + Windows::Storage::Streams::IBuffer^ ArrayToBuffer( __in Platform::Array^ array ); + + Concurrency::critical_section m_lock; + Microsoft::Xbox::GameChat::ChatManager^ m_chatManager; + Windows::Foundation::EventRegistrationToken m_tokenOnDebugMessage; + Windows::Foundation::EventRegistrationToken m_tokenOnOutgoingChatPacketReady; + Windows::Foundation::EventRegistrationToken m_tokenOnCompareUniqueConsoleIdentifiers; + Windows::Foundation::EventRegistrationToken m_tokenResourceAvailabilityChanged; + Windows::Foundation::EventRegistrationToken m_tokenOnPreEncodeAudioBuffer; + Windows::Foundation::EventRegistrationToken m_tokenOnPostDecodeAudioBuffer; + Windows::Foundation::EventRegistrationToken m_tokenUserAudioDeviceAdded; + Windows::Foundation::EventRegistrationToken m_tokenUserAudioDeviceRemoved; + Windows::Foundation::EventRegistrationToken m_tokenUserAudioDeviceChanged; + + // Debug stats for chat packets. Use Debug_GetPacketStatistic() to get the values. + /// It is useful to monitor this number in the UI / logs to debug network issues. + void GameUI_RecordPacketStatistic( + __in Microsoft::Xbox::GameChat::ChatMessageType messageType, + __in ChatPacketType chatPacketType + ); + Concurrency::critical_section m_chatPacketStatsLock; + int m_chatVoicePacketsStatistic[2][(int)Microsoft::Xbox::GameChat::ChatMessageType::InvalidMessage+1]; +}; + +std::shared_ptr GetChatIntegrationLayer(); \ No newline at end of file diff --git a/Minecraft.Client/Durango/Network/DQRNetworkManager.cpp b/Minecraft.Client/Durango/Network/DQRNetworkManager.cpp new file mode 100644 index 00000000..f13cc4aa --- /dev/null +++ b/Minecraft.Client/Durango/Network/DQRNetworkManager.cpp @@ -0,0 +1,3093 @@ +#include "stdafx.h" + +#include "DQRNetworkManager.h" +#include "PartyController.h" +#include +#include +#include +#include "..\Minecraft.World\StringHelpers.h" +#include "base64.h" + +#ifdef _DURANGO +#include "..\Minecraft.World\DurangoStats.h" +#endif + +#include "ChatIntegrationLayer.h" + + +using namespace Concurrency; +using namespace Windows::Foundation::Collections; + +DQRNetworkManager::ePartyProcessType DQRNetworkManager::m_partyProcess = DQRNetworkManager::DNM_PARTY_PROCESS_NONE; + +bool DQRNetworkManager::m_inviteReceived = false; +int DQRNetworkManager::m_bootUserIndex; +wstring DQRNetworkManager::m_bootSessionName; +wstring DQRNetworkManager::m_bootServiceConfig; +wstring DQRNetworkManager::m_bootSessionTemplate; +DQRNetworkManager * DQRNetworkManager::s_pDQRManager = NULL; + +//using namespace Windows::Xbox::Networking; + +DQRNetworkManager::SessionInfo::SessionInfo(wstring& sessionName, wstring& serviceConfig, wstring& sessionTemplate) +{ + m_detailsValid = true; + m_sessionName = sessionName; + m_serviceConfig = serviceConfig; + m_sessionTemplate = sessionTemplate; +} + +DQRNetworkManager::SessionInfo::SessionInfo() +{ + m_detailsValid = false; +} + +// This maps internal to extern states, and needs to match element-by-element the eSQRNetworkManagerInternalState enumerated type +const DQRNetworkManager::eDQRNetworkManagerState DQRNetworkManager::m_INTtoEXTStateMappings[DQRNetworkManager::DNM_INT_STATE_COUNT] = +{ + DNM_STATE_INITIALISING, // DNM_INT_STATE_INITIALISING + DNM_STATE_INITIALISE_FAILED, // DNM_INT_STATE_INITIALISE_FAILED + DNM_STATE_IDLE, // DNM_INT_STATE_IDLE + DNM_STATE_HOSTING, // DNM_INT_STATE_HOSTING + DNM_STATE_HOSTING, // DNM_INT_STATE_HOSTING_WAITING_TO_PLAY + DNM_STATE_HOSTING, // DNM_INT_STATE_HOSTING_FAILED + DNM_STATE_JOINING, // DNM_INT_STATE_JOINING + DNM_STATE_JOINING, // DNM_INT_STATE_JOINING_WAITING_FOR_RESERVATIONS + DNM_STATE_JOINING, // DNM_INT_STATE_JOINING_GET_SDA + DNM_STATE_JOINING, // DNM_INT_STATE_JOINING_WAITING_FOR_SDA + DNM_STATE_JOINING, // DNM_INT_STATE_JOINING_CREATE_SESSION + DNM_STATE_JOINING, // DNM_INT_STATE_JOINING_WAITING_FOR_ACTIVE_SESSION + DNM_STATE_JOINING, // DNM_INT_STATE_JOINING_SENDING_UNRELIABLE + DNM_STATE_JOINING, // DNM_INT_STATE_JOINING_FAILED_TIDY_UP + DNM_STATE_JOINING, // DNM_INT_STATE_JOINING_FAILED + DNM_STATE_STARTING, // DNM_INT_STATE_STARTING + DNM_STATE_PLAYING, // DNM_INT_STATE_PLAYING + DNM_STATE_LEAVING, // DNM_INT_STATE_LEAVING + DNM_STATE_LEAVING, // DNM_INT_STATE_LEAVING_FAILED + DNM_STATE_ENDING, // DNM_INT_STATE_ENDING +}; + +DQRNetworkManager::DQRNetworkManager(IDQRNetworkManagerListener *listener) +{ + s_pDQRManager = this; + m_listener = listener; + m_eventHandlers = ref new DQRNetworkManagerEventHandlers(this); + m_XRNS_Session = nullptr; + m_multiplayerSession = nullptr; + m_sda = nullptr; + m_currentSmallId = 0; + m_hostSmallId = 0; + m_isHosting = false; + m_isInSession = false; + m_partyController = new PartyController(this); + m_partyController->RegisterEventHandlers(); + memset(m_sessionAddressFromSmallId,0,sizeof(m_sessionAddressFromSmallId)); + memset(m_channelFromSmallId,0,sizeof(m_channelFromSmallId)); + + memset(&m_roomSyncData, 0, sizeof(m_roomSyncData)); + memset(m_players, 0, sizeof(m_players)); + + m_CreateSessionThread = NULL; + m_GetFriendPartyThread = NULL; + m_UpdateCustomSessionDataThread = NULL; + + m_CheckPartyInviteThread = NULL; + m_notifyForFullParty = false; + + m_customDataDirtyUpdateTicks = 0; + m_sessionResultCount = 0; + m_sessionSearchResults = NULL; + m_joinSessionUserMask = 0; + m_cancelJoinFromSearchResult = false; + + InitializeCriticalSection(&m_csStateChangeQueue); + InitializeCriticalSection(&m_csHostGamertagResolveResults); + InitializeCriticalSection(&m_csRTSMessageQueueIncoming); + InitializeCriticalSection(&m_csRTSMessageQueueOutgoing); + InitializeCriticalSection(&m_csSendBytes); + InitializeCriticalSection(&m_csVecChatPlayers); + InitializeCriticalSection(&m_csRoomSyncData); + InitializeCriticalSection(&m_csPartyViewVector); + + m_joinSessionXUIDs = ref new Platform::Array(4); + m_addLocalPlayerState = DNM_ADD_PLAYER_STATE_IDLE; + m_removeLocalPlayerState = DNM_REMOVE_PLAYER_STATE_IDLE; + + m_playersLeftParty = 0; + + m_handleForcedSignOut = false; + + m_RTS_Stat_totalBytes = 0; + m_RTS_Stat_totalSends = 0; + + m_RTS_DoWorkThread = new C4JThread(DQRNetworkManager::_RTSDoWorkThread, this, "Realtimesession processing"); + m_RTS_DoWorkThread->SetProcessor(CPU_CORE_DQR_REALTIMESESSION); + m_RTS_DoWorkThread->SetPriority(THREAD_PRIORITY_ABOVE_NORMAL); + m_RTS_DoWorkThread->Run(); +} + +void DQRNetworkManager::Initialise() +{ + m_associationTemplate = WXN::SecureDeviceAssociationTemplate::GetTemplateByName( L"MultiplayerUdp" ); + + m_state = DNM_INT_STATE_IDLE; + m_stateExternal = DNM_STATE_IDLE; + + m_chat = GetChatIntegrationLayer(); + m_chat->InitializeChatManager(true, true, false, false, this); +} + +// This method can be called on any xbox live context, to enable tracing of the service calls that go on internally when anything is done using that context +void DQRNetworkManager::EnableDebugXBLContext(MXS::XboxLiveContext^ XBLContext) +{ +#ifndef _CONTENT_PACKAGE + // Turn on debug logging to Output debug window for Xbox Services + XBLContext->Settings->DiagnosticsTraceLevel = MXS::XboxServicesDiagnosticsTraceLevel::Verbose; + + // Show service calls from Xbox Services on the UI for easy debugging + XBLContext->Settings->EnableServiceCallRoutedEvents = true; + XBLContext->Settings->ServiceCallRouted += ref new Windows::Foundation::EventHandler( + [=]( Platform::Object^, Microsoft::Xbox::Services::XboxServiceCallRoutedEventArgs^ args ) + { + //if( args->HttpStatus != 200 ) + { + LogComment(L"[URL]: " + args->HttpMethod + " " + args->Url->AbsoluteUri); + if( !args->RequestBody->IsEmpty() ) + { + LogComment(L"[RequestBody]: " + args->RequestBody ); + } + LogComment(L""); + LogComment(L"[Response]: " + args->HttpStatus.ToString() + " " + args->ResponseBody); + LogComment(L""); + } + }); +#endif +} + +// This is the top level method called when starting to host a network game. Most of the functionality is asynchronously run in a separate thread kicked off here - see ::HostGameThreadProc +void DQRNetworkManager::CreateAndJoinSession(int usersMask, unsigned char *customSessionData, unsigned int customSessionDataSize, bool offline) +{ + m_isHosting = true; + m_isInSession = true; + m_isOfflineGame = offline; + m_currentUserMask = usersMask; + SetState(DNM_INT_STATE_HOSTING); + m_customSessionData = customSessionData; + m_customSessionDataSize = customSessionDataSize; + + m_CreateSessionThread = new C4JThread(&DQRNetworkManager::_HostGameThreadProc, this, "Create session"); + m_CreateSessionThread->Run(); +} + +// Flag that the custom session data has been updated - this isn't actually updated here since updating is an asynchronous process and we may already be in the middle of doing an +// update. Instead the custom data is flagged flagged as dirty here, and it will be considered for updated when next appropriate during a tick. +void DQRNetworkManager::UpdateCustomSessionData() +{ + if( !m_isHosting) return; + if( m_isOfflineGame ) return; + + // Update data on next tick + m_customDataDirtyUpdateTicks = 1; +} + +// This is the main method for finishing joining a game session itself, by any method. +// By the point this is called, we should already have a reserved slot in the game session, by virtue +// of adding our local players to the party, having this noticed by the host, and the host add reserved slots for us in the game session. +// At this point we need to: +// (1) Set out players state in the session to active, so that they won't timeout & be removed +// (2) Get the network details of the host that we need to connect to +// (3) Set state up so that in the next tick we'll attempt to set up the network communications for this endpoint +// Note that the reason that the final setting up of the network endpoint isn't just directly in this method itself, is that we have seen it fail in +// the past and so we need to be able to retry it, which is simpler if it is part of our general state machine to be able to repeat this operation. +void DQRNetworkManager::JoinSession(int playerMask) +{ + // Establish a primary user & xbox live context for this user. We can use these for operations which aren't particular to any specific user on the local console + m_primaryUser = ProfileManager.GetUser(0); + if( m_primaryUser == nullptr ) + { + app.DebugPrintf("DNM_INT_STATE_JOINING_FAILED getting primary user\n"); + SetState(DNM_INT_STATE_JOINING_FAILED); + return; + } + + m_primaryUserXboxLiveContext = ref new MXS::XboxLiveContext(m_primaryUser); + if( m_primaryUserXboxLiveContext == nullptr ) + { + app.DebugPrintf("DNM_INT_STATE_JOINING_FAILED getting primary context\n"); + SetState(DNM_INT_STATE_JOINING_FAILED); + return; + } + EnableDebugXBLContext(m_primaryUserXboxLiveContext); + + SetState(DNM_INT_STATE_JOINING); + + m_partyController->RefreshPartyView(); + m_isInSession = true; + m_isOfflineGame = false; + + for( int i = 0; i < MAX_LOCAL_PLAYER_COUNT; i++ ) + { + // Get the game session associated with our party. We need to get this once for every person joining to set them individually to be active + if( playerMask & ( 1 << i ) ) + { + MXSM::MultiplayerSession^ session = nullptr; + + // Get user & xbox live context for this specific local user that we are attempting to join + WXS::User^ joiningUser = ProfileManager.GetUser(i); + if( joiningUser == nullptr ) + { + app.DebugPrintf("DNM_INT_STATE_JOINING_FAILED getting joining user\n"); + SetState(DNM_INT_STATE_JOINING_FAILED); + return; + } + + MXS::XboxLiveContext^ joiningUserXBLContext = ref new MXS::XboxLiveContext(joiningUser); + if( joiningUserXBLContext == nullptr ) + { + app.DebugPrintf("DNM_INT_STATE_JOINING_FAILED getting joining context\n"); + SetState(DNM_INT_STATE_JOINING_FAILED); + return; + } + + if( m_partyController->GetPartyView() == nullptr ) + { + app.DebugPrintf("DNM_INT_STATE_JOINING_FAILED getting party view\n"); + SetState(DNM_INT_STATE_JOINING_FAILED); + return; + } + + // Get a copy of the session document, for this user + auto multiplayerSessionAsync = joiningUserXBLContext->MultiplayerService->GetCurrentSessionAsync( ConvertToMicrosoftXboxServicesMultiplayerSessionReference(m_partyController->GetPartyView()->GameSession)); + create_task(multiplayerSessionAsync).then([&session,this](task t) + { + try + { + session = t.get(); // if t.get() didn't throw, it succeeded + } + catch (Platform::COMException^ ex) + { + LogCommentWithError( L"MultiplayerSession failed", ex->HResult ); + } + }) + .wait(); + + // If we found the session, then set the status of this member to be active (should be reserved). This will stop our slot timing out and us being dropped out of the session. + if( session != nullptr ) + { + if(!IsPlayerInSession(joiningUser->XboxUserId, session, NULL) ) + { + app.DebugPrintf("DNM_INT_STATE_JOINING_FAILED didn't find required player in session\n"); + SetState(DNM_INT_STATE_JOINING_FAILED); + return; + } + session->SetCurrentUserStatus(MXSM::MultiplayerSessionMemberStatus::Active); + HRESULT hr = S_OK; + session = WriteSessionHelper( joiningUserXBLContext, session, MXSM::MultiplayerSessionWriteMode::UpdateExisting, hr ); + HandleSessionChange(session); + } + else + { + app.DebugPrintf("DNM_INT_STATE_JOINING_FAILED didn't find session\n"); + SetState(DNM_INT_STATE_JOINING_FAILED); + return; + } + } + } + + MXSM::MultiplayerSession^ session = m_multiplayerSession; + + if( session != nullptr ) + { + // Get the secure device address for the host player, and then attempt to create a association with it + int hostSessionIndex = GetSessionIndexAndSmallIdForHost(&m_hostSmallId); + + MXSM::MultiplayerSessionMember^ member = m_multiplayerSession->Members->GetAt(hostSessionIndex); + + m_secureDeviceAddressBase64 = member->SecureDeviceAddressBase64; + + m_isHosting = false; + + sockaddr_in6 localSocketAddressStorage; + + ZeroMemory(&localSocketAddressStorage, sizeof(localSocketAddressStorage)); + + localSocketAddressStorage.sin6_family = AF_INET6; + localSocketAddressStorage.sin6_port = htons(m_associationTemplate->AcceptorSocketDescription->BoundPortRangeLower); + + memcpy(&localSocketAddressStorage.sin6_addr, &in6addr_any, sizeof(in6addr_any)); + + m_localSocketAddress = Platform::ArrayReference(reinterpret_cast(&localSocketAddressStorage), sizeof(localSocketAddressStorage)); + + m_joinCreateSessionAttempts = 0; + + m_joinSmallIdMask = playerMask; + + SetState(DNM_INT_STATE_JOINING_GET_SDA); + } + else + { + app.DebugPrintf("DNM_INT_STATE_JOINING_FAILED getting session\n"); + SetState(DNM_INT_STATE_JOINING_FAILED); + } +} + +void DQRNetworkManager::JoinSessionFromInviteInfo(int playerMask) +{ + // Gather set of XUIDs for the players that we are joining with + for( int i = 0; i < MAX_LOCAL_PLAYER_COUNT; i++ ) + { + if( playerMask & ( 1 << i ) ) + { + WXS::User^ user = ProfileManager.GetUser(i); + if( user == nullptr ) + { + return; + } + m_joinSessionXUIDs[i] = user->XboxUserId; + } + else + { + m_joinSessionXUIDs[i] = nullptr; + } + } + + // It is possible that in addition to the player that has been invited (and will already have a slot in the session) that we added more local player(s) from the quadrant sign in. + // In this case, then we need to attempt to add these to the party at this stage, and then wait for another gameSession ready event(s) before trying to progress to getting the whole + // set of local players into the game + + bool playerAdded = m_partyController->AddLocalUsersToParty( playerMask, ProfileManager.GetUser(0) ); + + if( playerAdded ) + { + app.DebugPrintf("Joining from invite, but extra non-party user(s) found so waiting for reservations\n"); + // Wait until we get notification via game session ready that our newly added party members have slots, then proceed to join session + m_isInSession = true; + m_startedWaitingForReservationsTime = System::currentTimeMillis(); + m_joinSessionUserMask = playerMask; + m_currentUserMask = 0; + m_isOfflineGame = false; + + SetState(DNM_INT_STATE_JOINING_WAITING_FOR_RESERVATIONS); + } + else + { + app.DebugPrintf("Joining from invite, no extra non-party users required\n"); + // No further players added - continue directly on with joining + JoinSession(playerMask); + } +} + + +// Add one or more local users (specified by bits set in playerMask) to the session. We use this as a client in a network game. At the stage this +// is called, the players being added should already have reserved slots in the session - ie we've already put the plyers in the party, this has +// been detected by the host, and it has added the reserved slots in the sesion that we require. +// +// At this stage we need to: +// (1) Set the player's state in the session to active +// (2) Send the small Id of the player to the host - we've already got reliable network communications to the host at this point. This lets the +// host know that there is an active player on this communication channel (we are multiplexing 4 channels, one for each local player) + +bool DQRNetworkManager::AddUsersToSession(int playerMask, MXSM::MultiplayerSessionReference^ sessionRef ) +{ + if( m_isHosting ) + { + return false; + } + + bool bSuccess = true; + for( int i = 0; i < MAX_LOCAL_PLAYER_COUNT; i++ ) + { + if( playerMask & ( 1 << i ) ) + { + // We need to get a MultiplayerSession for each player that is joining + + MXSM::MultiplayerSession^ session = nullptr; + + WXS::User^ newUser = ProfileManager.GetUser(i); + if( newUser == nullptr ) + { + bSuccess = false; + continue; + } + MXS::XboxLiveContext^ newUserXBLContext = ref new MXS::XboxLiveContext(newUser); + + auto multiplayerSessionAsync = newUserXBLContext->MultiplayerService->GetCurrentSessionAsync( sessionRef ); + create_task(multiplayerSessionAsync).then([&session,this](task t) + { + try + { + session = t.get(); // if t.get() didn't throw, it succeeded + } + catch (Platform::COMException^ ex) + { + LogCommentWithError( L"MultiplayerSession failed", ex->HResult ); + } + }) + .wait(); + + // If we found the session, then set the status of this member to be active (should be reserved). This will stop our slot timing out and us being dropped out of the session. + if( session != nullptr ) + { + int smallId = -1; + if(!IsPlayerInSession(newUser->XboxUserId, session, &smallId) ) + { + bSuccess = false; + continue; + } + session->SetCurrentUserStatus(MXSM::MultiplayerSessionMemberStatus::Active); + HRESULT hr = S_OK; + session = WriteSessionHelper( newUserXBLContext, session, MXSM::MultiplayerSessionWriteMode::UpdateExisting, hr ); + HandleSessionChange(session); + + SendSmallId(true, 1 << i); + } + } + } + return bSuccess; +} + +bool DQRNetworkManager::AddLocalPlayerByUserIndex(int userIndex) +{ + // We need to handle this differently for the host and other machines. As the procedure for adding a reserved slot for a local player whilst on the host doesn't seem to work + // + // On the host machine, we: + // + // (1) Get a MPSD for the player that is being added + // (2) Call the join method + // (3) Write the MPSD + // (4) Update the player sync data, and broadcast out to all clients + + // On remote machines, we: + // + // (1) join the party + // (2) the host should (if a slot is available) put a reserved slot in the session and attempt to pull reserved players + // (3) the client will respond to the gamesessionready event that is then received to set the added player to be active + + // If we're already in some of the asynchronous processing for adding as player, then we can't add another one - just fail straight away + if( m_addLocalPlayerState != DNM_ADD_PLAYER_STATE_IDLE ) return false; + + if( m_isHosting ) + { + WXS::User^ newUser = ProfileManager.GetUser(userIndex); + if( newUser == nullptr ) + { + return false; + } + + if( !m_isOfflineGame ) + { + // This is going to involve some async processing + + MXS::XboxLiveContext^ newUserXBLContext = ref new MXS::XboxLiveContext(newUser); + if( newUserXBLContext == nullptr ) + { + return false; + } + + EnableDebugXBLContext( newUserXBLContext); + + m_addLocalPlayerState = DNM_ADD_PLAYER_STATE_PROCESSING; + + auto asyncOp = newUserXBLContext->MultiplayerService->GetCurrentSessionAsync( m_multiplayerSession->SessionReference ); + create_task(asyncOp) + .then([this,newUserXBLContext,userIndex] (task t) + { + try + { + Microsoft::Xbox::Services::Multiplayer::MultiplayerSession^ currentSession = t.get(); + + // Don't attempt to join a player if we've no slots left in the session (this will include reserved slots) + if( currentSession->Members->Size < currentSession->SessionConstants->MaxMembersInSession ) + { + int smallId = m_currentSmallId; + MXSM::MultiplayerSessionMember ^member = currentSession->Join(GetNextSmallIdAsJsonString(), false); + currentSession->SetCurrentUserStatus( MXSM::MultiplayerSessionMemberStatus::Active ); + m_currentUserMask |= (1 << userIndex ); + + // Get device ID for current user & set in the session + Platform::String^ secureDeviceAddress = WXN::SecureDeviceAddress::GetLocal()->GetBase64String(); + currentSession->SetCurrentUserSecureDeviceAddressBase64( secureDeviceAddress ); + + HRESULT result; + WriteSessionHelper(newUserXBLContext, currentSession, MXSM::MultiplayerSessionWriteMode::UpdateExisting, result); // ************ WAITING ************** + + DQRNetworkPlayer* pPlayer = new DQRNetworkPlayer(this, DQRNetworkPlayer::DNP_TYPE_LOCAL, true, userIndex, m_XRNS_Session->LocalSessionAddress); + pPlayer->SetSmallId(smallId); + pPlayer->SetName(ProfileManager.GetUser(userIndex)->DisplayInfo->Gamertag->Data()); + pPlayer->SetDisplayName(ProfileManager.GetDisplayName(userIndex)); + pPlayer->SetUID(PlayerUID(ProfileManager.GetUser(userIndex)->XboxUserId->Data())); + + // Also add to the party so that our friends can find us. The host will get notified of this additional player in the party, but we should ignore since we're already in the session + m_partyController->AddLocalUsersToParty(1 << userIndex, ProfileManager.GetUser(0)); + + m_addLocalPlayerSuccessPlayer = pPlayer; + m_addLocalPlayerSuccessIndex = userIndex; + m_addLocalPlayerState = DNM_ADD_PLAYER_STATE_COMPLETE_SUCCESS; + } + else + { + m_addLocalPlayerFailedIndex = userIndex; + m_addLocalPlayerState = DNM_ADD_PLAYER_STATE_COMPLETE_FAIL_FULL; + } + } + catch ( Platform::COMException^ ex ) + { + m_addLocalPlayerFailedIndex = userIndex; + m_addLocalPlayerState = DNM_ADD_PLAYER_STATE_COMPLETE_FAIL; + } + catch ( Platform::Exception ^ex ) + { + m_addLocalPlayerFailedIndex = userIndex; + m_addLocalPlayerState = DNM_ADD_PLAYER_STATE_COMPLETE_FAIL; + } + }); + + return true; + } + else + { + DQRNetworkPlayer* pPlayer = new DQRNetworkPlayer(this, DQRNetworkPlayer::DNP_TYPE_LOCAL, true, userIndex, 0); + pPlayer->SetSmallId(m_currentSmallId++); + pPlayer->SetName(ProfileManager.GetUser(userIndex)->DisplayInfo->Gamertag->Data()); + pPlayer->SetDisplayName(ProfileManager.GetDisplayName(userIndex)); + pPlayer->SetUID(PlayerUID(ProfileManager.GetUser(userIndex)->XboxUserId->Data())); + + // TODO - could this add fail? + if(AddRoomSyncPlayer( pPlayer, 0, userIndex)) + { + SendRoomSyncInfo(); + m_listener->HandlePlayerJoined(pPlayer); // This is for notifying of local players joining in an offline game + } + else + { + // Can fail (notably if m_roomSyncData contains players who've left) + assert(0); + return false; + } + } + return true; + } + else + { + // Check if there's any available slots before attempting to add the player to the party. We can still fail joining later if + // the host can't add a reserved slot for us for some reason but better checking on the client side before even attempting. + + WXS::User^ newUser = ProfileManager.GetUser(userIndex); + + MXS::XboxLiveContext^ newUserXBLContext = ref new MXS::XboxLiveContext(newUser); + if( newUserXBLContext == nullptr ) + { + return false; + } + + m_addLocalPlayerState = DNM_ADD_PLAYER_STATE_PROCESSING; + auto asyncOp = newUserXBLContext->MultiplayerService->GetCurrentSessionAsync( m_multiplayerSession->SessionReference ); + create_task(asyncOp) + .then([this,newUserXBLContext,userIndex] (task t) + { + try + { + Microsoft::Xbox::Services::Multiplayer::MultiplayerSession^ currentSession = t.get(); + + if( currentSession->Members->Size == currentSession->SessionConstants->MaxMembersInSession ) + { + m_addLocalPlayerFailedIndex = userIndex; + m_addLocalPlayerState = DNM_ADD_PLAYER_STATE_COMPLETE_FAIL_FULL; + } + else + { + m_joinSessionUserMask |= (1 << userIndex); + m_joinSessionXUIDs[userIndex] = ProfileManager.GetUser(userIndex)->XboxUserId; + m_partyController->AddLocalUsersToParty(1 << userIndex, ProfileManager.GetUser(0)); + + m_addLocalPlayerSuccessPlayer = NULL; + m_addLocalPlayerState = DNM_ADD_PLAYER_STATE_COMPLETE_SUCCESS; + } + } + catch( Platform::COMException^ ex ) + { + m_addLocalPlayerFailedIndex = userIndex; + m_addLocalPlayerState = DNM_ADD_PLAYER_STATE_COMPLETE_FAIL; + } + catch ( Platform::Exception ^ex ) + { + m_addLocalPlayerFailedIndex = userIndex; + m_addLocalPlayerState = DNM_ADD_PLAYER_STATE_COMPLETE_FAIL; + } + }); + + return true; + } +} + +bool DQRNetworkManager::RemoveLocalPlayerByUserIndex(int userIndex) +{ + // We need to handle this differently for the host and other machines. + // + // On the host machine, we: + // + // (1) Get a MPSD for the player that is being removed + // (2) Call the leave method + // (3) Write the MPSD + // (4) Leave the party + // (5) Update the player sync data, and broadcast out to all clients + + // On remote machines, we: + // + // (1) Get a MPSD for the player that is being removed + // (2) Call the leave method + // (3) Write the MPSD + // (4) Leave the party + // (5) send message to the host that this player has left + // (6) host should respond to this message by removing the player from the player sync data, and notifying all clients of updated players + // (7) the client should respond to the player leaving that will happen and this will actually notify the game that the player has left + + // TODO - this should be rearranged so that the async stuff isn't waited on here, and so that the callbacks don't get called from the task's thread + + if( m_removeLocalPlayerState != DNM_REMOVE_PLAYER_STATE_IDLE ) return false; + + WXS::User^ leavingUser = ProfileManager.GetUser(userIndex, true); + if( leavingUser == nullptr ) + { + return false; + } + + if( !m_isOfflineGame ) + { + if( m_chat ) + { + m_chat->RemoveLocalUser(leavingUser); + } + MXS::XboxLiveContext^ leavingUserXBLContext = ref new MXS::XboxLiveContext(leavingUser); + if( leavingUserXBLContext == nullptr ) + { + return false; + } + EnableDebugXBLContext( leavingUserXBLContext); + m_removeLocalPlayerState = DNM_REMOVE_PLAYER_STATE_PROCESSING; + auto asyncOp = leavingUserXBLContext->MultiplayerService->GetCurrentSessionAsync( m_multiplayerSession->SessionReference ); + create_task(asyncOp) + .then([this,leavingUserXBLContext,userIndex,leavingUser] (task t) + { + try + { + Microsoft::Xbox::Services::Multiplayer::MultiplayerSession^ currentSession = t.get(); + + // Remove from the party + LogComment(L"Removing user from party"); + m_partyController->RemoveLocalUserFromParty(leavingUser); + LogComment(L"Removed user from party, now leaving session"); + + // Then leave & update the session + currentSession->Leave(); + HRESULT result; + WriteSessionHelper(leavingUserXBLContext, currentSession, MXSM::MultiplayerSessionWriteMode::UpdateExisting, result); + m_currentUserMask &= ~(1<HResult); + + m_removeLocalPlayerState = DNM_REMOVE_PLAYER_STATE_COMPLETE_FAIL; + m_removeLocalPlayerIndex = userIndex; + } + }); + } + else + { + DQRNetworkPlayer* pPlayer = GetLocalPlayerByUserIndex( userIndex ); + RemoveRoomSyncPlayer( pPlayer ); + } + return true; +} + +bool DQRNetworkManager::IsHost() +{ + return m_isHosting; +} + +// Consider as "in session" from the moment that a game is created or joined, until the point where the game itself has been told via state change that we are now idle. The +// game code requires IsInSession to return true as soon as it has asked to do one of these things (even if the state system hasn't really caught up with this request yet), and +// it also requires that it is informed of the state changes leading up to not being in the session, before this should report false. +bool DQRNetworkManager::IsInSession() +{ + return m_isInSession; +} + +// Get count of players currently in the session +int DQRNetworkManager::GetPlayerCount() +{ + return m_roomSyncData.playerCount; +} + +// Get count of players who are in the session, but not local to this machine +int DQRNetworkManager::GetOnlinePlayerCount() +{ + int count = 0; + for( int i = 0; i < MAX_ONLINE_PLAYER_COUNT; i++ ) + { + if( m_players[i] ) + { + if( !m_players[i]->IsLocal() ) + { + count++; + } + } + } + return count; +} + + +DQRNetworkPlayer *DQRNetworkManager::GetPlayerByIndex(int idx) +{ + return m_players[idx]; + +} + +DQRNetworkPlayer *DQRNetworkManager::GetPlayerBySmallId(int idx) +{ + for( int i = 0; i < MAX_ONLINE_PLAYER_COUNT; i++ ) + { + if( m_players[i] ) + { + if( m_players[i]->GetSmallId() == idx) + { + return m_players[i]; + } + } + } + return NULL; +} + +DQRNetworkPlayer *DQRNetworkManager::GetPlayerByXuid(PlayerUID xuid) +{ + for( int i = 0; i < MAX_ONLINE_PLAYER_COUNT; i++ ) + { + if( m_players[i] ) + { + if( m_players[i]->GetUID() == xuid) + { + return m_players[i]; + } + } + } + return NULL; +} + +// Retrieve player display name by gamertag +wstring DQRNetworkManager::GetDisplayNameByGamertag(wstring gamertag) +{ + if (m_displayNames.find(gamertag) != m_displayNames.end()) + { + return m_displayNames[gamertag]; + } + else + { + return gamertag; + } +} + +DQRNetworkPlayer *DQRNetworkManager::GetLocalPlayerByUserIndex(int idx) +{ + for( int i = 0; i < MAX_ONLINE_PLAYER_COUNT; i++ ) + { + if( m_players[i] ) + { + if( m_players[i]->IsLocal() ) + { + if( m_players[i]->GetLocalPlayerIndex() == idx ) + { + return m_players[i]; + } + } + } + } + return NULL; +} + +DQRNetworkPlayer *DQRNetworkManager::GetHostPlayer() +{ + return GetPlayerBySmallId(m_hostSmallId); +} + + +int DQRNetworkManager::GetSessionIndex(DQRNetworkPlayer *player) +{ + for( int i = 0; i < MAX_ONLINE_PLAYER_COUNT; i++ ) + { + if( m_players[i] == player ) + { + return i; + } + } + return 0; +} + +void DQRNetworkManager::SetState(DQRNetworkManager::eDQRNetworkManagerInternalState state) +{ + eDQRNetworkManagerState oldState = m_INTtoEXTStateMappings[m_state]; + eDQRNetworkManagerState newState = m_INTtoEXTStateMappings[state]; + m_state = state; + + // Queue any important (ie externally relevant) state changes - we will do a call back for these in our main tick. Don't do it directly here + // as we could be coming from any thread at this stage, with any stack size etc. and so we don't generally want to expect the game to be able to handle itself in such circumstances. + if( newState != oldState ) + { + EnterCriticalSection(&m_csStateChangeQueue); + m_stateChangeQueue.push(StateChangeInfo(oldState,newState)); + LeaveCriticalSection(&m_csStateChangeQueue); + } +} + +DQRNetworkManager::eDQRNetworkManagerState DQRNetworkManager::GetState() +{ + return m_stateExternal;; +} + +void DQRNetworkManager::Tick() +{ + Tick_XRNS(); + Tick_VoiceChat(); + Tick_Party(); + Tick_CustomSessionData(); + Tick_AddAndRemoveLocalPlayers(); + Tick_ResolveGamertags(); + Tick_PartyProcess(); + Tick_StateMachine(); + Tick_CheckInviteParty(); +} + +void DQRNetworkManager::Tick_XRNS() +{ + ProcessRTSMessagesIncoming(); +} + +void DQRNetworkManager::Tick_VoiceChat() +{ +#if 0 + static int chatDumpCount = 0; + chatDumpCount++; + if( ( chatDumpCount % 40 ) == 0 ) + { + if( m_chat ) + { + LogCommentFormat(L"ChatManager: hasFocus:%d\n",m_chat->HasMicFocus()); + IVectorView^ chatUsers = m_chat->GetChatUsers(); + for( int i = 0; i < chatUsers->Size; i++ ) + { + Microsoft::Xbox::GameChat::ChatUser^ chatUser = chatUsers->GetAt(i); + LogCommentFormat(L"local: %d muted: %d type:%s restriction:%s mode:%s volume:%f [xuid:%s]\n", + chatUser->IsLocal,chatUser->IsMuted,chatUser->ParticipantType.ToString()->Data(),chatUser->RestrictionMode.ToString()->Data(), chatUser->TalkingMode.ToString()->Data(),chatUser->Volume, + chatUser->XboxUserId->Data()); + } + } + } +#endif + // If we have to inform the chat integration layer of any players that have joined, do that now + EnterCriticalSection(&m_csVecChatPlayers); + for( int i = 0; i < m_vecChatPlayersJoined.size(); i++ ) + { + int idx = m_vecChatPlayersJoined[i]; + if( m_chat ) + { + WXS::User^ user = ProfileManager.GetUser(idx); + if( user != nullptr ) + { + m_chat->AddLocalUser(user); + } + } + } + m_vecChatPlayersJoined.clear(); + LeaveCriticalSection(&m_csVecChatPlayers); +} + +void DQRNetworkManager::Tick_Party() +{ + // If the primary player has been flagged as having left the party, then we don't respond immediately as it is possible we are just transitioning from one party to another, and it would be much + // nicer to handle this kind of transition directly. If we do get a new party within this time period, then we'll handle by asking the user if they want to leave the game they are currently in etc. + if( m_playersLeftParty ) + { + if( ( System::currentTimeMillis() - m_playersLeftPartyTime ) > PRIMARY_PLAYER_LEAVING_PARTY_WAIT_MS ) + { + // We've waited long enough. User must (hopefully) have just left the party + // Previously we'd switch to offline but that causes a world of pain with forced sign-outs + if( m_playersLeftParty & 1 ) + { + // Before we switch to an offline game, check to see if there is currently a new party. If this is the case and + // we're here, then its because we were added to a party, but didn't receive a gamesessionready event. So if we have + // a party here that we've joined, and the number of players in the party (including us) is more than MAX_PLAYERS_IN_TEMPLATE, + // then it seems reasonable to assume that the reason we're not in the game is due to lack of space, and we can inform the + // user of this when converting to an offline game + + m_partyController->RefreshPartyView(); + WXM::PartyView^ partyView = m_partyController->GetPartyView(); + if( partyView ) + { + int partySize = partyView->Members->Size; + if( partySize > MAX_PLAYERS_IN_TEMPLATE ) + { + g_NetworkManager.SetFullSessionMessageOnNextSessionChange(); + } + } + + DQRNetworkManager::LogComment(L"Primary player on this system has left the party, switching to offline\n"); + app.SetAction(0, eAppAction_EthernetDisconnected); + } + else + { + // Secondary player(s) leaving, just remove as if they had chosen to exit themselves from the game + for( int i = 0; i < MAX_LOCAL_PLAYERS; i++ ) + { + if( m_playersLeftParty & ( 1 << i ) ) + { + RemoveLocalPlayerByUserIndex(i); + } + } + } + + m_playersLeftParty = 0; + } + } + + // Forced sign out + if (m_handleForcedSignOut) + { + HandleForcedSignOut(); + m_handleForcedSignOut = false; + } +} + +void DQRNetworkManager::Tick_CustomSessionData() +{ + // If there was a thread updaing our custom session data, then clear it up if it is done + if( m_UpdateCustomSessionDataThread != NULL ) + { + if( !m_UpdateCustomSessionDataThread->isRunning() ) + { + delete m_UpdateCustomSessionDataThread; + m_UpdateCustomSessionDataThread = NULL; + } + } + + // If our custom data is dirty, and we aren't currently updating, then kick off a thread to update it + if( m_isHosting && ( !m_isOfflineGame ) ) + { + if( m_UpdateCustomSessionDataThread == NULL ) + { + if( m_customDataDirtyUpdateTicks ) + { + m_customDataDirtyUpdateTicks--; + if( m_customDataDirtyUpdateTicks == 0 ) + { + m_UpdateCustomSessionDataThread = new C4JThread(&DQRNetworkManager::_UpdateCustomSessionDataThreadProc, this, "Updating custom data"); + m_UpdateCustomSessionDataThread->Run(); + } + } + } + } + else + { + m_customDataDirtyUpdateTicks = 0; + } +} + +void DQRNetworkManager::Tick_AddAndRemoveLocalPlayers() +{ + // A lot of handling adding local players is handled asynchronously. Trying to avoid having the callbacks that may result from this being called from the task threads, so handling this aspect of it here in the tick + if( m_addLocalPlayerState == DNM_ADD_PLAYER_STATE_COMPLETE_SUCCESS ) + { + // If we've completed, and we're the host, then we should have the new player to create stored here in m_localPlayerSuccessCreated. For clients, this will just be NULL as the actual + // adding of the player happens as part of a longer process of the host creating us a reserved slot etc. etc. + if( m_addLocalPlayerSuccessPlayer ) + { + if( AddRoomSyncPlayer( m_addLocalPlayerSuccessPlayer, m_XRNS_Session->LocalSessionAddress, m_addLocalPlayerSuccessIndex) ) + { + SendRoomSyncInfo(); + m_listener->HandlePlayerJoined(m_addLocalPlayerSuccessPlayer); // This is notifying local players joining, when online (host only) + } + } + m_addLocalPlayerState = DNM_ADD_PLAYER_STATE_IDLE; + } + else if( m_addLocalPlayerState == DNM_ADD_PLAYER_STATE_COMPLETE_FAIL ) + { + m_listener->HandleAddLocalPlayerFailed(m_addLocalPlayerFailedIndex, false); + m_addLocalPlayerState = DNM_ADD_PLAYER_STATE_IDLE; + } + else if( m_addLocalPlayerState == DNM_ADD_PLAYER_STATE_COMPLETE_FAIL_FULL ) + { + m_listener->HandleAddLocalPlayerFailed(m_addLocalPlayerFailedIndex, true); + m_addLocalPlayerState = DNM_ADD_PLAYER_STATE_IDLE; + } + + // Similarly for removing local players - avoiding having callbacks from the async task threads, so this aspect of the process is handled here + + if( m_removeLocalPlayerState == DNM_REMOVE_PLAYER_STATE_COMPLETE_SUCCESS || m_removeLocalPlayerState == DNM_REMOVE_PLAYER_STATE_COMPLETE_FAIL ) + { + // Note: we now remove the player from the room sync data even if remove from session/party failed, + // either way we need to clean up + + // On host, directly remove from the player sync data. On client, send a message to the host which will do this + if( m_isHosting) + { + DQRNetworkPlayer* pPlayer = GetLocalPlayerByUserIndex( m_removeLocalPlayerIndex ); + RemoveRoomSyncPlayer( pPlayer ); + SendRoomSyncInfo(); + } + else + { + // Check if this player actually exists yet on this machine. If it is, then we need to send a message to the host to unassign it which + // ultimately will end up with this player being removed when the host syncs back with us. If it hasn't then there isn't anything to + // unassign with the host + DQRNetworkPlayer* pPlayer = GetLocalPlayerByUserIndex( m_removeLocalPlayerIndex ); + if( pPlayer ) + { + SendUnassignSmallId(m_removeLocalPlayerIndex); + } + } + m_removeLocalPlayerState = DNM_REMOVE_PLAYER_STATE_IDLE; + } +} + +void DQRNetworkManager::Tick_ResolveGamertags() +{ + // Host only - if there are any player display names which have been resolved (or failed to resolve), then this is the last stage in the player becoming active on the host's side and so do a few things here + EnterCriticalSection(&m_csHostGamertagResolveResults); + while( !m_hostGamertagResolveResults.empty() ) + { + HostGamertagResolveDetails *details = m_hostGamertagResolveResults.front(); + + details->m_pPlayer->SetName(details->m_name.c_str()); + + LogComment("Adding a player"); + if( AddRoomSyncPlayer(details->m_pPlayer, details->m_sessionAddress, details->m_channel ) ) + { + LogComment("Adding a player - success"); + m_listener->HandlePlayerJoined(details->m_pPlayer); // This is for notifying of remote players joining, when online (when we are the host), as we have resolved their names + // The last name to be resolve in any one atomic set (ie that comes in from a single DQR_INTERNAL_ASSIGN_SMALL_IDS message) will have this flag set, so we know this is the point + // to synchronise out to the clients + if( details->m_sync ) + { + LogComment("Synchronising players with clients"); + SendRoomSyncInfo(); + } + } + else + { + LogComment("Adding a player - failed"); + delete details->m_pPlayer; + + // TODO - what to do if adding a player failed here? + assert(false); + } + + delete details; + m_hostGamertagResolveResults.pop(); + } + LeaveCriticalSection(&m_csHostGamertagResolveResults); +} + +void DQRNetworkManager::Tick_PartyProcess() +{ + // On starting up the game, there's 3 options of what we need to do... + // (1) Attempt to join a game session that was passed in on activation (this will have happened if we were started from a game ready notification) + // (2) Attempt to join whatever game the party is associated with (this will happen if we were started in response to a party invite) + switch( m_partyProcess ) + { + case DNM_PARTY_PROCESS_NONE: + break; + case DNM_PARTY_PROCESS_JOIN_PARTY: + if( GetBestPartyUserIndex() ) + { + m_listener->HandleInviteReceived(0, new SessionInfo()); + } + break; + case DNM_PARTY_PROCESS_JOIN_SPECIFIED: + m_listener->HandleInviteReceived(m_bootUserIndex, new SessionInfo(m_bootSessionName, m_bootServiceConfig, m_bootSessionTemplate)); + break; + } + m_partyProcess = DNM_PARTY_PROCESS_NONE; +} + +void DQRNetworkManager::Tick_StateMachine() +{ + switch( m_state ) + { + case DNM_INT_STATE_JOINING_GET_SDA: + { + SetState(DNM_INT_STATE_JOINING_WAITING_FOR_SDA); + auto asyncOp = m_associationTemplate->CreateAssociationAsync(WXN::SecureDeviceAddress::FromBase64String(m_secureDeviceAddressBase64), WXN::CreateSecureDeviceAssociationBehavior::Reevaluate); + create_task(asyncOp).then([this](task t) + { + m_sda = nullptr; + try + { + m_sda = t.get(); + } + catch (Platform::COMException^ ex) + { + LogCommentWithError( L"CreateAssociationAsync failed", ex->HResult ); + } + // If this succeeded, then make a store of all the things we'll need to initiate the network communication endpoint for this machine (our local address, remove address, secure device association etc.) + if( m_sda) + { + m_remoteSocketAddress = ref new Platform::Array(sizeof(SOCKADDR_STORAGE)); + m_sda->GetRemoteSocketAddressBytes(m_remoteSocketAddress); + SetState(DNM_INT_STATE_JOINING_CREATE_SESSION); + } + else + { + SetState(DNM_INT_STATE_JOINING_FAILED); + } + }); + } + break; + case DNM_INT_STATE_JOINING_CREATE_SESSION: + RTS_StartCient(); + SetState(DNM_INT_STATE_JOINING_WAITING_FOR_ACTIVE_SESSION); + break; + case DNM_INT_STATE_JOINING_SENDING_UNRELIABLE: + { + __int64 timeNow = System::currentTimeMillis(); + // m_firstUnreliableSendTime of 0 indicates that we haven't tried sending an unreliable packet yet so need to send one and initialise things + if( m_firstUnreliableSendTime == 0 ) + { + m_firstUnreliableSendTime = timeNow; + m_lastUnreliableSendTime = timeNow; + + SendSmallId(false, m_joinSmallIdMask); + } + else + { + // Timeout if we've exceeded the threshold for this + if( (timeNow - m_firstUnreliableSendTime) > JOIN_PACKET_RESEND_TIMEOUT_MS ) + { + app.DebugPrintf("DNM_INT_STATE_JOINING_FAILED unreliable resend timeout\n"); + SetState(DNM_INT_STATE_JOINING_FAILED); + } + else + { + // Possibly send another packet if it has been long enough + if( (timeNow - m_lastUnreliableSendTime ) > JOIN_PACKET_RESEND_DELAY_MS ) + { + LogComment("Resending unreliable packet\n"); + m_lastUnreliableSendTime = timeNow; + SendSmallId(false, m_joinSmallIdMask); + } + } + } + } + break; + case DNM_INT_STATE_JOINING_WAITING_FOR_RESERVATIONS: + { + // Timeout if we've been waiting for reserved slots for our joining players for too long. This is most likely because the host doesn't have room for all the slots we wanted, and we weren't able to determine this + // when we went to join the game (ie someone else was joining at the same time). At this point we need to remove any local players that did already join, from both the session and the party. + __int64 timeNow = System::currentTimeMillis(); + if( ( timeNow - m_startedWaitingForReservationsTime ) > JOIN_RESERVATION_WAIT_TIME ) + { + SetState(DNM_INT_STATE_JOINING_FAILED_TIDY_UP); + TidyUpFailedJoin(); + } + } + break; + case DNM_INT_STATE_ENDING: + SetState(DNM_INT_STATE_IDLE); + break; + case DNM_INT_STATE_HOSTING_WAITING_TO_PLAY: + delete m_CreateSessionThread; + m_CreateSessionThread = NULL; + // If the game is offline we can transition straight to playing + if (m_isOfflineGame) StartGame(); + break; + case DNM_INT_STATE_JOINING_FAILED: + SetState(DNM_INT_STATE_JOINING_FAILED_TIDY_UP); + TidyUpFailedJoin(); + break; + case DNM_INT_STATE_HOSTING_FAILED: + m_multiplayerSession = nullptr; + LogComment("Error DNM_INT_STATE_HOSTING_FAILED\n"); + SetState(DNM_INT_STATE_IDLE); + break; + case DNM_INT_STATE_LEAVING_FAILED: + m_multiplayerSession = nullptr; + LogComment("Error DNM_INT_STATE_LEAVING_FAILED\n"); + SetState(DNM_INT_STATE_IDLE); + break; + } + + EnterCriticalSection(&m_csStateChangeQueue); + while(m_stateChangeQueue.size() > 0 ) + { + if( m_listener ) + { + m_listener->HandleStateChange(m_stateChangeQueue.front().m_oldState, m_stateChangeQueue.front().m_newState); + if( m_stateChangeQueue.front().m_newState == DNM_STATE_IDLE ) + { + m_isInSession = false; + } + } + m_stateExternal = m_stateChangeQueue.front().m_newState; + m_stateChangeQueue.pop(); + } + LeaveCriticalSection(&m_csStateChangeQueue); +} + +void DQRNetworkManager::Tick_CheckInviteParty() +{ + if( m_inviteReceived ) + { + if( m_CheckPartyInviteThread ) + { + if( !m_CheckPartyInviteThread->isRunning() ) + { + delete m_CheckPartyInviteThread; + m_CheckPartyInviteThread = NULL; + } + } + if( m_CheckPartyInviteThread == NULL ) + { + m_inviteReceived = false; + m_CheckPartyInviteThread = new C4JThread(&DQRNetworkManager::_CheckInviteThreadProc, this, "Check invite thread"); + m_CheckPartyInviteThread->Run(); + } + } +} + +bool DQRNetworkManager::ShouldMessageForFullSession() +{ + bool retval = m_notifyForFullParty; + m_notifyForFullParty = false; + return retval; +} + +void DQRNetworkManager::FlagInvitedToFullSession() +{ + m_notifyForFullParty = true; +} + +void DQRNetworkManager::UnflagInvitedToFullSession() +{ + m_notifyForFullParty = false; +} + +void DQRNetworkManager::AddPlayerFailed(Platform::String ^xuid) +{ + // A request to add a player (via the party) has been rejected by the host. If this is a player that we were waiting to join, then we can now: + // (1) stop waiting + // (2) remove from the party + // (3) inform the game of the failure + LogCommentFormat(L"AddPlayerFailed received, for XUID %s", xuid->Data()); + for( int i = 0; i < MAX_LOCAL_PLAYER_COUNT; i++ ) + { + if( m_joinSessionUserMask & ( 1 << i ) ) + { + if( m_joinSessionXUIDs[i] == xuid ) + { + LogCommentFormat(L"AddPlayerFailed received, XUID matched with joining player so handling (index %d)",i); + m_joinSessionUserMask &= ~( 1 << i ); + m_joinSessionXUIDs[i] = nullptr; + m_partyController->RemoveLocalUsersFromParty(m_primaryUser, 1 << i, m_multiplayerSession->SessionReference ); + m_listener->HandleAddLocalPlayerFailed(i, true); + } + } + } +} + +// Utility method to remove the braces at the start and end of a GUID and return the remaining string +Platform::String^ DQRNetworkManager::RemoveBracesFromGuidString(__in Platform::String^ guid ) +{ + std::wstring strGuid = guid->ToString()->Data(); + + if(strGuid.length() > 0 && strGuid[0] == L'{') + { + // Remove the { + strGuid.erase(0, 1); + } + + if(strGuid.length() > 0 && strGuid[strGuid.length() - 1] == L'}') + { + // Remove the } + strGuid.erase(strGuid.end() - 1, strGuid.end()); + } + + return ref new Platform::String(strGuid.c_str()); +} + +void DQRNetworkManager::HandleSessionChange(MXSM::MultiplayerSession^ multiplayerSession) +{ + // 4J-JEV: Fix for Durango #152208 - [CRASH] Code: Gameplay: Title crashes during loading screen after signing in when prompted. + if (multiplayerSession != nullptr) + { + // 4J-JEV: This id is needed to link stats together. + // I thought setting the value from here would be less intrusive than adding an accessor. + ((DurangoStats*)GenericStats::getInstance())->setMultiplayerCorrelationId(multiplayerSession->MultiplayerCorrelationId); + } + else + { + ((DurangoStats*)GenericStats::getInstance())->setMultiplayerCorrelationId( nullptr ); + } + + m_multiplayerSession = multiplayerSession; +} + +// Utility method to update a session on the server, synchronously. +MXSM::MultiplayerSession^ DQRNetworkManager::WriteSessionHelper( MXS::XboxLiveContext^ xboxLiveContext, MXSM::MultiplayerSession^ multiplayerSession, MXSM::MultiplayerSessionWriteMode writeMode, HRESULT& hr ) +{ + if (multiplayerSession == nullptr) + { + return nullptr; + } + + auto asyncOpWriteSessionAsync = xboxLiveContext->MultiplayerService->WriteSessionAsync( multiplayerSession, writeMode ); + + MXSM::MultiplayerSession^ outputMultiplayerSession = nullptr; + + create_task(asyncOpWriteSessionAsync) + .then([&outputMultiplayerSession, &hr](task t) + { + try + { + outputMultiplayerSession = t.get(); // if t.get() didn't throw, it succeeded + } + catch ( Platform::COMException^ ex ) + { + hr = ex->HResult; + } + }) + .wait(); + + if( outputMultiplayerSession != nullptr && + outputMultiplayerSession->SessionReference != nullptr ) + { + app.DebugPrintf( "Session written OK\n" ); + } + + return outputMultiplayerSession; +} + +MXSM::MultiplayerSessionMember^ DQRNetworkManager::GetUserMemberInSession( Windows::Xbox::System::User^ user, MXSM::MultiplayerSession^ session) +{ + for each (MXSM::MultiplayerSessionMember^ member in session->Members) + { + if( _wcsicmp(member->XboxUserId->Data(), user->XboxUserId->Data()) == 0) + { + return member; + } + } + + return nullptr; +} + +bool DQRNetworkManager::IsPlayerInSession( Platform::String^ xboxUserId, MXSM::MultiplayerSession^ session, int *smallId ) +{ + if( session == nullptr ) + { + LogComment(L"IsPlayerInSession: invalid session."); + return false; + } + + for each (MXSM::MultiplayerSessionMember^ member in session->Members) + { + if( _wcsicmp(xboxUserId->Data(), member->XboxUserId->Data() ) == 0 ) + { + if( smallId ) + { + // Get small Id for this member + try + { + Windows::Data::Json::JsonObject^ customConstant = Windows::Data::Json::JsonObject::Parse(member->MemberCustomConstantsJson); + Windows::Data::Json::JsonValue^ customValue = customConstant->GetNamedValue(L"smallId"); + *smallId = (int)(customValue->GetNumber()) & 255; + } + catch (Platform::COMException^ ex) + { + LogCommentWithError( L"Custom constant Parse/GetNamedValue failed", ex->HResult ); + } + } + + return true; + } + } + + return false; +} + +WXM::MultiplayerSessionReference^ DQRNetworkManager::ConvertToWindowsXboxMultiplayerSessionReference(MXSM::MultiplayerSessionReference^ sessionRef ) +{ + return ref new WXM::MultiplayerSessionReference( + sessionRef->SessionName, + sessionRef->ServiceConfigurationId, + sessionRef->SessionTemplateName + ); +} + +MXSM::MultiplayerSessionReference^ DQRNetworkManager::ConvertToMicrosoftXboxServicesMultiplayerSessionReference(WXM::MultiplayerSessionReference^ sessionRef ) +{ + return ref new MXSM::MultiplayerSessionReference( + sessionRef->ServiceConfigurationId, + sessionRef->SessionTemplateName, + sessionRef->SessionName + ); +} + +// This is called on the client, when new room sync data is received. By comparing this with the existing room sync data, +// this method is able to work out who has been added or removed from the game session, and notify the game of these events. +void DQRNetworkManager::UpdateRoomSyncPlayers(RoomSyncData *pNewSyncData) +{ + vector tempPlayers; + vector newPlayers; + + EnterCriticalSection(&m_csRoomSyncData); + + // Make temporary vector with all the current players in + for( int j = 0; j < m_roomSyncData.playerCount; j++ ) + { + tempPlayers.push_back(m_players[j]); + m_players[j] = NULL; + } + + // For each new player, it's either: + // (1) In the temp player array already, so we already knew about it. + // (2) Not in the temp player array already, so its a new player. Need to inform the game. + // And when we are done, anything left in the temporary vector must be a player that left + for( int i = 0; i < pNewSyncData->playerCount; i++ ) + { + PlayerSyncData *pNewPlayer = &pNewSyncData->players[i]; + bool bAlreadyExisted = false; + for( AUTO_VAR(it, tempPlayers.begin()); it != tempPlayers.end(); it++ ) + { + if( pNewPlayer->m_smallId == (*it)->GetSmallId() ) + { + m_players[i] = (*it); + it = tempPlayers.erase(it); + bAlreadyExisted = true; + break; + } + } + if( !bAlreadyExisted ) + { + // Create the new player, and tell the game etc. about it - the game is now free to send data via this player since it is active + if( i == 0 ) + { + // Player 0 is always the host + m_players[i] = new DQRNetworkPlayer(this, DQRNetworkPlayer::DNP_TYPE_HOST, false, pNewPlayer->m_channel, pNewPlayer->m_sessionAddress); + } + else + { + if( pNewPlayer->m_sessionAddress == m_XRNS_LocalAddress ) + { + m_players[i] = new DQRNetworkPlayer(this, DQRNetworkPlayer::DNP_TYPE_LOCAL, false, pNewPlayer->m_channel, pNewPlayer->m_sessionAddress); + } + else + { + m_players[i] = new DQRNetworkPlayer(this, DQRNetworkPlayer::DNP_TYPE_REMOTE, false, pNewPlayer->m_channel, pNewPlayer->m_sessionAddress); + } + } + + LogCommentFormat(L"Adding new player, index %d - type %d, small Id %d, name %s, xuid %s\n",i,m_players[i]->m_type,pNewPlayer->m_smallId,pNewPlayer->m_name,pNewPlayer->m_XUID); + + m_players[i]->SetSmallId(pNewPlayer->m_smallId); + m_players[i]->SetName(pNewPlayer->m_name); + m_players[i]->SetUID(PlayerUID(pNewPlayer->m_XUID)); + if (m_players[i]->IsLocal()) + { + m_players[i]->SetDisplayName(ProfileManager.GetDisplayName(i)); + } + + newPlayers.push_back( m_players[i] ); + } + } + for( int i = 0; i < m_roomSyncData.playerCount; i++ ) + { + delete [] m_roomSyncData.players[i].m_XUID; + } + memcpy(&m_roomSyncData, pNewSyncData, sizeof(m_roomSyncData)); + + for( int i = 0; i < tempPlayers.size(); i++ ) + { + m_listener->HandlePlayerLeaving(tempPlayers[i]); + delete tempPlayers[i]; + } + for( int i = 0; i < newPlayers.size(); i++ ) + { + m_listener->HandlePlayerJoined(newPlayers[i]); // For clients, this is where we get notified of local and remote players joining + } + LeaveCriticalSection(&m_csRoomSyncData); +} + +// This is called from the host, to add a new player into the room sync data that is then sent out to the clients. +bool DQRNetworkManager::AddRoomSyncPlayer(DQRNetworkPlayer *pPlayer, unsigned int sessionAddress, int channel) +{ + if( m_roomSyncData.playerCount == MAX_ONLINE_PLAYER_COUNT ) return false; + + EnterCriticalSection(&m_csRoomSyncData); + // Find the first entry that isn't us, to decide what to sync before. Don't consider entry #0 as this is reserved to indicate the host. + int insertAtIdx = m_roomSyncData.playerCount; + for( int i = 1; i < m_roomSyncData.playerCount; i++ ) + { + if( m_roomSyncData.players[i].m_sessionAddress != sessionAddress ) + { + insertAtIdx = i; + break; + } + else + { + // Don't add the same local index twice + if( m_roomSyncData.players[i].m_channel == channel ) + { + LeaveCriticalSection(&m_csRoomSyncData); + return false; + } + } + } + + // Make room for a new entry... + for( int i = m_roomSyncData.playerCount; i > insertAtIdx; i-- ) + { + m_roomSyncData.players[i] = m_roomSyncData.players[i-1]; + m_players[i] = m_players[i - 1]; + } + m_roomSyncData.players[insertAtIdx].m_channel = channel; + m_roomSyncData.players[insertAtIdx].m_sessionAddress = sessionAddress; + int xuidLength = pPlayer->GetUID().toString().length() + 1; // +1 for terminator + m_roomSyncData.players[insertAtIdx].m_XUID = new wchar_t [xuidLength]; + wcsncpy(m_roomSyncData.players[insertAtIdx].m_XUID, pPlayer->GetUID().toString().c_str(), xuidLength); + m_roomSyncData.players[insertAtIdx].m_smallId = pPlayer->GetSmallId(); + wcscpy_s(m_roomSyncData.players[insertAtIdx].m_name, pPlayer->GetName()); + m_players[insertAtIdx] = pPlayer; + + + m_roomSyncData.playerCount++; + + LeaveCriticalSection(&m_csRoomSyncData); + return true; +} + +// This is called from the host to remove players from the room sync data that is sent out to the clients. +// This method removes any players sharing a session address, and is used when one machine leaves the network game. +void DQRNetworkManager::RemoveRoomSyncPlayersWithSessionAddress(unsigned int sessionAddress) +{ + EnterCriticalSection(&m_csRoomSyncData); + vector removedPlayers; + int iWriteIdx = 0; + for( int i = 0; i < m_roomSyncData.playerCount; i++ ) + { + if( m_roomSyncData.players[i].m_sessionAddress == sessionAddress ) + { + removedPlayers.push_back(m_players[i]); + delete [] m_roomSyncData.players[i].m_XUID; + } + else + { + m_roomSyncData.players[iWriteIdx] = m_roomSyncData.players[i]; + m_players[iWriteIdx] = m_players[i]; + iWriteIdx++; + } + } + m_roomSyncData.playerCount = iWriteIdx; + + for( int i = 0; i < removedPlayers.size(); i++ ) + { + m_listener->HandlePlayerLeaving(removedPlayers[i]); + delete removedPlayers[i]; + memset(&m_roomSyncData.players[m_roomSyncData.playerCount + i], 0, sizeof(PlayerSyncData)); + m_players[m_roomSyncData.playerCount + i] = NULL; + } + LeaveCriticalSection(&m_csRoomSyncData); +} + +// This is called from the host a remove player from the room sync data that is sent out to the clients. +void DQRNetworkManager::RemoveRoomSyncPlayer(DQRNetworkPlayer *pPlayer) +{ + vector removedPlayers; + int iWriteIdx = 0; + for( int i = 0; i < m_roomSyncData.playerCount; i++ ) + { + if( m_players[i] == pPlayer ) + { + removedPlayers.push_back(m_players[i]); + delete [] m_roomSyncData.players[i].m_XUID; + } + else + { + m_roomSyncData.players[iWriteIdx] = m_roomSyncData.players[i]; + m_players[iWriteIdx] = m_players[i]; + iWriteIdx++; + } + } + m_roomSyncData.playerCount = iWriteIdx; + + for( int i = 0; i < removedPlayers.size(); i++ ) + { + m_listener->HandlePlayerLeaving(removedPlayers[i]); + delete removedPlayers[i]; + memset(&m_roomSyncData.players[m_roomSyncData.playerCount + i], 0, sizeof(PlayerSyncData)); + m_players[m_roomSyncData.playerCount + i] = NULL; + } +} + +// Broadcast RoomSyncData to all clients (host only) +void DQRNetworkManager::SendRoomSyncInfo() +{ + if( m_isOfflineGame ) return; + + EnterCriticalSection(&m_csRoomSyncData); + // Calculate the size of data we are going to be sending. This is composed of: + // (1) 2 byte general header + // (2) A single byte internal data tag + // (3) An unsigned int encoding the size of the combined size of all the strings in stage (5) + // (4) The RoomSyncData structure itself + // (5) A wchar NULL terminated string for every active player to encode the XUID + unsigned int xuidBytes = 0; + for( int i = 0 ; i < m_roomSyncData.playerCount; i++ ) + { + LogCommentFormat(L"Sending room sync info for player with XUID %s",m_roomSyncData.players[i].m_XUID); + xuidBytes += ( wcslen(m_roomSyncData.players[i].m_XUID) + 1 ) * sizeof(wchar_t); // 2 bytes per character, including 0 terminator + } + + unsigned int internalBytes = 1 + 4 + sizeof(RoomSyncData) + xuidBytes; + unsigned int totalBytes = 2 + internalBytes; + + unsigned char *data = new unsigned char[totalBytes]; + + uint32_t sizeHigh = internalBytes >> 8; + uint32_t sizeLow = internalBytes & 0xff; + + data[0] = 0x80 | sizeHigh; // Header - flag as internal data (0x80), sending + data[1] = sizeLow; // Data following has the a single byte to say what it is, followed by the room sync data itself + data[2] = DQR_INTERNAL_PLAYER_TABLE; + + memcpy(data + 3, &xuidBytes, 4); + memcpy(data + 7, &m_roomSyncData, sizeof(RoomSyncData)); + unsigned char *pucCurr = data + 7 + sizeof(RoomSyncData); + + for( int i = 0 ; i < m_roomSyncData.playerCount; i++ ) + { + unsigned int thisBytes = ( wcslen(m_roomSyncData.players[i].m_XUID) + 1 ) * sizeof(wchar_t); + memcpy(pucCurr, m_roomSyncData.players[i].m_XUID, thisBytes); + pucCurr += thisBytes; + } + + SendBytesRaw(-1, data, totalBytes, true); + + delete [] data; + LeaveCriticalSection(&m_csRoomSyncData); +} + +// Broadcast the fact that joining a particular XUID has failed (host only) +void DQRNetworkManager::SendAddPlayerFailed(Platform::String^ xuid) +{ + if( m_isOfflineGame ) return; + + // Calculate the size of data we are going to be sending. This is composed of: + // (1) 2 byte general header + // (2) A single byte internal data tag + // (3) An unsigned int encoding the size size of the string + // (5) A wchar NULL terminated string storing the xuid of the player which has failed to join + + unsigned int xuidBytes = sizeof(wchar_t) * ( xuid->Length() + 1 ); + + unsigned int internalBytes = 1 + 4 + xuidBytes; + unsigned int totalBytes = 2 + internalBytes; + + unsigned char *data = new unsigned char[totalBytes]; + + uint32_t sizeHigh = internalBytes >> 8; + uint32_t sizeLow = internalBytes & 0xff; + + data[0] = 0x80 | sizeHigh; // Header - flag as internal data (0x80), sending + data[1] = sizeLow; // Data following has the a single byte to say what it is, followed by the room sync data itself + data[2] = DQR_INTERNAL_ADD_PLAYER_FAILED; + + memcpy(data + 3, &xuidBytes, 4); + memcpy(data + 7, xuid->Data(), xuidBytes); + + SendBytesRaw(-1, data, totalBytes, true); + + delete [] data; +} + +// This method is used by the client to send a small Id to the host. When the host receives this on a particular communication channel, +// it then knows the association between communication channel & small Id, and that a player is actitve. +void DQRNetworkManager::SendSmallId(bool reliableAndSequential, int playerMask) +{ + // Send data with small Id setting mode - see full comment in DQRNetworkManagerEventHandlers::DataReceivedHandler + BYTE data[8]; + data[0] = 0x80; // Send 6 bytes, internal mode. Send on channel 0 but this is ignored. + data[1] = 6; + data[2] = DQR_INTERNAL_ASSIGN_SMALL_IDS; // Internal data type + data[3] = playerMask; // Actual id + data[4] = 0; + data[5] = 0; + data[6] = 0; + data[7] = 0; + + bool bError = false; + for( int j = 0; j < MAX_LOCAL_PLAYER_COUNT; j++ ) + { + if( playerMask & ( 1 << j ) ) + { + bool bFound = false; + for( unsigned int i = 0; i < m_multiplayerSession->Members->Size; i++ ) + { + MXSM::MultiplayerSessionMember^ member = m_multiplayerSession->Members->GetAt(i); + + if( member->XboxUserId == m_joinSessionXUIDs[j] ) + { + BYTE smallId = 0; + try + { + Windows::Data::Json::JsonObject^ customConstant = Windows::Data::Json::JsonObject::Parse(member->MemberCustomConstantsJson); + Windows::Data::Json::JsonValue^ customValue = customConstant->GetNamedValue(L"smallId"); + smallId = (BYTE)(customValue->GetNumber()); + bFound = true; + } + catch (Platform::COMException^ ex) + { + bError = true; + LogCommentWithError( L"Custom constant Parse/GetNamedValue failed", ex->HResult ); + } + + m_channelFromSmallId[smallId] = j; + + data[ 4 + j ] = smallId; + m_connectionInfoClient.m_smallId[ j ] = smallId; + LogCommentFormat( L"SendSmallId, channel %d, id %d\n", m_channelFromSmallId[smallId], smallId); + } + } + if( !bFound ) + { + bError = true; + } + } + } + + assert(bError == false ); + + SendBytesRaw(0, data, 8, reliableAndSequential); +} + +// This is sent by the client to the host, acting to undo a previous SendSmallId call +void DQRNetworkManager::SendUnassignSmallId(int playerIndex) +{ + LogCommentFormat( L"SendUnassignSmallId, channel %d\n", playerIndex); + // Send data with small Id setting mode - see full comment in DQRNetworkManagerEventHandlers::DataReceivedHandler + BYTE data[4]; + data[0] = 0x80 | ( playerIndex << 5 ); // Send 1 byte, internal mode + data[1] = 1; + data[2] = DQR_INTERNAL_UNASSIGN_SMALL_ID; // Internal data type + + SendBytesRaw(0, data, 3, true); +} + +// This method gets the player index within the session document for a particular small Id. +int DQRNetworkManager::GetSessionIndexForSmallId(unsigned char smallId) +{ + for( unsigned int i = 0; i < m_multiplayerSession->Members->Size; i++ ) + { + MXSM::MultiplayerSessionMember^ member = m_multiplayerSession->Members->GetAt(i); + BYTE smallIdMember = 0; + try + { + Windows::Data::Json::JsonObject^ customConstant = Windows::Data::Json::JsonObject::Parse(member->MemberCustomConstantsJson); + Windows::Data::Json::JsonValue^ customValue = customConstant->GetNamedValue(L"smallId"); + smallIdMember = (BYTE)(customValue->GetNumber()); + } + catch (Platform::COMException^ ex) + { + LogCommentWithError( L"Custom constant Parse/GetNamedValue failed", ex->HResult ); + } + if( smallIdMember == smallId ) + { + return i; + } + } + return -1; +} + +// This method gets the player index and small id for the host, which is sent with a small id that has 256 added to it +int DQRNetworkManager::GetSessionIndexAndSmallIdForHost(unsigned char *smallId) +{ + for( unsigned int i = 0; i < m_multiplayerSession->Members->Size; i++ ) + { + MXSM::MultiplayerSessionMember^ member = m_multiplayerSession->Members->GetAt(i); + int smallIdMember = 0; + try + { + Windows::Data::Json::JsonObject^ customConstant = Windows::Data::Json::JsonObject::Parse(member->MemberCustomConstantsJson); + Windows::Data::Json::JsonValue^ customValue = customConstant->GetNamedValue(L"smallId"); + smallIdMember = customValue->GetNumber(); + } + catch (Platform::COMException^ ex) + { + LogCommentWithError( L"Custom constant Parse/GetNamedValue failed", ex->HResult ); + } + if( smallIdMember > 255 ) + { + *smallId = (BYTE)(smallIdMember); + return i; + } + } + return -1; +} + +// Connection info is used to store the current state of a communcation endpoint, on both host & client +DQRConnectionInfo::DQRConnectionInfo() +{ + Reset(); +} + +void DQRConnectionInfo::Reset() +{ + m_currentChannel = 0; + m_internalFlag = false; + m_bytesRemaining = 0; + m_internalDataState = ConnectionState_InternalHeaderByte; + for( int i = 0; i < 4; i++ ) + { + m_smallId[i] = 0; + m_channelActive[i] = false; + } + m_state = ConnectionState_HeaderByte0; + m_initialPacketReceived = false; +} + +// This method allocates the next available small id, returning it as a json formatted named value so that it can be inserted as custom data in the session document +Platform::String^ DQRNetworkManager::GetNextSmallIdAsJsonString() +{ + Windows::Data::Json::JsonObject^ customConstant = ref new Windows::Data::Json::JsonObject(); + + // The host sends it small Id with 256 added to it, so we can determine which player is the host easily at the client side + int smallIdToSend = m_currentSmallId; + if( smallIdToSend == m_hostSmallId ) + { + smallIdToSend += 256; + } + customConstant->Insert(L"smallId", Windows::Data::Json::JsonValue::CreateNumberValue( smallIdToSend )); + m_sessionAddressFromSmallId[m_currentSmallId++] = 0; + + return customConstant->Stringify(); +} + +int DQRNetworkManager::_HostGameThreadProc( void* lpParameter ) +{ + DQRNetworkManager *pDQR = (DQRNetworkManager *)lpParameter; + return pDQR->HostGameThreadProc(); +} + +// This is the main asynchronous method that is called when hosting a game (initiated by calling ::createAndJoinSession). This is called for +// both online & offline games, and it must: +// (1) Create a new multiplayer session document, with active players for all local players starting the game +// (2) Create a new game party, with matching players in it (possibly clearing any existing party) +// (3) Get a device token for the host & assign to the session +// (4) Initialise the room sync data, and inform the game of all local players joining at this stage + +int DQRNetworkManager::HostGameThreadProc() +{ + Platform::String^ sessionName; + + // Get primary user that we are going to create the session with, and create an xbox live context from it + + WXS::User^ primaryUser = ProfileManager.GetUser(0); + m_primaryUser = primaryUser; + m_primaryUserXboxLiveContext = nullptr; + if( primaryUser == nullptr ) + { + SetState(DNM_INT_STATE_HOSTING_FAILED); + return 0; + } + + int localSessionAddress = 0; + + if( !m_isOfflineGame ) + { + MXS::XboxLiveContext^ primaryUserXBLContext = ref new MXS::XboxLiveContext(primaryUser); + m_primaryUserXboxLiveContext = primaryUserXBLContext; + if( primaryUserXBLContext == nullptr ) + { + SetState(DNM_INT_STATE_HOSTING_FAILED); + return 0; + } + + EnableDebugXBLContext(m_primaryUserXboxLiveContext); + + // Get a globally unique identifier to use as our session name that we are going to create + GUID sessionNameGUID; + CoCreateGuid( &sessionNameGUID ); + Platform::Guid sessionGuidName = Platform::Guid( sessionNameGUID ); + sessionName = RemoveBracesFromGuidString( sessionGuidName.ToString() ); + + MXSM::MultiplayerSession^ session = nullptr; + // Actually create the session (locally), using the primary player's context + try + { + session = ref new MXSM::MultiplayerSession( primaryUserXBLContext, + ref new MXSM::MultiplayerSessionReference( SERVICE_CONFIG_ID, MATCH_SESSION_TEMPLATE_NAME, sessionName ), + 0, // this means that it will use the maxMembers specified in the session template. + false, + MXSM::MultiplayerSessionVisibility::Open, + nullptr, + nullptr + ); + } + catch (Platform::COMException^ ex) + { + SetState(DNM_INT_STATE_HOSTING_FAILED); + return 0; + } + + // Set custom property with the game session data + session->SetSessionCustomPropertyJson( L"GameSessionData", Windows::Data::Json::JsonValue::CreateStringValue( base64_encode(m_customSessionData, m_customSessionDataSize ) )->Stringify() ); + + // More custom data, for the XUIDs of the players to match our room sync data. This isn't itself set up at t:his point but we know what is going in it. + Windows::Data::Json::JsonArray ^currentXuidArray = ref new Windows::Data::Json::JsonArray(); + for( int i = 0 ; i < MAX_LOCAL_PLAYER_COUNT; i++ ) + { + if( m_currentUserMask & ( 1 << i ) ) + { + WXS::User^ newUser = ProfileManager.GetUser(i); + if( newUser != nullptr ) + { + currentXuidArray->Append( Windows::Data::Json::JsonValue::CreateStringValue( newUser->XboxUserId ) ); + } + else + { + SetState(DNM_INT_STATE_HOSTING_FAILED); + return 0; + } + } + } + session->SetSessionCustomPropertyJson( L"RoomSyncData", currentXuidArray->Stringify() ); + + // Join session with the primary user for whom the session was created (via their xbox live context) + // user to store the small Id + m_hostSmallId = m_currentSmallId; + m_sessionAddressFromSmallId[m_hostSmallId] = 0; + + session->Join( GetNextSmallIdAsJsonString(), true ); + session->SetCurrentUserStatus( MXSM::MultiplayerSessionMemberStatus::Active ); + + // Get device ID for current user & set in the session + Platform::String^ secureDeviceAddress = WXN::SecureDeviceAddress::GetLocal()->GetBase64String(); + session->SetCurrentUserSecureDeviceAddressBase64( secureDeviceAddress ); + LogComment(L"Setting host secure device: " + secureDeviceAddress + L"\n"); + + // If there is a party currently, then remove all our local players from it so that we can start our own one + m_partyController->RefreshPartyView(); + WXM::PartyView^ partyView = m_partyController->GetPartyView(); + + if( partyView != nullptr ) + { + m_partyController->RemoveLocalUsersFromParty(primaryUser); + } + + m_partyController->AddLocalUsersToParty(m_currentUserMask, primaryUser); + partyView = m_partyController->GetPartyView(); + + // If there is no party by this stage, then we can't proceed. + if( partyView == nullptr ) + { + SetState(DNM_INT_STATE_HOSTING_FAILED); + return 0; + } + m_partyController->SetJoinability(m_listener->IsSessionJoinable()); + + // Add reservations for anyone in the party, who isn't the primary player. Just adding local players for now, but perhaps this should add + // other party members at this stage? + for ( WXM::PartyMember^ member : partyView->Members ) + { + if( member->IsLocal ) + { + if ( _wcsicmp(primaryUser->XboxUserId->Data(), member->XboxUserId->Data()) != 0) + { + session->AddMemberReservation( member->XboxUserId, GetNextSmallIdAsJsonString(), true ); + LogCommentFormat( L"Added %s to session\n", member->XboxUserId->Data()); + } + } + } + + // This is everything now set up locally as we want to start the session. Now attempt to write the session data to the server - will return a valid new session object if we succeeeded. + HRESULT hr = S_OK; + session = WriteSessionHelper( primaryUserXBLContext, session, MXSM::MultiplayerSessionWriteMode::UpdateOrCreateNew, hr ); + + // It is important to set the session as soon as we have written it, so that if we get any incoming events (such as the game session ready one) then we will be aware that we are actually already in the session + HandleSessionChange(session); + + // If this was successful, then do further set up of the session + if( session != nullptr ) + { + // Get reference to the current user within the session + MXSM::MultiplayerSessionMember^ hostMember = GetUserMemberInSession(primaryUser, session); + + // Set the device token of the host from this user (since we're hosting) + session->SetHostDeviceToken( hostMember->DeviceToken ); + + m_partyController->RegisterGamePlayersChangedEventHandler(); + + // Update session on the server + HRESULT hr = S_OK; + session = WriteSessionHelper( primaryUserXBLContext, session, MXSM::MultiplayerSessionWriteMode::UpdateExisting, hr ); + + if ( FAILED(hr) ) + { + app.DebugPrintf("Failed setting host device token"); + + SetState(DNM_INT_STATE_HOSTING_FAILED); + return 0; + } + + // Convert the session reference (in Microsoft::Xbox::Services::Multiplayer namespace) to Windows::Xbox::Multiplayer names space so we can use in the party system + WXM::MultiplayerSessionReference^ winSessionRef = ConvertToWindowsXboxMultiplayerSessionReference(session->SessionReference); + + // Register this multiplayer session as the current session for the party + auto registerSessionAsync = WXM::Party::RegisterGameSessionAsync(primaryUser, winSessionRef); + create_task(registerSessionAsync).then([this](task t) + { + try + { + t.get(); // if t.get() didn't throw, it succeeded + } + catch (Platform::COMException^ ex) + { + LogCommentWithError( L"RegisterGameSessionAsync failed", ex->HResult ); + + SetState(DNM_INT_STATE_HOSTING_FAILED); + } + }) + .wait(); + if( m_state == DNM_INT_STATE_HOSTING_FAILED) return 0; + + m_partyController->RefreshPartyView(); + + // We've now created the session with our local player in it, and reserved slots for everyone else in the party. We've also set the party to say that + // the current game the party are playing is this session. We can now request that the reserved player's be pulled into the game. For people not currently running the + // game, this will ask them if they want to start playing, and for people already in the title it will send an even to say that the game is ready. + auto pullPlayersAsync = WXM::Party::PullReservedPlayersAsync(primaryUser, winSessionRef); + create_task(pullPlayersAsync).then([this](task t) + { + try + { + t.get(); // if t.get() didn't throw, it succeeded + } + catch (Platform::COMException^ ex) + { + LogCommentWithError( L"PullReservedPlayersAsync failed", ex->HResult ); + + // SetState(DNM_INT_STATE_HOSTING_FAILED); // This does seem to fail (harmlessly?) with a code of 0x87cc0008 sometimes + } + }) + .wait(); + if( m_state == DNM_INT_STATE_HOSTING_FAILED) return 0; + + sockaddr_in6 localSocketAddressStorage; + + ZeroMemory(&localSocketAddressStorage, sizeof(localSocketAddressStorage)); + + localSocketAddressStorage.sin6_family = AF_INET6; + localSocketAddressStorage.sin6_port = htons(m_associationTemplate->AcceptorSocketDescription->BoundPortRangeLower); + + memcpy(&localSocketAddressStorage.sin6_addr, &in6addr_any, sizeof(in6addr_any)); + + m_localSocketAddress = Platform::ArrayReference(reinterpret_cast(&localSocketAddressStorage), sizeof(localSocketAddressStorage)); + + // This shouldn't ever happen, but seems worth checking that we don't have a pre-existing session in case there's any way to get here with one already running + if( m_XRNS_Session ) + { + RTS_Terminate(); + do + { + Sleep(20); + } while ( m_XRNS_Session != nullptr ); + } + + // Start a new session (this actually happens in the RTS processing thread), and wait until it exists + RTS_StartHost(); + do + { + Sleep(20); + } while ( m_XRNS_Session == nullptr ); + + // Set any other local players that we added as reserved in the session, to be active. This must be done by getting and writing the multiplayer session + // document from each player's xbox live context in turn + + for( int i = 1; i < 4; i++ ) + { + if( m_currentUserMask & ( 1 << i ) ) + { + WXS::User^ extraUser = ProfileManager.GetUser(i); + if( extraUser == nullptr ) + { + SetState(DNM_INT_STATE_HOSTING_FAILED); + return 0; + } + MXS::XboxLiveContext^ extraUserXBLContext = ref new MXS::XboxLiveContext(extraUser); + if( extraUserXBLContext == nullptr ) + { + SetState(DNM_INT_STATE_HOSTING_FAILED); + return 0; + } + + auto asyncOp = extraUserXBLContext->MultiplayerService->GetCurrentSessionAsync( session->SessionReference ); + create_task(asyncOp).then([this, extraUserXBLContext, &session] (task t) + { + try + { + MXSM::MultiplayerSession^ currentSession = t.get(); + + currentSession->SetCurrentUserStatus(MXSM::MultiplayerSessionMemberStatus::Active); + HRESULT hr = S_OK; + session = WriteSessionHelper(extraUserXBLContext, currentSession, MXSM::MultiplayerSessionWriteMode::UpdateExisting, hr); + } + catch ( Platform::COMException^ ex ) + { + } + }).wait(); + } + } + + HandleSessionChange(session); + } + else + { + app.DebugPrintf("Error creating session"); + SetState(DNM_INT_STATE_HOSTING_FAILED); + return 0; + } + m_XRNS_LocalAddress = m_XRNS_Session->LocalSessionAddress; + m_XRNS_OldestAddress = m_XRNS_Session->OldestSessionAddress; + localSessionAddress = m_XRNS_Session->LocalSessionAddress; + } + else + { + m_hostSmallId = m_currentSmallId; + // Offline game - get small id incremented to the same value that it would have ended up with + for( int i = 0; i < 4; i++ ) + { + if( m_currentUserMask & ( 1 << i ) ) + { + m_currentSmallId++; + } + } + } + + // At this stage, set the local players up. We know we'll have created these with smallIds from m_hostSmallId (for the host) to a max of m_hostSmallId+3 for the other local players + int smallId = m_hostSmallId; + for( int i = 0; i < 4; i++ ) + { + // If user is present in mask and currently signed in + if( m_currentUserMask & ( 1 << i ) && ProfileManager.IsSignedIn(i)) + { + auto user = ProfileManager.GetUser(i); + wstring displayName = ProfileManager.GetDisplayName(i); + + DQRNetworkPlayer* pPlayer = new DQRNetworkPlayer(this, ( ( smallId == m_hostSmallId ) ? DQRNetworkPlayer::DNP_TYPE_HOST : DQRNetworkPlayer::DNP_TYPE_LOCAL ), true, i, localSessionAddress); + pPlayer->SetSmallId(smallId); + pPlayer->SetName(user->DisplayInfo->Gamertag->Data()); + pPlayer->SetDisplayName(displayName); + pPlayer->SetUID(PlayerUID(user->XboxUserId->Data())); + + AddRoomSyncPlayer( pPlayer, localSessionAddress, i); + + m_listener->HandlePlayerJoined(pPlayer); + + smallId++; + } + } + + SetState(DNM_INT_STATE_HOSTING_WAITING_TO_PLAY); + + return 0; +} + +int DQRNetworkManager::_LeaveRoomThreadProc( void* lpParameter ) +{ + + DQRNetworkManager *pDQR = (DQRNetworkManager *)lpParameter; + return pDQR->LeaveRoomThreadProc(); +} + +int DQRNetworkManager::LeaveRoomThreadProc() +{ + WXS::User^ primaryUser = ProfileManager.GetUser(0, true); + + LogComment(L"LeaveRoomThreadProc"); + + if( !m_isOfflineGame && m_multiplayerSession != nullptr ) + { + // If we are hosting, then we need to disassociate the gaming session from the party. We also need to make sure that we don't subscribe to gameplayer events anymore + // or else if we subsequently become a client in another game, things will get confused + if( m_isHosting ) + { + m_partyController->DisassociateSessionFromParty( m_multiplayerSession->SessionReference ); + + m_partyController->UnregisterGamePlayersEventHandler(); + } + + // Remove local players from the party + m_partyController->RemoveLocalUsersFromParty(primaryUser, m_currentUserMask, m_multiplayerSession->SessionReference); + + // Request RTS to be terminated + RTS_Terminate(); + + // Now leave the game session. We need to do this for each player in turn, writing each time + bool bError = false; + for( int i = 0; i < 4; i++ ) + { + if( m_currentUserMask & ( 1 << i ) ) + { + LogCommentFormat(L"DQRNetworkManager::LeaveRoomThreadProc: Attempting to remove player %d from session",i); + WXS::User^ leavingUser = ProfileManager.GetUser(i); + if( leavingUser == nullptr ) + { + bError = true; + continue; + } + if( m_chat ) + { + m_chat->RemoveLocalUser(leavingUser); + } + + MXS::XboxLiveContext^ leavingUserXBLContext = ref new MXS::XboxLiveContext(leavingUser); + if( leavingUserXBLContext == nullptr ) + { + bError = true; + continue; + } + + auto asyncOp = leavingUserXBLContext->MultiplayerService->GetCurrentSessionAsync( m_multiplayerSession->SessionReference ); + create_task(asyncOp).then([this, leavingUserXBLContext,&bError] (task t) + { + try + { + MXSM::MultiplayerSession^ currentSession = t.get(); + + if (currentSession != nullptr) + { + currentSession->Leave(); + HRESULT hr = S_OK; + WriteSessionHelper(leavingUserXBLContext, currentSession, MXSM::MultiplayerSessionWriteMode::UpdateExisting, hr); + } + else + { + // Specific error case where session is gone, this generally happens if all players have left (e.g. party of one and player signs out) + app.DebugPrintf("DQRNetworkManager::LeaveRoomThreadProc: Error removing a player from the session, session was null (user probably signed out)"); + } + } + catch ( Platform::COMException^ ex ) + { + bError = true; + } + }).wait(); + } + } + + if ( bError ) + { + app.DebugPrintf("DQRNetworkManager::LeaveRoomThreadProc: Error removing a player from the session"); + assert(true); + } + } + + ProfileManager.CompleteDeferredSignouts(); + app.DebugPrintf("DQRNetworkManager::LeaveRoomThreadProc: Completing deferred sign out"); + ProfileManager.SetDeferredSignoutEnabled(false); + + m_multiplayerSession = nullptr; + m_currentUserMask = 0; + m_joinSessionUserMask = 0; + UnflagInvitedToFullSession(); + + SetState(DNM_INT_STATE_ENDING); + + return 0; +} + +int DQRNetworkManager::_TidyUpJoinThreadProc( void* lpParameter ) +{ + + DQRNetworkManager *pDQR = (DQRNetworkManager *)lpParameter; + return pDQR->TidyUpJoinThreadProc(); +} + +// This method is called when joining the game fails in some situations, ie when we attempted to join with a +// set of players and not all managed to get into the session. Tidies things up by removing any players that +// Did get into the session, and removing any players we added to the party. +int DQRNetworkManager::TidyUpJoinThreadProc() +{ + WXS::User^ primaryUser = ProfileManager.GetUser(0); + + LogComment(L"TidyUpJoinThreadProc"); + + if( primaryUser != nullptr ) + { + // Remove any local users at all who are in the party - but first get a session reference from the party whilst we still have it + m_partyController->RefreshPartyView(); + MXSM::MultiplayerSessionReference ^sessionRef = m_partyController->GetGamePartySessionReference(); + m_partyController->RemoveLocalUsersFromParty(primaryUser); + + if( sessionRef != nullptr ) + { + // Now leave the game session. We need to do this for each player in turn, writing each time. Consider that any of the joining + // members *may* have a slot (reserved or active) depending on how far progressed the joining got. + bool bError = false; + + // We can fail to join at various points, and in at least one case (if it is down to RUDP unreliable packets timing out) then we don't have m_joinSessionUserMask bits set any more, + // but we Do have m_currentUserMask set. Any of these should be considered users we should be attempting to remove from the session. + int removeSessionMask = m_joinSessionUserMask | m_currentUserMask; + for( int i = 0; i < 4; i++ ) + { + if( removeSessionMask & ( 1 << i ) ) + { + LogCommentFormat(L"Attempting to remove player %d from session",i); + WXS::User^ leavingUser = ProfileManager.GetUser(i); + if( leavingUser == nullptr ) + { + bError = true; + continue; + } + MXS::XboxLiveContext^ leavingUserXBLContext = ref new MXS::XboxLiveContext(leavingUser); + if( leavingUserXBLContext == nullptr ) + { + bError = true; + continue; + } + + EnableDebugXBLContext(leavingUserXBLContext); + + auto asyncOp = leavingUserXBLContext->MultiplayerService->GetCurrentSessionAsync( sessionRef ); + create_task(asyncOp).then([this, leavingUser, leavingUserXBLContext,&bError] (task t) + { + try + { + MXSM::MultiplayerSession^ currentSession = t.get(); + + if( currentSession ) + { + bool bFound = false; + for( int i = 0; i < currentSession->Members->Size; i++ ) + { + if( currentSession->Members->GetAt(i)->XboxUserId == leavingUser->XboxUserId ) + { + bFound = true; + break; + } + } + + if( bFound ) + { + currentSession->Leave(); + HRESULT hr = S_OK; + WriteSessionHelper(leavingUserXBLContext, currentSession, MXSM::MultiplayerSessionWriteMode::UpdateExisting, hr); + } + } + } + catch ( Platform::COMException^ ex ) + { + bError = true; + } + }).wait(); + } + } + + if ( bError ) + { + app.DebugPrintf("Error removing a player from the session"); + assert(true); + } + } + } + + m_multiplayerSession = nullptr; + m_currentUserMask = 0; + m_joinSessionUserMask = 0; + + // Fixing up things from joining needs to go straight from joining -> idle to be properly detected as a failed join by the higher-level networking systems + SetState(DNM_INT_STATE_IDLE); + + return 0; +} + +int DQRNetworkManager::_UpdateCustomSessionDataThreadProc( void* lpParameter ) +{ + + DQRNetworkManager *pDQR = (DQRNetworkManager *)lpParameter; + return pDQR->UpdateCustomSessionDataThreadProc(); +} + +// This method is called to updat the custom session data associated with the multiplayer session. This is done only on the host. The custom data is specified +// when we create the game session (when calling CreateAndJoinSession) as a region of memory so that this layer doesn't have to be concerned with what it +// represents, however we use it to synchronise a GameSessionData structure containing details of the current game session. This data is base 64 encoded +// and then put in the session document as a custom value as a json string name/value pair. +int DQRNetworkManager::UpdateCustomSessionDataThreadProc() +{ + LogComment(L"Starting thread to update custom data"); + WXS::User^ primaryUser = ProfileManager.GetUser(0); + + if( primaryUser == nullptr ) + { + return 0; + } + MXS::XboxLiveContext^ primaryUserXBLContext = ref new MXS::XboxLiveContext(primaryUser); + if( primaryUserXBLContext == nullptr ) + { + return 0; + } + + MXSM::MultiplayerSession^ session = nullptr; + + auto multiplayerSessionAsync = primaryUserXBLContext->MultiplayerService->GetCurrentSessionAsync( m_multiplayerSession->SessionReference ); + create_task(multiplayerSessionAsync).then([&session,this](task t) + { + try + { + session = t.get(); // if t.get() didn't throw, it succeeded + } + catch (Platform::COMException^ ex) + { + LogCommentWithError( L"MultiplayerSession failed", ex->HResult ); + } + }) + .wait(); + + if( session != nullptr ) + { + // Set custom property with the game session data + session->SetSessionCustomPropertyJson( L"GameSessionData", Windows::Data::Json::JsonValue::CreateStringValue( base64_encode(m_customSessionData, m_customSessionDataSize ) )->Stringify() ); + + // Update XUIDs from room sync data which we also have as custom data + EnterCriticalSection(&m_csRoomSyncData); + Windows::Data::Json::JsonArray ^currentXuidArray = ref new Windows::Data::Json::JsonArray(); + for( int i = 0 ; i < m_roomSyncData.playerCount; i++ ) + { + currentXuidArray->Append( Windows::Data::Json::JsonValue::CreateStringValue( ref new Platform::String(m_roomSyncData.players[i].m_XUID ) ) ); + } + session->SetSessionCustomPropertyJson( L"RoomSyncData", currentXuidArray->Stringify() ); + LeaveCriticalSection(&m_csRoomSyncData); + + HRESULT hr = S_OK; + WriteSessionHelper( primaryUserXBLContext, session, MXSM::MultiplayerSessionWriteMode::UpdateExisting, hr ); + + // If we didn't succeed, then retry later + if( hr != S_OK ) + { + if( m_customDataDirtyUpdateTicks == 0 ) + { + LogCommentFormat(L"Error updating custom data 0x%x, will retry", hr); + m_customDataDirtyUpdateTicks = 20; + } + } + } + + LogComment(L"Ending thread to update custom data"); + + return 0; +} + +int DQRNetworkManager::_CheckInviteThreadProc(void* lpParameter) +{ + DQRNetworkManager *pDQR = (DQRNetworkManager *)lpParameter; + return pDQR->CheckInviteThreadProc(); +} + +int DQRNetworkManager::CheckInviteThreadProc() +{ + for( int i = 4; i < 12; i++ ) + { + WXS::User^ anyUser = InputManager.GetUserForGamepad(i); + if( anyUser ) + { + m_partyController->CheckPartySessionFull(anyUser); + return 0; + } + } + return 0; +} + +// This method is called by the the party controller if a new party is found for a local player. This will happen after the party system +// has called HandlePlayerRemovedFromParty, if the player is being removed from one party only to be placed in another. If Only +// HandlePlayerRemovedFromParty is called (with no following HandleNewPartyFoundForPlayer), then we must assume that the player was +// just removed from a party, and Isn't moving to another party. We try to differentiate between these two events by allowing a window of time +// to pass after a user is removed from a party before processing it. +void DQRNetworkManager::HandleNewPartyFoundForPlayer() +{ + LogCommentFormat(L"HandleNewPartyFoundForPlayer called after %d ms\n", System::currentTimeMillis() - m_playersLeftPartyTime); + m_playersLeftParty = 0; +} + +void DQRNetworkManager::HandlePlayerRemovedFromParty(int playerMask) +{ + if( m_state == DNM_INT_STATE_PLAYING ) + { + if( m_isHosting ) + { + // We should check that they're still here, they might already have left + for( int i = 0; i < MAX_LOCAL_PLAYER_COUNT; i++ ) + { + if( playerMask & ( 1 << i ) ) + { + if (!ProfileManager.IsSignedIn(i)) + { + // Player is already gone so remove them from the mask + playerMask &= ~(1 << i); + } + } + } + + LogCommentFormat(L"HandlePlayerRemovedFromParty called mask %d\n", playerMask); + m_playersLeftParty |= playerMask; + m_playersLeftPartyTime = System::currentTimeMillis(); + + // Check for forced sign out + CheckForcedSignOut(); + } + else + { + // As a client, we don't have any messy changing to offline game or saving etc. to do, so we can respond immediately to leaving the party + if( playerMask & 1 ) + { + DQRNetworkManager::LogComment(L"Primary player on this system has left the party - leaving game\n"); + app.SetDisconnectReason(DisconnectPacket::eDisconnect_ExitedGame); + LeaveRoom(); + } + else + { + // Secondary player(s) leaving, just remove as if they had chosen to exit themselves from the game + for( int i = 0; i < MAX_LOCAL_PLAYERS; i++ ) + { + if( playerMask & ( 1 << i ) ) + { + RemoveLocalPlayerByUserIndex(i); + } + } + } + } + } + else + { + LogComment(L"HandlePlayerRemovedFromParty called, ignoring as not in state DNM_INT_STATE_PLAYING\n"); + } +} + +// Method called by the DQRNetworkManager when we need to inform the chat system that a new player has been added to the game. We don't do anything +// directly here, as this ends up getting called whilst we are in a handler for receiving network data, and telling the chat system that a player +// has joined causes it to direct attempt to send data on the network, causing us to lock up. This is processed in the tick instead. +void DQRNetworkManager::ChatPlayerJoined(int idx) +{ + EnterCriticalSection(&m_csVecChatPlayers); + m_vecChatPlayersJoined.push_back(idx); + LeaveCriticalSection(&m_csVecChatPlayers); +} + +bool DQRNetworkManager::IsReadyToPlayOrIdle() +{ + return (( m_state == DNM_INT_STATE_HOSTING_WAITING_TO_PLAY ) || ( m_state == DNM_INT_STATE_PLAYING ) || ( m_state == DNM_INT_STATE_IDLE ) ); +} + +void DQRNetworkManager::StartGame() +{ + SetState( DNM_INT_STATE_STARTING); + SetState( DNM_INT_STATE_PLAYING); +} + +// Removes all local players from a network game (aysnchronously) and leaves the game +void DQRNetworkManager::LeaveRoom() +{ + m_playersLeftParty = 0; + if( ( m_state == DNM_INT_STATE_HOSTING_WAITING_TO_PLAY ) || + ( m_state == DNM_INT_STATE_STARTING ) || + ( m_state == DNM_INT_STATE_PLAYING ) ) + { + SetState(DNM_INT_STATE_LEAVING); + + // Empty out the room of players & notify the game (needs separate loops for each as HandlePlayerLeaving checks the players) + for( int i = 0; i < m_roomSyncData.playerCount; i++ ) + { + m_listener->HandlePlayerLeaving(m_players[i]); + } + + for( int i = 0; i < m_roomSyncData.playerCount; i++ ) + { + delete m_players[i]; + m_players[i] = NULL; + } + memset(&m_roomSyncData, 0, sizeof(m_roomSyncData)); + m_displayNames.clear(); + + m_LeaveRoomThread = new C4JThread(&DQRNetworkManager::_LeaveRoomThreadProc, this, "Leave room"); + m_LeaveRoomThread->Run(); + } + else + { + SetState(DNM_INT_STATE_IDLE); + } +} + +void DQRNetworkManager::TidyUpFailedJoin() +{ + m_TidyUpJoinThread = new C4JThread(&DQRNetworkManager::_TidyUpJoinThreadProc, this, "Tidying up failed join"); + m_TidyUpJoinThread->Run(); +} + +// This is called when we get notification that the user has accepted an invite toast - this is a good point to check the session that the party is associated with, +// and see if it is full of people that aren't us +void DQRNetworkManager::SetInviteReceivedFlag() +{ + m_inviteReceived = true; +} + +// The "Party process" is picked up in the tick and used to join games from invites etc. This method is static so it can be called from bits of the game that aren't really tied in with the network libs. +void DQRNetworkManager::SetPartyProcessJoinParty() +{ + m_partyProcess = DQRNetworkManager::DNM_PARTY_PROCESS_JOIN_PARTY; +} + +// The "Party process" is picked up in the tick and used to join games from invites etc. This method is static so it can be called from bits of the game that aren't really tied in with the network libs. +void DQRNetworkManager::SetPartyProcessJoinSession(int bootUserIndex, Platform::String^ bootSessionName, Platform::String^ bootServiceConfig, Platform::String^ bootSessionTemplate) +{ + if( s_pDQRManager ) + { + // Don't do anything if we are already in this session + if( s_pDQRManager->m_multiplayerSession ) + { + if( s_pDQRManager->m_multiplayerSession->SessionReference->SessionName == bootSessionName ) + { + return; + } + } + } + m_bootUserIndex = bootUserIndex; + m_bootSessionName = bootSessionName->Data(); + m_bootServiceConfig = bootServiceConfig->Data(); + m_bootSessionTemplate = bootSessionTemplate->Data(); + m_partyProcess = DQRNetworkManager::DNM_PARTY_PROCESS_JOIN_SPECIFIED; +} + +// Brings up the system GUI so that invites can be sent to invite friends to join the current game party +void DQRNetworkManager::SendInviteGUI(int quadrant) +{ + Windows::Xbox::UI::SystemUI::ShowSendInvitesAsync(ProfileManager.GetUser(quadrant)); +} + +bool DQRNetworkManager::IsAddingPlayer() +{ + return ( m_addLocalPlayerState != DNM_ADD_PLAYER_STATE_IDLE ); +} + +// Attempt to join a party that we have found, for a given set of local players. This adds the specified users to the +// party, and then we have to wait for the host to detect this change, and (hopefully) reserve slots for us in the game session. When our +// slots are reserved, we will receive a game session ready notification through the party manager & can take things from there. +bool DQRNetworkManager::JoinPartyFromSearchResult(SessionSearchResult *searchResult, int playerMask) +{ + // Assume that primary player is always player 0 + if( ( playerMask & 1 ) == 0 ) + { + return false; + } + + // Gather set of XUIDs for the players that we are joining with + for( int i = 0; i < MAX_LOCAL_PLAYER_COUNT; i++ ) + { + if( playerMask & ( 1 << i ) ) + { + WXS::User^ user = ProfileManager.GetUser(i); + if( user == nullptr ) + { + return false; + } + m_joinSessionXUIDs[i] = user->XboxUserId; + } + else + { + m_joinSessionXUIDs[i] = nullptr; + } + } + + // Set up primary user & context to be used generally by other things once we are in the game + m_primaryUser = ProfileManager.GetUser(0); + if( m_primaryUser == nullptr ) + { + return false; + } + + m_primaryUserXboxLiveContext = ref new MXS::XboxLiveContext(m_primaryUser); + if( m_primaryUserXboxLiveContext == nullptr ) + { + return false; + } + + m_currentUserMask = 0; + m_joinSessionUserMask = playerMask; + m_isInSession = true; + m_isOfflineGame = false; + + m_startedWaitingForReservationsTime = System::currentTimeMillis(); + SetState(DNM_INT_STATE_JOINING_WAITING_FOR_RESERVATIONS); + + // There is a small window that we currently allow cancelling + m_cancelJoinFromSearchResult = false; + + // Before we join the party, check if any of the joining players are in the session already, and remove. Joining the game cleanly depends + // on the host detecting us joining the party and then adding us (as reserved) to the session so it can pull us in, which it can't do + // if we are already in the session + + MXSM::MultiplayerSessionReference ^sessionRef = ref new MXSM::MultiplayerSessionReference(SERVICE_CONFIG_ID, MATCH_SESSION_TEMPLATE_NAME, ref new Platform::String(searchResult->m_sessionName.c_str())); + + bool shownCancelScreen = false; + if( sessionRef != nullptr ) + { + // Allow 2 seconds before we let the player cancel + __int64 allowCancelTime = System::currentTimeMillis() + (1000 * 2); + + // Now leave the game session. We need to do this for each player in turn, writing each time. Consider that any of the joining + // members *may* have a slot (reserved or active) depending on how far progressed the joining got. + bool bError = false; + for( int i = 0; i < 4; i++ ) + { + if( playerMask & ( 1 << i ) ) + { + LogCommentFormat(L"Attempting to remove player %d from session",i); + WXS::User^ leavingUser = ProfileManager.GetUser(i); + if( leavingUser == nullptr ) + { + bError = true; + continue; + } + MXS::XboxLiveContext^ leavingUserXBLContext = ref new MXS::XboxLiveContext(leavingUser); + if( leavingUserXBLContext == nullptr ) + { + bError = true; + continue; + } + + EnableDebugXBLContext(leavingUserXBLContext); + + auto asyncOp = leavingUserXBLContext->MultiplayerService->GetCurrentSessionAsync( sessionRef ); + auto ccTask = create_task(asyncOp).then([this, leavingUser, leavingUserXBLContext,&bError] (task t) + { + try + { + MXSM::MultiplayerSession^ currentSession = t.get(); + + if( currentSession == nullptr ) + { + bError = true; + } + else + { + bool bFound = false; + for( int i = 0; i < currentSession->Members->Size; i++ ) + { + if( currentSession->Members->GetAt(i)->XboxUserId == leavingUser->XboxUserId ) + { + bFound = true; + break; + } + } + + if( bFound ) + { + currentSession->Leave(); + HRESULT hr = S_OK; + WriteSessionHelper(leavingUserXBLContext, currentSession, MXSM::MultiplayerSessionWriteMode::UpdateExisting, hr); + } + } + } + catch ( Platform::COMException^ ex ) + { + bError = true; + } + }); + + while(!ccTask.is_done()) + { + // Check for being disconnected from the network + if(!ProfileManager.IsSignedInLive(i) || m_cancelJoinFromSearchResult) + { + asyncOp->Cancel(); + bError = true; + break; + } + + __int64 currentTime = System::currentTimeMillis(); + if( currentTime > allowCancelTime) + { + shownCancelScreen = true; + + ConnectionProgressParams *param = new ConnectionProgressParams(); + param->iPad = 0; + param->stringId = -1; + param->showTooltips = true; + param->cancelFunc = &g_NetworkManager.CancelJoinGame; + param->cancelFuncParam = &g_NetworkManager; + + // Show a progress spinner so that we can cancel the join. + ui.NavigateToScene(0, eUIScene_ConnectingProgress, param); + + allowCancelTime = LONGLONG_MAX; + } + + // Tick some simple things + ProfileManager.Tick(); + StorageManager.Tick(); + InputManager.Tick(); + RenderManager.Tick(); + ui.tick(); + ui.render(); + RenderManager.Present(); + } + // Check for being disconnected from the network + if(!ProfileManager.IsSignedInLive(i)) + { + bError = true; + break; + } + } + } + + if ( bError && !m_cancelJoinFromSearchResult ) + { + app.DebugPrintf("Error removing a player from the session"); + assert(true); + } + } + + if(shownCancelScreen) + { + ui.NavigateToScene(0,eUIScene_Timer); + } + + if(m_cancelJoinFromSearchResult) + { + SetState(DNM_INT_STATE_IDLE); + m_cancelJoinFromSearchResult= false; + + return false; + } + + m_cancelJoinFromSearchResult = false; + + + // Now we join the party with each of joining players, and then wait to be informed of our reserved slots + for( int i = 0; i < MAX_LOCAL_PLAYER_COUNT; i++ ) + { + if( playerMask & ( 1 << i ) ) + { + WXS::User^ user = ProfileManager.GetUser(i); + + auto joinPartyAsync = WXM::Party::JoinPartyByIdAsync(user, ref new Platform::String(searchResult->m_partyId.c_str())); + auto ccTask = create_task(joinPartyAsync).then([this](task t) + { + try + { + t.get(); // if t.get() didn't throw, it succeeded + } + catch (Platform::COMException^ ex) + { + LogCommentWithError( L"JoinPartyByIdAsync failed", ex->HResult ); + SetState(DNM_INT_STATE_JOINING_FAILED); + } + }); + + + while(!ccTask.is_done()) + { + // Check for being disconnected from the network + if(!ProfileManager.IsSignedInLive(i)) + { + joinPartyAsync->Cancel(); + break; + } + + // Tick some simple things + ProfileManager.Tick(); + StorageManager.Tick(); + InputManager.Tick(); + RenderManager.Tick(); + ui.tick(); + ui.render(); + RenderManager.Present(); + } + // Check for being disconnected from the network + if(!ProfileManager.IsSignedInLive(i)) + { + break; + } + } + } + + return ( m_state == DNM_INT_STATE_JOINING_WAITING_FOR_RESERVATIONS ); +} + +void DQRNetworkManager::CancelJoinPartyFromSearchResult() +{ + m_cancelJoinFromSearchResult = true; +} + +// This method attempts to find the local player within a party that would be most appropriate to act as our primary player when joining the game. +bool DQRNetworkManager::GetBestPartyUserIndex() +{ + bool playerFound = false; + + // Use context from any user at all for this + WXS::User ^anyUser = nullptr; + if( WXS::User::Users->Size > 0 ) + { + anyUser = WXS::User::Users->GetAt(0); + } + if( anyUser == nullptr ) return 0; + MXS::XboxLiveContext^ xboxLiveContext = ref new MXS::XboxLiveContext(anyUser); + + m_partyController->RefreshPartyView(); + MXSM::MultiplayerSessionReference ^sessionRef = m_partyController->GetGamePartySessionReference(); + if( sessionRef != nullptr ) + { + auto asyncOp = xboxLiveContext->MultiplayerService->GetCurrentSessionAsync( sessionRef ); + create_task(asyncOp) + .then([this,&playerFound] (task t) + { + try + { + Microsoft::Xbox::Services::Multiplayer::MultiplayerSession^ session = t.get(); + + int playerIdx = -1; + for( int i = 0; i < session->Members->Size; i++ ) // First pass through to see if we've a signed in user that is in the session we've been added to + { + MXSM::MultiplayerSessionMember^ member = session->Members->GetAt(i); + for( int j = 0; j < MAX_LOCAL_PLAYERS; j++ ) + { + WXS::User ^user = ProfileManager.GetUser(j); + if( user != nullptr ) + { + if( user->XboxUserId == member->XboxUserId ) + { + DQRNetworkManager::LogCommentFormat(L"Found already signed in player %s to act as invite recipient",member->XboxUserId->Data()); + playerIdx = j; + playerFound = true; + break; + } + } + } + } + if( playerIdx == -1 ) // If nothing found, second pass through to attempt to find a controller that matches + { + for( int i = 0; i < session->Members->Size; i++ ) + { + MXSM::MultiplayerSessionMember^ member = session->Members->GetAt(i); + for( int j = 4; j < 12; j++ ) + { + WXS::User ^user = InputManager.GetUserForGamepad(j); + if( user != nullptr ) + { + if( user->XboxUserId == member->XboxUserId ) + { + DQRNetworkManager::LogCommentFormat(L"Found controller %d for %s (session idx %d) to act as invite recipient (%s)",j,member->XboxUserId->Data(),i, user->XboxUserId->Data()); + playerIdx = ProfileManager.AddGamepadToGame(j); + if( playerIdx != -1 ) + { + playerFound = true; + DQRNetworkManager::LogCommentFormat(L"Assigned controller to user index %d",playerIdx); + break; + } + } + } + } + } + } + } + catch ( Platform::COMException^ ex ) + { + } + }).wait(); + } + return playerFound; +} + +// Request the GameDisplayName for this player asynchronously +void DQRNetworkManager::RequestDisplayName(DQRNetworkPlayer *player) +{ + if (player->IsLocal()) + { + // Player is local so we can just ask profile manager + SetDisplayName(player->GetUID(), ProfileManager.GetDisplayName(player->GetLocalPlayerIndex())); + } + else + { + // Player is remote so we need to do an async request + PlayerUID xuid = player->GetUID(); + ProfileManager.GetProfile(xuid, &GetProfileCallback, this); + } +} + +void DQRNetworkManager::GetProfileCallback(LPVOID pParam, Microsoft::Xbox::Services::Social::XboxUserProfile^ profile) +{ + DQRNetworkManager *dqnm = (DQRNetworkManager *)pParam; + dqnm->SetDisplayName(PlayerUID(profile->XboxUserId->Data()), profile->GameDisplayName->Data()); +} + +// Set player display name +void DQRNetworkManager::SetDisplayName(PlayerUID xuid, wstring displayName) +{ + EnterCriticalSection(&m_csRoomSyncData); + for (int i = 0; i < m_roomSyncData.playerCount; i++) + { + if( m_players[i] ) + { + if (m_players[i]->GetUID() == xuid) + { + // Set player display name + m_players[i]->SetDisplayName(displayName); + // Add display name to map + m_displayNames.insert(std::make_pair(m_players[i]->m_name, m_players[i]->m_displayName)); + } + } + } + LeaveCriticalSection(&m_csRoomSyncData); +} + +void DQRNetworkManager::CheckForcedSignOut() +{ + auto asyncOp = m_primaryUserXboxLiveContext->MultiplayerService->GetCurrentSessionAsync(m_multiplayerSession->SessionReference); + create_task(asyncOp) + .then([this] (task t) + { + try + { + t.get(); + } + catch (Platform::COMException^ ex) + { + if (ex->HResult == 0x8015DC16) + { + m_handleForcedSignOut = true; + } + } + }); +} + +void DQRNetworkManager::HandleForcedSignOut() +{ + // Bin the session (we can't use it anymore) + m_multiplayerSession = nullptr; + + // Bin the party + m_partyController->SetPartyView(nullptr); + + // Forced sign out destroyed the party so time to go + app.DebugPrintf("DQRNetworkManager::HandleForcedSignOut: Forced sign out destroyed the party, aborting game\n"); + + if (IsInSession() && !g_NetworkManager.IsLeavingGame()) + { + // Exit world + app.SetAction(0, eAppAction_ExitWorld); + } + else + { + app.DebugPrintf("DQRNetworkManager::HandleForcedSignOut: Already leaving the game, skipping abort\n"); + } +} diff --git a/Minecraft.Client/Durango/Network/DQRNetworkManager.h b/Minecraft.Client/Durango/Network/DQRNetworkManager.h new file mode 100644 index 00000000..5f7b8d90 --- /dev/null +++ b/Minecraft.Client/Durango/Network/DQRNetworkManager.h @@ -0,0 +1,582 @@ +#pragma once + +#include "DQRNetworkPlayer.h" +#include "..\Minecraft.World\C4JThread.h" +#include + +class IDQRNetworkManagerListener; +class PartyController; + +class DQRNetworkManager; +class ChatIntegrationLayer; + +namespace MXS = Microsoft::Xbox::Services; +namespace MXSM = Microsoft::Xbox::Services::Multiplayer; +namespace MXSS = Microsoft::Xbox::Services::Social; +namespace WXM = Windows::Xbox::Multiplayer; +namespace WXN = Windows::Xbox::Networking; +namespace WXNRs = Windows::Xbox::Networking::RealtimeSession; +namespace WFC = Windows::Foundation::Collections; + +#define MATCH_SESSION_TEMPLATE_NAME L"PeerToHostTemplate" +#define MAX_PLAYERS_IN_TEMPLATE 8 + +using namespace std; + +ref class DQRNetworkManagerEventHandlers sealed +{ +internal: + DQRNetworkManagerEventHandlers(DQRNetworkManager *pDQRNet); +public: + void Setup(WXNRs::Session^ session); + void Pulldown(WXNRs::Session^ session); + + void DataReceivedHandler(Platform::Object^ session, WXNRs::DataReceivedEventArgs^ args); + void SessionAddressDataChangedHandler(Platform::Object^ session, WXNRs::SessionAddressDataChangedEventArgs^ args); + void SessionStatusUpdateHandler(Platform::Object^ session, WXNRs::SessionStatusUpdateEventArgs^ args); + void AddedSessionAddressHandler(Platform::Object^ session, WXNRs::AddedSessionAddressEventArgs^ args); + void RemovedSessionAddressHandler(Platform::Object^ session, WXNRs::RemovedSessionAddressEventArgs^ args); + void GlobalSessionDataChangedHandler(Platform::Object^ session, WXNRs::GlobalSessionDataChangedEventArgs^ args); + +private: + Windows::Foundation::EventRegistrationToken m_dataReceivedToken; + Windows::Foundation::EventRegistrationToken m_sessionStatusToken; + Windows::Foundation::EventRegistrationToken m_sessionAddressToken; + Windows::Foundation::EventRegistrationToken m_addedSessionToken; + Windows::Foundation::EventRegistrationToken m_removedSessionToken; + Windows::Foundation::EventRegistrationToken m_globalDataToken; + + DQRNetworkManager *m_pDQRNet; +}; + +typedef enum +{ + DQR_INTERNAL_ASSIGN_SMALL_IDS, + DQR_INTERNAL_UNASSIGN_SMALL_ID, + DQR_INTERNAL_PLAYER_TABLE, + DQR_INTERNAL_ADD_PLAYER_FAILED, +}; + +class DQRConnectionInfo +{ +public: + typedef enum + { + ConnectionState_HeaderByte0, + ConnectionState_HeaderByte1, + ConnectionState_ReadBytes + } eDQRConnectionState; + + typedef enum + { + ConnectionState_InternalHeaderByte, + ConnectionState_InternalAssignSmallIdMask, + ConnectionState_InternalAssignSmallId0, + ConnectionState_InternalAssignSmallId1, + ConnectionState_InternalAssignSmallId2, + ConnectionState_InternalAssignSmallId3, + ConnectionState_InternalRoomSyncData, + ConnectionState_InternalAddPlayerFailedData, + } eDQRInternalDataState; + + DQRConnectionInfo(); + void Reset(); + + eDQRConnectionState m_state; + eDQRInternalDataState m_internalDataState; + + int m_currentChannel; + bool m_internalFlag; + int m_bytesRemaining; + int m_roomSyncDataBytesRead; + int m_roomSyncDataBytesToRead; + unsigned char * m_pucRoomSyncData; + int m_addFailedPlayerDataBytesRead; + int m_addFailedPlayerDataBytesToRead; + unsigned char * m_pucAddFailedPlayerData; + unsigned char m_smallId[4]; + bool m_channelActive[4]; + unsigned char m_smallIdReadMask; + unsigned char *m_pucsmallIdReadMaskResolved; + bool m_initialPacketReceived; +}; + + +class DQRNetworkManager +{ + friend class PartyController; + friend ref class DQRNetworkManagerEventHandlers; + friend class DQRNetworkPlayer; + friend class ChatIntegrationLayer; +public: + static const int JOIN_PACKET_RESEND_DELAY_MS = 200; + static const int JOIN_PACKET_RESEND_TIMEOUT_MS = 20000; + static const int JOIN_RESERVATION_WAIT_TIME = 30000; + static const int JOIN_CREATE_SESSION_MAX_ATTEMPTS = 5; + + static const int PRIMARY_PLAYER_LEAVING_PARTY_WAIT_MS = 20000; // Time between primary player leaving and when we should respond to it, to allow time for us to receive a new party for them to be going to if they are just changing party rather than leaving altogether + + class SessionInfo + { + public: + SessionInfo(wstring& sessionName, wstring& serviceConfig, wstring& sessionTemplate); + SessionInfo(); + bool m_detailsValid; + wstring m_sessionName; + wstring m_serviceConfig; + wstring m_sessionTemplate; + }; + + static const int MAX_LOCAL_PLAYER_COUNT = 4; + static const int MAX_ONLINE_PLAYER_COUNT = 8; + static const int MAX_ONLINE_PLAYER_NAME_LENGTH = 21; + + // This class stores everything about a player that must be synchronised between machines. + class PlayerSyncData + { + public: + wchar_t *m_XUID; // XUID / XboxUserIds are passed round as decimal strings on Xbox 1 + uint32_t m_sessionAddress; // XRNS session address for this player, ie can identify which machine this player is on + uint8_t m_smallId; // Assigned by DQRNetworkManager, to attach a permanent id to this player (until we have to wrap round), to match a similar concept in qnet + uint8_t m_channel; // Local index / communication channel within session address, of player on this machine + wchar_t m_name[MAX_ONLINE_PLAYER_NAME_LENGTH]; + }; + + class RoomSyncData + { + public: + int playerCount; + PlayerSyncData players[MAX_ONLINE_PLAYER_COUNT]; + }; + + class HostGamertagResolveDetails + { + public:; + DQRNetworkPlayer* m_pPlayer; + wstring m_name; + unsigned int m_sessionAddress; + int m_channel; + bool m_sync; + }; + + DQRNetworkManager(IDQRNetworkManagerListener *listener); + void Initialise(); + void EnableDebugXBLContext(MXS::XboxLiveContext^ XBLContext); + + void CreateAndJoinSession(int userMask, unsigned char *customSessionData, unsigned int customSessionDataSize, bool offline); + void JoinSession(int playerMask); + void JoinSessionFromInviteInfo(int playerMask); + bool AddUsersToSession(int playerMask, MXSM::MultiplayerSessionReference^ sessionRef ); + void UpdateCustomSessionData(); + + bool AddLocalPlayerByUserIndex(int userIndex); + bool RemoveLocalPlayerByUserIndex(int userIndex); + + bool IsHost(); + bool IsInSession(); + + // Player retrieval + int GetPlayerCount(); + int GetOnlinePlayerCount(); + DQRNetworkPlayer *GetPlayerByIndex(int idx); + DQRNetworkPlayer *GetPlayerBySmallId(int idx); + DQRNetworkPlayer *GetPlayerByXuid(PlayerUID xuid); + wstring GetDisplayNameByGamertag(wstring gamertag); + DQRNetworkPlayer *GetLocalPlayerByUserIndex(int idx); + DQRNetworkPlayer *GetHostPlayer(); + int GetSessionIndex(DQRNetworkPlayer *player); + void Tick(); + void Tick_XRNS(); + void Tick_VoiceChat(); + void Tick_Party(); + void Tick_CustomSessionData(); + void Tick_AddAndRemoveLocalPlayers(); + void Tick_ResolveGamertags(); + void Tick_PartyProcess(); + void Tick_StateMachine(); + void Tick_CheckInviteParty(); + + bool ShouldMessageForFullSession(); + void FlagInvitedToFullSession(); + void UnflagInvitedToFullSession(); + // Externally exposed state. All internal states are mapped to one of these broader states. + typedef enum + { + DNM_STATE_INITIALISING, + DNM_STATE_INITIALISE_FAILED, + DNM_STATE_IDLE, + + DNM_STATE_HOSTING, + DNM_STATE_JOINING, + + DNM_STATE_STARTING, + DNM_STATE_PLAYING, + + DNM_STATE_LEAVING, + DNM_STATE_ENDING, + } eDQRNetworkManagerState; + + eDQRNetworkManagerState GetState(); + + class SessionSearchResult + { + public: + SessionSearchResult() { m_extData = NULL; } + ~SessionSearchResult() { free(m_extData); } + wstring m_partyId; + wstring m_sessionName; + + // These names/xuids reflect the server controlled list of who is actually in the game + wstring m_playerNames[MAX_ONLINE_PLAYER_COUNT]; + PlayerUID m_playerXuids[MAX_ONLINE_PLAYER_COUNT]; + int m_playerCount; + + // This count & set of xuids reflects the session document list of who is in the game + wstring m_sessionXuids[MAX_ONLINE_PLAYER_COUNT]; + int m_usedSlotCount; + + void *m_extData; + }; + +protected: + // NOTE: If anything changes in here, then the mapping from internal -> external state needs to be updated (m_INTtoEXTStateMappings, defined in the cpp file) + typedef enum + { + DNM_INT_STATE_INITIALISING, + DNM_INT_STATE_INITIALISE_FAILED, + DNM_INT_STATE_IDLE, + DNM_INT_STATE_HOSTING, + DNM_INT_STATE_HOSTING_WAITING_TO_PLAY, + DNM_INT_STATE_HOSTING_FAILED, + DNM_INT_STATE_JOINING, + DNM_INT_STATE_JOINING_WAITING_FOR_RESERVATIONS, + DNM_INT_STATE_JOINING_GET_SDA, + DNM_INT_STATE_JOINING_WAITING_FOR_SDA, + DNM_INT_STATE_JOINING_CREATE_SESSION, + DNM_INT_STATE_JOINING_WAITING_FOR_ACTIVE_SESSION, + DNM_INT_STATE_JOINING_SENDING_UNRELIABLE, + DNM_INT_STATE_JOINING_FAILED_TIDY_UP, + DNM_INT_STATE_JOINING_FAILED, + DNM_INT_STATE_STARTING, + DNM_INT_STATE_PLAYING, + DNM_INT_STATE_LEAVING, + DNM_INT_STATE_LEAVING_FAILED, + DNM_INT_STATE_ENDING, + DNM_INT_STATE_COUNT + } eDQRNetworkManagerInternalState; + + typedef enum + { + DNM_ADD_PLAYER_STATE_IDLE, + DNM_ADD_PLAYER_STATE_PROCESSING, + DNM_ADD_PLAYER_STATE_COMPLETE_SUCCESS, + DNM_ADD_PLAYER_STATE_COMPLETE_FAIL, + DNM_ADD_PLAYER_STATE_COMPLETE_FAIL_FULL, + } eDQRAddLocalPlayerState; + + typedef enum + { + DNM_REMOVE_PLAYER_STATE_IDLE, + DNM_REMOVE_PLAYER_STATE_PROCESSING, + DNM_REMOVE_PLAYER_STATE_COMPLETE_SUCCESS, + DNM_REMOVE_PLAYER_STATE_COMPLETE_FAIL, + } eDQRRemoveLocalPlayerState; + + class StateChangeInfo + { + public: + eDQRNetworkManagerState m_oldState; + eDQRNetworkManagerState m_newState; + StateChangeInfo(eDQRNetworkManagerState oldState, eDQRNetworkManagerState newState) : m_oldState(oldState), m_newState(newState) {} + }; + + typedef enum + { + // Incoming messages + RTS_MESSAGE_DATA_RECEIVED, + RTS_MESSAGE_DATA_RECEIVED_CHAT, + RTS_MESSAGE_ADDED_SESSION_ADDRESS, + RTS_MESSAGE_REMOVED_SESSION_ADDRESS, + RTS_MESSAGE_STATUS_ACTIVE, + RTS_MESSAGE_STATUS_TERMINATED, + + // Outgoing messages + RTS_MESSAGE_START_CLIENT, + RTS_MESSAGE_START_HOST, + RTS_MESSAGE_TERMINATE, + RTS_MESSAGE_SEND_DATA, + } eRTSMessageType; + + typedef enum + { + RTS_MESSAGE_FLAG_BROADCAST_MODE = 1, + RTS_MESSAGE_FLAG_RELIABLE = 2, + RTS_MESSAGE_FLAG_SEQUENTIAL = 4, + RTS_MESSAGE_FLAG_COALESCE = 8, + RTS_MESSAGE_FLAG_GAME_CHANNEL = 16, + } eRTSFlags; + + class RTS_Message + { + public: + eRTSMessageType m_eType; + unsigned int m_sessionAddress; + unsigned char *m_pucData; + unsigned int m_dataSize; + unsigned int m_flags; + }; + + std::queue m_stateChangeQueue; + CRITICAL_SECTION m_csStateChangeQueue; + CRITICAL_SECTION m_csSendBytes; + CRITICAL_SECTION m_csPartyViewVector; + std::queue m_RTSMessageQueueIncoming; + CRITICAL_SECTION m_csRTSMessageQueueIncoming; + std::queue m_RTSMessageQueueOutgoing; + CRITICAL_SECTION m_csRTSMessageQueueOutgoing; +private: + void SetState(DQRNetworkManager::eDQRNetworkManagerInternalState state); + static const eDQRNetworkManagerState m_INTtoEXTStateMappings[DNM_INT_STATE_COUNT]; + eDQRNetworkManagerInternalState m_state; + eDQRNetworkManagerState m_stateExternal; + __int64 m_lastUnreliableSendTime; + __int64 m_firstUnreliableSendTime; + __int64 m_startedWaitingForReservationsTime; + unsigned char *m_customSessionData; + unsigned int m_customSessionDataSize; + int m_customDataDirtyUpdateTicks; + std::shared_ptr m_chat; + + eDQRAddLocalPlayerState m_addLocalPlayerState; + DQRNetworkPlayer *m_addLocalPlayerSuccessPlayer; + int m_addLocalPlayerSuccessIndex; + int m_addLocalPlayerFailedIndex; + + eDQRRemoveLocalPlayerState m_removeLocalPlayerState; + int m_removeLocalPlayerIndex; + + Windows::Xbox::System::User^ m_primaryUser; + MXS::XboxLiveContext^ m_primaryUserXboxLiveContext; + WXN::SecureDeviceAssociationTemplate^ m_associationTemplate; + + CRITICAL_SECTION m_csRoomSyncData; + RoomSyncData m_roomSyncData; + DQRNetworkPlayer *m_players[MAX_ONLINE_PLAYER_COUNT]; + + IDQRNetworkManagerListener *m_listener; + PartyController *m_partyController; + DQRNetworkManagerEventHandlers^ m_eventHandlers; + WXNRs::Session^ m_XRNS_Session; + unsigned int m_XRNS_LocalAddress; + unsigned int m_XRNS_OldestAddress; + MXSM::MultiplayerSession^ m_multiplayerSession; + WXN::SecureDeviceAssociation^ m_sda; + Platform::String^ m_secureDeviceAddressBase64; + unsigned char m_currentSmallId; + unsigned char m_hostSmallId; + bool m_isHosting; + bool m_isInSession; + bool m_isOfflineGame; +public: + int m_currentUserMask; +private: + int m_joinSessionUserMask; + Platform::Array^ m_joinSessionXUIDs; + int m_joinSmallIdMask; + + Platform::Array^ m_remoteSocketAddress; + Platform::Array^ m_localSocketAddress; + int m_joinCreateSessionAttempts; + + C4JThread *m_CreateSessionThread; + C4JThread *m_LeaveRoomThread; + C4JThread *m_TidyUpJoinThread; + C4JThread *m_UpdateCustomSessionDataThread; + C4JThread *m_RTS_DoWorkThread; + C4JThread *m_CheckPartyInviteThread; + + bool m_notifyForFullParty; + + unordered_map m_sessionAddressToConnectionInfoMapHost; // For host - there may be more than one remote session attached to this listening session + unsigned int m_sessionAddressFromSmallId[256]; // For host - for mapping back from small Id, to session address + unsigned char m_channelFromSmallId[256]; // For host and client, for mapping back from small Id, to channel + DQRConnectionInfo m_connectionInfoClient; // For client + unsigned int m_hostSessionAddress; // For client + + CRITICAL_SECTION m_csHostGamertagResolveResults; + queue m_hostGamertagResolveResults; + + void AddPlayerFailed(Platform::String ^xuid); + Platform::String^ RemoveBracesFromGuidString(__in Platform::String^ guid ); + void HandleSessionChange( MXSM::MultiplayerSession^ session ); + MXSM::MultiplayerSession^ WriteSessionHelper( MXS::XboxLiveContext^ xboxLiveContext, + MXSM::MultiplayerSession^ multiplayerSession, + MXSM::MultiplayerSessionWriteMode writeMode, + HRESULT& hr); + MXSM::MultiplayerSessionMember^ GetUserMemberInSession( Windows::Xbox::System::User^ user, MXSM::MultiplayerSession^ session); + bool IsPlayerInSession( Platform::String^ xboxUserId, MXSM::MultiplayerSession^ session, int *smallId ); + + WXM::MultiplayerSessionReference^ ConvertToWindowsXboxMultiplayerSessionReference( MXSM::MultiplayerSessionReference^ sessionRef); + MXSM::MultiplayerSessionReference^ ConvertToMicrosoftXboxServicesMultiplayerSessionReference( WXM::MultiplayerSessionReference^ sessionRef ); + + void BytesReceived(int smallId, BYTE *bytes, int byteCount); + void BytesReceivedInternal(DQRConnectionInfo *connectionInfo, unsigned int sessionAddress, BYTE *bytes, int byteCount); + void SendBytes(int smallId, BYTE *bytes, int byteCount); + int GetQueueSizeBytes(); + int GetQueueSizeMessages(); + void SendBytesRaw(int smallId, BYTE *bytes, int byteCount, bool reliableAndSequential); + void SendBytesChat(unsigned int address, BYTE *bytes, int byteCount, bool reliable, bool sequential, bool broadcast); + + bool AddRoomSyncPlayer(DQRNetworkPlayer *pPlayer, unsigned int sessionAddress, int channel); + void RemoveRoomSyncPlayersWithSessionAddress(unsigned int sessionAddress); + void RemoveRoomSyncPlayer(DQRNetworkPlayer *pPlayer); + void UpdateRoomSyncPlayers(RoomSyncData *pNewSyncData); + void SendRoomSyncInfo(); + void SendAddPlayerFailed(Platform::String^ xuid); + void SendSmallId(bool reliableAndSequential, int playerMask); + void SendUnassignSmallId(int playerIndex); + int GetSessionIndexForSmallId(unsigned char smallId); + int GetSessionIndexAndSmallIdForHost(unsigned char *smallId); + + static void LogComment( Platform::String^ strText ); + static void LogCommentFormat( LPCWSTR strMsg, ... ); + static void LogCommentWithError( Platform::String^ strTest, HRESULT hr ); + + static Platform::String^ GetErrorString( HRESULT hr ); + static Platform::String^ FormatString( LPCWSTR strMsg, ... ); + static Platform::String^ ConvertHResultToErrorName( HRESULT hr ); + + Platform::String^ GetNextSmallIdAsJsonString(); + static int _HostGameThreadProc( void* lpParameter ); + int HostGameThreadProc(); + static int _LeaveRoomThreadProc( void* lpParameter ); + int LeaveRoomThreadProc(); + static int _TidyUpJoinThreadProc( void* lpParameter ); + int TidyUpJoinThreadProc(); + static int _UpdateCustomSessionDataThreadProc( void* lpParameter ); + int UpdateCustomSessionDataThreadProc(); + static int _CheckInviteThreadProc(void *lpParameter); + int CheckInviteThreadProc(); + static int _RTSDoWorkThread(void* lpParameter); + int RTSDoWorkThread(); + + CRITICAL_SECTION m_csVecChatPlayers; + vector m_vecChatPlayersJoined; +public: + void HandleNewPartyFoundForPlayer(); + void HandlePlayerRemovedFromParty(int playerMask); + + void ChatPlayerJoined(int idx); + bool IsReadyToPlayOrIdle(); + void StartGame(); + void LeaveRoom(); + void TidyUpFailedJoin(); + + static void SetInviteReceivedFlag(); + static void SetPartyProcessJoinParty(); + static void SetPartyProcessJoinSession(int bootUserIndex, Platform::String^ bootSessionName, Platform::String^ bootServiceConfig, Platform::String^ bootSessionTemplate); + + void SendInviteGUI(int quadrant); + bool IsAddingPlayer(); + + bool FriendPartyManagerIsBusy(); + int FriendPartyManagerGetCount(); + bool FriendPartyManagerSearch(); + void FriendPartyManagerGetSessionInfo(int idx, SessionSearchResult *searchResult); + WFC::IVectorView^ FilterPartiesByPermission(MXS::XboxLiveContext ^context, WFC::IVectorView^ partyResults); + + bool JoinPartyFromSearchResult(SessionSearchResult *searchResult, int playerMask); + void CancelJoinPartyFromSearchResult(); + void RequestDisplayName(DQRNetworkPlayer *player); + void SetDisplayName(PlayerUID xuid, wstring displayName); + +private: + __int64 m_playersLeftPartyTime; + int m_playersLeftParty; + + bool GetBestPartyUserIndex(); + C4JThread *m_GetFriendPartyThread; + static int _GetFriendsThreadProc( void* lpParameter ); + int GetFriendsThreadProc(); + bool IsSessionFriendsOfFriends(MXSM::MultiplayerSession^ session); + bool GetGameSessionData(MXSM::MultiplayerSession^ session, void *gameSessionData); + +public: + static Platform::Collections::Vector^ GetFriends(); + +private: + SessionSearchResult *m_sessionSearchResults; + int m_sessionResultCount; + bool m_cancelJoinFromSearchResult; + + map m_displayNames; // Player display names by gamertag + + + + typedef enum + { + DNM_PARTY_PROCESS_NONE, + DNM_PARTY_PROCESS_JOIN_PARTY, + DNM_PARTY_PROCESS_JOIN_SPECIFIED + } ePartyProcessType; + static int m_bootUserIndex; + static ePartyProcessType m_partyProcess; + static wstring m_bootSessionName; + static wstring m_bootServiceConfig; + static wstring m_bootSessionTemplate; + static bool m_inviteReceived; + + static DQRNetworkManager *s_pDQRManager; + + static void GetProfileCallback(LPVOID pParam, Microsoft::Xbox::Services::Social::XboxUserProfile^ profile); + + // Forced signout + bool m_handleForcedSignOut; + + void CheckForcedSignOut(); + void HandleForcedSignOut(); + + unsigned int m_RTS_Stat_totalBytes; + unsigned int m_RTS_Stat_totalSends; + + void UpdateRTSStats(); + + // Incoming messages - to be called from the main thread, to get incoming messages from the RTS work thread + void ProcessRTSMessagesIncoming(); + void Process_RTS_MESSAGE_DATA_RECEIVED(RTS_Message &message); + void Process_RTS_MESSAGE_DATA_RECEIVED_CHAT(RTS_Message &message); + void Process_RTS_MESSAGE_ADDED_SESSION_ADDRESS(RTS_Message &message); + void Process_RTS_MESSAGE_REMOVED_SESSION_ADDRESS(RTS_Message &message); + void Process_RTS_MESSAGE_STATUS_ACTIVE(RTS_Message &message); + void Process_RTS_MESSAGE_STATUS_TERMINATED(RTS_Message &message); + + // Outgoing messages - to be called from the RTS work thread, to process requests from the main thread + + void ProcessRTSMessagesOutgoing(); + void Process_RTS_MESSAGE_START_CLIENT(RTS_Message &message); + void Process_RTS_MESSAGE_START_HOST(RTS_Message &message); + void Process_RTS_MESSAGE_TERMINATE(RTS_Message &message); + void Process_RTS_MESSAGE_SEND_DATA(RTS_Message &message); + + // These methods are called from the main thread, to put an outgoing message onto the queue to be processed by these previous methods + void RTS_StartCient(); + void RTS_StartHost(); + void RTS_Terminate(); + void RTS_SendData(unsigned char *pucData, unsigned int dataSize, unsigned int sessionAddress, bool reliable, bool sequential, bool coalesce, bool includeMode, bool gameChannel ); + +}; + +// Class defining interface to be implemented for class that handles callbacks +class IDQRNetworkManagerListener +{ +public: + virtual void HandleDataReceived(DQRNetworkPlayer *playerFrom, DQRNetworkPlayer *playerTo, unsigned char *data, unsigned int dataSize) = 0; + virtual void HandlePlayerJoined(DQRNetworkPlayer *player) = 0; + virtual void HandlePlayerLeaving(DQRNetworkPlayer *player) = 0; + virtual void HandleStateChange(DQRNetworkManager::eDQRNetworkManagerState oldState, DQRNetworkManager::eDQRNetworkManagerState newState) = 0; +// virtual void HandleResyncPlayerRequest(DQRNetworkPlayer **aPlayers) = 0; + virtual void HandleAddLocalPlayerFailed(int idx, bool serverFull) = 0; + virtual void HandleDisconnect(bool bLostRoomOnly) = 0; + virtual void HandleInviteReceived(int playerIndex, DQRNetworkManager::SessionInfo *pInviteInfo) = 0; + virtual bool IsSessionJoinable() = 0; +}; diff --git a/Minecraft.Client/Durango/Network/DQRNetworkManager_FriendSessions.cpp b/Minecraft.Client/Durango/Network/DQRNetworkManager_FriendSessions.cpp new file mode 100644 index 00000000..3a14a2d5 --- /dev/null +++ b/Minecraft.Client/Durango/Network/DQRNetworkManager_FriendSessions.cpp @@ -0,0 +1,591 @@ +#include "stdafx.h" + +#include "DQRNetworkManager.h" +#include "PartyController.h" +#include +#include +#include +#include "..\Minecraft.World\StringHelpers.h" +#include "base64.h" + +#ifdef _DURANGO +#include "..\Minecraft.World\DurangoStats.h" +#endif + +#include "ChatIntegrationLayer.h" + +using namespace Concurrency; +using namespace Windows::Foundation::Collections; + +// Returns true if we are already processing a request to find game parties of friends +bool DQRNetworkManager::FriendPartyManagerIsBusy() +{ + if( m_GetFriendPartyThread ) + { + if( m_GetFriendPartyThread->isRunning() ) + { + return true; + } + } + return false; +} + +// Returns the total count of game parties that we found for our friends +int DQRNetworkManager::FriendPartyManagerGetCount() +{ + return m_sessionResultCount; +} + +// Initiate the (asynchronous) search for game parties of our friends +bool DQRNetworkManager::FriendPartyManagerSearch() +{ + if( m_GetFriendPartyThread ) + { + if( m_GetFriendPartyThread->isRunning() ) + { + return false; + } + } + + m_sessionResultCount = 0; + delete [] m_sessionSearchResults; + m_sessionSearchResults = NULL; + + m_GetFriendPartyThread = new C4JThread(&_GetFriendsThreadProc,this,"GetFriendsThreadProc"); + m_GetFriendPartyThread->Run(); + + return true; +} + +// Get a particular search result for a game party that we have discovered. Index should be from 0 to the value returned by FriendPartyManagerGetCount. +void DQRNetworkManager::FriendPartyManagerGetSessionInfo(int idx, SessionSearchResult *searchResult) +{ + assert( idx < m_sessionResultCount ); + assert( ( m_GetFriendPartyThread == NULL ) || ( !m_GetFriendPartyThread->isRunning()) ); + + // Need to make sure that copied data has independently allocated m_extData, so both copies can be freed + *searchResult = m_sessionSearchResults[idx]; + searchResult->m_extData = malloc(sizeof(GameSessionData)); + memcpy(searchResult->m_extData, m_sessionSearchResults[idx].m_extData, sizeof(GameSessionData)); +} + +int DQRNetworkManager::_GetFriendsThreadProc(void* lpParameter) +{ + DQRNetworkManager *pDQR = (DQRNetworkManager *)lpParameter; + return pDQR->GetFriendsThreadProc(); +} + +// This is the main thread that is kicked off to find game sessions associated with our friends. We have to do this +// by finding parties associated with our friends, and from the parties get the assocated game session. +int DQRNetworkManager::GetFriendsThreadProc() +{ + LogComment(L"Starting GetFriendsThreadProc"); + WXS::User^ primaryUser = ProfileManager.GetUser(0); + + if( primaryUser == nullptr ) + { + return -1; + } + MXS::XboxLiveContext^ primaryUserXboxLiveContext = ref new MXS::XboxLiveContext(primaryUser); + if( primaryUserXboxLiveContext == nullptr ) + { + return -1; + } + + MXSS::XboxSocialRelationshipResult^ socialRelationshipResult = nullptr; + + // First get our friends list (people we follow who may or may not follow us back), note we're requesting all friends + auto getSocialRelationshipsAsync = primaryUserXboxLiveContext->SocialService->GetSocialRelationshipsAsync(MXSS::SocialRelationship::All, 0, 1100); + create_task(getSocialRelationshipsAsync).then([this,&socialRelationshipResult](task t) + { + try + { + socialRelationshipResult = t.get(); + } + catch (Platform::COMException^ ex) + { + LogCommentWithError( L"GetSocialRelationshipsAsync failed", ex->HResult ); + } + }) + .wait(); + if( socialRelationshipResult == nullptr ) + { + return -1; + } + + IVector^ friendXUIDs = ref new Platform::Collections::Vector; + + // Now construct a vector of these users, that follow us back - these are our "friends" + for( int i = 0; i < socialRelationshipResult->TotalCount; i++ ) + { + MXSS::XboxSocialRelationship^ relationship = socialRelationshipResult->Items->GetAt(i); + if(relationship->IsFollowingCaller) + { + friendXUIDs->Append(relationship->XboxUserId); + } + } + + // If we don't have any such friends, we're done + if( friendXUIDs->Size == 0 ) + { + return 0; + } + + // Now get party associations for these friends + auto getPartyAssociationsAsync = WXM::Party::GetUserPartyAssociationsAsync(primaryUser, friendXUIDs->GetView() ); + + IVectorView^ partyResults = nullptr; + + create_task(getPartyAssociationsAsync).then([this,&partyResults](task^> t) + { + try + { + partyResults = t.get(); + } + catch (Platform::COMException^ ex) + { + LogCommentWithError( L"getPartyAssociationsAsync failed", ex->HResult ); + } + }) + .wait(); + + if( partyResults == nullptr ) + { + return -1; + } + + if( partyResults->Size == 0 ) + { + return 0; + } + + // Filter these parties by whether we have permission to see them online + partyResults = FilterPartiesByPermission(primaryUserXboxLiveContext, partyResults); + + + // At this point, we have Party Ids for our friends. Now we need to get Party Views for each of these Ids. + + LogComment("Parties found"); + + // Get party views for each of the user party associations that we have. These seem to be able to (individually) raise errors, so + // accumulate results into 2 matched vectors declared below so that we can ignore any broken UserPartyAssociations from now + vector partyViewVector; + vector partyResultsVector; + + vector> taskVector; + for each(WXM::UserPartyAssociation^ remoteParty in partyResults) + { + auto asyncOp = WXM::Party::GetPartyViewByPartyIdAsync( primaryUser, remoteParty->PartyId ); + task asyncTask = create_task(asyncOp); + + taskVector.push_back(asyncTask.then([this, &partyViewVector, &partyResultsVector, remoteParty] (task t) + { + try + { + WXM::PartyView^ partyView = t.get(); + + if( partyView != nullptr ) + { + app.DebugPrintf("Got party view\n"); + EnterCriticalSection(&m_csPartyViewVector); + partyViewVector.push_back(partyView); + partyResultsVector.push_back(remoteParty); + LeaveCriticalSection(&m_csPartyViewVector); + } + } + catch ( Platform::COMException^ ex ) + { + app.DebugPrintf("Getting party view error 0x%x\n",ex->HResult); + } + })); + } + for( auto it = taskVector.begin(); it != taskVector.end(); it++ ) + { + it->wait(); + } + + if( partyViewVector.size() == 0 ) + { + return 0; + } + + // Filter the party view, and party results vector (partyResultsVector) this is matched to, to remove any that don't have game sessions - or game sessions that aren't this game + vector partyViewVectorFiltered; + vector partyResultsFiltered; + + for( int i = 0; i < partyViewVector.size(); i++ ) + { + WXM::PartyView^ partyView = partyViewVector[i]; + + if( partyView->Joinability == WXM::SessionJoinability::JoinableByFriends ) + { + if( partyView->GameSession ) + { + if( partyView->GameSession->ServiceConfigurationId == SERVICE_CONFIG_ID ) + { + partyViewVectorFiltered.push_back( partyView ); + partyResultsFiltered.push_back( partyResultsVector[i] ); + } + } + } + } + + // We now have matched vectors: + // + // partyResultsFiltered + // partyViewVectorFiltered + // + // and, from the party views, we can now attempt to get game sessions + + vector sessionVector; + vector partyViewVectorValid; + vector partyResultsValid; + + for( int i = 0; i < partyViewVectorFiltered.size(); i++ ) + { + WXM::PartyView^ partyView = partyViewVectorFiltered[i]; + Microsoft::Xbox::Services::Multiplayer::MultiplayerSessionReference^ sessionRef = ConvertToMicrosoftXboxServicesMultiplayerSessionReference(partyView->GameSession); + + LogComment(L"Party view vector " + sessionRef->SessionName + L" " + partyResultsFiltered[i]->QueriedXboxUserIds->GetAt(0)); + + MXSM::MultiplayerSession^ session = nullptr; + auto asyncOp = primaryUserXboxLiveContext->MultiplayerService->GetCurrentSessionAsync( sessionRef ); + create_task(asyncOp).then([&session] (task t) + { + try + { + session = t.get(); + } + catch (Platform::COMException^ ex) + { + } + }) + .wait(); + if( session ) + { + sessionVector.push_back(session); + partyViewVectorValid.push_back(partyView); + partyResultsValid.push_back(partyResultsFiltered[i]); + } + } + + if( sessionVector.size() == 0 ) + { + return 0; + } + + // We now have matched vectors: + // + // partyResultsValid + // partyViewVectorValid + // sessionVector + + // The next stage is to resolve the display names for the XUIDs of all the players in each of the sessions. It is possible that + // a session won't have any XUIDs to resolve, which would make GetUserProfilesAsync unhappy, so we'll only be creating a task + // when there are members. Creating new matching arrays for party results and sessions, to match the results (we don't care about the party view anymore) + + vector^>> nameResolveTaskVector; + vector^> nameResolveVector; + vector newSessionVector; + vector newPartyVector; + + for( int j = 0; j < sessionVector.size(); j++ ) + { + MXSM::MultiplayerSession^ session = sessionVector[j]; + IVector^ memberXUIDs = ref new Platform::Collections::Vector; + + Windows::Data::Json::JsonArray^ roomSyncArray = nullptr; + try + { + Windows::Data::Json::JsonObject^ customJson = Windows::Data::Json::JsonObject::Parse(session->SessionProperties->SessionCustomPropertiesJson); + Windows::Data::Json::JsonValue^ customValue = customJson->GetNamedValue(L"RoomSyncData"); + roomSyncArray = customValue->GetArray(); + LogComment("Attempting to parse RoomSyncData"); + for( int i = 0; i < roomSyncArray->Size; i++ ) + { + LogComment(roomSyncArray->GetAt(i)->GetString()); + } + } + catch (Platform::COMException^ ex) + { + LogCommentWithError( L"Custom RoomSyncData Parse/GetNamedValue failed", ex->HResult ); + continue; + } + + if( roomSyncArray && ( roomSyncArray->Size > 0 ) ) + { + // For each session, we want to order these XUIDs so the display name of the first one is what we will name the session by. Prioritise doing this by: + // + // (1) If the host player (indicated by having a small id of 0) is our friend, use that + // (2) Otherwise use anyone who is our friend + + // Default to true + bool friendsOfFriends = true; + + int hostIndexFound = -1; + int friendIndexFound = -1; + + friendsOfFriends = IsSessionFriendsOfFriends(session); + + for( int i = 0; i < roomSyncArray->Size; i++ ) + { + Platform::String^ roomSyncXuid = roomSyncArray->GetAt(i)->GetString(); + + // Determine if this player is a friend + bool isFriend = false; + for each( Platform::String^ friendXUID in friendXUIDs ) + { + if( friendXUID == roomSyncXuid ) + { + isFriend = true; + break; + } + } + + bool isHost = i == 0; + + // Store that what we found at this index if it is a friend, or a friend who is a host + if( isFriend && ( friendsOfFriends || isHost ) ) + { + friendIndexFound = i; + if( isHost ) // Host is always in slot 0 + { + hostIndexFound = i; + } + } + } + + // Prefer to use index of host who is our friend + int bestIndex = friendIndexFound; + if( hostIndexFound != -1 ) + { + bestIndex = hostIndexFound; + } + + // Only consider if we have at least found one friend in the list of players + if( bestIndex != -1 ) + { + // Compile list of XUIDs to resolve with our specially chosen player as entry 0, then the rest + memberXUIDs->Append(roomSyncArray->GetAt(bestIndex)->GetString()); + for( int i = 0; i < roomSyncArray->Size; i++ ) + { + if( i != bestIndex ) + { + memberXUIDs->Append(roomSyncArray->GetAt(i)->GetString()); + } + } + nameResolveTaskVector.push_back( create_task( primaryUserXboxLiveContext->ProfileService->GetUserProfilesAsync( memberXUIDs->GetView() ) ) ); + newSessionVector.push_back(session); + newPartyVector.push_back(partyResultsValid[j]); + } + } + } + + try + { + auto joinTask = when_all(begin(nameResolveTaskVector), end(nameResolveTaskVector) ).then([this, &nameResolveVector](vector^> results) + { + nameResolveVector = results; + }) + .wait(); + } + catch(Platform::COMException^ ex) + { + return -1; + } + + // We now have matched vectors: + // + // newPartyVector - contains the party Ids that we'll need should we wish to join + // nameResolveVector - contains vectors views of the names of the members of the session each of these parties is in + // newSessionVector - contains the session information itself associated with each of the parties + + // Construct the final result vector + m_sessionResultCount = newSessionVector.size(); + m_sessionSearchResults = new SessionSearchResult[m_sessionResultCount]; + for( int i = 0; i < m_sessionResultCount; i++ ) + { + m_sessionSearchResults[i].m_partyId = newPartyVector[i]->PartyId->Data(); + m_sessionSearchResults[i].m_sessionName = newSessionVector[i]->SessionReference->SessionName->Data(); + for( int j = 0; j < nameResolveVector[i]->Size; j++ ) + { + m_sessionSearchResults[i].m_playerNames[j] = nameResolveVector[i]->GetAt(j)->GameDisplayName->Data(); + m_sessionSearchResults[i].m_playerXuids[j] = PlayerUID(nameResolveVector[i]->GetAt(j)->XboxUserId->Data()); + } + m_sessionSearchResults[i].m_playerCount = nameResolveVector[i]->Size; + m_sessionSearchResults[i].m_usedSlotCount = newSessionVector[i]->Members->Size; + if( m_sessionSearchResults[i].m_usedSlotCount > MAX_ONLINE_PLAYER_COUNT ) + { + // Don't think this could ever happen, but no harm in checking + m_sessionSearchResults[i].m_usedSlotCount = MAX_ONLINE_PLAYER_COUNT; + } + for( int j = 0; j < m_sessionSearchResults[i].m_usedSlotCount; j++ ) + { + m_sessionSearchResults[i].m_sessionXuids[j] = wstring( newSessionVector[i]->Members->GetAt(j)->XboxUserId->Data() ); + } + + m_sessionSearchResults[i].m_extData = malloc( sizeof(GameSessionData) ); + memset( m_sessionSearchResults[i].m_extData, 0, sizeof(GameSessionData) ); + + GetGameSessionData(newSessionVector[i], m_sessionSearchResults[i].m_extData); + } + + return 0; +} + +// Filters list of parties based on online presence permission (whether the friend is set to invisible or not) +IVectorView^ DQRNetworkManager::FilterPartiesByPermission(MXS::XboxLiveContext ^context, IVectorView^ partyResults) +{ + Platform::Collections::Vector^ filteredPartyResults = ref new Platform::Collections::Vector(); + + // List of permissions we want + auto permissionIds = ref new Platform::Collections::Vector(1, ref new Platform::String(L"ViewTargetPresence")); + + // List of target users + auto targetXboxUserIds = ref new Platform::Collections::Vector(); + for (int i = 0; i < partyResults->Size; i++) + { + assert(partyResults->GetAt(i)->QueriedXboxUserIds->Size > 0); + targetXboxUserIds->Append( partyResults->GetAt(i)->QueriedXboxUserIds->GetAt(0) ); + } + + // Check + auto checkPermissionsAsync = context->PrivacyService->CheckMultiplePermissionsWithMultipleTargetUsersAsync(permissionIds->GetView(), targetXboxUserIds->GetView()); + create_task(checkPermissionsAsync).then([&partyResults, &filteredPartyResults](task^> t) + { + try + { + auto results = t.get(); + + // For each party, check to see if we have permission for the user + for (int i = 0; i < partyResults->Size; i++) + { + // For each permissions result + for (int j = 0; j < results->Size; j++) + { + auto result = results->GetAt(j); + + // If allowed to see this user AND it's the same user, add the party to the just + if ((result->Items->GetAt(0)->IsAllowed) && (partyResults->GetAt(i)->QueriedXboxUserIds->GetAt(0) == result->XboxUserId)) + { + filteredPartyResults->Append(partyResults->GetAt(i)); + break; + } + } + } + } + catch (Platform::COMException^ ex) + { + LogCommentWithError( L"CheckMultiplePermissionsWithMultipleTargetUsersAsync failed", ex->HResult ); + } + }) + .wait(); + + app.DebugPrintf("DQRNetworkManager::FilterPartiesByPermission: Removed %i parties because of online presence permissions\n", partyResults->Size - filteredPartyResults->Size); + + return filteredPartyResults->GetView(); +} + +// Get all friends (list of XUIDs) syncronously from the service (slow, may take 300ms+), returns empty list if something goes wrong +Platform::Collections::Vector^ DQRNetworkManager::GetFriends() +{ + auto friends = ref new Platform::Collections::Vector; + + auto primaryUser = ProfileManager.GetUser(0); + if (primaryUser == nullptr) + { + // Return empty + return friends; + } + + auto xboxLiveContext = ref new MXS::XboxLiveContext(primaryUser); + + // Request ALL friends because there's no other way to check friendships without using the REST API + auto getSocialRelationshipsAsync = xboxLiveContext->SocialService->GetSocialRelationshipsAsync(MXSS::SocialRelationship::All, 0, 1100); + MXSS::XboxSocialRelationshipResult^ socialRelationshipResult = nullptr; + + // First get our friends list (people we follow who may or may not follow us back) + Concurrency::create_task(getSocialRelationshipsAsync).then([&socialRelationshipResult](Concurrency::task t) + { + try + { + socialRelationshipResult = t.get(); + } + catch (Platform::COMException^ ex) + { + app.DebugPrintf("DQRNetworkManager::GetFriends: GetSocialRelationshipsAsync failed ()\n", ex->HResult); + } + }) + .wait(); + + if (socialRelationshipResult == nullptr) + { + // Return empty + return friends; + } + + app.DebugPrintf("DQRNetworkManager::GetFriends: Retrieved %i relationships\n", socialRelationshipResult->TotalCount); + + // Now construct a vector of these users, that follow us back - these are our "friends" + for( int i = 0; i < socialRelationshipResult->TotalCount; i++ ) + { + MXSS::XboxSocialRelationship^ relationship = socialRelationshipResult->Items->GetAt(i); + if(relationship->IsFollowingCaller) + { + app.DebugPrintf("DQRNetworkManager::GetFriends: Found friend \"%ls\"\n", relationship->XboxUserId->Data()); + friends->Append(relationship->XboxUserId); + } + } + + app.DebugPrintf("DQRNetworkManager::GetFriends: Found %i 2-way friendships\n", friends->Size); + + return friends; +} + +// If data for game settings exists returns FriendsOfFriends value, otherwise returns true +bool DQRNetworkManager::IsSessionFriendsOfFriends(MXSM::MultiplayerSession^ session) +{ + // Default to true, don't want to incorrectly prevent joining + bool friendsOfFriends = true; + + // We retrieve the game session data later too, shouldn't really duplicate this + void *gameSessionData = malloc( sizeof(GameSessionData)); + memset(gameSessionData, 0, sizeof(GameSessionData)); + + bool result = GetGameSessionData(session, gameSessionData); + + if (result) + { + friendsOfFriends = app.GetGameHostOption(((GameSessionData *)gameSessionData)->m_uiGameHostSettings, eGameHostOption_FriendsOfFriends); + } + + free(gameSessionData); + + return friendsOfFriends; +} + +// Parses custom json data from session and populates game session data param, return true if parse succeeded +bool DQRNetworkManager::GetGameSessionData(MXSM::MultiplayerSession^ session, void *gameSessionData) +{ + Platform::String ^gameSessionDataJson = session->SessionProperties->SessionCustomPropertiesJson; + if( gameSessionDataJson ) + { + try + { + Windows::Data::Json::JsonObject^ customParam = Windows::Data::Json::JsonObject::Parse(gameSessionDataJson); + Windows::Data::Json::JsonValue^ customValue = customParam->GetNamedValue(L"GameSessionData"); + Platform::String ^customValueString = customValue->GetString(); + if( customValueString ) + { + base64_decode( customValueString, (unsigned char *)gameSessionData, sizeof(GameSessionData) ); + return true; + } + } + catch (Platform::COMException^ ex) + { + LogCommentWithError( L"Custom GameSessionData parameter Parse/GetNamedValue failed", ex->HResult ); + } + } + + return false; +} \ No newline at end of file diff --git a/Minecraft.Client/Durango/Network/DQRNetworkManager_Log.cpp b/Minecraft.Client/Durango/Network/DQRNetworkManager_Log.cpp new file mode 100644 index 00000000..cf66ea6f --- /dev/null +++ b/Minecraft.Client/Durango/Network/DQRNetworkManager_Log.cpp @@ -0,0 +1,303 @@ +#include "stdafx.h" + +#include "DQRNetworkManager.h" +#include "PartyController.h" +#include +#include +#include +#include "..\Minecraft.World\StringHelpers.h" +#include "base64.h" + +#ifdef _DURANGO +#include "..\Minecraft.World\DurangoStats.h" +#endif + +#include "ChatIntegrationLayer.h" + +using namespace Concurrency; +using namespace Windows::Foundation::Collections; + +void DQRNetworkManager::LogComment( Platform::String^ strText ) +{ +#ifndef _CONTENT_PACKAGE + static int64_t firstTime = 0; + wchar_t buf[64]; + + int64_t currentTime = System::currentTimeMillis(); + if( firstTime != 0 ) + { + _i64tow_s(currentTime - firstTime, buf, 64, 10); + OutputDebugString(buf); + OutputDebugString(L" ms: "); + } + else + { + firstTime = currentTime; + } + OutputDebugString(strText->Data()); + OutputDebugString(L"\n"); +#endif +} + +void DQRNetworkManager::LogCommentFormat( LPCWSTR strMsg, ... ) +{ + WCHAR strBuffer[2048]; + + va_list args; + va_start(args, strMsg); + _vsnwprintf_s( strBuffer, 2048, _TRUNCATE, strMsg, args ); + strBuffer[2047] = L'\0'; + + va_end(args); + + LogComment(ref new Platform::String(strBuffer)); +} + +void DQRNetworkManager::LogCommentWithError( Platform::String^ strTest, HRESULT hr ) +{ + Platform::String^ final = strTest + GetErrorString(hr); + LogComment(final); +} + +Platform::String^ DQRNetworkManager::GetErrorString( HRESULT hr ) +{ + Platform::String^ str = FormatString(L" %s [0x%0.8x]", ConvertHResultToErrorName(hr)->Data(), hr ); + return str; +} + +Platform::String^ DQRNetworkManager::FormatString( LPCWSTR strMsg, ... ) +{ + WCHAR strBuffer[2048]; + + va_list args; + va_start(args, strMsg); + _vsnwprintf_s( strBuffer, 2048, _TRUNCATE, strMsg, args ); + strBuffer[2047] = L'\0'; + + va_end(args); + + Platform::String^ str = ref new Platform::String(strBuffer); + return str; +} + +Platform::String^ DQRNetworkManager::ConvertHResultToErrorName( HRESULT hr ) +{ + switch( hr ) + { + // Generic errors + case S_OK: return L"S_OK"; + case S_FALSE: return L"S_FALSE"; + case E_OUTOFMEMORY: return L"E_OUTOFMEMORY"; + case E_ACCESSDENIED: return L"E_ACCESSDENIED"; + case E_INVALIDARG: return L"E_INVALIDARG"; + case E_UNEXPECTED: return L"E_UNEXPECTED"; + case E_ABORT: return L"E_ABORT"; + case E_FAIL: return L"E_FAIL"; + case E_NOTIMPL: return L"E_NOTIMPL"; + case E_ILLEGAL_METHOD_CALL: return L"E_ILLEGAL_METHOD_CALL"; + + // Authentication specific errors + case 0x87DD0003: return L"AM_E_XASD_UNEXPECTED"; + case 0x87DD0004: return L"AM_E_XASU_UNEXPECTED"; + case 0x87DD0005: return L"AM_E_XAST_UNEXPECTED"; + case 0x87DD0006: return L"AM_E_XSTS_UNEXPECTED"; + case 0x87DD0007: return L"AM_E_XDEVICE_UNEXPECTED"; + case 0x87DD0008: return L"AM_E_DEVMODE_NOT_AUTHORIZED"; + case 0x87DD0009: return L"AM_E_NOT_AUTHORIZED"; + case 0x87DD000A: return L"AM_E_FORBIDDEN"; + case 0x87DD000B: return L"AM_E_UNKNOWN_TARGET"; + case 0x87DD000C: return L"AM_E_INVALID_NSAL_DATA"; + case 0x87DD000D: return L"AM_E_TITLE_NOT_AUTHENTICATED"; + case 0x87DD000E: return L"AM_E_TITLE_NOT_AUTHORIZED"; + case 0x87DD000F: return L"AM_E_DEVICE_NOT_AUTHENTICATED"; + case 0x87DD0010: return L"AM_E_INVALID_USER_INDEX"; + case 0x87DD0011: return L"AM_E_USER_HASH_MISSING"; + case 0x87DD0012: return L"AM_E_ACTOR_NOT_SPECIFIED"; + case 0x87DD0013: return L"AM_E_USER_NOT_FOUND"; + case 0x87DD0014: return L"AM_E_INVALID_SUBTOKEN"; + case 0x87DD0015: return L"AM_E_INVALID_ENVIRONMENT"; + case 0x87DD0016: return L"AM_E_XASD_TIMEOUT"; + case 0x87DD0017: return L"AM_E_XASU_TIMEOUT"; + case 0x87DD0018: return L"AM_E_XAST_TIMEOUT"; + case 0x87DD0019: return L"AM_E_XSTS_TIMEOUT"; + case 0x8015DC00: return L"XO_E_DEVMODE_NOT_AUTHORIZED"; + case 0x8015DC01: return L"XO_E_SYSTEM_UPDATE_REQUIRED"; + case 0x8015DC02: return L"XO_E_CONTENT_UPDATE_REQUIRED"; + case 0x8015DC03: return L"XO_E_ENFORCEMENT_BAN"; + case 0x8015DC04: return L"XO_E_THIRD_PARTY_BAN"; + case 0x8015DC05: return L"XO_E_ACCOUNT_PARENTALLY_RESTRICTED"; + case 0x8015DC06: return L"XO_E_DEVICE_SUBSCRIPTION_NOT_ACTIVATED"; + case 0x8015DC08: return L"XO_E_ACCOUNT_BILLING_MAINTENANCE_REQUIRED"; + case 0x8015DC09: return L"XO_E_ACCOUNT_CREATION_REQUIRED"; + case 0x8015DC0A: return L"XO_E_ACCOUNT_TERMS_OF_USE_NOT_ACCEPTED"; + case 0x8015DC0B: return L"XO_E_ACCOUNT_COUNTRY_NOT_AUTHORIZED"; + case 0x8015DC0C: return L"XO_E_ACCOUNT_AGE_VERIFICATION_REQUIRED"; + case 0x8015DC0D: return L"XO_E_ACCOUNT_CURFEW"; + case 0x8015DC0E: return L"XO_E_ACCOUNT_ZEST_MAINTENANCE_REQUIRED"; + case 0x8015DC0F: return L"XO_E_ACCOUNT_CSV_TRANSITION_REQUIRED"; + case 0x8015DC10: return L"XO_E_ACCOUNT_MAINTENANCE_REQUIRED"; + case 0x8015DC11: return L"XO_E_ACCOUNT_TYPE_NOT_ALLOWED"; + case 0x8015DC12: return L"XO_E_CONTENT_ISOLATION"; + case 0x8015DC13: return L"XO_E_ACCOUNT_NAME_CHANGE_REQUIRED"; + case 0x8015DC14: return L"XO_E_DEVICE_CHALLENGE_REQUIRED"; + case 0x8015DC20: return L"XO_E_EXPIRED_DEVICE_TOKEN"; + case 0x8015DC21: return L"XO_E_EXPIRED_TITLE_TOKEN"; + case 0x8015DC22: return L"XO_E_EXPIRED_USER_TOKEN"; + case 0x8015DC23: return L"XO_E_INVALID_DEVICE_TOKEN"; + case 0x8015DC24: return L"XO_E_INVALID_TITLE_TOKEN"; + case 0x8015DC25: return L"XO_E_INVALID_USER_TOKEN"; + + // winsock errors + case MAKE_HRESULT(1,7,WSAEWOULDBLOCK) : return L"WSAEWOULDBLOCK"; + case MAKE_HRESULT(1,7,WSAEINPROGRESS) : return L"WSAEINPROGRESS"; + case MAKE_HRESULT(1,7,WSAEALREADY) : return L"WSAEALREADY"; + case MAKE_HRESULT(1,7,WSAENOTSOCK) : return L"WSAENOTSOCK"; + case MAKE_HRESULT(1,7,WSAEDESTADDRREQ) : return L"WSAEDESTADDRREQ"; + case MAKE_HRESULT(1,7,WSAEMSGSIZE) : return L"WSAEMSGSIZE"; + case MAKE_HRESULT(1,7,WSAEPROTOTYPE) : return L"WSAEPROTOTYPE"; + case MAKE_HRESULT(1,7,WSAENOPROTOOPT) : return L"WSAENOPROTOOPT"; + case MAKE_HRESULT(1,7,WSAEPROTONOSUPPORT) : return L"WSAEPROTONOSUPPORT"; + case MAKE_HRESULT(1,7,WSAESOCKTNOSUPPORT) : return L"WSAESOCKTNOSUPPORT"; + case MAKE_HRESULT(1,7,WSAEOPNOTSUPP) : return L"WSAEOPNOTSUPP"; + case MAKE_HRESULT(1,7,WSAEPFNOSUPPORT) : return L"WSAEPFNOSUPPORT"; + case MAKE_HRESULT(1,7,WSAEAFNOSUPPORT) : return L"WSAEAFNOSUPPORT"; + case MAKE_HRESULT(1,7,WSAEADDRINUSE) : return L"WSAEADDRINUSE"; + case MAKE_HRESULT(1,7,WSAEADDRNOTAVAIL) : return L"WSAEADDRNOTAVAIL"; + case MAKE_HRESULT(1,7,WSAENETDOWN) : return L"WSAENETDOWN"; + case MAKE_HRESULT(1,7,WSAENETUNREACH) : return L"WSAENETUNREACH"; + case MAKE_HRESULT(1,7,WSAENETRESET) : return L"WSAENETRESET"; + case MAKE_HRESULT(1,7,WSAECONNABORTED) : return L"WSAECONNABORTED"; + case MAKE_HRESULT(1,7,WSAECONNRESET) : return L"WSAECONNRESET"; + case MAKE_HRESULT(1,7,WSAENOBUFS) : return L"WSAENOBUFS"; + case MAKE_HRESULT(1,7,WSAEISCONN) : return L"WSAEISCONN"; + case MAKE_HRESULT(1,7,WSAENOTCONN) : return L"WSAENOTCONN"; + case MAKE_HRESULT(1,7,WSAESHUTDOWN) : return L"WSAESHUTDOWN"; + case MAKE_HRESULT(1,7,WSAETOOMANYREFS) : return L"WSAETOOMANYREFS"; + case MAKE_HRESULT(1,7,WSAETIMEDOUT) : return L"WSAETIMEDOUT"; + case MAKE_HRESULT(1,7,WSAECONNREFUSED) : return L"WSAECONNREFUSED"; + case MAKE_HRESULT(1,7,WSAELOOP) : return L"WSAELOOP"; + case MAKE_HRESULT(1,7,WSAENAMETOOLONG) : return L"WSAENAMETOOLONG"; + case MAKE_HRESULT(1,7,WSAEHOSTDOWN) : return L"WSAEHOSTDOWN"; + case MAKE_HRESULT(1,7,WSAEHOSTUNREACH) : return L"WSAEHOSTUNREACH"; + case MAKE_HRESULT(1,7,WSAENOTEMPTY) : return L"WSAENOTEMPTY"; + case MAKE_HRESULT(1,7,WSAEPROCLIM) : return L"WSAEPROCLIM"; + case MAKE_HRESULT(1,7,WSAEUSERS) : return L"WSAEUSERS"; + case MAKE_HRESULT(1,7,WSAEDQUOT) : return L"WSAEDQUOT"; + case MAKE_HRESULT(1,7,WSAESTALE) : return L"WSAESTALE"; + case MAKE_HRESULT(1,7,WSAEREMOTE) : return L"WSAEREMOTE"; + case MAKE_HRESULT(1,7,WSASYSNOTREADY) : return L"WSASYSNOTREADY"; + case MAKE_HRESULT(1,7,WSAVERNOTSUPPORTED) : return L"WSAVERNOTSUPPORTED"; + case MAKE_HRESULT(1,7,WSANOTINITIALISED) : return L"WSANOTINITIALISED"; + case MAKE_HRESULT(1,7,WSAEDISCON) : return L"WSAEDISCON"; + case MAKE_HRESULT(1,7,WSAENOMORE) : return L"WSAENOMORE"; + case MAKE_HRESULT(1,7,WSAECANCELLED) : return L"WSAECANCELLED"; + case MAKE_HRESULT(1,7,WSAEINVALIDPROCTABLE) : return L"WSAEINVALIDPROCTABLE"; + case MAKE_HRESULT(1,7,WSAEINVALIDPROVIDER) : return L"WSAEINVALIDPROVIDER"; + case MAKE_HRESULT(1,7,WSAEPROVIDERFAILEDINIT) : return L"WSAEPROVIDERFAILEDINIT"; + case MAKE_HRESULT(1,7,WSASYSCALLFAILURE) : return L"WSASYSCALLFAILURE"; + case MAKE_HRESULT(1,7,WSASERVICE_NOT_FOUND) : return L"WSASERVICE_NOT_FOUND"; + case MAKE_HRESULT(1,7,WSATYPE_NOT_FOUND) : return L"WSATYPE_NOT_FOUND"; + case MAKE_HRESULT(1,7,WSA_E_NO_MORE) : return L"WSA_E_NO_MORE"; + case MAKE_HRESULT(1,7,WSA_E_CANCELLED) : return L"WSA_E_CANCELLED"; + case MAKE_HRESULT(1,7,WSAEREFUSED) : return L"WSAEREFUSED"; + case MAKE_HRESULT(1,7,WSAHOST_NOT_FOUND) : return L"WSAHOST_NOT_FOUND"; + case MAKE_HRESULT(1,7,WSATRY_AGAIN) : return L"WSATRY_AGAIN"; + case MAKE_HRESULT(1,7,WSANO_RECOVERY) : return L"WSANO_RECOVERY"; + case MAKE_HRESULT(1,7,WSANO_DATA) : return L"WSANO_DATA"; + case MAKE_HRESULT(1,7,WSA_QOS_RECEIVERS) : return L"WSA_QOS_RECEIVERS"; + case MAKE_HRESULT(1,7,WSA_QOS_SENDERS) : return L"WSA_QOS_SENDERS"; + case MAKE_HRESULT(1,7,WSA_QOS_NO_SENDERS) : return L"WSA_QOS_NO_SENDERS"; + case MAKE_HRESULT(1,7,WSA_QOS_NO_RECEIVERS) : return L"WSA_QOS_NO_RECEIVERS"; + case MAKE_HRESULT(1,7,WSA_QOS_REQUEST_CONFIRMED) : return L"WSA_QOS_REQUEST_CONFIRMED"; + case MAKE_HRESULT(1,7,WSA_QOS_ADMISSION_FAILURE) : return L"WSA_QOS_ADMISSION_FAILURE"; + case MAKE_HRESULT(1,7,WSA_QOS_POLICY_FAILURE) : return L"WSA_QOS_POLICY_FAILURE"; + case MAKE_HRESULT(1,7,WSA_QOS_BAD_STYLE) : return L"WSA_QOS_BAD_STYLE"; + case MAKE_HRESULT(1,7,WSA_QOS_BAD_OBJECT) : return L"WSA_QOS_BAD_OBJECT"; + case MAKE_HRESULT(1,7,WSA_QOS_TRAFFIC_CTRL_ERROR) : return L"WSA_QOS_TRAFFIC_CTRL_ERROR"; + case MAKE_HRESULT(1,7,WSA_QOS_GENERIC_ERROR) : return L"WSA_QOS_GENERIC_ERROR"; + case MAKE_HRESULT(1,7,WSA_QOS_ESERVICETYPE) : return L"WSA_QOS_ESERVICETYPE"; + case MAKE_HRESULT(1,7,WSA_QOS_EFLOWSPEC) : return L"WSA_QOS_EFLOWSPEC"; + case MAKE_HRESULT(1,7,WSA_QOS_EPROVSPECBUF) : return L"WSA_QOS_EPROVSPECBUF"; + case MAKE_HRESULT(1,7,WSA_QOS_EFILTERSTYLE) : return L"WSA_QOS_EFILTERSTYLE"; + case MAKE_HRESULT(1,7,WSA_QOS_EFILTERTYPE) : return L"WSA_QOS_EFILTERTYPE"; + case MAKE_HRESULT(1,7,WSA_QOS_EFILTERCOUNT) : return L"WSA_QOS_EFILTERCOUNT"; + case MAKE_HRESULT(1,7,WSA_QOS_EOBJLENGTH) : return L"WSA_QOS_EOBJLENGTH"; + case MAKE_HRESULT(1,7,WSA_QOS_EFLOWCOUNT) : return L"WSA_QOS_EFLOWCOUNT"; + case MAKE_HRESULT(1,7,WSA_QOS_EUNKOWNPSOBJ) : return L"WSA_QOS_EUNKOWNPSOBJ"; + case MAKE_HRESULT(1,7,WSA_QOS_EPOLICYOBJ) : return L"WSA_QOS_EPOLICYOBJ"; + case MAKE_HRESULT(1,7,WSA_QOS_EFLOWDESC) : return L"WSA_QOS_EFLOWDESC"; + case MAKE_HRESULT(1,7,WSA_QOS_EPSFLOWSPEC) : return L"WSA_QOS_EPSFLOWSPEC"; + case MAKE_HRESULT(1,7,WSA_QOS_EPSFILTERSPEC) : return L"WSA_QOS_EPSFILTERSPEC"; + case MAKE_HRESULT(1,7,WSA_QOS_ESDMODEOBJ) : return L"WSA_QOS_ESDMODEOBJ"; + case MAKE_HRESULT(1,7,WSA_QOS_ESHAPERATEOBJ) : return L"WSA_QOS_ESHAPERATEOBJ"; + case MAKE_HRESULT(1,7,WSA_QOS_RESERVED_PETYPE) : return L"WSA_QOS_RESERVED_PETYPE"; + + // HTTP specific errors + case WEB_E_UNSUPPORTED_FORMAT: return L"WEB_E_UNSUPPORTED_FORMAT"; + case WEB_E_INVALID_XML: return L"WEB_E_INVALID_XML"; + case WEB_E_MISSING_REQUIRED_ELEMENT: return L"WEB_E_MISSING_REQUIRED_ELEMENT"; + case WEB_E_MISSING_REQUIRED_ATTRIBUTE: return L"WEB_E_MISSING_REQUIRED_ATTRIBUTE"; + case WEB_E_UNEXPECTED_CONTENT: return L"WEB_E_UNEXPECTED_CONTENT"; + case WEB_E_RESOURCE_TOO_LARGE: return L"WEB_E_RESOURCE_TOO_LARGE"; + case WEB_E_INVALID_JSON_STRING: return L"WEB_E_INVALID_JSON_STRING"; + case WEB_E_INVALID_JSON_NUMBER: return L"WEB_E_INVALID_JSON_NUMBER"; + case WEB_E_JSON_VALUE_NOT_FOUND: return L"WEB_E_JSON_VALUE_NOT_FOUND"; + case HTTP_E_STATUS_UNEXPECTED: return L"HTTP_E_STATUS_UNEXPECTED"; + case HTTP_E_STATUS_UNEXPECTED_REDIRECTION: return L"HTTP_E_STATUS_UNEXPECTED_REDIRECTION"; + case HTTP_E_STATUS_UNEXPECTED_CLIENT_ERROR: return L"HTTP_E_STATUS_UNEXPECTED_CLIENT_ERROR"; + case HTTP_E_STATUS_UNEXPECTED_SERVER_ERROR: return L"HTTP_E_STATUS_UNEXPECTED_SERVER_ERROR"; + case HTTP_E_STATUS_AMBIGUOUS: return L"HTTP_E_STATUS_AMBIGUOUS"; + case HTTP_E_STATUS_MOVED: return L"HTTP_E_STATUS_MOVED"; + case HTTP_E_STATUS_REDIRECT: return L"HTTP_E_STATUS_REDIRECT"; + case HTTP_E_STATUS_REDIRECT_METHOD: return L"HTTP_E_STATUS_REDIRECT_METHOD"; + case HTTP_E_STATUS_NOT_MODIFIED: return L"HTTP_E_STATUS_NOT_MODIFIED"; + case HTTP_E_STATUS_USE_PROXY: return L"HTTP_E_STATUS_USE_PROXY"; + case HTTP_E_STATUS_REDIRECT_KEEP_VERB: return L"HTTP_E_STATUS_REDIRECT_KEEP_VERB"; + case HTTP_E_STATUS_BAD_REQUEST: return L"HTTP_E_STATUS_BAD_REQUEST"; + case HTTP_E_STATUS_DENIED: return L"HTTP_E_STATUS_DENIED"; + case HTTP_E_STATUS_PAYMENT_REQ: return L"HTTP_E_STATUS_PAYMENT_REQ"; + case HTTP_E_STATUS_FORBIDDEN: return L"HTTP_E_STATUS_FORBIDDEN"; + case HTTP_E_STATUS_NOT_FOUND: return L"HTTP_E_STATUS_NOT_FOUND"; + case HTTP_E_STATUS_BAD_METHOD: return L"HTTP_E_STATUS_BAD_METHOD"; + case HTTP_E_STATUS_NONE_ACCEPTABLE: return L"HTTP_E_STATUS_NONE_ACCEPTABLE"; + case HTTP_E_STATUS_PROXY_AUTH_REQ: return L"HTTP_E_STATUS_PROXY_AUTH_REQ"; + case HTTP_E_STATUS_REQUEST_TIMEOUT: return L"HTTP_E_STATUS_REQUEST_TIMEOUT"; + case HTTP_E_STATUS_CONFLICT: return L"HTTP_E_STATUS_CONFLICT"; + case HTTP_E_STATUS_GONE: return L"HTTP_E_STATUS_GONE"; + case HTTP_E_STATUS_LENGTH_REQUIRED: return L"HTTP_E_STATUS_LENGTH_REQUIRED"; + case HTTP_E_STATUS_PRECOND_FAILED: return L"HTTP_E_STATUS_PRECOND_FAILED"; + case HTTP_E_STATUS_REQUEST_TOO_LARGE: return L"HTTP_E_STATUS_REQUEST_TOO_LARGE"; + case HTTP_E_STATUS_URI_TOO_LONG: return L"HTTP_E_STATUS_URI_TOO_LONG"; + case HTTP_E_STATUS_UNSUPPORTED_MEDIA: return L"HTTP_E_STATUS_UNSUPPORTED_MEDIA"; + case HTTP_E_STATUS_RANGE_NOT_SATISFIABLE: return L"HTTP_E_STATUS_RANGE_NOT_SATISFIABLE"; + case HTTP_E_STATUS_EXPECTATION_FAILED: return L"HTTP_E_STATUS_EXPECTATION_FAILED"; + case HTTP_E_STATUS_SERVER_ERROR: return L"HTTP_E_STATUS_SERVER_ERROR"; + case HTTP_E_STATUS_NOT_SUPPORTED: return L"HTTP_E_STATUS_NOT_SUPPORTED"; + case HTTP_E_STATUS_BAD_GATEWAY: return L"HTTP_E_STATUS_BAD_GATEWAY"; + case HTTP_E_STATUS_SERVICE_UNAVAIL: return L"HTTP_E_STATUS_SERVICE_UNAVAIL"; + case HTTP_E_STATUS_GATEWAY_TIMEOUT: return L"HTTP_E_STATUS_GATEWAY_TIMEOUT"; + case HTTP_E_STATUS_VERSION_NOT_SUP: return L"HTTP_E_STATUS_VERSION_NOT_SUP"; + + // WinINet specific errors + case INET_E_INVALID_URL: return L"INET_E_INVALID_URL"; + case INET_E_NO_SESSION: return L"INET_E_NO_SESSION"; + case INET_E_CANNOT_CONNECT: return L"INET_E_CANNOT_CONNECT"; + case INET_E_RESOURCE_NOT_FOUND: return L"INET_E_RESOURCE_NOT_FOUND"; + case INET_E_OBJECT_NOT_FOUND: return L"INET_E_OBJECT_NOT_FOUND"; + case INET_E_DATA_NOT_AVAILABLE: return L"INET_E_DATA_NOT_AVAILABLE"; + case INET_E_DOWNLOAD_FAILURE: return L"INET_E_DOWNLOAD_FAILURE"; + case INET_E_AUTHENTICATION_REQUIRED: return L"INET_E_AUTHENTICATION_REQUIRED"; + case INET_E_NO_VALID_MEDIA: return L"INET_E_NO_VALID_MEDIA"; + case INET_E_CONNECTION_TIMEOUT: return L"INET_E_CONNECTION_TIMEOUT"; + case INET_E_INVALID_REQUEST: return L"INET_E_INVALID_REQUEST"; + case INET_E_UNKNOWN_PROTOCOL: return L"INET_E_UNKNOWN_PROTOCOL"; + case INET_E_SECURITY_PROBLEM: return L"INET_E_SECURITY_PROBLEM"; + case INET_E_CANNOT_LOAD_DATA: return L"INET_E_CANNOT_LOAD_DATA"; + case INET_E_CANNOT_INSTANTIATE_OBJECT: return L"INET_E_CANNOT_INSTANTIATE_OBJECT"; + case INET_E_INVALID_CERTIFICATE: return L"INET_E_INVALID_CERTIFICATE"; + case INET_E_REDIRECT_FAILED: return L"INET_E_REDIRECT_FAILED"; + case INET_E_REDIRECT_TO_DIR: return L"INET_E_REDIRECT_TO_DIR"; + } + + return L""; +} diff --git a/Minecraft.Client/Durango/Network/DQRNetworkManager_SendReceive.cpp b/Minecraft.Client/Durango/Network/DQRNetworkManager_SendReceive.cpp new file mode 100644 index 00000000..9232d095 --- /dev/null +++ b/Minecraft.Client/Durango/Network/DQRNetworkManager_SendReceive.cpp @@ -0,0 +1,409 @@ +#include "stdafx.h" + +#include "DQRNetworkManager.h" +#include "PartyController.h" +#include +#include +#include +#include "..\Minecraft.World\StringHelpers.h" +#include "base64.h" + +#ifdef _DURANGO +#include "..\Minecraft.World\DurangoStats.h" +#endif + +#include "ChatIntegrationLayer.h" + +using namespace Concurrency; +using namespace Windows::Foundation::Collections; + +// This method is called when bytes have been received that are to be passed on to the game itself. The data is associated with a small id so we can specify which network player +// that it was received for. +void DQRNetworkManager::BytesReceived(int smallId, BYTE *bytes, int byteCount) +{ + DQRNetworkPlayer *host = GetPlayerBySmallId(m_hostSmallId); + DQRNetworkPlayer *client = GetPlayerBySmallId(smallId); + + if( ( host == NULL ) || ( client == NULL ) ) + { + return; + } + + if( m_isHosting ) + { + m_listener->HandleDataReceived(client, host, bytes, byteCount ); + } + else + { + m_listener->HandleDataReceived(host, client, bytes, byteCount ); + } +// app.DebugPrintf("%d bytes received: %s\n", byteCount, bytes); +} + +// This method is called when network data is received, that is to be processed by the DQRNetworkManager itself. This is for handling internal +// updates such as assigning & unassigning of small Ids, transmission of the table of players currently in the session etc. +// Processing of these things is handled as a state machine so that we can receive a message split over more than one call to this method should +// the underlying communcation layer split data up somehow. +void DQRNetworkManager::BytesReceivedInternal(DQRConnectionInfo *connectionInfo, unsigned int sessionAddress, BYTE *bytes, int byteCount) +{ + BYTE *pNextByte = bytes; + BYTE *pEndByte = pNextByte + byteCount; + + do + { + BYTE byte = *pNextByte; + switch( connectionInfo->m_internalDataState ) + { + case DQRConnectionInfo::ConnectionState_InternalHeaderByte: + switch( byte ) + { + case DQR_INTERNAL_ASSIGN_SMALL_IDS: + connectionInfo->m_internalDataState = DQRConnectionInfo::ConnectionState_InternalAssignSmallIdMask; + break; + case DQR_INTERNAL_UNASSIGN_SMALL_ID: + // Host only + if( connectionInfo->m_channelActive[connectionInfo->m_currentChannel] ) + { + int smallId = connectionInfo->m_smallId[connectionInfo->m_currentChannel]; + connectionInfo->m_channelActive[connectionInfo->m_currentChannel] = false; + m_sessionAddressFromSmallId[smallId] = 0; + DQRNetworkPlayer *pPlayer = GetPlayerBySmallId(smallId); + if( pPlayer ) + { + RemoveRoomSyncPlayer(pPlayer); + SendRoomSyncInfo(); + } + } + break; + case DQR_INTERNAL_PLAYER_TABLE: + connectionInfo->m_internalDataState = DQRConnectionInfo::ConnectionState_InternalRoomSyncData; + connectionInfo->m_pucRoomSyncData = new unsigned char[4]; + connectionInfo->m_roomSyncDataBytesToRead = 0; + connectionInfo->m_roomSyncDataBytesRead = 0; + break; + case DQR_INTERNAL_ADD_PLAYER_FAILED: + connectionInfo->m_internalDataState = DQRConnectionInfo::ConnectionState_InternalAddPlayerFailedData; + connectionInfo->m_pucAddFailedPlayerData = new unsigned char[4]; + connectionInfo->m_addFailedPlayerDataBytesToRead = 0; + connectionInfo->m_addFailedPlayerDataBytesRead = 0; + break; + default: + break; + } + pNextByte++; + break; + case DQRConnectionInfo::ConnectionState_InternalAssignSmallIdMask: + // Up to 4 smallIds are assigned at once, with the ones that are being assigned dictated by a mask byte which is passed in first. + // The small Ids themselves follow, always 4 bytes, and any that are masked as being assigned are processed, the other bytes ignored. + // In order work around a bug with the networking library, this particular packet (being the first this that is sent from a client) + // is at first sent unreliably, with retries, until a message is received back to the client, or it times out. We therefore have to be able + // to handle (and ignore) this being received more than once + DQRNetworkManager::LogCommentFormat(L"Small Ids being received"); + connectionInfo->m_smallIdReadMask = byte; + // Create a uniquely allocated byte to which names have been resolved, as another one of these packets could be received whilst that asyncronous process is going o n + connectionInfo->m_pucsmallIdReadMaskResolved = new unsigned char; + *connectionInfo->m_pucsmallIdReadMaskResolved = 0; + connectionInfo->m_internalDataState = DQRConnectionInfo::ConnectionState_InternalAssignSmallId0; + connectionInfo->m_initialPacketReceived = true; + + pNextByte++; + break; + case DQRConnectionInfo::ConnectionState_InternalAssignSmallId0: + case DQRConnectionInfo::ConnectionState_InternalAssignSmallId1: + case DQRConnectionInfo::ConnectionState_InternalAssignSmallId2: + case DQRConnectionInfo::ConnectionState_InternalAssignSmallId3: + { + int channel = ((int)connectionInfo->m_internalDataState) - DQRConnectionInfo::ConnectionState_InternalAssignSmallId0; + + if( ( connectionInfo->m_smallIdReadMask & ( 1 << channel ) ) && ( !connectionInfo->m_channelActive[channel] ) ) + { + // HOST ONLY + // Store the small Id that is associated with this send channel. In order work around a bug with the networking library, this particular packet + // (being the first this that is sent from a client) is sent unreliably, with retries, until a message is received back to the client, or it times out. + // We therefore have to be able to handle (and ignore) this being received more than once - hence the check of the bool above. + // At this point, the connection is considered properly active from the point of view of the host. + + int sessionIndex = GetSessionIndexForSmallId(byte); + if( sessionIndex != -1 ) + { + connectionInfo->m_channelActive[channel] = true; + connectionInfo->m_smallId[channel] = byte; + + m_sessionAddressFromSmallId[byte] = sessionAddress; + m_channelFromSmallId[byte] = channel; + + auto pAsyncOp = m_primaryUserXboxLiveContext->ProfileService->GetUserProfileAsync(m_multiplayerSession->Members->GetAt(sessionIndex)->XboxUserId); + DQRNetworkManager::LogCommentFormat(L"Session index of %d found for player with small id %d - attempting to resolve display name\n",sessionIndex,byte); + + DQRNetworkPlayer *pPlayer = new DQRNetworkPlayer(this, DQRNetworkPlayer::DNP_TYPE_REMOTE, true, 0, sessionAddress); + pPlayer->SetSmallId(byte); + pPlayer->SetUID(PlayerUID(m_multiplayerSession->Members->GetAt(sessionIndex)->XboxUserId->Data())); + + HostGamertagResolveDetails *resolveDetails = new HostGamertagResolveDetails(); + resolveDetails->m_pPlayer = pPlayer; + resolveDetails->m_sessionAddress = sessionAddress; + resolveDetails->m_channel = channel; + resolveDetails->m_sync = false; + + int mask = 1 << channel; + unsigned char *pucsmallIdReadMaskResolved = connectionInfo->m_pucsmallIdReadMaskResolved; + unsigned char ucsmallIdReadMask = connectionInfo->m_smallIdReadMask; + create_task( pAsyncOp ).then( [this,resolveDetails,mask,pucsmallIdReadMaskResolved,ucsmallIdReadMask] (task resultTask) + { + try + { + Microsoft::Xbox::Services::Social::XboxUserProfile^ result = resultTask.get(); + + resolveDetails->m_name.assign(result->Gamertag->Data()); // Use the gamertag for this data, as it is synchronised round all the machines and so we can't use a display name that could be a real name + + EnterCriticalSection(&m_csHostGamertagResolveResults); + // Update flags for which names have been resolved, and if this completes this set, then set the flag to say that we should synchronise these out to the clients + *pucsmallIdReadMaskResolved |= mask; + LogCommentFormat(L"<<>> Compare %d to %d",*pucsmallIdReadMaskResolved,ucsmallIdReadMask); + if(ucsmallIdReadMask == *pucsmallIdReadMaskResolved) + { + resolveDetails->m_sync = true; + delete pucsmallIdReadMaskResolved; + } + m_hostGamertagResolveResults.push(resolveDetails); + LeaveCriticalSection(&m_csHostGamertagResolveResults); + } + + catch (Platform::Exception^ ex) + { + LogComment("Name resolve exception raised"); + // TODO - handle errors more usefully than just not setting the name... + EnterCriticalSection(&m_csHostGamertagResolveResults); + // Update flags for which names have been resolved, and if this completes this set, then set the flag to say that we should synchronise these out to the clients + *pucsmallIdReadMaskResolved |= mask; + if(ucsmallIdReadMask == *pucsmallIdReadMaskResolved) + { + resolveDetails->m_sync = true; + delete pucsmallIdReadMaskResolved; + } + m_hostGamertagResolveResults.push(resolveDetails); + LeaveCriticalSection(&m_csHostGamertagResolveResults); + } + }); + } + } + } + + switch(connectionInfo->m_internalDataState) + { + case DQRConnectionInfo::ConnectionState_InternalAssignSmallId0: + connectionInfo->m_internalDataState = DQRConnectionInfo::ConnectionState_InternalAssignSmallId1; + break; + case DQRConnectionInfo::ConnectionState_InternalAssignSmallId1: + connectionInfo->m_internalDataState = DQRConnectionInfo::ConnectionState_InternalAssignSmallId2; + break; + case DQRConnectionInfo::ConnectionState_InternalAssignSmallId2: + connectionInfo->m_internalDataState = DQRConnectionInfo::ConnectionState_InternalAssignSmallId3; + break; + case DQRConnectionInfo::ConnectionState_InternalAssignSmallId3: + connectionInfo->m_internalDataState = DQRConnectionInfo::ConnectionState_InternalHeaderByte; + break; + } + + pNextByte++; + break; + case DQRConnectionInfo::ConnectionState_InternalRoomSyncData: + connectionInfo->m_pucRoomSyncData[connectionInfo->m_roomSyncDataBytesRead++] = byte; + // The room sync info is sent as a 4 byte count of the length of XUID strings, then the RoomSyncData, then the XUID strings + if( connectionInfo->m_roomSyncDataBytesToRead == 0 ) + { + // At first stage of reading the 4 byte count + if( connectionInfo->m_roomSyncDataBytesRead == 4 ) + { + memcpy( &connectionInfo->m_roomSyncDataBytesToRead, connectionInfo->m_pucRoomSyncData, 4); + delete [] connectionInfo->m_pucRoomSyncData; + connectionInfo->m_roomSyncDataBytesToRead += sizeof(RoomSyncData); + connectionInfo->m_pucRoomSyncData = new unsigned char[ connectionInfo->m_roomSyncDataBytesToRead ]; + connectionInfo->m_roomSyncDataBytesRead = 0; + } + } + else if( connectionInfo->m_roomSyncDataBytesRead == connectionInfo->m_roomSyncDataBytesToRead ) + { + // Second stage of reading the variable length data - when we've read this all, we can created storage for the XUID strings and copy them all in + RoomSyncData *roomSyncData = (RoomSyncData *)connectionInfo->m_pucRoomSyncData; + wchar_t *pwcsData = (wchar_t *)((unsigned char *)connectionInfo->m_pucRoomSyncData + sizeof(RoomSyncData)); + for( int i = 0; i < roomSyncData->playerCount; i++ ) + { + unsigned int thisWchars = ( wcslen(pwcsData) + 1 ); + roomSyncData->players[i].m_XUID = new wchar_t[thisWchars]; + wcsncpy(roomSyncData->players[i].m_XUID, pwcsData, thisWchars); + pwcsData += thisWchars; + } + // Update the room sync data with this new data. This will handle notification of new and removed players + UpdateRoomSyncPlayers((RoomSyncData *)connectionInfo->m_pucRoomSyncData); + + delete connectionInfo->m_pucRoomSyncData; + connectionInfo->m_pucRoomSyncData = NULL; + connectionInfo->m_internalDataState = DQRConnectionInfo::ConnectionState_InternalHeaderByte; + + // If we haven't actually established a connection yet for this channel, then this is the point where we can consider this active + if( !connectionInfo->m_channelActive[connectionInfo->m_currentChannel] ) + { + DQRNetworkManager::LogCommentFormat(L"Received data from host, channel %d considered active (%d bytes)\n",connectionInfo->m_currentChannel,connectionInfo->m_bytesRemaining); + connectionInfo->m_channelActive[connectionInfo->m_currentChannel] = true; + + // This is also the time (as a client) to inform the chat integration layer of the host's session address, since we can now (reliably) send data to it + if(connectionInfo->m_currentChannel == 0) + { + if( m_chat ) + { + m_chat->OnNewSessionAddressAdded(m_hostSessionAddress); + } + } + } + + // Move to starting & playing states, if we are still joining rather than adding an additional player from this client, and we have all the local players here. + // We need to check that they are all here because we could have received a broadcast room sync data caused by another machine joining, and and so we can't assume + // that we're ready to go just yet. + if( m_state == DQRNetworkManager::DNM_INT_STATE_JOINING_SENDING_UNRELIABLE ) + { + bool allLocalPlayersHere = true; + for( int i = 0; i < MAX_LOCAL_PLAYERS; i++ ) + { + if( m_currentUserMask & ( 1 << i ) ) + { + if( GetLocalPlayerByUserIndex(i) == NULL ) + { + allLocalPlayersHere = false; + } + } + } + if( allLocalPlayersHere ) + { + DQRNetworkManager::LogComment(L"All local players present"); + SetState(DQRNetworkManager::DNM_INT_STATE_STARTING); + SetState(DQRNetworkManager::DNM_INT_STATE_PLAYING); + } + else + { + // Our players aren't all here yet. Going to keep on sending unreliable packets though until the connection is up and running + DQRNetworkManager::LogComment(L"All local players not yet present"); + } + } + } + pNextByte++; + break; + case DQRConnectionInfo::ConnectionState_InternalAddPlayerFailedData: + connectionInfo->m_pucAddFailedPlayerData[connectionInfo->m_addFailedPlayerDataBytesRead++] = byte; + // The failed player info is sent as a 4 byte count of the length of XUID string, then the string itself + if( connectionInfo->m_addFailedPlayerDataBytesToRead == 0 ) + { + // At first stage of reading the 4 byte count + if( connectionInfo->m_addFailedPlayerDataBytesRead == 4 ) + { + memcpy( &connectionInfo->m_addFailedPlayerDataBytesToRead, connectionInfo->m_pucAddFailedPlayerData, 4); + delete [] connectionInfo->m_pucAddFailedPlayerData; + connectionInfo->m_pucAddFailedPlayerData = new unsigned char[ connectionInfo->m_addFailedPlayerDataBytesToRead ]; + connectionInfo->m_addFailedPlayerDataBytesRead = 0; + } + } + else if( connectionInfo->m_addFailedPlayerDataBytesRead == connectionInfo->m_addFailedPlayerDataBytesToRead ) + { + // XUID fully read, can now handle what to do with it + AddPlayerFailed(ref new Platform::String( (wchar_t *)connectionInfo->m_pucAddFailedPlayerData ) ); + delete [] connectionInfo->m_pucAddFailedPlayerData; + connectionInfo->m_pucAddFailedPlayerData = NULL; + connectionInfo->m_internalDataState = DQRConnectionInfo::ConnectionState_InternalHeaderByte; + } + + pNextByte++; + break; + } + } while (pNextByte != pEndByte); +} + +// This method directly sends bytes via the network communication layer, used to send both game data & data internal to the DQRNetworkManager itself. +// This is used by higher level sending methods that wrap communications up with headers that can be processed at the receiving end. +void DQRNetworkManager::SendBytesRaw(int smallId, BYTE *bytes, int byteCount, bool reliableAndSequential) +{ + bool broadcast; + unsigned int sessionAddress; + +// app.DebugPrintf("{%d,%d - %d}\n",smallId,reliableAndSequential,byteCount); + + if( smallId == -1 ) + { + LogCommentFormat(L"Attempting broadcast, exception of address m_XRNS_Session->LocalSessionAddress %d %d %d", smallId, byteCount, reliableAndSequential); + // Broadcast, used from host only + broadcast = true; + sessionAddress = 0; + } + else + { + // Send to individual session address + broadcast = false; + if( m_isHosting ) + { + sessionAddress = m_sessionAddressFromSmallId[ smallId ]; + } + else + { + sessionAddress = m_hostSessionAddress; + } + } + RTS_SendData(bytes, byteCount, sessionAddress, reliableAndSequential, reliableAndSequential, reliableAndSequential, broadcast, true); +} + +// This method is called by the chat integration layer to be able to send data +void DQRNetworkManager::SendBytesChat(unsigned int address, BYTE *bytes, int byteCount, bool reliable, bool sequential, bool broadcast) +{ + unsigned int sessionAddress; + + if( broadcast ) + { + sessionAddress = 0; + } + else + { + // Send to individual session address + sessionAddress = address; + } + + RTS_SendData(bytes, byteCount, sessionAddress, reliable, sequential, false, broadcast, false); +} + +// This is the higher level sending method for sending game data - this prefixes the send with a header so that it will get routed to the correct player. +void DQRNetworkManager::SendBytes(int smallId, BYTE *bytes, int byteCount) +{ + EnterCriticalSection(&m_csSendBytes); + unsigned char *tempSendBuffer = (unsigned char *)malloc(8191 + 2); + + BYTE *data = bytes; + BYTE *dataEnd = bytes + byteCount; + + // Data to be sent has a header to say which of our own internal channels it is on (2 bits), and number of bytes that are in the message. + // The number of bytes has to be stored in 13 bits, and so a maximum of 8191 bytes can be send at a time. Split up longer messages into + // blocks of this size. + do + { + int bytesToSend = (int)(dataEnd - data); + if( bytesToSend > 8191 ) bytesToSend = 8191; + + // Send header with data sending mode - see full comment in DQRNetworkManagerEventHandlers::DataReceivedHandler + tempSendBuffer[0] = ( m_channelFromSmallId[smallId] << 5 ) | ( bytesToSend >> 8 ); + tempSendBuffer[1] = bytesToSend & 0xff; + memcpy(&tempSendBuffer[2], data, bytesToSend); + + SendBytesRaw(smallId, tempSendBuffer, bytesToSend + 2, true); + + data += bytesToSend; + } while (data != dataEnd); + + free(tempSendBuffer); + LeaveCriticalSection(&m_csSendBytes); +} + +int DQRNetworkManager::GetQueueSizeBytes() +{ + return m_RTS_Stat_totalBytes; +} + +int DQRNetworkManager::GetQueueSizeMessages() +{ + return m_RTS_Stat_totalSends; +} \ No newline at end of file diff --git a/Minecraft.Client/Durango/Network/DQRNetworkManager_XRNSEvent.cpp b/Minecraft.Client/Durango/Network/DQRNetworkManager_XRNSEvent.cpp new file mode 100644 index 00000000..c985a191 --- /dev/null +++ b/Minecraft.Client/Durango/Network/DQRNetworkManager_XRNSEvent.cpp @@ -0,0 +1,651 @@ +#include "stdafx.h" + +#include "DQRNetworkManager.h" +#include "PartyController.h" +#include +#include +#include +#include "..\Minecraft.World\StringHelpers.h" +#include "base64.h" + +#ifdef _DURANGO +#include "..\Minecraft.World\DurangoStats.h" +#endif + +#include "ChatIntegrationLayer.h" + +using namespace Concurrency; +using namespace Windows::Foundation::Collections; + +DQRNetworkManagerEventHandlers::DQRNetworkManagerEventHandlers(DQRNetworkManager *pDQRNet) +{ + m_pDQRNet = pDQRNet; +} + +void DQRNetworkManagerEventHandlers::Setup(WXNRs::Session^ session) +{ + try + { + m_dataReceivedToken = session->DataReceived += ref new Windows::Foundation::EventHandler(this, &DQRNetworkManagerEventHandlers::DataReceivedHandler); + m_sessionStatusToken = session->SessionStatusUpdate += ref new Windows::Foundation::EventHandler(this, &DQRNetworkManagerEventHandlers::SessionStatusUpdateHandler); + m_sessionAddressToken = session->SessionAddressDataChanged += ref new Windows::Foundation::EventHandler(this, &DQRNetworkManagerEventHandlers::SessionAddressDataChangedHandler); + m_addedSessionToken = session->AddedSessionAddress += ref new Windows::Foundation::EventHandler(this, &DQRNetworkManagerEventHandlers::AddedSessionAddressHandler); + m_removedSessionToken = session->RemovedSessionAddress += ref new Windows::Foundation::EventHandler(this, &DQRNetworkManagerEventHandlers::RemovedSessionAddressHandler); + m_globalDataToken = session->GlobalSessionDataChanged += ref new Windows::Foundation::EventHandler(this, &DQRNetworkManagerEventHandlers::GlobalSessionDataChangedHandler); + } + catch(Platform::COMException^ ex) + { + // swallow exceptions + } + catch(...) + { + // swallow exceptions + } +} + +void DQRNetworkManagerEventHandlers::Pulldown(WXNRs::Session^ session) +{ + try + { + session->DataReceived -= m_dataReceivedToken; + session->SessionStatusUpdate -= m_sessionStatusToken; + session->SessionAddressDataChanged -= m_sessionAddressToken; + session->AddedSessionAddress -= m_addedSessionToken; + session->RemovedSessionAddress -= m_removedSessionToken; + session->GlobalSessionDataChanged -= m_globalDataToken; + } + catch(Platform::COMException^ ex) + { + // swallow exceptions + } + catch(...) + { + // swallow exceptions + } +} + +// This event handler is called directly by the realtime session layer, when data is received. We split this data into into data that is meant to be +// handled internally by the DQRNetworkManager, and that which is meant to be passed on to the game itself as communication between players. +void DQRNetworkManagerEventHandlers::DataReceivedHandler(Platform::Object^ session, WXNRs::DataReceivedEventArgs^ args) +{ +// DQRNetworkManager::LogCommentFormat(L"DataReceivedHandler session addr: 0x%x (%d bytes)",args->SessionAddress,args->Data->Length); + + if (session == m_pDQRNet->m_XRNS_Session) + { + EnterCriticalSection(&m_pDQRNet->m_csRTSMessageQueueIncoming); + DQRNetworkManager::RTS_Message rtsMessage; + if( args->ChannelId == WXNRs::ChannelId::DefaultChatReceive ) + { + rtsMessage.m_eType = DQRNetworkManager::eRTSMessageType::RTS_MESSAGE_DATA_RECEIVED_CHAT; + } + else + { + rtsMessage.m_eType = DQRNetworkManager::eRTSMessageType::RTS_MESSAGE_DATA_RECEIVED; + } + rtsMessage.m_sessionAddress = args->SessionAddress; + rtsMessage.m_dataSize = args->Data->Length; + rtsMessage.m_pucData = (unsigned char *)malloc(rtsMessage.m_dataSize); + memcpy( rtsMessage.m_pucData, args->Data->Data, rtsMessage.m_dataSize ); + m_pDQRNet->m_RTSMessageQueueIncoming.push(rtsMessage); + LeaveCriticalSection(&m_pDQRNet->m_csRTSMessageQueueIncoming); + } +} + +// This event handler is called by the realtime session layer, when session address data is updated. We don't currently use session address data. +void DQRNetworkManagerEventHandlers::SessionAddressDataChangedHandler(Platform::Object^ session, WXNRs::SessionAddressDataChangedEventArgs^ args) +{ + DQRNetworkManager::LogComment(L"SessionAddressDataChangedHandler"); +} + +// This event handler is called by the realtime session layer when a session changes status. We use this to determine that a connection has been made made to the host, +// and the case when a connection has been terminated. +void DQRNetworkManagerEventHandlers::SessionStatusUpdateHandler(Platform::Object^ session, WXNRs::SessionStatusUpdateEventArgs^ args) +{ + DQRNetworkManager::LogComment(L"SessionStatusUpdateHandler"); + if (m_pDQRNet->m_XRNS_Session == session) + { + switch(args->NewStatus) + { + case WXNRs::SessionStatus::Active: + { + DQRNetworkManager::LogComment(L"Session active"); + m_pDQRNet->m_XRNS_LocalAddress = m_pDQRNet->m_XRNS_Session->LocalSessionAddress; + m_pDQRNet->m_XRNS_OldestAddress = m_pDQRNet->m_XRNS_Session->OldestSessionAddress; + EnterCriticalSection(&m_pDQRNet->m_csRTSMessageQueueIncoming); + DQRNetworkManager::RTS_Message rtsMessage; + rtsMessage.m_eType = DQRNetworkManager::eRTSMessageType::RTS_MESSAGE_STATUS_ACTIVE; + rtsMessage.m_sessionAddress = 0; + rtsMessage.m_dataSize = 0; + rtsMessage.m_pucData = 0; + m_pDQRNet->m_RTSMessageQueueIncoming.push(rtsMessage); + LeaveCriticalSection(&m_pDQRNet->m_csRTSMessageQueueIncoming); + } + break; + case WXNRs::SessionStatus::Terminated: + { + DQRNetworkManager::LogComment(L"Session terminated"); + EnterCriticalSection(&m_pDQRNet->m_csRTSMessageQueueIncoming); + DQRNetworkManager::RTS_Message rtsMessage; + rtsMessage.m_eType = DQRNetworkManager::eRTSMessageType::RTS_MESSAGE_STATUS_TERMINATED; + rtsMessage.m_sessionAddress = 0; + rtsMessage.m_dataSize = 0; + rtsMessage.m_pucData = 0; + m_pDQRNet->m_RTSMessageQueueIncoming.push(rtsMessage); + LeaveCriticalSection(&m_pDQRNet->m_csRTSMessageQueueIncoming); + } + break; + case WXNRs::SessionStatus::Activating: + DQRNetworkManager::LogComment(L"Session activating"); + break; + case WXNRs::SessionStatus::Terminating: + DQRNetworkManager::LogComment(L"Session terminating"); + break; + } + } +} + +// This event is called from the realtime session layer to notify any clients that a new endpoint has been connected into the network mesh. +void DQRNetworkManagerEventHandlers::AddedSessionAddressHandler(Platform::Object^ session, WXNRs::AddedSessionAddressEventArgs^ args) +{ + DQRNetworkManager::LogCommentFormat(L"AddedSessionAddressHandler session address 0x%x",args->SessionAddress); + EnterCriticalSection(&m_pDQRNet->m_csRTSMessageQueueIncoming); + DQRNetworkManager::RTS_Message rtsMessage; + rtsMessage.m_eType = DQRNetworkManager::eRTSMessageType::RTS_MESSAGE_ADDED_SESSION_ADDRESS; + rtsMessage.m_sessionAddress = args->SessionAddress; + rtsMessage.m_dataSize = 0; + rtsMessage.m_pucData = 0; + m_pDQRNet->m_RTSMessageQueueIncoming.push(rtsMessage); + LeaveCriticalSection(&m_pDQRNet->m_csRTSMessageQueueIncoming); +} + +// This event is called from the realtime session layer to notify any clients that an endpoint has been removed from the network mesh. +void DQRNetworkManagerEventHandlers::RemovedSessionAddressHandler(Platform::Object^ session, WXNRs::RemovedSessionAddressEventArgs^ args) +{ + DQRNetworkManager::LogCommentFormat(L"RemovedSessionAddressHandler session address 0x%x", args->SessionAddress); + EnterCriticalSection(&m_pDQRNet->m_csRTSMessageQueueIncoming); + DQRNetworkManager::RTS_Message rtsMessage; + rtsMessage.m_eType = DQRNetworkManager::eRTSMessageType::RTS_MESSAGE_REMOVED_SESSION_ADDRESS; + rtsMessage.m_sessionAddress = args->SessionAddress; + rtsMessage.m_dataSize = 0; + rtsMessage.m_pucData = 0; + m_pDQRNet->m_RTSMessageQueueIncoming.push(rtsMessage); + LeaveCriticalSection(&m_pDQRNet->m_csRTSMessageQueueIncoming); +} + +// This event is called from the realtime session layer when session global data has been updated. We don't currently use global session data. +void DQRNetworkManagerEventHandlers::GlobalSessionDataChangedHandler(Platform::Object^ session, WXNRs::GlobalSessionDataChangedEventArgs^ args) +{ + DQRNetworkManager::LogComment(L"GlobalSessionDataChangedHandler"); +} + +void DQRNetworkManager::UpdateRTSStats() +{ + Platform::Array ^sessionAddresses = nullptr; + try + { + sessionAddresses = m_XRNS_Session->GetAllRemoteSessionAddresses(WXNRs::RemoteSessionAddressStateOptions::All, WXNRs::RemoteSessionAddressConnectivityOptions::All); + } + catch(Platform::COMException^ ex) + { + // swallow exceptions + } + catch(...) + { + // swallow exceptions + } + + if( sessionAddresses ) + { + unsigned int totalBytes = 0; + unsigned int totalSends = 0; + for( unsigned int i = 0; i < sessionAddresses->Length; i++ ) + { + try + { + totalBytes += m_XRNS_Session->GetSendChannelOutstandingBytes(sessionAddresses->get(i), WXNRs::ChannelId::DefaultGameSend ); + totalSends += m_XRNS_Session->GetSendChannelOutstandingSends(sessionAddresses->get(i), WXNRs::ChannelId::DefaultGameSend ); + } + catch(Platform::COMException^ ex) + { + // swallow exceptions + } + catch(...) + { + // swallow exceptions + } + } + m_RTS_Stat_totalBytes = totalBytes; + m_RTS_Stat_totalSends = totalSends; + } + else + { + m_RTS_Stat_totalBytes = 0; + m_RTS_Stat_totalSends = 0; + } +} + +void DQRNetworkManager::ProcessRTSMessagesIncoming() +{ + EnterCriticalSection(&m_csRTSMessageQueueIncoming); + while(m_RTSMessageQueueIncoming.size() > 0 ) + { + RTS_Message message = m_RTSMessageQueueIncoming.front(); + switch( message.m_eType ) + { + case eRTSMessageType::RTS_MESSAGE_DATA_RECEIVED: + Process_RTS_MESSAGE_DATA_RECEIVED(message); + break; + case eRTSMessageType::RTS_MESSAGE_DATA_RECEIVED_CHAT: + Process_RTS_MESSAGE_DATA_RECEIVED_CHAT(message); + break; + case eRTSMessageType::RTS_MESSAGE_ADDED_SESSION_ADDRESS: + Process_RTS_MESSAGE_ADDED_SESSION_ADDRESS(message); + break; + case eRTSMessageType::RTS_MESSAGE_REMOVED_SESSION_ADDRESS: + Process_RTS_MESSAGE_REMOVED_SESSION_ADDRESS(message); + break; + case eRTSMessageType::RTS_MESSAGE_STATUS_ACTIVE: + Process_RTS_MESSAGE_STATUS_ACTIVE(message); + break; + case eRTSMessageType::RTS_MESSAGE_STATUS_TERMINATED: + Process_RTS_MESSAGE_STATUS_TERMINATED(message); + break; + default: + break; + } + m_RTSMessageQueueIncoming.pop(); + } + LeaveCriticalSection(&m_csRTSMessageQueueIncoming); +}; + +void DQRNetworkManager::Process_RTS_MESSAGE_DATA_RECEIVED(RTS_Message &message) +{ + DQRConnectionInfo *connectionInfo; + if( m_isHosting ) + { + connectionInfo = m_sessionAddressToConnectionInfoMapHost[message.m_sessionAddress]; + } + else + { + connectionInfo = &m_connectionInfoClient; + } + + // Handle any header data, and actual data, in our stream. Data is as follows: + // Byte 0 Byte 1 + // fccsssss ssssssss + // + // Where: f is 0 if this is normal data send (to be passed up to the game), or is 1 if this is to be internally processed + // cc is the channel number that the data belongs to (0 to 3 representing actual player indices) + // sssssssssssss is the count of data bytes to follow (range 0 - 8191) + BYTE *pNextByte = message.m_pucData; + BYTE *pEndByte = pNextByte + message.m_dataSize; + do + { + BYTE byte = *pNextByte; + switch( connectionInfo->m_state ) + { + case DQRConnectionInfo::ConnectionState_HeaderByte0: + connectionInfo->m_currentChannel = ( byte >> 5 ) & 3; + connectionInfo->m_internalFlag = ( ( byte & 0x80 ) == 0x80 ); + + // Byte transfer mode. Bits 0-4 of this byte represent the upper 5 bits of our count of bytes to transfer... lower 8-bits will follow + connectionInfo->m_bytesRemaining = ((int)( byte & 0x1f )) << 8; + connectionInfo->m_state = DQRConnectionInfo::ConnectionState_HeaderByte1; + connectionInfo->m_internalDataState = DQRConnectionInfo::ConnectionState_InternalHeaderByte; + pNextByte++; + break; + case DQRConnectionInfo::ConnectionState_HeaderByte1: + // Add in the lower 8 bits of our byte count, the upper 5 were obtained from the first header byte. + connectionInfo->m_bytesRemaining |= byte; + + // If there isn't any data following, then just go back to the initial state expecting another header byte. + if( connectionInfo->m_bytesRemaining == 0 ) + { + connectionInfo->m_state = DQRConnectionInfo::ConnectionState_HeaderByte0; + } + else + { + connectionInfo->m_state = DQRConnectionInfo::ConnectionState_ReadBytes; + } + pNextByte++; + break; + case DQRConnectionInfo::ConnectionState_ReadBytes: + // At this stage we can send up to connectionInfo->m_bytesRemaining bytes, or the number of bytes that we have remaining in the data received, whichever is lowest. + int bytesInBuffer = (int)(pEndByte - pNextByte); + int bytesToReceive = ( ( connectionInfo->m_bytesRemaining < bytesInBuffer ) ? connectionInfo->m_bytesRemaining : bytesInBuffer ); + + if( connectionInfo->m_internalFlag ) + { + BytesReceivedInternal(connectionInfo, message.m_sessionAddress, pNextByte, bytesToReceive ); + } + else + { + BytesReceived(connectionInfo->m_smallId[connectionInfo->m_currentChannel], pNextByte, bytesToReceive ); + } + + // Adjust counts and pointers + pNextByte += bytesToReceive; + connectionInfo->m_bytesRemaining -= bytesToReceive; + + // Set state back to expect a header if there is no more data bytes to receive + if( connectionInfo->m_bytesRemaining == 0 ) + { + connectionInfo->m_state = DQRConnectionInfo::ConnectionState_HeaderByte0; + } + break; + } + } while (pNextByte != pEndByte); + + free(message.m_pucData); +} + +void DQRNetworkManager::Process_RTS_MESSAGE_DATA_RECEIVED_CHAT(RTS_Message &message) +{ + if( m_chat ) + { + m_chat->OnIncomingChatMessage(message.m_sessionAddress, Platform::ArrayReference(message.m_pucData, message.m_dataSize) ); + free(message.m_pucData); + } +} + +void DQRNetworkManager::Process_RTS_MESSAGE_ADDED_SESSION_ADDRESS(RTS_Message &message) +{ + if( m_chat ) + { + m_chat->OnNewSessionAddressAdded(message.m_sessionAddress); + } + + // New session address - add a mapping for it + if( m_isHosting ) + { + auto it = m_sessionAddressToConnectionInfoMapHost.find(message.m_sessionAddress); + DQRConnectionInfo *connectionInfo; + if( it == m_sessionAddressToConnectionInfoMapHost.end() ) + { + connectionInfo = new DQRConnectionInfo(); + + m_sessionAddressToConnectionInfoMapHost[message.m_sessionAddress] = connectionInfo; + } + else + { + // This shouldn't happen as we should be removing mappings as session addresses are removed. + connectionInfo = it->second; + connectionInfo->Reset(); + } + + } +} + +void DQRNetworkManager::Process_RTS_MESSAGE_REMOVED_SESSION_ADDRESS(RTS_Message &message) +{ + if( m_chat ) + { + m_chat->RemoveRemoteConsole(message.m_sessionAddress); + } + + if( m_isHosting ) + { + auto it = m_sessionAddressToConnectionInfoMapHost.find(message.m_sessionAddress); + + if( it != m_sessionAddressToConnectionInfoMapHost.end() ) + { + delete it->second; + m_sessionAddressToConnectionInfoMapHost.erase(it); + RemoveRoomSyncPlayersWithSessionAddress(message.m_sessionAddress); + SendRoomSyncInfo(); + } + } + else + { + // As the client, if we are disonnected from the host, then it is all over. Proceed as if leaving the room. + if( message.m_sessionAddress == m_hostSessionAddress ) + { + LeaveRoom(); + } + } +} + +void DQRNetworkManager::Process_RTS_MESSAGE_STATUS_ACTIVE(RTS_Message &message) +{ + // When we detect that the session has become active, we start sending unreliable packets, until we get some data back. This is because there is an issue with the + // realtime session layer where it is telling us that the connection is active a bit to early, and it will disconnect if it receives a packet that must be reliable in this + // state. + if( !m_isHosting ) + { + m_firstUnreliableSendTime = 0; + m_hostSessionAddress = m_XRNS_OldestAddress; + // Also initialise the status of this connection + m_connectionInfoClient.Reset(); + SetState(DQRNetworkManager::DNM_INT_STATE_JOINING_SENDING_UNRELIABLE); + } +} + +void DQRNetworkManager::Process_RTS_MESSAGE_STATUS_TERMINATED(RTS_Message &message) +{ + if( m_state == DQRNetworkManager::DNM_INT_STATE_JOINING_WAITING_FOR_ACTIVE_SESSION ) + { + m_joinCreateSessionAttempts++; + if( m_joinCreateSessionAttempts > DQRNetworkManager::JOIN_CREATE_SESSION_MAX_ATTEMPTS ) + { + SetState(DQRNetworkManager::DNM_INT_STATE_JOINING_FAILED); + } + else + { + SetState(DQRNetworkManager::DNM_INT_STATE_JOINING_GET_SDA); + } + } +} + +int DQRNetworkManager::_RTSDoWorkThread(void* lpParameter) +{ + DQRNetworkManager *pDQR = (DQRNetworkManager *)lpParameter; + return pDQR->RTSDoWorkThread(); +} + +static const DWORD XRNS_TERMINATE_LOCAL_SESSION_FLAG_IMMEDIATE = 0x00000001; +int DQRNetworkManager::RTSDoWorkThread() +{ + do + { + if( m_XRNS_Session ) + { + try + { + m_XRNS_Session->DoWork(20); + } + catch(Platform::COMException^ ex) + { + // swallow exceptions + } + catch(...) + { + // swallow exceptions + } + UpdateRTSStats(); + } + else + { + Sleep(20); + } + ProcessRTSMessagesOutgoing(); + } while(true); +} + +void DQRNetworkManager::ProcessRTSMessagesOutgoing() +{ + EnterCriticalSection(&m_csRTSMessageQueueOutgoing); + while(m_RTSMessageQueueOutgoing.size() > 0 ) + { + RTS_Message message = m_RTSMessageQueueOutgoing.front(); + switch( message.m_eType ) + { + case eRTSMessageType::RTS_MESSAGE_START_CLIENT: + Process_RTS_MESSAGE_START_CLIENT(message); + break; + case eRTSMessageType::RTS_MESSAGE_START_HOST: + Process_RTS_MESSAGE_START_HOST(message); + break; + case eRTSMessageType::RTS_MESSAGE_TERMINATE: + Process_RTS_MESSAGE_TERMINATE(message); + break; + case eRTSMessageType::RTS_MESSAGE_SEND_DATA: + Process_RTS_MESSAGE_SEND_DATA(message); + break; + default: + break; + } + m_RTSMessageQueueOutgoing.pop(); + } + LeaveCriticalSection(&m_csRTSMessageQueueOutgoing); +}; + +void DQRNetworkManager::Process_RTS_MESSAGE_START_CLIENT(RTS_Message &message) +{ + if( m_XRNS_Session ) + { + m_eventHandlers->Pulldown(m_XRNS_Session); + // Close XRNS session + try + { + m_XRNS_Session->TerminateLocalSession(XRNS_TERMINATE_LOCAL_SESSION_FLAG_IMMEDIATE); + } + catch(Platform::COMException^ ex) + { + // swallow exceptions + } + catch(...) + { + // swallow exceptions + } + + m_XRNS_Session = nullptr; + } + + m_XRNS_Session = ref new WXNRs::Session( m_localSocketAddress, m_remoteSocketAddress, MAX_PLAYERS_IN_TEMPLATE, 0); + m_XRNS_Session->MinSendRate = 512000; + + LogCommentFormat(L"connect retry period %d retries %d, data retry count %d, data retry timeout %d\n",m_XRNS_Session->ConnectRetryPeriod,m_XRNS_Session->MaxConnectRetries,m_XRNS_Session->MaxDataRetries,m_XRNS_Session->MinDataRetryTimeout); + + m_XRNS_Session->MaxConnectRetries = 50; // 50 at 100ms intervals = 5 seconds of attempting to connect + + m_eventHandlers->Setup(m_XRNS_Session); +} + +void DQRNetworkManager::Process_RTS_MESSAGE_START_HOST(RTS_Message &message) +{ + m_XRNS_Session = ref new WXNRs::Session( m_localSocketAddress, MAX_PLAYERS_IN_TEMPLATE, 0); + m_XRNS_Session->MinSendRate = 512000; + m_XRNS_Session->MaxConnectRetries = 50; // 50 at 100ms intervals = 5 seconds of attempting to connect + m_eventHandlers->Setup(m_XRNS_Session); +} + +void DQRNetworkManager::Process_RTS_MESSAGE_TERMINATE(RTS_Message &message) +{ + if( m_XRNS_Session ) + { + m_eventHandlers->Pulldown(m_XRNS_Session); + // Close XRNS session + try + { + m_XRNS_Session->TerminateLocalSession(XRNS_TERMINATE_LOCAL_SESSION_FLAG_IMMEDIATE); + } + catch(Platform::COMException^ ex) + { + // swallow exceptions + } + catch(...) + { + // swallow exceptions + } + + m_XRNS_Session = nullptr; + } +} + +void DQRNetworkManager::Process_RTS_MESSAGE_SEND_DATA(RTS_Message &message) +{ + if( m_XRNS_Session ) + { + unsigned int sessionAddress = message.m_sessionAddress; + + try + { + if( message.m_flags & eRTSFlags::RTS_MESSAGE_FLAG_BROADCAST_MODE ) + { + sessionAddress = m_XRNS_Session->LocalSessionAddress; + } + + m_XRNS_Session->Send( ( message.m_flags & eRTSFlags::RTS_MESSAGE_FLAG_GAME_CHANNEL ) ? WXNRs::ChannelId::DefaultGameSend : WXNRs::ChannelId::DefaultChatSend, + ( message.m_flags & eRTSFlags::RTS_MESSAGE_FLAG_BROADCAST_MODE ) ? WXNRs::SendExceptionType::ExcludedAddresses : WXNRs::SendExceptionType::IncludedAddresses, + Platform::ArrayReference(&message.m_sessionAddress, 1), + Platform::ArrayReference(message.m_pucData, message.m_dataSize), + 0, + ( message.m_flags & eRTSFlags::RTS_MESSAGE_FLAG_RELIABLE ) ? WXNRs::Send_Reliability::Reliable : WXNRs::Send_Reliability::NonReliable, + ( message.m_flags & eRTSFlags::RTS_MESSAGE_FLAG_SEQUENTIAL ) ? WXNRs::Send_Sequence::Sequential : WXNRs::Send_Sequence::NonSequential, + WXNRs::Send_Ack::AckNormal, + ( message.m_flags & eRTSFlags::RTS_MESSAGE_FLAG_COALESCE ) ? WXNRs::Send_Coalesce::CoalesceDelay : WXNRs::Send_Coalesce::CoalesceNever, + WXNRs::Send_MiscState::NoMiscState ); + } + catch(Platform::COMException^ ex) + { + // swallow exceptions + } + catch(...) + { + // swallow exceptions + } + } + free(message.m_pucData); +} + +void DQRNetworkManager::RTS_StartCient() +{ + EnterCriticalSection(&m_csRTSMessageQueueOutgoing); + RTS_Message message; + message.m_eType = eRTSMessageType::RTS_MESSAGE_START_CLIENT; + message.m_pucData = NULL; + message.m_dataSize = 0; + m_RTSMessageQueueOutgoing.push(message); + LeaveCriticalSection(&m_csRTSMessageQueueOutgoing); +} + +void DQRNetworkManager::RTS_StartHost() +{ + EnterCriticalSection(&m_csRTSMessageQueueOutgoing); + RTS_Message message; + message.m_eType = eRTSMessageType::RTS_MESSAGE_START_HOST; + message.m_pucData = NULL; + message.m_dataSize = 0; + m_RTSMessageQueueOutgoing.push(message); + LeaveCriticalSection(&m_csRTSMessageQueueOutgoing); +} + +void DQRNetworkManager::RTS_Terminate() +{ + EnterCriticalSection(&m_csRTSMessageQueueOutgoing); + RTS_Message message; + message.m_eType = eRTSMessageType::RTS_MESSAGE_TERMINATE; + message.m_pucData = NULL; + message.m_dataSize = 0; + m_RTSMessageQueueOutgoing.push(message); + LeaveCriticalSection(&m_csRTSMessageQueueOutgoing); +} + +void DQRNetworkManager::RTS_SendData(unsigned char *pucData, unsigned int dataSize, unsigned int sessionAddress, bool reliable, bool sequential, bool coalesce, bool broadcastMode, bool gameChannel ) +{ + EnterCriticalSection(&m_csRTSMessageQueueOutgoing); + RTS_Message message; + message.m_eType = eRTSMessageType::RTS_MESSAGE_SEND_DATA; + message.m_pucData = (unsigned char *)malloc(dataSize); + memcpy(message.m_pucData, pucData, dataSize); + message.m_dataSize = dataSize; + message.m_sessionAddress = sessionAddress; + message.m_flags = 0; + if( reliable ) message.m_flags |= eRTSFlags::RTS_MESSAGE_FLAG_RELIABLE; + if( sequential ) message.m_flags |= eRTSFlags::RTS_MESSAGE_FLAG_SEQUENTIAL; + if( coalesce ) message.m_flags |= eRTSFlags::RTS_MESSAGE_FLAG_COALESCE; + if( broadcastMode ) message.m_flags |= eRTSFlags::RTS_MESSAGE_FLAG_BROADCAST_MODE; + if( gameChannel ) message.m_flags |= eRTSFlags::RTS_MESSAGE_FLAG_GAME_CHANNEL; + m_RTSMessageQueueOutgoing.push(message); + LeaveCriticalSection(&m_csRTSMessageQueueOutgoing); +} \ No newline at end of file diff --git a/Minecraft.Client/Durango/Network/DQRNetworkPlayer.cpp b/Minecraft.Client/Durango/Network/DQRNetworkPlayer.cpp new file mode 100644 index 00000000..e2d82a90 --- /dev/null +++ b/Minecraft.Client/Durango/Network/DQRNetworkPlayer.cpp @@ -0,0 +1,204 @@ +#include "stdafx.h" +#include "DQRNetworkPlayer.h" +#include "ChatIntegrationLayer.h" + +DQRNetworkPlayer::DQRNetworkPlayer() +{ +} + +DQRNetworkPlayer::DQRNetworkPlayer(DQRNetworkManager *manager, eDQRNetworkPlayerType playerType, bool onHost, int localPlayerIdx, unsigned int sessionAddress) +{ + m_localPlayerIdx = localPlayerIdx; + m_type = playerType; + m_host = onHost; + m_manager = manager; + m_customData = 0; + m_sessionAddress = sessionAddress; +} + +DQRNetworkPlayer::~DQRNetworkPlayer() +{ +} + +PlayerUID DQRNetworkPlayer::GetUID() +{ + return m_UID; +} + +void DQRNetworkPlayer::SetUID(PlayerUID UID) +{ + m_UID = UID; +} + +int DQRNetworkPlayer::GetLocalPlayerIndex() +{ + return m_localPlayerIdx; +} + +uintptr_t DQRNetworkPlayer::GetCustomDataValue() +{ + return m_customData; +} + +void DQRNetworkPlayer::SetCustomDataValue(uintptr_t data) +{ + m_customData = data; +} + +bool DQRNetworkPlayer::IsRemote() +{ + return !IsLocal(); +} + +bool DQRNetworkPlayer::IsHost() +{ + return (m_type == DNP_TYPE_HOST); +} + +bool DQRNetworkPlayer::IsLocal() +{ + // m_host determines whether this *machine* is hosting the game, not this player (which is determined by m_type) + if( m_host ) + { + // If we are the hosting machine, then both the host & local players are local to this machine + return (m_type == DNP_TYPE_HOST) || (m_type == DNP_TYPE_LOCAL); + } + else + { + // Not hosting, just local players are actually physically local + return (m_type == DNP_TYPE_LOCAL) ; + } +} + +bool DQRNetworkPlayer::IsSameSystem(DQRNetworkPlayer *other) +{ + return ( m_sessionAddress == other->m_sessionAddress ); +} + +bool DQRNetworkPlayer::IsTalking() +{ + if(m_manager->m_chat == nullptr) return false; + Microsoft::Xbox::GameChat::ChatUser^ chatUser = m_manager->m_chat->GetChatUserByXboxUserId(ref new Platform::String(m_UID.toString().c_str())); + + if( chatUser == nullptr ) return false; + if( chatUser->TalkingMode == Microsoft::Xbox::GameChat::ChatUserTalkingMode::NotTalking ) + { + return false; + } + else + { + return true; + } +} + +bool DQRNetworkPlayer::HasVoice() +{ + if(m_manager->m_chat == nullptr) return false; + Microsoft::Xbox::GameChat::ChatUser^ chatUser = m_manager->m_chat->GetChatUserByXboxUserId(ref new Platform::String(m_UID.toString().c_str())); + + if( chatUser == nullptr ) return false; + if( ((int)chatUser->ParticipantType) & ((int)Windows::Xbox::Chat::ChatParticipantTypes::Talker) ) + { + return true; + } + else + { + return false; + } +} + +bool DQRNetworkPlayer::HasCamera() +{ + return false; +} + +LPCWSTR DQRNetworkPlayer::GetGamertag() +{ + return m_name; +} + +int DQRNetworkPlayer::GetSmallId() +{ + return (int)m_smallId; +} + +void DQRNetworkPlayer::SetSmallId(unsigned char smallId) +{ + m_smallId = smallId; +} + +int DQRNetworkPlayer::GetSessionIndex() +{ + return m_manager->GetSessionIndex(this); +} + +// Attempt to send data, of any size, from this player to that specified by pPlayerTarget. This may not be possible depending on the two players, due to +// our star shaped network connectivity. Data may be any size, and is copied so on returning from this method it does not need to be preserved. +void DQRNetworkPlayer::SendData( DQRNetworkPlayer *pPlayerTarget, const void *data, unsigned int dataSize ) +{ + // Our network is connected as a star. If we are the host, then we can send to any remote player. If we're a client, we can send only to the host. + // The host can also send to other local players, but this doesn't need to go through Rudp. + if( m_host ) + { + if( ( m_type == DNP_TYPE_HOST ) && ( pPlayerTarget->m_type == DNP_TYPE_REMOTE ) ) + { + // Rudp communication from host to remote player - handled by remote player instance + pPlayerTarget->SendInternal(data,dataSize); + } + else + { + // Can't do any other types of communications + assert(false); + } + } + else + { + if( ( m_type == DNP_TYPE_LOCAL ) && ( pPlayerTarget->m_type == DNP_TYPE_HOST ) ) + { + // Rudp communication from client to host - handled by this player instace + SendInternal(data, dataSize); + } + else + { + // Can't do any other types of communications + assert(false); + } + } +} + +void DQRNetworkPlayer::SendInternal(const void *data, unsigned int dataSize) +{ + m_manager->SendBytes(m_smallId, (BYTE *)data, dataSize); +} + +int DQRNetworkPlayer::GetSendQueueSizeBytes() +{ + return m_manager->GetQueueSizeBytes(); +} + +int DQRNetworkPlayer::GetSendQueueSizeMessages() +{ + return m_manager->GetQueueSizeMessages(); +} + +wchar_t *DQRNetworkPlayer::GetName() +{ + return m_name; +} + +void DQRNetworkPlayer::SetName(const wchar_t *name) +{ + wcscpy_s(m_name, name); +} + +// Return display name (if display name is not set, return name instead) +wstring DQRNetworkPlayer::GetDisplayName() +{ + return (m_displayName == L"") ? m_name : m_displayName; +} + +// Set display name +void DQRNetworkPlayer::SetDisplayName(wstring displayName) +{ + m_displayName = displayName; +} \ No newline at end of file diff --git a/Minecraft.Client/Durango/Network/DQRNetworkPlayer.h b/Minecraft.Client/Durango/Network/DQRNetworkPlayer.h new file mode 100644 index 00000000..fd140722 --- /dev/null +++ b/Minecraft.Client/Durango/Network/DQRNetworkPlayer.h @@ -0,0 +1,65 @@ +#pragma once +#include "DQRNetworkManager.h" +#include + +// This is the lowest level class for handling the concept of a player on Durango. This is managed by DQRNetworkManager. The game shouldn't directly communicate +// with this class, as it is wrapped by NetworkPlayerDurango which is an implementation of a platform-independent interface INetworkPlayer. + +class DQRNetworkPlayer +{ +public: + friend class DQRNetworkManager; + + typedef enum + { + DNP_TYPE_HOST, // This player represents the host + DNP_TYPE_LOCAL, // On host - this player is a local player that needs communicated with specially not using rudp. On clients - this is a local player, where network communications can be used to communicate with the host + DNP_TYPE_REMOTE, // On host - this player can be used to communicate from between the host and this player. On clients - this is a remote player that cannot be communicated with + } eDQRNetworkPlayerType; + + DQRNetworkPlayer(); + DQRNetworkPlayer(DQRNetworkManager *manager, eDQRNetworkPlayerType playerType, bool onHost, int localPlayerIdx, unsigned int sessionAddress); + ~DQRNetworkPlayer(); + + PlayerUID GetUID(); + void SetUID(PlayerUID UID); + int GetLocalPlayerIndex(); + uintptr_t GetCustomDataValue(); + void SetCustomDataValue(uintptr_t data); + bool IsRemote(); + bool IsHost(); + bool IsLocal(); + bool IsSameSystem(DQRNetworkPlayer *other); + bool HasVoice(); + bool IsTalking(); + bool HasCamera(); + LPCWSTR GetGamertag(); + int GetSmallId(); + void SetSmallId(unsigned char smallId); + int GetSessionIndex(); + void SendData( DQRNetworkPlayer *pPlayerTarget, const void *data, unsigned int dataSize ); + + int GetSendQueueSizeBytes(); + int GetSendQueueSizeMessages(); + + wchar_t *GetName(); + void SetName(const wchar_t *name); + + std::wstring GetDisplayName(); + void SetDisplayName(std::wstring displayName); +private: + void SendInternal(const void *data, unsigned int dataSize); + + eDQRNetworkPlayerType m_type; // The player type + bool m_host; // Whether this actual player class is stored on a host (not whether it represents the host, or a player on the host machine) + int m_localPlayerIdx; // Index of this player on the machine to which it belongs + DQRNetworkManager *m_manager; // Pointer back to the manager that is managing this player + + PlayerUID m_UID; + uintptr_t m_customData; + unsigned char m_smallId; + unsigned int m_sessionAddress; + + wchar_t m_name[21]; + std::wstring m_displayName; +}; \ No newline at end of file diff --git a/Minecraft.Client/Durango/Network/NetworkPlayerDurango.cpp b/Minecraft.Client/Durango/Network/NetworkPlayerDurango.cpp new file mode 100644 index 00000000..fd2181df --- /dev/null +++ b/Minecraft.Client/Durango/Network/NetworkPlayerDurango.cpp @@ -0,0 +1,113 @@ +#include "stdafx.h" +#include "NetworkPlayerDurango.h" + +NetworkPlayerDurango::NetworkPlayerDurango(DQRNetworkPlayer *qnetPlayer) +{ + m_dqrPlayer = qnetPlayer; + m_pSocket = NULL; +} + +unsigned char NetworkPlayerDurango::GetSmallId() +{ + return m_dqrPlayer->GetSmallId(); +} + +void NetworkPlayerDurango::SendData(INetworkPlayer *player, const void *pvData, int dataSize, bool lowPriority) +{ + m_dqrPlayer->SendData( ((NetworkPlayerDurango *)player)->m_dqrPlayer, pvData, dataSize ); +} + +bool NetworkPlayerDurango::IsSameSystem(INetworkPlayer *player) +{ + return m_dqrPlayer->IsSameSystem(((NetworkPlayerDurango *)player)->m_dqrPlayer); +} + +int NetworkPlayerDurango::GetSendQueueSizeBytes( INetworkPlayer *player, bool lowPriority ) +{ + return m_dqrPlayer->GetSendQueueSizeBytes(); +} + +int NetworkPlayerDurango::GetSendQueueSizeMessages( INetworkPlayer *player, bool lowPriority ) +{ + return m_dqrPlayer->GetSendQueueSizeMessages(); +} + +int NetworkPlayerDurango::GetCurrentRtt() +{ + return 0; // TODO +} + +bool NetworkPlayerDurango::IsHost() +{ + return m_dqrPlayer->IsHost(); +} + +bool NetworkPlayerDurango::IsGuest() +{ + return false; // TODO +} + +bool NetworkPlayerDurango::IsLocal() +{ + return m_dqrPlayer->IsLocal(); +} + +int NetworkPlayerDurango::GetSessionIndex() +{ + return m_dqrPlayer->GetSessionIndex(); +} + +bool NetworkPlayerDurango::IsTalking() +{ + return m_dqrPlayer->IsTalking(); +} + +bool NetworkPlayerDurango::IsMutedByLocalUser(int userIndex) +{ + return false; +} + +bool NetworkPlayerDurango::HasVoice() +{ + return m_dqrPlayer->HasVoice(); +} + +bool NetworkPlayerDurango::HasCamera() +{ + return false; // TODO +} + +int NetworkPlayerDurango::GetUserIndex() +{ + return m_dqrPlayer->GetLocalPlayerIndex(); +} + +void NetworkPlayerDurango::SetSocket(Socket *pSocket) +{ + m_pSocket = pSocket; +} + +Socket *NetworkPlayerDurango::GetSocket() +{ + return m_pSocket; +} + +const wchar_t *NetworkPlayerDurango::GetOnlineName() +{ + return m_dqrPlayer->GetName(); +} + +wstring NetworkPlayerDurango::GetDisplayName() +{ + return m_dqrPlayer->GetDisplayName(); +} + +PlayerUID NetworkPlayerDurango::GetUID() +{ + return m_dqrPlayer->GetUID(); +} + +void NetworkPlayerDurango::SetUID(PlayerUID UID) +{ + m_dqrPlayer->SetUID(UID); +} \ No newline at end of file diff --git a/Minecraft.Client/Durango/Network/NetworkPlayerDurango.h b/Minecraft.Client/Durango/Network/NetworkPlayerDurango.h new file mode 100644 index 00000000..c95e8aef --- /dev/null +++ b/Minecraft.Client/Durango/Network/NetworkPlayerDurango.h @@ -0,0 +1,39 @@ +#pragma once + +#include "..\..\Common\Network\NetworkPlayerInterface.h" +#include "DQRNetworkPlayer.h" + +// This is an implementation of the INetworkPlayer interface, for Durango. It effectively wraps the DQRNetworkPlayer class in a non-platform-specific way. + +class NetworkPlayerDurango : public INetworkPlayer +{ +public: + // Common player interface + NetworkPlayerDurango(DQRNetworkPlayer *sqrPlayer); + virtual unsigned char GetSmallId(); + virtual void SendData(INetworkPlayer *player, const void *pvData, int dataSize, bool lowPriority); + virtual bool IsSameSystem(INetworkPlayer *player); + virtual int GetSendQueueSizeBytes( INetworkPlayer *player, bool lowPriority ); + virtual int GetSendQueueSizeMessages( INetworkPlayer *player, bool lowPriority ); + virtual int GetCurrentRtt(); + virtual bool IsHost(); + virtual bool IsGuest(); + virtual bool IsLocal(); + virtual int GetSessionIndex(); + virtual bool IsTalking(); + virtual bool IsMutedByLocalUser(int userIndex); + virtual bool HasVoice(); + virtual bool HasCamera(); + virtual int GetUserIndex(); + virtual void SetSocket(Socket *pSocket); + virtual Socket *GetSocket(); + virtual const wchar_t *GetOnlineName(); + virtual wstring GetDisplayName(); + virtual PlayerUID GetUID(); + + void SetUID(PlayerUID UID); + +private: + DQRNetworkPlayer *m_dqrPlayer; + Socket *m_pSocket; +}; \ No newline at end of file diff --git a/Minecraft.Client/Durango/Network/PartyController.cpp b/Minecraft.Client/Durango/Network/PartyController.cpp new file mode 100644 index 00000000..753a71ac --- /dev/null +++ b/Minecraft.Client/Durango/Network/PartyController.cpp @@ -0,0 +1,1205 @@ +//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF +//// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO +//// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A +//// PARTICULAR PURPOSE. +//// +//// Copyright (c) Microsoft Corporation. All rights reserved +#include "stdafx.h" +#include "PartyController.h" +#include "DQRNetworkManager.h" +#include + +/* +#include "time.h" +#include "../GameLogic/Game.h" +#include "../Utils/LogController.h" +#include "../Utils/Utils.h" +#include "UserController.h" +#include "SessionController.h" +*/ + +using namespace Concurrency; +using namespace Microsoft::Xbox::Services::Multiplayer; +using namespace Microsoft::Xbox::Services::Matchmaking; +using namespace Microsoft::Xbox::Services; +using namespace Windows::Foundation::Collections; +using namespace Windows::Foundation; +using namespace Windows::Storage::Streams; +using namespace Windows::Storage; +using namespace Windows::System; +using namespace Windows::UI::Core; +using namespace Windows::Xbox::Multiplayer; +using namespace Windows::Xbox::Networking; +using namespace Windows::Xbox::System; + + +PartyController::PartyController(DQRNetworkManager *pDQRNet) : + m_isGameSessionReadyEventTriggered(false), + m_isGamePlayerEventRegistered(false), + m_pDQRNet(pDQRNet) +{ +} + +void PartyController::DebugPrintPartyView( Windows::Xbox::Multiplayer::PartyView^ partyView ) +{ + DQRNetworkManager::LogComment( L"PartyView:" ); + if( partyView == nullptr ) + { + DQRNetworkManager::LogComment( L" No party view" ); + return; + } + + DQRNetworkManager::LogComment( L" GameSession::SessionName: " + (partyView->GameSession ? partyView->GameSession->SessionName : L"NONE") ); + DQRNetworkManager::LogComment( L" GameSession::SessionTemplateName " + (partyView->GameSession ? partyView->GameSession->SessionTemplateName : L"NONE") ); + DQRNetworkManager::LogComment( L" GameSession::ServiceConfigurationId " + (partyView->GameSession ? partyView->GameSession->ServiceConfigurationId : L"NONE") ); + DQRNetworkManager::LogComment( L" MatchSession: " + (partyView->MatchSession ? partyView->MatchSession->SessionName : L"NONE") ); + DQRNetworkManager::LogComment( L" IsPartyInAnotherTitle: " + partyView->IsPartyInAnotherTitle.ToString() ); + + DQRNetworkManager::LogComment( L" Members: " + partyView->Members->Size.ToString() ); + for( PartyMember^ member : partyView->Members ) + { + DQRNetworkManager::LogComment( L" Member:" ); + DQRNetworkManager::LogComment( L" XboxUserID: " + member->XboxUserId ); + DQRNetworkManager::LogCommentFormat( L" IsLocalUser: %s", member->IsLocal ? L"TRUE" : L"FALSE" ); +// DQRNetworkManager::LogComment( L" JoinTime: " + Utils::DateTimeToString(member->JoinTime) ); + } + + DQRNetworkManager::LogComment( L" ReservedMembers: " + partyView->ReservedMembers->Size.ToString() ); + for( Platform::String^ memberXuid : partyView->ReservedMembers ) + { + DQRNetworkManager::LogComment( L" ReservedMember:" ); + DQRNetworkManager::LogComment( L" XboxUserID " + memberXuid ); + } + + DQRNetworkManager::LogComment( L" MembersGroupedByDevice: " + partyView->MembersGroupedByDevice->Size.ToString() ); + for( PartyMemberDeviceGroup^ partyMemberDeviceGroup : partyView->MembersGroupedByDevice ) + { + DQRNetworkManager::LogComment( L" Device:" ); + for( PartyMember^ member : partyMemberDeviceGroup->Members ) + { + DQRNetworkManager::LogComment( L" Member:" ); + DQRNetworkManager::LogComment( L" XboxUserID: " + member->XboxUserId ); + DQRNetworkManager::LogCommentFormat( L" IsLocalUser: %s", member->IsLocal ? L"TRUE" : L"FALSE" ); +// DQRNetworkManager::LogComment( L" JoinTime: " + Utils::DateTimeToString(member->JoinTime) ); + } + } +} + +void PartyController::RefreshPartyView() +{ +// LogComment( L"RefreshPartyView" ); + + PartyView^ partyView; + try + { + IAsyncOperation^ partyOperation = Party::GetPartyViewAsync(); + create_task(partyOperation) + .then([this, &partyView] (task t) + { + try + { + Concurrency::critical_section::scoped_lock lock(m_lock); + partyView = t.get(); + } + catch ( Platform::Exception^ ex ) + { + if( ex->HResult != (int)Windows::Xbox::Multiplayer::PartyErrorStatus::EmptyParty ) + { +// LogCommentWithError( L"GetPartyView failed", ex->HResult ); + } + + } + }).wait(); + } + catch ( Platform::Exception^ ex ) + { + partyView = nullptr; +// LogCommentWithError( L"GetPartyView failed", ex->HResult ); + } + + DebugPrintPartyView(partyView); + + SetPartyView(partyView); +} + +// Add any players specified in userMask to the party. This method returns a bool that is true if the a player was added, which wasn't already +// in the game session associated with the party. This is used to determine whether we should be waiting for a slot to be added for it by the host. +bool PartyController::AddLocalUsersToParty(int userMask, Windows::Xbox::System::User^ primaryUser) +{ + bool addedNewPlayerToPartyThatIsntInSession = false; + + PartyView^ partyView = GetPartyView(); + + // If there's already a party, then attempt to get a session document as we'll be needing this later + MultiplayerSession^ session; + if( partyView ) + { + MXS::XboxLiveContext^ xblContext = ref new MXS::XboxLiveContext(primaryUser); + if( xblContext ) + { + // Get a copy of the session document, for this user + auto multiplayerSessionAsync = xblContext->MultiplayerService->GetCurrentSessionAsync( m_pDQRNet->ConvertToMicrosoftXboxServicesMultiplayerSessionReference(partyView->GameSession)); + create_task(multiplayerSessionAsync).then([&session,this](task t) + { + try + { + session = t.get(); // if t.get() didn't throw, it succeeded + } + catch (Platform::COMException^ ex) + { + DQRNetworkManager::LogCommentWithError( L"GetCurrentSessionAsync failed", ex->HResult ); + } + }) + .wait(); + } + } + + // Adds all local players that are specified in userMask to the party belonging to the primary player + IVector^ localUsersToAddVector = ref new Platform::Collections::Vector; + for( int i = 0; i < 4; i++ ) + { + if( userMask & ( 1 << i ) ) + { + bool alreadyHere = false; + if( partyView ) + { + Windows::Xbox::System::User^ userToAdd = ProfileManager.GetUser(i, true); + for( int j = 0; j < partyView->Members->Size; j++ ) + { + if( partyView->Members->GetAt(j)->XboxUserId == userToAdd->XboxUserId ) + { + primaryUser = userToAdd; // If there is already a party, then the acting user passed to AddLocalUsersAsync must be a user that is in that party, so make sure this is the case. Doesn't matter Which user. + alreadyHere = true; + break; + } + } + } + + if( !alreadyHere ) + { + localUsersToAddVector->Append(ProfileManager.GetUser(i)); + bool alreadyInSession = false; + if( session ) + { + if( m_pDQRNet->IsPlayerInSession( ProfileManager.GetUser(i, true)->XboxUserId, session, NULL ) ) + { + alreadyInSession = true; + } + } + if( !alreadyInSession ) + { + addedNewPlayerToPartyThatIsntInSession = true; + } + } + } + } + + IVectorView^ localUsersToAddVecView = localUsersToAddVector->GetView(); + + try + { + IAsyncAction^ addMemberOperation = Party::AddLocalUsersAsync( primaryUser, localUsersToAddVecView ); + + create_task(addMemberOperation) + .then([this] (task t) + { + try + { + t.get(); + RefreshPartyView(); + } + catch (Platform::COMException^ ex) + { + DQRNetworkManager::LogCommentWithError( L"AddLocalUsersAsync failed", ex->HResult ); + } + catch (Platform::OperationCanceledException^ ex) + { + DQRNetworkManager::LogCommentWithError( L"AddLocalUsersAsync failed - operation cancelled", ex->HResult ); + } + }).wait(); + } + catch (Platform::COMException^ ex) + { + DQRNetworkManager::LogCommentWithError( L"AddLocalUsersAsync failed to create", ex->HResult ); + } + + return addedNewPlayerToPartyThatIsntInSession; +} + +void PartyController::CheckPartySessionFull(Windows::Xbox::System::User^ primaryUser) +{ + RefreshPartyView(); + + PartyView^ partyView = GetPartyView(); + + // If there's already a party, then attempt to get a session document + MultiplayerSession^ session; + if( partyView && partyView->GameSession) + { + MXS::XboxLiveContext^ xblContext = ref new MXS::XboxLiveContext(primaryUser); + if( xblContext ) + { + // Get a copy of the session document, for this user + auto multiplayerSessionAsync = xblContext->MultiplayerService->GetCurrentSessionAsync( m_pDQRNet->ConvertToMicrosoftXboxServicesMultiplayerSessionReference(partyView->GameSession)); + create_task(multiplayerSessionAsync).then([&session,this](task t) + { + try + { + session = t.get(); // if t.get() didn't throw, it succeeded + } + catch (Platform::COMException^ ex) + { + DQRNetworkManager::LogCommentWithError( L"GetCurrentSessionAsync failed", ex->HResult ); + } + }) + .wait(); + } + if( session ) + { + int nonLocalPlayerCount = 0; + for( int i = 0; i < session->Members->Size; i++ ) + { + MXSM::MultiplayerSessionMember^ member = session->Members->GetAt(i); + + bool isLocalPlayer = false; + for( int j = 4; j < 12; j++ ) + { + WXS::User ^user = InputManager.GetUserForGamepad(j); + if( user != nullptr ) + { + if( user->XboxUserId == member->XboxUserId ) + { + isLocalPlayer = true; + } + } + } + if( !isLocalPlayer ) + { + nonLocalPlayerCount++; + } + } + app.DebugPrintf(">>>>> Invited to a game with a non-local player count of %d\n", nonLocalPlayerCount); + + if( nonLocalPlayerCount >= DQRNetworkManager::MAX_ONLINE_PLAYER_COUNT ) + { + m_pDQRNet->FlagInvitedToFullSession(); + } + } + } +} + +void PartyController::SetJoinability(bool isJoinable) +{ + Party::Joinability = isJoinable ? WXM::SessionJoinability::JoinableByFriends : WXM::SessionJoinability::InviteOnly; +} + +void PartyController::DisassociateSessionFromParty( Microsoft::Xbox::Services::Multiplayer::MultiplayerSessionReference^ sessionReference) +{ + RefreshPartyView(); + + PartyView^ partyView = GetPartyView(); + + if( partyView ) + { + // We need a user to be the acting user, when disassociating the party. Attempt to find a party member who is local. + for( int j = 0; j < partyView->Members->Size; j++ ) + { + Windows::Xbox::Multiplayer::PartyMember^ partyMember = partyView->Members->GetAt(j); + if( partyMember->IsLocal ) + { + IVectorView^ localUsers = Windows::Xbox::System::User::Users; + + for( int i = 0; i < localUsers->Size; i++ ) + { + Windows::Xbox::System::User^ localUser = localUsers->GetAt(i); + if( localUser->XboxUserId == partyMember->XboxUserId ) + { + // Convert the session reference (in Microsoft::Xbox::Services::Multiplayer namespace) to Windows::Xbox::Multiplayer names space so we can use in the party system + WXM::MultiplayerSessionReference^ winSessionRef = m_pDQRNet->ConvertToWindowsXboxMultiplayerSessionReference(sessionReference); + + auto disassociateSessionAsync = WXM::Party::DisassociateGameSessionAsync(localUser, winSessionRef); + create_task(disassociateSessionAsync).then([this](task t) + { + try + { + t.get(); // if t.get() didn't throw, it succeeded + } + catch (Platform::COMException^ ex) + { + m_pDQRNet->LogCommentWithError( L"DisassociateGameSessionAsync failed", ex->HResult ); + } + }); + //.wait(); // There are situations in which this never completes (?!) so waiting isn't a good idea + return; + } + } + } + } + } + + +} + +void PartyController::RemoveLocalUsersFromParty(Windows::Xbox::System::User^ primaryUser) +{ + PartyView^ partyView = GetPartyView(); + + if( partyView == nullptr ) return; + + // Attempt to remove all local users that are currently in the party + IVectorView^ localUsers = Windows::Xbox::System::User::Users; + IVector^ localUsersToRemoveVector = ref new Platform::Collections::Vector; + for( int i = 0; i < localUsers->Size; i++ ) + { + Windows::Xbox::System::User^ userToRemove = localUsers->GetAt(i); + for( int j = 0; j < partyView->Members->Size; j++ ) + { + if( partyView->Members->GetAt(j)->XboxUserId == userToRemove->XboxUserId ) + { + localUsersToRemoveVector->Append(userToRemove); + break; + } + } + } + + IVectorView^ localUsersToRemoveVecView = localUsersToRemoveVector->GetView(); + + IAsyncAction^ removeMemberOperation = Party::RemoveLocalUsersAsync( localUsersToRemoveVecView ); + + create_task(removeMemberOperation) + .then([this] (task t) + { + try + { + t.get(); + RefreshPartyView(); + } + catch (Platform::COMException^ ex) + { + DQRNetworkManager::LogCommentWithError( L"RemoveLocalUsersAsync failed", ex->HResult ); + } + }).wait(); +} + +void PartyController::RemoveLocalUsersFromParty(Windows::Xbox::System::User^ primaryUser, int playerMask, Microsoft::Xbox::Services::Multiplayer::MultiplayerSessionReference^ sessionReference) +{ + PartyView^ partyView = GetPartyView(); + + if( partyView == nullptr ) return; + + // Don't leave the party if it isn't actually the party belonging to the session we are in - this can happen when switching from one game session to another, after accepting an invite to a game whilst already playing + if( sessionReference != nullptr ) + { + if( partyView->GameSession != nullptr ) + { + if( partyView->GameSession->SessionName != sessionReference->SessionName ) return; + } + } + + // Attempt to remove all specified local users that are currently in the party. Check that each player is actually in + // the party, as we'll get an exception for trying to remove players that aren't + + IVector^ localUsersToRemoveVector = ref new Platform::Collections::Vector; + + for( int i = 0; i < MAX_LOCAL_PLAYERS; i++ ) + { + if( playerMask & ( 1 << i ) ) + { + Windows::Xbox::System::User^ userToRemove = ProfileManager.GetUser(i, true); + if(userToRemove!=nullptr) + { + for( int j = 0; j < partyView->Members->Size; j++ ) + { + if( partyView->Members->GetAt(j)->XboxUserId == userToRemove->XboxUserId ) + { + localUsersToRemoveVector->Append(userToRemove); + break; + } + } + } + } + } + + IVectorView^ localUsersToRemoveVecView = localUsersToRemoveVector->GetView(); + + IAsyncAction^ removeMemberOperation = Party::RemoveLocalUsersAsync( localUsersToRemoveVecView ); + + create_task(removeMemberOperation) + .then([this] (task t) + { + try + { + t.get(); + RefreshPartyView(); + } + catch (Platform::COMException^ ex) + { + DQRNetworkManager::LogCommentWithError( L"RemoveLocalUsersAsync failed", ex->HResult ); + } + }).wait(); +} + +void PartyController::RemoveLocalUserFromParty(Windows::Xbox::System::User^ userToRemove) +{ + // Attempt to a specific local user from the party + + RefreshPartyView(); + + // Don't need to do anything if there isn't currently a party + PartyView^ partyView = GetPartyView(); + + if( partyView == nullptr ) return; + + // Don't need to do anything if this player isn't in the current party - the remove will raise an exception + bool inParty = false; + for( int i = 0; i < partyView->Members->Size; i++ ) + { + if( partyView->Members->GetAt(i)->XboxUserId == userToRemove->XboxUserId ) + { + inParty = true; + break; + } + } + if( !inParty ) return; + + IVector^ localUsersToRemoveVector = ref new Platform::Collections::Vector; + localUsersToRemoveVector->Append(userToRemove); + IVectorView^ localUsersToRemoveVecView = localUsersToRemoveVector->GetView(); + + IAsyncAction^ removeMemberOperation = Party::RemoveLocalUsersAsync( localUsersToRemoveVecView ); + + create_task(removeMemberOperation) + .then([this] (task t) + { + try + { + t.get(); + RefreshPartyView(); + } + catch (Platform::COMException^ ex) + { + DQRNetworkManager::LogCommentWithError( L"RemoveLocalUsersAsync failed", ex->HResult ); + } + }).wait(); +} + +void PartyController::RegisterGamePlayersChangedEventHandler() +{ + // Listen to Party::GamePlayersChanged + // Only the HOST should register for this event to detect if any party members were added that should be pulled into the game. + EventHandler^ partyGamePlayersChanged = ref new EventHandler( + [this] (Platform::Object^, GamePlayersChangedEventArgs^ eventArgs) + { + OnGamePlayersChanged( eventArgs ); + }); + m_partyGamePlayersChangedToken = Party::GamePlayersChanged += partyGamePlayersChanged; + m_isGamePlayerEventRegistered = true; +} + +void PartyController::RegisterEventHandlers() +{ + // Listen to Party Roster Changed + EventHandler^ partyRosterChangedEvent = ref new EventHandler( + [this] (Platform::Object^, PartyRosterChangedEventArgs^ eventArgs) + { + OnPartyRosterChanged( eventArgs ); + }); + m_partyRosterChangedToken = Party::PartyRosterChanged += partyRosterChangedEvent; + + // Listen to Party State Changed + EventHandler^ partyStateChangedEvent = ref new EventHandler( + [this] (Platform::Object^, PartyStateChangedEventArgs^ eventArgs) + { + OnPartyStateChanged( eventArgs ); + }); + m_partyStateChangedToken = Party::PartyStateChanged += partyStateChangedEvent; + // Listen to Game Session Ready + EventHandler^ gameSessionReadyEvent = ref new EventHandler( + [this] (Platform::Object^, GameSessionReadyEventArgs^ eventArgs) + { + OnGameSessionReady(eventArgs); + }); + m_partyGameSessionReadyToken = Party::GameSessionReady += gameSessionReadyEvent; +} + +void PartyController::UnregisterEventHandlers() +{ + Party::PartyRosterChanged -= m_partyRosterChangedToken; + Party::PartyStateChanged -= m_partyStateChangedToken; + Party::GameSessionReady -= m_partyGameSessionReadyToken; +} + +void PartyController::UnregisterGamePlayersEventHandler() +{ + if(m_isGamePlayerEventRegistered) + { + Party::GamePlayersChanged -= m_partyGamePlayersChangedToken; + } +} + +// This event will fire when : +// - A new Match Session registered to party, or +// - A new Game Session is registered to party (via RegisterGame call, or as a result of matchmaking), and +// - Party Title ID changes (which will trigger change in IsPartyInAnotherTItle bool flag). +void PartyController::OnPartyStateChanged( PartyStateChangedEventArgs^ eventArgs ) +{ + DQRNetworkManager::LogComment( L"OnPartyStateChanged"); + RefreshPartyView(); +} + +void PartyController::OnPartyRosterChanged( PartyRosterChangedEventArgs^ eventArgs ) +{ + if( m_pDQRNet->m_multiplayerSession == nullptr) return; + + RefreshPartyView(); + + XboxLiveContext^ xboxLiveContext = m_pDQRNet->m_primaryUserXboxLiveContext; + if( xboxLiveContext == nullptr ) return; + + DQRNetworkManager::LogComment( L"OnPartyRosterChanged"); + + if( eventArgs->RemovedMembers->Size ) + { + DQRNetworkManager::LogComment( L"Removed Members:"); + } + + // First, establish whether an active player local to this machine have been removed + bool activePlayerRemoved = false; + int playerLeavingMask = 0; + + // If there's no party anymore, then we're all leaving + if( m_partyView == nullptr ) + { + playerLeavingMask = m_pDQRNet->m_currentUserMask; + } + else + { + // Still a party, find out who left + for( int i = 0; i < eventArgs->RemovedMembers->Size; i++ ) + { + DQRNetworkPlayer *player = m_pDQRNet->GetPlayerByXuid(PlayerUID(eventArgs->RemovedMembers->GetAt(i)->Data())); + if( player ) + { + if( player->IsLocal() ) + { + playerLeavingMask |= ( 1 << player->GetLocalPlayerIndex() ); + } + } + DQRNetworkManager::LogComment(eventArgs->RemovedMembers->GetAt(i)); + } + } + + // If a local player is leaving the party, we want to handle it generally as if they had selected to exit from within the game, assuming that they have just deliberatly removed themselves from + // the party via the system interface. However... we may be being removed from this party because we have just accepted a request to join Another party via a "game session ready" sort of prompt. + // I don't think there's any way to distinguish these two things happening at this stage, so at this point we will signal to the DQR layer what has just happened, + // and it will only do something about it after some period of time has passed without a new game party becoming ready for the player to join + if( playerLeavingMask ) + { + m_pDQRNet->HandlePlayerRemovedFromParty(playerLeavingMask); + } +} + +#define LAST_INVITED_TIME_TIMEOUT 3 * 60 //secs +void PartyController::AddAvailableGamePlayers(IVectorView^ availablePlayers, int& remainingSlots, MultiplayerSession^ currentSession) +{ + bool bNewMembersAdded = false; + for each (Windows::Xbox::Multiplayer::GamePlayer^ player in availablePlayers) + { + if( remainingSlots <= 0 ) + { + DQRNetworkManager::LogCommentFormat( L"No more available slots - broadcasting failure of adding player %s",player->XboxUserId->Data()); + m_pDQRNet->SendAddPlayerFailed(player->XboxUserId); + continue; + } + + // Not sure what this condition is actually for - removing until I can see a use for it +#if 0 + if( GetTimeBetweenInSeconds(player->LastInvitedTime, GetCurrentTime()) < LAST_INVITED_TIME_TIMEOUT ) + { + DQRNetworkManager::LogComment( L"Possible user just exited; skipping join request" ); + continue; + } +#endif + + if( m_pDQRNet->IsPlayerInSession(player->XboxUserId, currentSession, NULL)) + { + DQRNetworkManager::LogComment( L"Player is already in session; skipping join request: " + player->XboxUserId->ToString() ); + continue; + } + + // Have a search through our local players, to see if we have a controller for this player. If so, then we'll want to add them directly to the game (if at all), rather than using + // the reservation system + bool bFoundLocal = false; + for( int i = 4; i < 12; i++ ) + { + WXS::User^ user = InputManager.GetUserForGamepad(i); + if( user != nullptr ) + { + if( user->XboxUserId == player->XboxUserId ) + { + bFoundLocal = true; + // Check that they aren't in the game already (don't see how this could be the case anyway) + if( m_pDQRNet->GetPlayerByXuid( PlayerUID(player->XboxUserId->Data()) ) == NULL ) + { + // And check whether they are signed in yet or not + int userIdx = -1; + for( int j = 0; j < MAX_LOCAL_PLAYERS; j++ ) + { + WXS::User^ user2 = ProfileManager.GetUser(j); + if( user2 != nullptr ) + { + if(user2->XboxUserId == user->XboxUserId) + { + userIdx = j; + break; + } + } + } + + // If not found, then attempt to add them since we've found a controller + if( userIdx == -1 ) + { + // Found the appropriate controller. Attempt to add it - this will return -1 if unsuccessful + userIdx = ProfileManager.AddGamepadToGame(i); + } + + // Found a slot, so just need to add the user now + if( userIdx != -1 ) + { + m_pDQRNet->AddLocalPlayerByUserIndex(userIdx); + } + } + } + } + } + if(bFoundLocal) + { + continue; + } + + currentSession->AddMemberReservation( player->XboxUserId, m_pDQRNet->GetNextSmallIdAsJsonString(), true ); + DQRNetworkManager::LogComment( L"Member added: " + player->XboxUserId->ToString() ); + bNewMembersAdded = true; + remainingSlots--; + } + + if(bNewMembersAdded) + { + XboxLiveContext^ xboxLiveContext = m_pDQRNet->m_primaryUserXboxLiveContext; + DQRNetworkManager::LogComment( L"New members found and added from related parties" ); + HRESULT hr = S_OK; + Microsoft::Xbox::Services::Multiplayer::MultiplayerSession^ outputSession = m_pDQRNet->WriteSessionHelper( + xboxLiveContext, + currentSession, + Microsoft::Xbox::Services::Multiplayer::MultiplayerSessionWriteMode::UpdateExisting, + hr + ); + + if(outputSession != nullptr) + { + Windows::Xbox::Multiplayer::MultiplayerSessionReference^ convertedSessionRef = + m_pDQRNet->ConvertToWindowsXboxMultiplayerSessionReference(currentSession->SessionReference); + Windows::Xbox::System::User^ actingUser = m_pDQRNet->m_primaryUser; + Party::PullReservedPlayersAsync(actingUser, convertedSessionRef); + + m_pDQRNet->HandleSessionChange( outputSession ); + } + } +} + +void PartyController::OnGamePlayersChanged( GamePlayersChangedEventArgs^ eventArgs ) +{ + DQRNetworkManager::LogComment( L"OnGamePlayersChanged"); + + RefreshPartyView(); + + if( m_pDQRNet->m_primaryUser == nullptr ) return; + + IVectorView^ availablePlayers = nullptr; + auto asyncGetAvailablePlayers = Party::GetAvailableGamePlayersAsync(m_pDQRNet->m_primaryUser); + create_task(asyncGetAvailablePlayers).then([&availablePlayers](task^> t) + { + try + { + availablePlayers = t.get(); + } + catch( Platform::COMException^ ex ) + { + } + }).wait(); + + if( availablePlayers == nullptr ) return; + + Microsoft::Xbox::Services::Multiplayer::MultiplayerSessionReference^ sessionRef = + m_pDQRNet->ConvertToMicrosoftXboxServicesMultiplayerSessionReference(eventArgs->GameSession); + + if(sessionRef == nullptr) + { +// LogComment(L"OnGamePlayersChanged: invalid sessionRef."); + return; + } + + XboxLiveContext^ xboxLiveContext = m_pDQRNet->m_primaryUserXboxLiveContext; + IAsyncOperation^ asyncOp = xboxLiveContext->MultiplayerService->GetCurrentSessionAsync( sessionRef ); + create_task(asyncOp) + .then([this, availablePlayers, &xboxLiveContext] (task t) + { + try + { + Microsoft::Xbox::Services::Multiplayer::MultiplayerSession^ currentSession = t.get(); + + int remainingSlots = currentSession->SessionConstants->MaxMembersInSession - currentSession->Members->Size; + + DQRNetworkManager::LogCommentFormat( L"OnGamePlayersChanged - calling AddAvailableGamePlayers, with %d players available",availablePlayers->Size); + + // This should be called if we have available slots or not, because it also handles broadcasting failed joins to clients already in the game, which + // the clients need to know that adding a local player has failed + AddAvailableGamePlayers(availablePlayers, remainingSlots, currentSession); + } + catch ( Platform::COMException^ ex ) + { +// LogCommentWithError( L"OnGameSessionReady failed to retrieve current session", ex->HResult ); + } + }).wait(); +} + +void PartyController::OnGameSessionReady( GameSessionReadyEventArgs^ eventArgs ) +{ + DQRNetworkManager::LogComment( L"OnGameSessionReady"); + + // If we are already in this session, then we'll be trying to add a player to the session rather than start up a new game. Set a flag if this is the case. + bool bInSession = false; + if( m_pDQRNet->m_multiplayerSession ) + { + if( m_pDQRNet->m_multiplayerSession->SessionReference->SessionName == eventArgs->GameSession->SessionName ) + { + bInSession = true; + } + } + + // Get a current copy of the MPSD, and search for the players that we are trying to join in it + Microsoft::Xbox::Services::Multiplayer::MultiplayerSessionReference^ sessionRef = + m_pDQRNet->ConvertToMicrosoftXboxServicesMultiplayerSessionReference(eventArgs->GameSession); + + vector localAdhocAdditions; + + // Use context from any user at all for this, since this might happen before we are in a game and won't have anything set up in the network manager itself. We are only + // using it to read the session so there shouldn't be any requirements to use a particular live context + WXS::User ^anyUser = nullptr; + if( WXS::User::Users->Size > 0 ) + { + anyUser = WXS::User::Users->GetAt(0); + } + if( anyUser == nullptr ) + { + app.DebugPrintf("Abandoning gamesessionready, no user found\n"); + return; + } + XboxLiveContext^ xboxLiveContext = ref new MXS::XboxLiveContext(anyUser); + + app.DebugPrintf("Gamesessionready user and xboxlivecontext found\n"); + + IAsyncOperation^ asyncOp = xboxLiveContext->MultiplayerService->GetCurrentSessionAsync( sessionRef ); + create_task(asyncOp) + .then([this, eventArgs, bInSession, &localAdhocAdditions,sessionRef] (task t) + { + try + { + Microsoft::Xbox::Services::Multiplayer::MultiplayerSession^ session = t.get(); + + // Check if our joining users are in the session + int userFoundMask = 0; + m_pDQRNet->LogCommentFormat(L"Found session, size %d\n",session->Members->Size); + for( int i = 0; i < session->Members->Size; i++ ) + { + MXSM::MultiplayerSessionMember^ member = session->Members->GetAt(i); + + Platform::String^ memberXUID = member->XboxUserId; + bool isAJoiningXuid = false; + for( int j = 0; j < MAX_LOCAL_PLAYERS; j++ ) + { + if( m_pDQRNet->m_joinSessionUserMask & ( 1 << j ) ) + { + if( m_pDQRNet->m_joinSessionXUIDs[j] == memberXUID ) + { + userFoundMask |= ( 1 << j ); + isAJoiningXuid = true; + } + } + } + + // If: + // + // (1) this isn't a player we are actively trying to join + // (2) it isn't currently in the game (only applicable if we are in the same session we're considering going to) + // (3) we've got a controller assigned to a user with a matching xuid + // + // then we might still be interested in this as this could be someone joining via the system interface + if( !isAJoiningXuid ) // Isn't someone we are actively trying to join + { + if( (!bInSession) || // If not in a game session at all + ( ( m_pDQRNet->GetState() == DQRNetworkManager::DNM_INT_STATE_PLAYING ) && ( m_pDQRNet->GetPlayerByXuid( PlayerUID(memberXUID->Data()) ) == NULL ) ) // Or we're fully in, and this player isn't in it + ) + { + for( int j = 4; j < 12; j++ ) // Final check that we have a gamepad for this xuid so that we might possibly be able to pair someone up + { + WXS::User^ user = InputManager.GetUserForGamepad(j); + if( user != nullptr ) + { + m_pDQRNet->LogCommentFormat(L"%d %d %s vs %s\n",i,j,user->XboxUserId->Data(), memberXUID->Data()); + if( user->XboxUserId == memberXUID ) + { + localAdhocAdditions.push_back( memberXUID ); + } + } + } + } + } + } + + // If we are in the middle of a game-controlled join, then we only (currently) care about users involved in this turning up in the session + if( m_pDQRNet->m_joinSessionUserMask != 0 ) + { + m_pDQRNet->LogComment(L"In game controlled join\n"); + // If all the users we are expecting to join are here, then proceed to either start a new game or just add to the existing session{ + if( userFoundMask == m_pDQRNet->m_joinSessionUserMask ) + { + m_pDQRNet->m_joinSessionUserMask = 0; + m_pDQRNet->m_currentUserMask |= userFoundMask; + + if( m_pDQRNet->m_state == DQRNetworkManager::DNM_INT_STATE_JOINING_WAITING_FOR_RESERVATIONS ) + { + // Attempting to join a game via the discovered list of parties that our friends are in + m_pDQRNet->JoinSession(userFoundMask); + } + else + { + if( bInSession ) + { + // Already in a game, and adding a new local player - make them active + m_pDQRNet->AddUsersToSession( userFoundMask, m_pDQRNet->ConvertToMicrosoftXboxServicesMultiplayerSessionReference( eventArgs->GameSession )); + } + } + } + if( localAdhocAdditions.size() > 0 ) + { + // TODO - need to flag up the fact that there were adhoc additions here that we've just ignored, so we can come back and do something with them at a more appropriate time (ie when m_joinSessionUserMask transitions back to 0) + } + } + else if( localAdhocAdditions.size() > 0 ) + { + m_pDQRNet->LogComment(L"Not in game controlled join, but have other player(s) of possible interest\n"); + // Not trying to do a game controlled join at the moment, and we've got at least one user of interest that we've got a controller for and isn't currently playing + + // If we are in a session, then we might be able to add local players into the game + if( bInSession ) + { + m_pDQRNet->LogComment(L"In session, may be able to add local player to game\n"); + int adhocMask = 0; + for( int i = 0; i < localAdhocAdditions.size(); i++ ) + { + // First search to see if we already have the player signed in + int userIdx = -1; + for( int j = 0; j < MAX_LOCAL_PLAYERS; j++ ) + { + WXS::User^ user = ProfileManager.GetUser(j); + if( user != nullptr ) + { + if(user->XboxUserId == localAdhocAdditions[i]) + { + userIdx = j; + break; + } + } + } + // If not found - see if we have a controller for that person so we can add them + if( userIdx == -1 ) + { + for( int j = 4; j < 12; j++ ) + { + WXS::User^ user = InputManager.GetUserForGamepad(j); + if( user != nullptr ) + { + if( user->XboxUserId == localAdhocAdditions[i] ) + { + // Found the appropriate controller. Attempt to add it - this will return -1 if unsuccessful + userIdx = ProfileManager.AddGamepadToGame(j); + break; + } + } + } + } + // If we found or were able to add a player to one of the 4 local player slots, accumulate in a mask + if( userIdx != -1 ) + { + m_pDQRNet->m_joinSessionXUIDs[userIdx] = localAdhocAdditions[i]; + adhocMask |= ( 1 << userIdx ); + } + } + // If we found anyone adhoc to add, join them into the game now + if( adhocMask ) + { + m_pDQRNet->AddUsersToSession( adhocMask, m_pDQRNet->ConvertToMicrosoftXboxServicesMultiplayerSessionReference( eventArgs->GameSession )); + } + } + else + { + // Not in a game, or not in The game that we've just been notified of. We need to try to do a best-fit to work out who + // of our signed in players or controllers we know about, should be being considered as being invited to this game + m_pDQRNet->LogComment(L"Not in a game, considering as possible invite scenario\n"); + int playerIdx = -1; + for( int i = 0; i < session->Members->Size; i++ ) // First pass through to see if we've a signed in user that is in the session we've been added to + { + MXSM::MultiplayerSessionMember^ member = session->Members->GetAt(i); + for( int j = 0; j < MAX_LOCAL_PLAYERS; j++ ) + { + WXS::User ^user = ProfileManager.GetUser(j); + if( user != nullptr ) + { + if( user->XboxUserId == member->XboxUserId ) + { + DQRNetworkManager::LogCommentFormat(L"Found already signed in player %s to act as invite recipient",member->XboxUserId->Data()); + playerIdx = j; + break; + } + } + } + } + if( playerIdx == -1 ) // If nothing found, second pass through to attempt to find a controller that matches + { + for( int i = 0; i < session->Members->Size; i++ ) + { + MXSM::MultiplayerSessionMember^ member = session->Members->GetAt(i); + for( int j = 4; j < 12; j++ ) + { + WXS::User ^user = InputManager.GetUserForGamepad(j); + if( user != nullptr ) + { + if( user->XboxUserId == member->XboxUserId ) + { + DQRNetworkManager::LogCommentFormat(L"Found controller %d for %s (session idx %d) to act as invite recipient",j,member->XboxUserId->Data(),i); + playerIdx = ProfileManager.AddGamepadToGame(j); + if( playerIdx != -1 ) + { + DQRNetworkManager::LogCommentFormat(L"Assigned controller to user index %d",playerIdx); + break; + } + } + } + } + } + } + if( playerIdx != -1 ) + { + m_pDQRNet->LogComment(L"Player found, considered as invite scenario\n"); + m_pDQRNet->HandleNewPartyFoundForPlayer(); + // Note - must pass player 0 here as the player that the invite is for, or else the xbox 1 code generally breaks because it sets a non-zero primary player. We're going to + // be trying to join all current local users to the new game session though. no matter who the invite is for. + DQRNetworkManager::SetPartyProcessJoinSession(0, sessionRef->SessionName, sessionRef->ServiceConfigurationId, sessionRef->SessionTemplateName); + } + else + { + app.DebugPrintf("No player found to join party with\n"); + } + } + } + + } + catch ( Platform::COMException^ ex ) + { + m_pDQRNet->LogCommentWithError( L"OnGameSessionReady failed to retrieve current session", ex->HResult ); + } + }).wait(); + +} + +bool PartyController::CanJoinParty() +{ + Concurrency::critical_section::scoped_lock lock(m_lock); + if( m_partyView == nullptr ) + { + return false; + } + + return (m_partyView->GameSession != nullptr && !m_partyView->IsPartyInAnotherTitle); +} + +bool PartyController::CanInvitePartyToMyGame( + Microsoft::Xbox::Services::Multiplayer::MultiplayerSession^ multiplayerSession + ) +{ + if( multiplayerSession == nullptr ) + { + // If my session doesn't exist then shouldn't invite party + return false; + } + + PartyView^ partyView = GetPartyView(); + if( partyView == nullptr ) + { + // If the party view doesn't have a session, then could invite party + return true; + } + + if( partyView->IsPartyInAnotherTitle ) + { + // If my session doesn't exist then shouldn't invite party + return true; + } + + if( partyView->GameSession != nullptr ) + { + // If my session and the party session differs, then could invite party + if ( _wcsicmp(partyView->GameSession->ServiceConfigurationId->Data(), multiplayerSession->SessionReference->ServiceConfigurationId->Data() ) != 0 ) + { + return true; + } + if ( _wcsicmp(partyView->GameSession->SessionName->Data(), multiplayerSession->SessionReference->SessionName->Data() ) != 0 ) + { + return true; + } + if ( _wcsicmp(partyView->GameSession->SessionTemplateName->Data(), multiplayerSession->SessionReference->SessionTemplateName->Data() ) != 0 ) + { + return true; + } + } + else + { + // If the party doesn't have a session, then I could invite party + return true; + } + + // If the party is in my session then return false + return false; +} + +int PartyController::GetActiveAndReservedMemberPartySize() +{ + int partySize = 0; + + PartyView^ partyView = GetPartyView(); + if ( partyView != nullptr ) + { + partySize = partyView->Members->Size + partyView->ReservedMembers->Size; + } + + return partySize; +} + +bool PartyController::IsPartyInAnotherTitle() +{ + PartyView^ partyView = GetPartyView(); + if( partyView == nullptr ) + { + return false; + } + + return partyView->IsPartyInAnotherTitle; +} + +bool PartyController::IsGameSessionReadyEventTriggered() +{ + Concurrency::critical_section::scoped_lock lock(m_lock); + return m_isGameSessionReadyEventTriggered; +} + +void PartyController::ClearGameSessionReadyEventTriggered() +{ + Concurrency::critical_section::scoped_lock lock(m_lock); + m_isGameSessionReadyEventTriggered = false; +} + +bool PartyController::DoesPartySessionExist() +{ + Concurrency::critical_section::scoped_lock lock(m_lock); + + if( m_partyView != nullptr && m_partyView->GameSession != nullptr) + { + return true; + } + return false; +} + +Microsoft::Xbox::Services::Multiplayer::MultiplayerSessionReference ^ PartyController::GetGamePartySessionReference() +{ + Concurrency::critical_section::scoped_lock lock(m_lock); + + if( m_partyView != nullptr ) + { + if( m_partyView->GameSession != nullptr) + { + return m_pDQRNet->ConvertToMicrosoftXboxServicesMultiplayerSessionReference(m_partyView->GameSession); + } + } + return nullptr; +} + +PartyView^ PartyController::GetPartyView() +{ + Concurrency::critical_section::scoped_lock lock(m_lock); + return m_partyView; +} + +bool PartyController::DoesPartyAndSessionPlayersMatch( + Microsoft::Xbox::Services::Multiplayer::MultiplayerSession^ session + ) +{ + PartyView^ partyView = GetPartyView(); + + // Verify that session size and party size match + if ( session->Members->Size != partyView->Members->Size ) + { + return false; + } + + bool inParty; + + // Verify that session players match current party players + for ( unsigned int i = 0; i < session->Members->Size; i++ ) + { + inParty = false; + + MultiplayerSessionMember^ member = session->Members->GetAt( i ); + + for ( PartyMember^ partyMember : partyView->Members ) + { + if ( _wcsicmp(member->XboxUserId->Data(), partyMember->XboxUserId->Data() ) == 0 ) + { + inParty = inParty || true; + } + } + + if ( !inParty ) + { + return false; + } + } + + return true; +} + +void PartyController::SetPartyView( PartyView^ partyView ) +{ + Concurrency::critical_section::scoped_lock lock(m_lock); + m_partyView = partyView; +} + +Windows::Foundation::DateTime PartyController::GetCurrentTime() +{ + ULARGE_INTEGER uInt; + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + uInt.LowPart = ft.dwLowDateTime; + uInt.HighPart = ft.dwHighDateTime; + + Windows::Foundation::DateTime time; + time.UniversalTime = uInt.QuadPart; + return time; +} + +double PartyController::GetTimeBetweenInSeconds(Windows::Foundation::DateTime dt1, Windows::Foundation::DateTime dt2) +{ + const uint64 tickPerSecond = 10000000i64; + uint64 deltaTime = dt2.UniversalTime - dt1.UniversalTime; + return (double)deltaTime / (double)tickPerSecond; +} \ No newline at end of file diff --git a/Minecraft.Client/Durango/Network/PartyController.h b/Minecraft.Client/Durango/Network/PartyController.h new file mode 100644 index 00000000..621162ce --- /dev/null +++ b/Minecraft.Client/Durango/Network/PartyController.h @@ -0,0 +1,74 @@ +//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF +//// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO +//// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A +//// PARTICULAR PURPOSE. +//// +//// Copyright (c) Microsoft Corporation. All rights reserved +#pragma once + +#include +class DQRNetworkManager; + +class PartyController +{ +public: + PartyController(DQRNetworkManager *pDQRNet); + + void SetPartyView( Windows::Xbox::Multiplayer::PartyView^ partyView ); + Windows::Xbox::Multiplayer::PartyView^ GetPartyView(); + + void RefreshPartyView(); + bool AddLocalUsersToParty(int userMask, Windows::Xbox::System::User^ primaryUser); + void RemoveLocalUsersFromParty(Windows::Xbox::System::User^ primaryUser); + void RemoveLocalUsersFromParty(Windows::Xbox::System::User^ primaryUser, int playerMask, Microsoft::Xbox::Services::Multiplayer::MultiplayerSessionReference^ sessionReference); + void RemoveLocalUserFromParty(Windows::Xbox::System::User^ userToRemove); + void RegisterEventHandlers(); + void UnregisterEventHandlers(); + void UnregisterGamePlayersEventHandler(); + void RegisterGamePlayersChangedEventHandler(); + bool CanJoinParty(); + bool CanInvitePartyToMyGame( Microsoft::Xbox::Services::Multiplayer::MultiplayerSession^ multiplayerSession ); + bool IsPartyInAnotherTitle(); + bool IsGameSessionReadyEventTriggered(); + bool DoesPartySessionExist(); + Microsoft::Xbox::Services::Multiplayer::MultiplayerSessionReference ^ GetGamePartySessionReference(); + void ClearGameSessionReadyEventTriggered(); + int GetActiveAndReservedMemberPartySize(); + bool DoesPartyAndSessionPlayersMatch( + Microsoft::Xbox::Services::Multiplayer::MultiplayerSession^ session + ); + void CheckPartySessionFull(Windows::Xbox::System::User^ primaryUser); + void SetJoinability(bool isJoinable); + void DisassociateSessionFromParty( Microsoft::Xbox::Services::Multiplayer::MultiplayerSessionReference^ sessionReference); + +private: + Concurrency::critical_section m_lock; + bool m_isGameSessionReadyEventTriggered; + bool m_isGamePlayerEventRegistered; + DQRNetworkManager *m_pDQRNet; + + static void DebugPrintPartyView( Windows::Xbox::Multiplayer::PartyView^ partyView ); + + void OnPartyStateChanged( Windows::Xbox::Multiplayer::PartyStateChangedEventArgs^ eventArgs ); + void OnPartyRosterChanged( Windows::Xbox::Multiplayer::PartyRosterChangedEventArgs^ eventArgs ); + void OnGamePlayersChanged( Windows::Xbox::Multiplayer::GamePlayersChangedEventArgs^ eventArgs ); + void OnGameSessionReady( Windows::Xbox::Multiplayer::GameSessionReadyEventArgs^ eventArgs ); + Windows::Xbox::Multiplayer::PartyView^ m_partyView; + Microsoft::Xbox::Services::Multiplayer::MultiplayerSessionReference^ m_partyGameReadyRef; + void AddAvailableGamePlayers( + Windows::Foundation::Collections::IVectorView^ availablePlayers, + int& remainingSlots, + Microsoft::Xbox::Services::Multiplayer::MultiplayerSession^ currentSession + ); + + Windows::Foundation::DateTime GetCurrentTime(); + double GetTimeBetweenInSeconds(Windows::Foundation::DateTime dt1, Windows::Foundation::DateTime dt2); + + // Party/Session events. + Windows::Foundation::EventRegistrationToken m_partyRosterChangedToken; + Windows::Foundation::EventRegistrationToken m_partyStateChangedToken; + Windows::Foundation::EventRegistrationToken m_partyGamePlayersChangedToken; + Windows::Foundation::EventRegistrationToken m_partyGameSessionReadyToken; +}; + + diff --git a/Minecraft.Client/Durango/Network/PlatformNetworkManagerDurango.cpp b/Minecraft.Client/Durango/Network/PlatformNetworkManagerDurango.cpp new file mode 100644 index 00000000..3efba5ed --- /dev/null +++ b/Minecraft.Client/Durango/Network/PlatformNetworkManagerDurango.cpp @@ -0,0 +1,940 @@ +#include "stdafx.h" +#include "..\..\..\Minecraft.World\Socket.h" +#include "..\..\..\Minecraft.World\StringHelpers.h" +#include "PlatformNetworkManagerDurango.h" +#include "NetworkPlayerDurango.h" + +CPlatformNetworkManagerDurango *g_pPlatformNetworkManager; + +void CPlatformNetworkManagerDurango::HandleStateChange(DQRNetworkManager::eDQRNetworkManagerState oldState, DQRNetworkManager::eDQRNetworkManagerState newState) +{ + static const char * c_apszStateNames[] = + { + "DNM_STATE_INITIALISING", + "DNM_STATE_INITIALISE_FAILED", + "DNM_STATE_IDLE", + "DNM_STATE_HOSTING", + "DNM_STATE_JOINING", + "DNM_STATE_STARTING", + "DNM_STATE_PLAYING", + "DNM_STATE_LEAVING", + "DNM_STATE_ENDING", + }; + + app.DebugPrintf( "Network State: %s ==> %s\n", + c_apszStateNames[ oldState ], + c_apszStateNames[ newState ] ); + + if( newState == DQRNetworkManager::DNM_STATE_HOSTING ) + { + m_bLeavingGame = false; + m_bLeaveGameOnTick = false; + m_bHostChanged = false; + g_NetworkManager.StateChange_AnyToHosting(); + } + else if( newState == DQRNetworkManager::DNM_STATE_JOINING ) + { + m_bLeavingGame = false; + m_bLeaveGameOnTick = false; + m_bHostChanged = false; + g_NetworkManager.StateChange_AnyToJoining(); + } + else if( newState == DQRNetworkManager::DNM_STATE_IDLE && oldState == DQRNetworkManager::DNM_STATE_JOINING ) + { + g_NetworkManager.StateChange_JoiningToIdle(JOIN_FAILED_NONSPECIFIC); + } + else if( newState == DQRNetworkManager::DNM_STATE_IDLE && oldState == DQRNetworkManager::DNM_STATE_HOSTING ) + { + m_bLeavingGame = true; + } + else if( newState == DQRNetworkManager::DNM_STATE_STARTING ) + { + m_lastPlayerEventTimeStart = app.getAppTime(); + + g_NetworkManager.StateChange_AnyToStarting(); + } + // Fix for #93148 - TCR 001: BAS Game Stability: Title will crash for the multiplayer client if host of the game will exit during the clients loading to created world. + // 4J Stu - If the client joins just as the host is exiting, then they can skip to leaving without passing through ending + else if( newState == DQRNetworkManager::DNM_STATE_ENDING ) + { + g_NetworkManager.StateChange_AnyToEnding( oldState == DQRNetworkManager::DNM_STATE_PLAYING ); + + if( m_pDQRNet->IsHost() ) + { + m_bLeavingGame = true; + } + } + + if( newState == DQRNetworkManager::DNM_STATE_IDLE ) + { + g_NetworkManager.StateChange_AnyToIdle(); + } +} + +void CPlatformNetworkManagerDurango::HandlePlayerJoined(DQRNetworkPlayer *pDQRPlayer) +{ + const char * pszDescription; + + // If this is a local player, we need to inform the chat system that it has joined + if( pDQRPlayer->IsLocal() ) + { + m_pDQRNet->ChatPlayerJoined(pDQRPlayer->GetLocalPlayerIndex()); + } + + // 4J Stu - We create a fake socket for every where that we need an INBOUND queue of game data. Outbound + // is all handled by QNet so we don't need that. Therefore each client player has one, and the host has one + // for each client player. + bool createFakeSocket = false; + bool localPlayer = false; + + NetworkPlayerDurango *networkPlayer = (NetworkPlayerDurango *)addNetworkPlayer(pDQRPlayer); + + // Request full display name for this player + m_pDQRNet->RequestDisplayName(pDQRPlayer); + + if( pDQRPlayer->IsLocal() ) + { + localPlayer = true; + if( pDQRPlayer->IsHost() ) + { + pszDescription = "local host"; + // 4J Stu - No socket for the localhost as it uses a special loopback queue + + m_machineDQRPrimaryPlayers.push_back( pDQRPlayer ); + } + else + { + pszDescription = "local"; + + // We need an inbound queue on all local players to receive data from the host + createFakeSocket = true; + } + } + else + { + if( pDQRPlayer->IsHost() ) + { + pszDescription = "remote host"; + } + else + { + pszDescription = "remote"; + + // If we are the host, then create a fake socket for every remote player + if( m_pDQRNet->IsHost() ) + { + createFakeSocket = true; + } + } + + if( m_pDQRNet->IsHost() && !m_bHostChanged ) + { + // Do we already have a primary player for this system? + bool systemHasPrimaryPlayer = false; + for(AUTO_VAR(it, m_machineDQRPrimaryPlayers.begin()); it < m_machineDQRPrimaryPlayers.end(); ++it) + { + DQRNetworkPlayer *pQNetPrimaryPlayer = *it; + if( pDQRPlayer->IsSameSystem(pQNetPrimaryPlayer) ) + { + systemHasPrimaryPlayer = true; + break; + } + } + if( !systemHasPrimaryPlayer ) + m_machineDQRPrimaryPlayers.push_back( pDQRPlayer ); + } + } + g_NetworkManager.PlayerJoining( networkPlayer ); + + if( createFakeSocket == true && !m_bHostChanged ) + { + g_NetworkManager.CreateSocket( networkPlayer, localPlayer ); + } + + app.DebugPrintf( "Player 0x%p \"%ls\" joined; %s; voice %i; camera %i.\n", + pDQRPlayer, + pDQRPlayer->GetGamertag(), + pszDescription, + (int) pDQRPlayer->HasVoice(), + (int) pDQRPlayer->HasCamera() ); + + + if( m_pDQRNet->IsHost() ) + { + g_NetworkManager.UpdateAndSetGameSessionData(); + SystemFlagAddPlayer( networkPlayer ); + } + + for( int idx = 0; idx < XUSER_MAX_COUNT; ++idx) + { + if(playerChangedCallback[idx] != NULL) + playerChangedCallback[idx]( playerChangedCallbackParam[idx], networkPlayer, false ); + } + + if(m_pDQRNet->GetState() == QNET_STATE_GAME_PLAY) + { + int localPlayerCount = 0; + for(unsigned int idx = 0; idx < XUSER_MAX_COUNT; ++idx) + { + if( m_pDQRNet->GetLocalPlayerByUserIndex(idx) != NULL ) ++localPlayerCount; + } + + float appTime = app.getAppTime(); + + // Only record stats for the primary player here + m_lastPlayerEventTimeStart = appTime; + } +} + +void CPlatformNetworkManagerDurango::HandlePlayerLeaving(DQRNetworkPlayer *pDQRPlayer) +{ + //__debugbreak(); + + app.DebugPrintf( "Player 0x%p leaving.\n", + pDQRPlayer ); + + INetworkPlayer *networkPlayer = getNetworkPlayer(pDQRPlayer); + + if( networkPlayer ) + { + // Get our wrapper object associated with this player. + Socket *socket = networkPlayer->GetSocket(); + if( socket != NULL ) + { + // If we are in game then remove this player from the game as well. + // We may get here either from the player requesting to exit the game, + // in which case we they will already have left the game server, or from a disconnection + // where we then have to remove them from the game server + if( m_pDQRNet->IsHost() && !m_bHostChanged ) + { + g_NetworkManager.CloseConnection(networkPlayer); + } + + // Free the wrapper object memory. + // TODO 4J Stu - We may still be using this at the point that the player leaves the session. + // We need this as long as the game server still needs to communicate with the player + //delete socket; + + networkPlayer->SetSocket( NULL ); + } + + if( m_pDQRNet->IsHost() && !m_bHostChanged ) + { + if( isSystemPrimaryPlayer(pDQRPlayer) ) + { + DQRNetworkPlayer *pNewDQRPrimaryPlayer = NULL; + for(unsigned int i = 0; i < m_pDQRNet->GetPlayerCount(); ++i ) + { + DQRNetworkPlayer *pDQRPlayer2 = m_pDQRNet->GetPlayerByIndex( i ); + + if( pDQRPlayer2 != pDQRPlayer && pDQRPlayer2->IsSameSystem( pDQRPlayer ) ) + { + pNewDQRPrimaryPlayer = pDQRPlayer2; + break; + } + } + AUTO_VAR(it, find( m_machineDQRPrimaryPlayers.begin(), m_machineDQRPrimaryPlayers.end(), pDQRPlayer)); + if( it != m_machineDQRPrimaryPlayers.end() ) + { + m_machineDQRPrimaryPlayers.erase( it ); + } + + if( pNewDQRPrimaryPlayer != NULL ) + m_machineDQRPrimaryPlayers.push_back( pNewDQRPrimaryPlayer ); + } + + g_NetworkManager.UpdateAndSetGameSessionData( networkPlayer ); + SystemFlagRemovePlayer( networkPlayer ); + + } + + g_NetworkManager.PlayerLeaving( networkPlayer ); + + for( int idx = 0; idx < XUSER_MAX_COUNT; ++idx) + { + if(playerChangedCallback[idx] != NULL) + playerChangedCallback[idx]( playerChangedCallbackParam[idx], networkPlayer, true ); + } + + if(m_pDQRNet->GetState() == DQRNetworkManager::DNM_STATE_PLAYING) + { + int localPlayerCount = 0; + for(unsigned int idx = 0; idx < XUSER_MAX_COUNT; ++idx) + { + if( m_pDQRNet->GetLocalPlayerByUserIndex(idx) != NULL ) ++localPlayerCount; + } + + float appTime = app.getAppTime(); + m_lastPlayerEventTimeStart = appTime; + } + + removeNetworkPlayer(pDQRPlayer); + } +} + +void CPlatformNetworkManagerDurango::HandleDataReceived(DQRNetworkPlayer *playerFrom, DQRNetworkPlayer *playerTo, unsigned char *data, unsigned int dataSize) +{ +#if 0 + // TODO - put this back in + if(m_pSQRNet->GetState() == SQRNetworkManager::SNM_STATE_ENDING) + { + return; + } +#endif + + if( playerTo->IsHost() ) + { + // If we are the host we care who this came from + //app.DebugPrintf( "Pushing data into host read queue for user \"%ls\"\n", pPlayerFrom->GetGamertag()); + // Push this data into the read queue for the player that sent it + INetworkPlayer *pPlayerFrom = getNetworkPlayer(playerFrom); + Socket *socket = pPlayerFrom->GetSocket(); + + if(socket != NULL) + socket->pushDataToQueue(data, dataSize, false); + } + else + { + // If we are not the host the message must have come from the host, so we care more about who it is addressed to + INetworkPlayer *pPlayerTo = getNetworkPlayer(playerTo); + Socket *socket = pPlayerTo->GetSocket(); + //app.DebugPrintf( "Pushing data into read queue for user \"%ls\"\n", apPlayersTo[dwPlayer]->GetGamertag()); + if(socket != NULL) + socket->pushDataToQueue(data, dataSize); + } +} + +void CPlatformNetworkManagerDurango::HandleInviteReceived(int playerIndex, DQRNetworkManager::SessionInfo *pInviteInfo) +{ + g_NetworkManager.GameInviteReceived(playerIndex, pInviteInfo); +} + +bool CPlatformNetworkManagerDurango::Initialise(CGameNetworkManager *pGameNetworkManager, int flagIndexSize) +{ + m_pDQRNet = new DQRNetworkManager(this); + m_pDQRNet->Initialise(); + + m_hostGameSessionIsJoinable = false; + m_pGameNetworkManager = pGameNetworkManager; + m_flagIndexSize = flagIndexSize; + g_pPlatformNetworkManager = this; + for( int i = 0; i < XUSER_MAX_COUNT; i++ ) + { + playerChangedCallback[ i ] = NULL; + } + + m_bLeavingGame = false; + m_bLeaveGameOnTick = false; + m_bHostChanged = false; + + m_bSearchResultsReady = false; + m_bSearchPending = false; + + m_bIsOfflineGame = false; + m_pSearchParam = NULL; + m_SessionsUpdatedCallback = NULL; + + m_searchResultsCount = 0; + m_lastSearchStartTime = 0; + + // The results that will be filled in with the current search + m_pSearchResults = NULL; + + Windows::Networking::Connectivity::NetworkInformation::NetworkStatusChanged += ref new Windows::Networking::Connectivity::NetworkStatusChangedEventHandler( []( Platform::Object^ pxObject ) + { + app.DebugPrintf("NetworkStatusChanged callback\n" ); + auto internetProfile = Windows::Networking::Connectivity::NetworkInformation::GetInternetConnectionProfile(); + if (internetProfile != nullptr) + { + auto connectionLevel = internetProfile->GetNetworkConnectivityLevel(); + app.DebugPrintf("Connection level has changed to (%d)\n", connectionLevel); + + //int iPrimaryPlayer = g_NetworkManager.GetPrimaryPad(); + //bool bConnected = (connectionLevel == Windows::Networking::Connectivity::NetworkConnectivityLevel::XboxLiveAccess)?true:false; + //if((g_NetworkManager.GetLockedProfile()!=-1) && iPrimaryPlayer!=-1 && bConnected == false && g_NetworkManager.IsInSession() ) + //{ + // app.SetAction(iPrimaryPlayer,eAppAction_EthernetDisconnected); + //} + } + }); + + // Success! + return true; +} + +void CPlatformNetworkManagerDurango::Terminate() +{ +} + +int CPlatformNetworkManagerDurango::GetJoiningReadyPercentage() +{ + return 100; +} + +int CPlatformNetworkManagerDurango::CorrectErrorIDS(int IDS) +{ + return IDS; +} + +bool CPlatformNetworkManagerDurango::isSystemPrimaryPlayer(DQRNetworkPlayer *pDQRPlayer) +{ + bool playerIsSystemPrimary = false; + for(auto it = m_machineDQRPrimaryPlayers.begin(); it < m_machineDQRPrimaryPlayers.end(); ++it) + { + DQRNetworkPlayer *pDQRPrimaryPlayer = *it; + if( pDQRPrimaryPlayer == pDQRPlayer ) + { + playerIsSystemPrimary = true; + break; + } + } + return playerIsSystemPrimary; +} + +// We call this twice a frame, either side of the render call so is a good place to "tick" things +void CPlatformNetworkManagerDurango::DoWork() +{ + m_pDQRNet->Tick(); + + TickSearch(); + + if( m_bLeaveGameOnTick ) + { + m_pDQRNet->LeaveRoom(); + m_bLeaveGameOnTick = false; + } +} + +int CPlatformNetworkManagerDurango::GetPlayerCount() +{ + return m_pDQRNet->GetPlayerCount(); +} + +bool CPlatformNetworkManagerDurango::ShouldMessageForFullSession() +{ + return m_pDQRNet->ShouldMessageForFullSession(); +} + +int CPlatformNetworkManagerDurango::GetOnlinePlayerCount() +{ + return m_pDQRNet->GetOnlinePlayerCount(); +} + +int CPlatformNetworkManagerDurango::GetLocalPlayerMask(int playerIndex) +{ + return 1 << playerIndex; +} + +bool CPlatformNetworkManagerDurango::AddLocalPlayerByUserIndex( int userIndex ) +{ + return m_pDQRNet->AddLocalPlayerByUserIndex( userIndex ); +} + +bool CPlatformNetworkManagerDurango::RemoveLocalPlayerByUserIndex( int userIndex ) +{ + return m_pDQRNet->RemoveLocalPlayerByUserIndex( userIndex ); +} + +bool CPlatformNetworkManagerDurango::IsInStatsEnabledSession() +{ + return true; +} + +bool CPlatformNetworkManagerDurango::SessionHasSpace(unsigned int spaceRequired /*= 1*/) +{ + return true; +} + +void CPlatformNetworkManagerDurango::SendInviteGUI(int quadrant) +{ + m_pDQRNet->SendInviteGUI(quadrant); +} + +bool CPlatformNetworkManagerDurango::IsAddingPlayer() +{ + return m_pDQRNet->IsAddingPlayer(); +} + +bool CPlatformNetworkManagerDurango::LeaveGame(bool bMigrateHost) +{ + if( m_bLeavingGame ) return true; + + m_bLeavingGame = true; + + // If we are the host wait for the game server to end + if(m_pDQRNet->IsHost() && g_NetworkManager.ServerStoppedValid()) + { +// m_pDQRNet->EndGame(); + g_NetworkManager.ServerStoppedWait(); + g_NetworkManager.ServerStoppedDestroy(); + } + return _LeaveGame(bMigrateHost, true);; +} + +bool CPlatformNetworkManagerDurango::_LeaveGame(bool bMigrateHost, bool bLeaveRoom) +{ + m_bLeavingGame = true; + m_bLeaveGameOnTick = true; + m_migrateHostOnLeave = bMigrateHost; + return true; +} + +void CPlatformNetworkManagerDurango::HostGame(int localUsersMask, bool bOnlineGame, bool bIsPrivate, unsigned char publicSlots /*= MINECRAFT_NET_MAX_PLAYERS*/, unsigned char privateSlots /*= 0*/) +{ +// #ifdef _XBOX + // 4J Stu - We probably did this earlier as well, but just to be sure! + SetLocalGame( !bOnlineGame ); + SetPrivateGame( bIsPrivate ); + SystemFlagReset(); + + // Make sure that the Primary Pad is in by default + localUsersMask |= GetLocalPlayerMask( g_NetworkManager.GetPrimaryPad() ); + + m_bLeavingGame = false; + + _HostGame( localUsersMask, publicSlots, privateSlots ); +//#endif +} + +void CPlatformNetworkManagerDurango::_HostGame(int usersMask, unsigned char publicSlots /*= MINECRAFT_NET_MAX_PLAYERS*/, unsigned char privateSlots /*= 0*/) +{ + memset(&m_hostGameSessionData,0,sizeof(m_hostGameSessionData)); + m_hostGameSessionData.netVersion = MINECRAFT_NET_VERSION; + m_hostGameSessionData.isReadyToJoin = false; + m_hostGameSessionData.m_uiGameHostSettings = app.GetGameHostOption(eGameHostOption_All); + m_hostGameSessionIsJoinable = !IsPrivateGame(); + + m_pDQRNet->CreateAndJoinSession(usersMask, (unsigned char *)&m_hostGameSessionData, sizeof(m_hostGameSessionData), IsLocalGame() ); +} + +bool CPlatformNetworkManagerDurango::_StartGame() +{ + return true; +} + +int CPlatformNetworkManagerDurango::JoinGame(FriendSessionInfo *searchResult, int localUsersMask, int primaryUserIndex) +{ + app.DebugPrintf("Joining game party from search result\n"); + + int joinPlayerCount = 0; + for( int i = 0; i < DQRNetworkManager::MAX_LOCAL_PLAYER_COUNT; i++ ) + { + if( localUsersMask & ( 1 << i ) ) + { + // Check if this joining user is already in the session, in which case we don't need to count it + bool isJoiningUser = false; + for( int j = 0; j < searchResult->searchResult.m_usedSlotCount; j++ ) + { + Platform::String^ xuid = ref new Platform::String(searchResult->searchResult.m_sessionXuids[j].c_str()); + if( xuid == ProfileManager.GetUser(i)->XboxUserId ) + { + app.DebugPrintf("Joining user found to be already in session, so won't be counting to our total\n"); + isJoiningUser = true; + break; + } + } + if( !isJoiningUser ) + { + joinPlayerCount++; + } + } + } + app.DebugPrintf("Used slots: %d, fully playing players: %d, trying to join %d\n", searchResult->searchResult.m_usedSlotCount, searchResult->searchResult.m_playerCount, joinPlayerCount); + GameSessionData *gameSession = (GameSessionData *)(&searchResult->data); + if( ( searchResult->searchResult.m_usedSlotCount + joinPlayerCount ) > DQRNetworkManager::MAX_ONLINE_PLAYER_COUNT ) + { + return CGameNetworkManager::JOINGAME_FAIL_SERVER_FULL; + } + + if(m_pDQRNet->JoinPartyFromSearchResult(&searchResult->searchResult, localUsersMask)) + { + app.DebugPrintf("Join success\n"); + return CGameNetworkManager::JOINGAME_SUCCESS; + } + else + { + app.DebugPrintf("Join fail\n"); + return CGameNetworkManager::JOINGAME_FAIL_GENERAL; + } +} + +void CPlatformNetworkManagerDurango::CancelJoinGame() +{ + m_pDQRNet->CancelJoinPartyFromSearchResult(); +} + +bool CPlatformNetworkManagerDurango::SetLocalGame(bool isLocal) +{ + m_bIsOfflineGame = isLocal; + + return true; +} + +void CPlatformNetworkManagerDurango::SetPrivateGame(bool isPrivate) +{ + app.DebugPrintf("Setting as private game: %s\n", isPrivate ? "yes" : "no" ); + m_bIsPrivateGame = isPrivate; +} + +void CPlatformNetworkManagerDurango::RegisterPlayerChangedCallback(int iPad, void (*callback)(void *callbackParam, INetworkPlayer *pPlayer, bool leaving), void *callbackParam) +{ + playerChangedCallback[iPad] = callback; + playerChangedCallbackParam[iPad] = callbackParam; +} + +void CPlatformNetworkManagerDurango::UnRegisterPlayerChangedCallback(int iPad, void (*callback)(void *callbackParam, INetworkPlayer *pPlayer, bool leaving), void *callbackParam) +{ + if(playerChangedCallbackParam[iPad] == callbackParam) + { + playerChangedCallback[iPad] = NULL; + playerChangedCallbackParam[iPad] = NULL; + } +} + +void CPlatformNetworkManagerDurango::HandleSignInChange() +{ + return; +} + +void CPlatformNetworkManagerDurango::HandleAddLocalPlayerFailed(int idx, bool serverFull) +{ + g_NetworkManager.AddLocalPlayerFailed(idx, serverFull); +} + +void CPlatformNetworkManagerDurango::HandleDisconnect(bool bLostRoomOnly) +{ + g_NetworkManager.HandleDisconnect(bLostRoomOnly); +} + +bool CPlatformNetworkManagerDurango::_RunNetworkGame() +{ + m_pDQRNet->StartGame(); + m_hostGameSessionData.isReadyToJoin = true; + m_pDQRNet->UpdateCustomSessionData(); + return true; +} + +void CPlatformNetworkManagerDurango::UpdateAndSetGameSessionData(INetworkPlayer *pNetworkPlayerLeaving /*= NULL*/) +{ + if( this->m_bLeavingGame ) + return; + + if( GetHostPlayer() == NULL ) + return; + + m_hostGameSessionData.m_uiGameHostSettings = app.GetGameHostOption(eGameHostOption_All); + + m_pDQRNet->UpdateCustomSessionData(); +} + +int CPlatformNetworkManagerDurango::RemovePlayerOnSocketClosedThreadProc( void* lpParam ) +{ + INetworkPlayer *pNetworkPlayer = (INetworkPlayer *)lpParam; + + Socket *socket = pNetworkPlayer->GetSocket(); + + if( socket != NULL ) + { + //printf("Waiting for socket closed event\n"); + socket->m_socketClosedEvent->WaitForSignal(INFINITE); + + //printf("Socket closed event has fired\n"); + // 4J Stu - Clear our reference to this socket + pNetworkPlayer->SetSocket( NULL ); + delete socket; + } + + return g_pPlatformNetworkManager->RemoveLocalPlayer( pNetworkPlayer ); +} + +bool CPlatformNetworkManagerDurango::RemoveLocalPlayer( INetworkPlayer *pNetworkPlayer ) +{ + return true; +} + +CPlatformNetworkManagerDurango::PlayerFlags::PlayerFlags(INetworkPlayer *pNetworkPlayer, unsigned int count) +{ + // 4J Stu - Don't assert, just make it a multiple of 8! This count is calculated from a load of separate values, + // and makes tweaking world/render sizes a pain if we hit an assert here + count = (count + 8 - 1) & ~(8 - 1); + //assert( ( count % 8 ) == 0 ); + this->m_pNetworkPlayer = pNetworkPlayer; + this->flags = new unsigned char [ count / 8 ]; + memset( this->flags, 0, count / 8 ); + this->count = count; +} + +CPlatformNetworkManagerDurango::PlayerFlags::~PlayerFlags() +{ + delete [] flags; +} + +// Add a player to the per system flag storage - if we've already got a player from that system, copy its flags over +void CPlatformNetworkManagerDurango::SystemFlagAddPlayer(INetworkPlayer *pNetworkPlayer) +{ + PlayerFlags *newPlayerFlags = new PlayerFlags( pNetworkPlayer, m_flagIndexSize); + // If any of our existing players are on the same system, then copy over flags from that one + for( unsigned int i = 0; i < m_playerFlags.size(); i++ ) + { + if( pNetworkPlayer->IsSameSystem(m_playerFlags[i]->m_pNetworkPlayer) ) + { + memcpy( newPlayerFlags->flags, m_playerFlags[i]->flags, m_playerFlags[i]->count / 8 ); + break; + } + } + m_playerFlags.push_back(newPlayerFlags); +} + +// Remove a player from the per system flag storage - just maintains the m_playerFlags vector without any gaps in it +void CPlatformNetworkManagerDurango::SystemFlagRemovePlayer(INetworkPlayer *pNetworkPlayer) +{ + for( unsigned int i = 0; i < m_playerFlags.size(); i++ ) + { + if( m_playerFlags[i]->m_pNetworkPlayer == pNetworkPlayer ) + { + delete m_playerFlags[i]; + m_playerFlags[i] = m_playerFlags.back(); + m_playerFlags.pop_back(); + return; + } + } +} + +void CPlatformNetworkManagerDurango::SystemFlagReset() +{ + for( unsigned int i = 0; i < m_playerFlags.size(); i++ ) + { + delete m_playerFlags[i]; + } + m_playerFlags.clear(); +} + +// Set a per system flag - this is done by setting the flag on every player that shares that system +void CPlatformNetworkManagerDurango::SystemFlagSet(INetworkPlayer *pNetworkPlayer, int index) +{ + if( ( index < 0 ) || ( index >= m_flagIndexSize ) ) return; + if( pNetworkPlayer == NULL ) return; + + for( unsigned int i = 0; i < m_playerFlags.size(); i++ ) + { + if( pNetworkPlayer->IsSameSystem(m_playerFlags[i]->m_pNetworkPlayer) ) + { + m_playerFlags[i]->flags[ index / 8 ] |= ( 128 >> ( index % 8 ) ); + } + } +} + +// Get value of a per system flag - can be read from the flags of the passed in player as anything else sent to that +// system should also have been duplicated here +bool CPlatformNetworkManagerDurango::SystemFlagGet(INetworkPlayer *pNetworkPlayer, int index) +{ + if( ( index < 0 ) || ( index >= m_flagIndexSize ) ) return false; + if( pNetworkPlayer == NULL ) + { + return false; + } + + for( unsigned int i = 0; i < m_playerFlags.size(); i++ ) + { + if( m_playerFlags[i]->m_pNetworkPlayer == pNetworkPlayer ) + { + return ( ( m_playerFlags[i]->flags[ index / 8 ] & ( 128 >> ( index % 8 ) ) ) != 0 ); + } + } + return false; +} + +wstring CPlatformNetworkManagerDurango::GatherStats() +{ + return L""; +} + +wstring CPlatformNetworkManagerDurango::GatherRTTStats() +{ + return L""; +} + +void CPlatformNetworkManagerDurango::TickSearch() +{ + if( m_bSearchPending ) + { + if( !m_pDQRNet->FriendPartyManagerIsBusy() ) + { + m_searchResultsCount = m_pDQRNet->FriendPartyManagerGetCount(); + delete [] m_pSearchResults; + m_pSearchResults = new DQRNetworkManager::SessionSearchResult[m_searchResultsCount]; + + for( int i = 0; i < m_searchResultsCount; i++ ) + { + m_pDQRNet->FriendPartyManagerGetSessionInfo(i, &m_pSearchResults[i] ); + } + m_bSearchPending = false; + + if( m_SessionsUpdatedCallback != NULL ) m_SessionsUpdatedCallback(m_pSearchParam); + } + } + else + { + if( !m_pDQRNet->FriendPartyManagerIsBusy() ) + { + // Don't start searches unless we have registered a callback + if( m_SessionsUpdatedCallback != NULL && (m_lastSearchStartTime + MINECRAFT_DURANGO_PARTY_SEARCH_DELAY_MILLISECONDS) < GetTickCount() ) + { + if( m_pDQRNet->FriendPartyManagerSearch() ); + { + m_bSearchPending = true; + m_lastSearchStartTime = GetTickCount(); + } + } + } + } +} + +vector *CPlatformNetworkManagerDurango::GetSessionList(int iPad, int localPlayers, bool partyOnly) +{ + vector *filteredList = new vector(); + for( int i = 0; i < m_searchResultsCount; i++ ) + { + GameSessionData *gameSessionData = (GameSessionData *)m_pSearchResults[i].m_extData; + if( ( gameSessionData->netVersion == MINECRAFT_NET_VERSION ) && + ( gameSessionData->isReadyToJoin ) ) + { + FriendSessionInfo *session = new FriendSessionInfo(); + session->searchResult = m_pSearchResults[i]; + session->searchResult.m_extData = NULL; // We have another copy of the GameSessionData, so don't need to make another copy of this here + session->displayLabelLength = session->searchResult.m_playerNames[0].size(); + session->displayLabel = new wchar_t[ session->displayLabelLength + 1 ]; + memcpy(&session->data, gameSessionData, sizeof(GameSessionData)); + wcscpy_s(session->displayLabel, session->displayLabelLength + 1, session->searchResult.m_playerNames[0].c_str() ); + filteredList->push_back(session); + } + } + return filteredList; +} + +bool CPlatformNetworkManagerDurango::GetGameSessionInfo(int iPad, SessionID sessionId, FriendSessionInfo *foundSessionInfo) +{ + return false; +} + +void CPlatformNetworkManagerDurango::SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam ) +{ + m_SessionsUpdatedCallback = SessionsUpdatedCallback; m_pSearchParam = pSearchParam; +} + +void CPlatformNetworkManagerDurango::GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam ) +{ + FriendSessionUpdatedFn(true, pParam); +} + +void CPlatformNetworkManagerDurango::ForceFriendsSessionRefresh() +{ + app.DebugPrintf("Resetting friends session search data\n"); + m_lastSearchStartTime = 0; + m_searchResultsCount = 0; + delete [] m_pSearchResults; + m_pSearchResults = NULL; +} + +INetworkPlayer *CPlatformNetworkManagerDurango::addNetworkPlayer(DQRNetworkPlayer *pDQRPlayer) +{ + NetworkPlayerDurango *pNetworkPlayer = new NetworkPlayerDurango(pDQRPlayer); + pDQRPlayer->SetCustomDataValue((ULONG_PTR)pNetworkPlayer); + currentNetworkPlayers.push_back( pNetworkPlayer ); + return pNetworkPlayer; +} + +void CPlatformNetworkManagerDurango::removeNetworkPlayer(DQRNetworkPlayer *pDQRPlayer) +{ + INetworkPlayer *pNetworkPlayer = getNetworkPlayer(pDQRPlayer); + for( AUTO_VAR(it, currentNetworkPlayers.begin()); it != currentNetworkPlayers.end(); it++ ) + { + if( *it == pNetworkPlayer ) + { + currentNetworkPlayers.erase(it); + return; + } + } +} + +INetworkPlayer *CPlatformNetworkManagerDurango::getNetworkPlayer(DQRNetworkPlayer *pDQRPlayer) +{ + return pDQRPlayer ? (INetworkPlayer *)(pDQRPlayer->GetCustomDataValue()) : NULL; +} + + +INetworkPlayer *CPlatformNetworkManagerDurango::GetLocalPlayerByUserIndex(int userIndex ) +{ + return getNetworkPlayer(m_pDQRNet->GetLocalPlayerByUserIndex(userIndex)); +} + +INetworkPlayer *CPlatformNetworkManagerDurango::GetPlayerByIndex(int playerIndex) +{ + return getNetworkPlayer(m_pDQRNet->GetPlayerByIndex(playerIndex)); +} + +INetworkPlayer * CPlatformNetworkManagerDurango::GetPlayerByXuid(PlayerUID xuid) +{ + return getNetworkPlayer(m_pDQRNet->GetPlayerByXuid(xuid)) ; +} + +INetworkPlayer * CPlatformNetworkManagerDurango::GetPlayerBySmallId(unsigned char smallId) +{ + return getNetworkPlayer(m_pDQRNet->GetPlayerBySmallId(smallId)); +} + +wstring CPlatformNetworkManagerDurango::GetDisplayNameByGamertag(wstring gamertag) +{ + return m_pDQRNet->GetDisplayNameByGamertag(gamertag); +} + +INetworkPlayer *CPlatformNetworkManagerDurango::GetHostPlayer() +{ + return getNetworkPlayer(m_pDQRNet->GetHostPlayer()); +} + +bool CPlatformNetworkManagerDurango::IsHost() +{ + return m_pDQRNet->IsHost() && !m_bHostChanged; +} + +bool CPlatformNetworkManagerDurango::JoinGameFromInviteInfo( int userIndex, int userMask, const INVITE_INFO *pInviteInfo) +{ + m_pDQRNet->m_currentUserMask = userMask; + m_pDQRNet->JoinSessionFromInviteInfo(userMask); + return true; +} + +void CPlatformNetworkManagerDurango::SetSessionTexturePackParentId( int id ) +{ + m_hostGameSessionData.texturePackParentId = id; +} + +void CPlatformNetworkManagerDurango::SetSessionSubTexturePackId( int id ) +{ + m_hostGameSessionData.subTexturePackId = id; +} + +void CPlatformNetworkManagerDurango::Notify(int ID, ULONG_PTR Param) +{ +} + +bool CPlatformNetworkManagerDurango::IsInSession() +{ + return m_pDQRNet->IsInSession(); +} + +bool CPlatformNetworkManagerDurango::IsInGameplay() +{ + return m_pDQRNet->GetState() == DQRNetworkManager::DNM_STATE_PLAYING; +} + +bool CPlatformNetworkManagerDurango::IsReadyToPlayOrIdle() +{ + return m_pDQRNet->IsReadyToPlayOrIdle(); +} + +bool CPlatformNetworkManagerDurango::IsSessionJoinable() +{ + return m_hostGameSessionIsJoinable; +} \ No newline at end of file diff --git a/Minecraft.Client/Durango/Network/PlatformNetworkManagerDurango.h b/Minecraft.Client/Durango/Network/PlatformNetworkManagerDurango.h new file mode 100644 index 00000000..55807227 --- /dev/null +++ b/Minecraft.Client/Durango/Network/PlatformNetworkManagerDurango.h @@ -0,0 +1,168 @@ +#pragma once +using namespace std; +#include +#include "..\..\..\Minecraft.World\C4JThread.h" +#include "..\..\Common\Network\NetworkPlayerInterface.h" +#include "..\..\Common\Network\PlatformNetworkManagerInterface.h" +#include "..\..\Common\Network\SessionInfo.h" +#include "DQRNetworkManager.h" + +#define MINECRAFT_DURANGO_PARTY_SEARCH_DELAY_MILLISECONDS 30000 + +class CPlatformNetworkManagerDurango : public CPlatformNetworkManager, IDQRNetworkManagerListener +{ + friend class CGameNetworkManager; +public: + virtual bool Initialise(CGameNetworkManager *pGameNetworkManager, int flagIndexSize); + virtual void Terminate(); + virtual int GetJoiningReadyPercentage(); + virtual int CorrectErrorIDS(int IDS); + + virtual void DoWork(); + virtual int GetPlayerCount(); + virtual int GetOnlinePlayerCount(); + virtual int GetLocalPlayerMask(int playerIndex); + virtual bool AddLocalPlayerByUserIndex( int userIndex ); + virtual bool RemoveLocalPlayerByUserIndex( int userIndex ); + virtual INetworkPlayer *GetLocalPlayerByUserIndex( int userIndex ); + virtual INetworkPlayer *GetPlayerByIndex(int playerIndex); + virtual INetworkPlayer * GetPlayerByXuid(PlayerUID xuid); + virtual INetworkPlayer * GetPlayerBySmallId(unsigned char smallId); + virtual wstring GetDisplayNameByGamertag(wstring gamertag); + virtual bool ShouldMessageForFullSession(); + + virtual INetworkPlayer *GetHostPlayer(); + virtual bool IsHost(); + virtual bool JoinGameFromInviteInfo( int userIndex, int userMask, const INVITE_INFO *pInviteInfo); + virtual bool LeaveGame(bool bMigrateHost); + + virtual bool IsInSession(); + virtual bool IsInGameplay(); + virtual bool IsReadyToPlayOrIdle(); + virtual bool IsInStatsEnabledSession(); + virtual bool SessionHasSpace(unsigned int spaceRequired = 1); + virtual void SendInviteGUI(int quadrant); + virtual bool IsAddingPlayer(); + + virtual void HostGame(int localUsersMask, bool bOnlineGame, bool bIsPrivate, unsigned char publicSlots = MINECRAFT_NET_MAX_PLAYERS, unsigned char privateSlots = 0); + virtual int JoinGame(FriendSessionInfo *searchResult, int localUsersMask, int primaryUserIndex ); + virtual void CancelJoinGame(); + virtual bool SetLocalGame(bool isLocal); + virtual bool IsLocalGame() { return m_bIsOfflineGame; } + virtual void SetPrivateGame(bool isPrivate); + virtual bool IsPrivateGame() { return m_bIsPrivateGame; } + virtual bool IsLeavingGame() { return m_bLeavingGame; } + virtual void ResetLeavingGame() { m_bLeavingGame = false; } + + virtual void RegisterPlayerChangedCallback(int iPad, void (*callback)(void *callbackParam, INetworkPlayer *pPlayer, bool leaving), void *callbackParam); + virtual void UnRegisterPlayerChangedCallback(int iPad, void (*callback)(void *callbackParam, INetworkPlayer *pPlayer, bool leaving), void *callbackParam); + + virtual void HandleSignInChange(); + + virtual bool _RunNetworkGame(); + +private: + bool isSystemPrimaryPlayer(DQRNetworkPlayer *pDQRPlayer); + virtual bool _LeaveGame(bool bMigrateHost, bool bLeaveRoom); + virtual void _HostGame(int dwUsersMask, unsigned char publicSlots = MINECRAFT_NET_MAX_PLAYERS, unsigned char privateSlots = 0); + virtual bool _StartGame(); + + DQRNetworkManager * m_pDQRNet; // pointer to SQRNetworkManager interface + + HANDLE m_notificationListener; + + vector m_machineDQRPrimaryPlayers; // collection of players that we deem to be the main one for that system + + bool m_bLeavingGame; + bool m_bLeaveGameOnTick; + bool m_migrateHostOnLeave; + bool m_bHostChanged; + + bool m_bIsOfflineGame; + bool m_bIsPrivateGame; + int m_flagIndexSize; + + // This is only maintained by the host, and is not valid on client machines + GameSessionData m_hostGameSessionData; + bool m_hostGameSessionIsJoinable; + CGameNetworkManager *m_pGameNetworkManager; +public: + virtual void UpdateAndSetGameSessionData(INetworkPlayer *pNetworkPlayerLeaving = NULL); + +private: + // TODO 4J Stu - Do we need to be able to have more than one of these? + void (*playerChangedCallback[XUSER_MAX_COUNT])(void *callbackParam, INetworkPlayer *pPlayer, bool leaving); + void *playerChangedCallbackParam[XUSER_MAX_COUNT]; + + static int RemovePlayerOnSocketClosedThreadProc( void* lpParam ); + virtual bool RemoveLocalPlayer( INetworkPlayer *pNetworkPlayer ); + + // Things for handling per-system flags + class PlayerFlags + { + public: + INetworkPlayer *m_pNetworkPlayer; + unsigned char *flags; + unsigned int count; + PlayerFlags(INetworkPlayer *pNetworkPlayer, unsigned int count); + ~PlayerFlags(); + }; + vector m_playerFlags; + void SystemFlagAddPlayer(INetworkPlayer *pNetworkPlayer); + void SystemFlagRemovePlayer(INetworkPlayer *pNetworkPlayer); + void SystemFlagReset(); +public: + virtual void SystemFlagSet(INetworkPlayer *pNetworkPlayer, int index); + virtual bool SystemFlagGet(INetworkPlayer *pNetworkPlayer, int index); + + // For telemetry +private: + float m_lastPlayerEventTimeStart; + +public: + wstring GatherStats(); + wstring GatherRTTStats(); + +private: + vector friendsSessions[XUSER_MAX_COUNT]; + int m_searchResultsCount; + int m_lastSearchStartTime; + + // The results that will be filled in with the current search + DQRNetworkManager::SessionSearchResult *m_pSearchResults; + + int m_lastSearchPad; + bool m_bSearchResultsReady; + bool m_bSearchPending; + LPVOID m_pSearchParam; + void (*m_SessionsUpdatedCallback)(LPVOID pParam); + + void TickSearch(); + + vectorcurrentNetworkPlayers; + INetworkPlayer *addNetworkPlayer(DQRNetworkPlayer *pDQRPlayer); + void removeNetworkPlayer(DQRNetworkPlayer *pDQRPlayer); + static INetworkPlayer *getNetworkPlayer(DQRNetworkPlayer *pDQRPlayer); + + virtual void SetSessionTexturePackParentId( int id ); + virtual void SetSessionSubTexturePackId( int id ); + virtual void Notify(int ID, ULONG_PTR Param); + +public: + virtual vector *GetSessionList(int iPad, int localPlayers, bool partyOnly); + virtual bool GetGameSessionInfo(int iPad, SessionID sessionId,FriendSessionInfo *foundSession); + virtual void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam ); + virtual void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam ); + virtual void ForceFriendsSessionRefresh(); + + // ... and the new ones that have been converted to IDQRNetworkManagerListener + virtual void HandleDataReceived(DQRNetworkPlayer *playerFrom, DQRNetworkPlayer *playerTo, unsigned char *data, unsigned int dataSize); + virtual void HandlePlayerJoined(DQRNetworkPlayer *player); + virtual void HandlePlayerLeaving(DQRNetworkPlayer *player); + virtual void HandleStateChange(DQRNetworkManager::eDQRNetworkManagerState oldState, DQRNetworkManager::eDQRNetworkManagerState newState); +// virtual void HandleResyncPlayerRequest(DQRNetworkPlayer **aPlayers); + virtual void HandleAddLocalPlayerFailed(int idx, bool serverFull); + virtual void HandleDisconnect(bool bLostRoomOnly); + virtual void HandleInviteReceived(int playerIndex, DQRNetworkManager::SessionInfo *pInviteInfo); + virtual bool IsSessionJoinable(); +}; \ No newline at end of file diff --git a/Minecraft.Client/Durango/Network/Windows.Xbox.Networking.RealtimeSession.dll b/Minecraft.Client/Durango/Network/Windows.Xbox.Networking.RealtimeSession.dll new file mode 100644 index 00000000..7ff53c86 Binary files /dev/null and b/Minecraft.Client/Durango/Network/Windows.Xbox.Networking.RealtimeSession.dll differ diff --git a/Minecraft.Client/Durango/Network/base64.cpp b/Minecraft.Client/Durango/Network/base64.cpp new file mode 100644 index 00000000..c5af745c --- /dev/null +++ b/Minecraft.Client/Durango/Network/base64.cpp @@ -0,0 +1,156 @@ +/* + base64.cpp and base64.h + + Copyright (C) 2004-2008 René Nyffenegger + + This source code is provided 'as-is', without any express or implied + warranty. In no event will the author be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this source code must not be misrepresented; you must not + claim that you wrote the original source code. If you use this source code + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original source code. + + 3. This notice may not be removed or altered from any source distribution. + + René Nyffenegger rene.nyffenegger@adp-gmbh.ch + +*/ + +#include "stdafx.h" + +#include "base64.h" +#include + +static const std::wstring base64_chars = + L"ABCDEFGHIJKLMNOPQRSTUVWXYZ" + L"abcdefghijklmnopqrstuvwxyz" + L"0123456789+/"; + + +static inline bool is_base64(wchar_t c) +{ + return (isalnum(c) || (c == L'+') || (c == L'/')); +} + +// 4J changed to use Platform::String +Platform::String^ base64_encode(unsigned char* chars_to_encode, unsigned int in_len) +{ + std::wstring ret; + int i = 0; + int j = 0; + unsigned char char_array_3[3]; + unsigned char char_array_4[4]; + + while (in_len--) + { + char_array_3[i++] = *(chars_to_encode++); + if (i == 3) + { + char_array_4[0] = (char_array_3[0] & 0xfc) >> 2; + char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); + char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6); + char_array_4[3] = char_array_3[2] & 0x3f; + + for(int ii = 0; (ii <4) ; ii++) + { + ret += base64_chars[char_array_4[ii]]; + } + i = 0; + } + } + + if (i) + { + for(j = i; j < 3; j++) + { + char_array_3[j] = '\0'; + } + + char_array_4[0] = (char_array_3[0] & 0xfc) >> 2; + char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); + char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6); + char_array_4[3] = char_array_3[2] & 0x3f; + + for (j = 0; (j < i + 1); j++) + { + ret += base64_chars[char_array_4[j]]; + } + + while((i++ < 3)) + { + ret += L'='; + } + + } + + return ref new Platform::String(ret.c_str()); + +} + +void base64_decode(Platform::String ^encoded_string, unsigned char *output, unsigned int out_len) +{ + int in_len = encoded_string->Length(); + int i = 0; + int j = 0; + int in_ = 0; + unsigned char char_array_4[4]; + unsigned char char_array_3[3]; + + unsigned char *pucOut = output; + + while (in_len-- && ( encoded_string->Data()[in_] != L'=') && is_base64(encoded_string->Data()[in_])) + { + char_array_4[i++] = (unsigned char)(encoded_string->Data()[in_]); + in_++; + if (i ==4) + { + for (i = 0; i <4; i++) + { + char_array_4[i] = (unsigned char )base64_chars.find(char_array_4[i]); + } + + char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4); + char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2); + char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3]; + + for (i = 0; (i < 3); i++) + { + *pucOut++ = char_array_3[i]; + if( ( pucOut - output ) >= out_len ) return; + } + i = 0; + } + } + + if(i) + { + for (j = i; j <4; j++) + { + char_array_4[j] = 0; + } + + for (j = 0; j <4; j++) + { + char_array_4[j] = (unsigned char )base64_chars.find(char_array_4[j]); + } + + char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4); + char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2); + char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3]; + + for (j = 0; (j < i - 1); j++) + { + *pucOut++ = char_array_3[j]; + if( ( pucOut - output ) >= out_len ) return; + } + } +} \ No newline at end of file diff --git a/Minecraft.Client/Durango/Network/base64.h b/Minecraft.Client/Durango/Network/base64.h new file mode 100644 index 00000000..637a0832 --- /dev/null +++ b/Minecraft.Client/Durango/Network/base64.h @@ -0,0 +1,6 @@ +#pragma once + +#include + +Platform::String^ base64_encode(unsigned char* chars_to_encode, unsigned int in_len); +void base64_decode(Platform::String ^encoded_string, unsigned char *output, unsigned int out_len); \ No newline at end of file diff --git a/Minecraft.Client/Durango/Network/windows.xbox.networking.realtimesession.pdb b/Minecraft.Client/Durango/Network/windows.xbox.networking.realtimesession.pdb new file mode 100644 index 00000000..18025f4f Binary files /dev/null and b/Minecraft.Client/Durango/Network/windows.xbox.networking.realtimesession.pdb differ diff --git a/Minecraft.Client/Durango/Network/windows.xbox.networking.realtimesession.winmd b/Minecraft.Client/Durango/Network/windows.xbox.networking.realtimesession.winmd new file mode 100644 index 00000000..3cf7a546 Binary files /dev/null and b/Minecraft.Client/Durango/Network/windows.xbox.networking.realtimesession.winmd differ diff --git a/Minecraft.Client/Durango/PresenceIds.h b/Minecraft.Client/Durango/PresenceIds.h new file mode 100644 index 00000000..98eea02b --- /dev/null +++ b/Minecraft.Client/Durango/PresenceIds.h @@ -0,0 +1,27 @@ +#pragma once + +// Values for CONTEXT_GAME_STATE + +#define CONTEXT_GAME_STATE_BLANK 0 +#define CONTEXT_GAME_STATE_RIDING_PIG 1 +#define CONTEXT_GAME_STATE_RIDING_MINECART 2 +#define CONTEXT_GAME_STATE_BOATING 3 +#define CONTEXT_GAME_STATE_FISHING 4 +#define CONTEXT_GAME_STATE_CRAFTING 5 +#define CONTEXT_GAME_STATE_FORGING 6 +#define CONTEXT_GAME_STATE_NETHER 7 +#define CONTEXT_GAME_STATE_CD 8 +#define CONTEXT_GAME_STATE_MAP 9 +#define CONTEXT_GAME_STATE_ENCHANTING 10 +#define CONTEXT_GAME_STATE_BREWING 11 +#define CONTEXT_GAME_STATE_ANVIL 12 +#define CONTEXT_GAME_STATE_TRADING 13 + +// Values for X_CONTEXT_PRESENCE + +#define CONTEXT_PRESENCE_IDLE 0 +#define CONTEXT_PRESENCE_MENUS 1 +#define CONTEXT_PRESENCE_MULTIPLAYER 2 +#define CONTEXT_PRESENCE_MULTIPLAYEROFFLINE 3 +#define CONTEXT_PRESENCE_MULTIPLAYER_1P 4 +#define CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE 5 \ No newline at end of file diff --git a/Minecraft.Client/Durango/Resource.h b/Minecraft.Client/Durango/Resource.h new file mode 100644 index 00000000..50af4a49 --- /dev/null +++ b/Minecraft.Client/Durango/Resource.h @@ -0,0 +1,31 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by DurangoRenderTest.rc +// + +#define IDS_APP_TITLE 103 + +#define IDR_MAINFRAME 128 +#define IDD_DURANGORENDERTEST_DIALOG 102 +#define IDD_ABOUTBOX 103 +#define IDM_ABOUT 104 +#define IDM_EXIT 105 +#define IDI_MINECRAFTWINDOWS 107 +#define IDI_SMALL 108 +#define IDC_MINECRAFTWINDOWS 109 +#define IDC_MYICON 2 +#ifndef IDC_STATIC +#define IDC_STATIC -1 +#endif +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS + +#define _APS_NO_MFC 130 +#define _APS_NEXT_RESOURCE_VALUE 129 +#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 110 +#endif +#endif diff --git a/Minecraft.Client/Durango/Sentient/DurangoTelemetry.cpp b/Minecraft.Client/Durango/Sentient/DurangoTelemetry.cpp new file mode 100644 index 00000000..d51ce966 --- /dev/null +++ b/Minecraft.Client/Durango/Sentient/DurangoTelemetry.cpp @@ -0,0 +1,986 @@ +#include "stdafx.h" + +#include "..\Minecraft.World\StringHelpers.h" + +#include "..\Minecraft.World\Player.h" +#include "..\Minecraft.World\Level.h" +#include "..\Minecraft.World\LevelData.h" +#include "..\Minecraft.World\LevelSettings.h" + +#include "Common\Network\GameNetworkManager.h" +#include "MultiPlayerLocalPlayer.h" + +#include "..\ServiceConfig\Events-XBLA.8-149E11AEEvents.h" + +#include "DurangoTelemetry.h" + +CTelemetryManager *TelemetryManager = new CDurangoTelemetryManager(); + +// Empty GUID +GUID CDurangoTelemetryManager::ZERO_GUID = GUID(); + +/* +HRESULT CDurangoTelemetryManager::Init() +{ + app.DebugPrintf("[CDurangoTelemetryManager] Init().\n"); + + m_initialiseTime = app.getAppTime(); + + return S_OK; +} +*/ + +CDurangoTelemetryManager::CDurangoTelemetryManager() +{ + m_initialiseTime = app.getAppTime(); +} + +/* +HRESULT CDurangoTelemetryManager::Tick() +{ + app.DebugPrintf("[CDurangoTelemetryManager] Tick().\n"); + return S_OK; +} + +HRESULT CDurangoTelemetryManager::Flush() +{ + app.DebugPrintf("[CDurangoTelemetryManager] Flush().\n"); + return S_OK; +} */ + +bool CDurangoTelemetryManager::RecordPlayerSessionStart(int iPad) +{ + durangoStats()->generatePlayerSession(); + + return true; +} + +bool CDurangoTelemetryManager::RecordPlayerSessionExit(int iPad, int exitStatus) +{ + PlayerUID puid; shared_ptr plr; + ProfileManager.GetXUID(iPad, &puid, true); + plr = Minecraft::GetInstance()->localplayers[iPad]; + + // 4J-JEV: Still needed to flush cached travel stats. + DurangoStats::playerSessionEnd(iPad); + + if (plr != NULL && plr->level != NULL && plr->level->getLevelData() != NULL) + { + ULONG hr = EventWritePlayerSessionEnd( + DurangoStats::getUserId(iPad), + DurangoStats::getPlayerSession(), + DurangoStats::getMultiplayerCorrelationId(), + plr->level->getLevelData()->getGameType()->isSurvival(), + plr->level->difficulty, + exitStatus); + + if (hr == 0) // Debug. + { + app.DebugPrintf("<%ls> PlayerSessionEnd(%ls,%ls,%i,%i,%i)\n", + DurangoStats::getUserId(iPad), + guid2str(DurangoStats::getPlayerSession()).c_str(), + DurangoStats::getMultiplayerCorrelationId(), + plr->level->getLevelData()->getGameType()->isSurvival(), + plr->level->difficulty, + exitStatus); + } + + if ( !g_NetworkManager.IsLocalGame() ) + { + float roundLength = app.getAppTime() - m_multiplayerRoundStartTimes[DurangoStats::getUserId(iPad)]; + + hr = EventWriteMultiplayerRoundEnd( + DurangoStats::getUserId(iPad), + &ZERO_GUID, + 0, + DurangoStats::getPlayerSession(), + DurangoStats::getMultiplayerCorrelationId(), + plr->level->getLevelData()->getGameType()->isSurvival(), // GameMode + 0, + plr->level->difficulty, + roundLength, // Time (seconds) + exitStatus + ); + + if (hr == 0) // Debug. + { + app.DebugPrintf( + "<%ls> MultiplayerRoundEnd(%ls,%ls,%i,%i,%.1f,%i).\n", + DurangoStats::getUserId(iPad), + guid2str(DurangoStats::getPlayerSession()).c_str(), + DurangoStats::getMultiplayerCorrelationId(), + plr->level->getLevelData()->getGameType()->isSurvival(), + plr->level->difficulty, + roundLength, + exitStatus); + } + } + } + + return true; +} + +bool CDurangoTelemetryManager::RecordLevelStart(int iPad, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, int numberOfLocalPlayers, int numberOfOnlinePlayers) +{ + CTelemetryManager::RecordLevelStart(iPad, friendsOrMatch, competeOrCoop, difficulty, numberOfLocalPlayers, numberOfOnlinePlayers); + + ULONG hr = 0; + + // Grab player info. + PlayerUID puid; shared_ptr plr; + ProfileManager.GetXUID(iPad, &puid, true); + plr = Minecraft::GetInstance()->localplayers[iPad]; + + if (plr != NULL && plr->level != NULL && plr->level->getLevelData() != NULL) + { + hr = EventWritePlayerSessionStart( + DurangoStats::getUserId(iPad), + DurangoStats::getPlayerSession(), + DurangoStats::getMultiplayerCorrelationId(), + plr->level->getLevelData()->getGameType()->isSurvival(), + plr->level->difficulty + ); + + if (hr == 0) // Debug. + { + app.DebugPrintf("<%ls> PlayerSessionStart(%ls,%ls,%i,%i)\n", + DurangoStats::getUserId(iPad), + guid2str(DurangoStats::getPlayerSession()).c_str(), + DurangoStats::getMultiplayerCorrelationId(), + plr->level->getLevelData()->getGameType()->isSurvival(), + plr->level->difficulty); + } + + m_multiplayerRoundStartTimes[DurangoStats::getUserId(iPad)] = -1.0f; + + // Send 'MultiplayerRoundStart' if we're starting an online game. + if ( !g_NetworkManager.IsLocalGame() ) + { + hr = EventWriteMultiplayerRoundStart( + DurangoStats::getUserId(iPad), + &ZERO_GUID, // RoundId + 0, // SectionId + DurangoStats::getPlayerSession(), + DurangoStats::getMultiplayerCorrelationId(), + plr->level->getLevelData()->getGameType()->isSurvival(), // GameMode + 0, // MatchType + plr->level->difficulty); + + if (hr == 0) // Debug. + { + app.DebugPrintf( + "<%ls> MultiplayerRoundStart(%ls,%ls,%i,%i).\n", + DurangoStats::getUserId(iPad), + guid2str(DurangoStats::getPlayerSession()).c_str(), + DurangoStats::getMultiplayerCorrelationId(), + plr->level->getLevelData()->getGameType()->isSurvival(), + plr->level->difficulty); + } + + m_multiplayerRoundStartTimes[DurangoStats::getUserId(iPad)] = app.getAppTime(); + } + } + + hr = EventWriteLevelStart( + DurangoStats::getUserId(iPad), + DurangoStats::getPlayerSession(), + GetSecondsSinceInitialize(), + GetMode(iPad), + GetSubMode(iPad), + GetLevelId(iPad), + GetSubLevelId(iPad), + GetLevelInstanceID(), + &ZERO_GUID, + friendsOrMatch, + competeOrCoop, + difficulty, + numberOfLocalPlayers, + numberOfOnlinePlayers, + &ZERO_GUID + ); + + if (hr == 0) // Debug. + { + app.DebugPrintf( + "<%ls> RecordLevelStart(" + "%is,%i,%i,%i,%i,%i," + "%ls,%ls,%i,%i,%i,%i,%i).\n", + + /* WSTR */ DurangoStats::getUserId(iPad), + + // Sentient // + /* int */ GetSecondsSinceInitialize(), + /* int */ GetMode(iPad), + /* int */ GetSubMode(iPad), + /* int */ GetLevelId(iPad), + /* int */ GetSubLevelId(iPad), + /* int */ GetLevelInstanceID(), + + // Durango // + /* GUID */ guid2str(DurangoStats::getPlayerSession()).c_str(), + /* WSTR */ DurangoStats::getMultiplayerCorrelationId(), + /* int */ friendsOrMatch, + /* int */ competeOrCoop, + /* int */ difficulty, + /* int */ numberOfLocalPlayers, + /* int */ numberOfOnlinePlayers + + ); + } + + return true; +} + +bool CDurangoTelemetryManager::RecordLevelExit(int iPad, ESen_LevelExitStatus levelExitStatus) +{ + CTelemetryManager::RecordLevelExit(iPad, levelExitStatus); + + ULONG hr = EventWriteLevelExit( + DurangoStats::getUserId(iPad), + DurangoStats::getPlayerSession(), + GetSecondsSinceInitialize(), + GetMode(iPad), + GetSubMode(iPad), + GetLevelId(iPad), + GetSubLevelId(iPad), + GetLevelInstanceID(), + &ZERO_GUID, + levelExitStatus, + &ZERO_GUID + ); + + if (hr == 0) // Debug. + { + app.DebugPrintf( + "<%ls> RecordLevelExit(", + "%is,%i,%i,%i,%i,%i," + "%ls,%ls,%i).\n", + + /* WSTR */ DurangoStats::getUserId(iPad), + + // Sentient // + /* int */ GetSecondsSinceInitialize(), + /* int */ GetMode(iPad), + /* int */ GetSubMode(iPad), + /* int */ GetLevelId(iPad), + /* int */ GetSubLevelId(iPad), + /* int */ GetLevelInstanceID(), + + // Durango // + /* GUID */ guid2str(DurangoStats::getPlayerSession()).c_str(), + /* WSTR */ DurangoStats::getMultiplayerCorrelationId(), + /* int */ levelExitStatus + ); + } + + return hr == 0; +} + +bool CDurangoTelemetryManager::RecordLevelSaveOrCheckpoint(int iPad, int saveOrCheckPointID, int saveSizeInBytes) +{ + CTelemetryManager::RecordLevelSaveOrCheckpoint(iPad, saveOrCheckPointID, saveSizeInBytes); + + ULONG hr = EventWriteLevelSaveOrCheckpoint( + DurangoStats::getUserId(iPad), + DurangoStats::getPlayerSession(), + GetSecondsSinceInitialize(), + GetMode(iPad), + GetSubMode(iPad), + GetLevelId(iPad), + GetSubLevelId(iPad), + GetLevelInstanceID(), + &ZERO_GUID, + &ZERO_GUID, + saveOrCheckPointID, + saveSizeInBytes + ); + + if (hr == 0) + { + app.DebugPrintf( + "<%ls> RecordLevelSaveOrCheckpoint(", + "%is,%i,%i,%i,%i,%i," + "%ls,%ls,%i,%i).\n", + + /* WSTR */ DurangoStats::getUserId(iPad), + + // Sentient // + /* int */ GetSecondsSinceInitialize(), + /* int */ GetMode(iPad), + /* int */ GetSubMode(iPad), + /* int */ GetLevelId(iPad), + /* int */ GetSubLevelId(iPad), + /* int */ GetLevelInstanceID(), + + // Durango // + /* GUID */ guid2str(DurangoStats::getPlayerSession()).c_str(), + /* WSTR */ DurangoStats::getMultiplayerCorrelationId(), + /* int */ saveOrCheckPointID, + /* int */ saveSizeInBytes + ); + } + + return hr == 0; +} + +bool CDurangoTelemetryManager::RecordLevelResume(int iPad, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, int numberOfLocalPlayers, int numberOfOnlinePlayers, int saveOrCheckPointID) +{ + CTelemetryManager::RecordLevelResume(iPad, friendsOrMatch, competeOrCoop, difficulty, numberOfLocalPlayers, numberOfOnlinePlayers, saveOrCheckPointID); + + ULONG hr = EventWriteLevelResume( + DurangoStats::getUserId(iPad), + DurangoStats::getPlayerSession(), + GetSecondsSinceInitialize(), + GetMode(iPad), + GetSubMode(iPad), + GetLevelId(iPad), + GetSubLevelId(iPad), + GetLevelInstanceID(), + &ZERO_GUID, + &ZERO_GUID, + friendsOrMatch, + competeOrCoop, + difficulty, + numberOfLocalPlayers, + numberOfOnlinePlayers, + saveOrCheckPointID + ); + + if (hr == 0) // Debug + { + app.DebugPrintf( + "<%ls> RecordLevelResume(", + "%is,%i,%i,%i,%i,%i," + "%ls,%ls,%i,%i,%i,%i,%i,%i).\n", + + /* WSTR */ DurangoStats::getUserId(iPad), + + // Sentient // + /* int */ GetSecondsSinceInitialize(), + /* int */ GetMode(iPad), + /* int */ GetSubMode(iPad), + /* int */ GetLevelId(iPad), + /* int */ GetSubLevelId(iPad), + /* int */ GetLevelInstanceID(), + + // Durango // + /* GUID */ guid2str(DurangoStats::getPlayerSession()).c_str(), + /* WSTR */ DurangoStats::getMultiplayerCorrelationId(), + /* int */ friendsOrMatch, + /* int */ competeOrCoop, + /* int */ difficulty, + /* int */ numberOfLocalPlayers, + /* int */ numberOfOnlinePlayers, + /* int */ saveOrCheckPointID + ); + } + + return hr == 0; +} + +bool CDurangoTelemetryManager::RecordPauseOrInactive(int iPad) +{ + CTelemetryManager::RecordPauseOrInactive(iPad); + + ULONG hr = EventWritePauseOrInactive( + DurangoStats::getUserId(iPad), + DurangoStats::getPlayerSession(), + GetSecondsSinceInitialize(), + GetMode(iPad), + GetSubMode(iPad), + GetLevelId(iPad), + GetSubLevelId(iPad), + GetLevelInstanceID(), + &ZERO_GUID, + &ZERO_GUID + ); + + if (hr == 0) // Debug. + { + app.DebugPrintf( + "<%ls> RecordPauseOrInactive(", + "%is,%i,%i,%i,%i,%i," + "%ls,%ls).\n", + + /* WSTR */ DurangoStats::getUserId(iPad), + + // Sentient // + /* int */ GetSecondsSinceInitialize(), + /* int */ GetMode(iPad), + /* int */ GetSubMode(iPad), + /* int */ GetLevelId(iPad), + /* int */ GetSubLevelId(iPad), + /* int */ GetLevelInstanceID(), + + // Durango // + /* GUID */ guid2str(DurangoStats::getPlayerSession()).c_str(), + /* WSTR */ DurangoStats::getMultiplayerCorrelationId() + ); + } + + return hr == 0; +} + +bool CDurangoTelemetryManager::RecordUnpauseOrActive(int iPad) +{ + CTelemetryManager::RecordUnpauseOrActive(iPad); + + ULONG hr = EventWriteUnpauseOrActive( + DurangoStats::getUserId(iPad), + DurangoStats::getPlayerSession(), + GetSecondsSinceInitialize(), + GetMode(iPad), + GetSubMode(iPad), + GetLevelId(iPad), + GetSubLevelId(iPad), + GetLevelInstanceID(), + &ZERO_GUID, + &ZERO_GUID + ); + + if (hr == 0) // Debug. + { + app.DebugPrintf( + "<%ls> RecordPauseOrInactive(", + "%is,%i,%i,%i,%i,%i," + "%ls,%ls).\n", + + /* WSTR */ DurangoStats::getUserId(iPad), + + // Sentient // + /* int */ GetSecondsSinceInitialize(), + /* int */ GetMode(iPad), + /* int */ GetSubMode(iPad), + /* int */ GetLevelId(iPad), + /* int */ GetSubLevelId(iPad), + /* int */ GetLevelInstanceID(), + + // Durango // + /* GUID */ guid2str(DurangoStats::getPlayerSession()).c_str(), + /* WSTR */ DurangoStats::getMultiplayerCorrelationId() + ); + } + + return hr == 0; +} + +bool CDurangoTelemetryManager::RecordMenuShown(int iPad, EUIScene menuID, int optionalMenuSubID) +{ + CTelemetryManager::RecordMenuShown(iPad, menuID, optionalMenuSubID); + + ULONG hr = EventWriteMenuShown( + DurangoStats::getUserId(iPad), + DurangoStats::getPlayerSession(), + GetSecondsSinceInitialize(), + GetMode(iPad), + GetSubMode(iPad), + GetLevelId(iPad), + GetSubLevelId(iPad), + GetLevelInstanceID(), + &ZERO_GUID, + &ZERO_GUID, + menuID, + optionalMenuSubID + ); + + if (hr == 0) + { + app.DebugPrintf( + "<%ls> RecordMenuShown(", + "%is,%i,%i,%i,%i,%i," + "%ls,%ls,%i,%i).\n", + + /* WSTR */ DurangoStats::getUserId(iPad), + + // Sentient // + /* int */ GetSecondsSinceInitialize(), + /* int */ GetMode(iPad), + /* int */ GetSubMode(iPad), + /* int */ GetLevelId(iPad), + /* int */ GetSubLevelId(iPad), + /* int */ GetLevelInstanceID(), + + // Durango // + /* GUID */ guid2str(DurangoStats::getPlayerSession()).c_str(), + /* WSTR */ DurangoStats::getMultiplayerCorrelationId(), + /* int */ menuID, + /* int */ optionalMenuSubID + ); + } + + return hr == 0; +} + +bool CDurangoTelemetryManager::RecordAchievementUnlocked(int iPad, int achievementID, int achievementGamerscore) +{ + CTelemetryManager::RecordAchievementUnlocked(iPad, achievementID, achievementGamerscore); + + ULONG hr = EventWriteAchievemntUnlocked( + DurangoStats::getUserId(iPad), + DurangoStats::getPlayerSession(), + GetSecondsSinceInitialize(), + GetMode(iPad), + GetSubMode(iPad), + GetLevelId(iPad), + GetSubLevelId(iPad), + GetLevelInstanceID(), + &ZERO_GUID, + &ZERO_GUID, + achievementID, + achievementGamerscore + ); + + if (hr == 0) // Debug. + { + app.DebugPrintf( + "<%ls> RecordPauseOrInactive(", + "%is,%i,%i,%i,%i,%i," + "%ls,%ls,%i,%i).\n", + + /* WSTR */ DurangoStats::getUserId(iPad), + + // Sentient // + /* int */ GetSecondsSinceInitialize(), + /* int */ GetMode(iPad), + /* int */ GetSubMode(iPad), + /* int */ GetLevelId(iPad), + /* int */ GetSubLevelId(iPad), + /* int */ GetLevelInstanceID(), + + // Durango // + /* GUID */ guid2str(DurangoStats::getPlayerSession()).c_str(), + /* WSTR */ DurangoStats::getMultiplayerCorrelationId(), + /* int */ achievementID, + /* int */ achievementGamerscore + ); + } + + return hr == 0; +} + +bool CDurangoTelemetryManager::RecordMediaShareUpload(int iPad, ESen_MediaDestination mediaDestination, ESen_MediaType mediaType) +{ + CTelemetryManager::RecordMediaShareUpload(iPad, mediaDestination, mediaType); + +#if 0 + ULONG hr = EventWriteRecordMediaShareUpload( + DurangoStats::getUserId(iPad), + DurangoStats::getPlayerSession(), + GetSecondsSinceInitialize(), + GetMode(iPad), + GetSubMode(iPad), + GetLevelId(iPad), + GetSubLevelId(iPad), + GetLevelInstanceID(), + &ZERO_GUID, + &ZERO_GUID, + mediaDestination, + mediaType + ); +#else + ULONG hr = -1; +#endif + + if (hr == 0) + { + app.DebugPrintf( + "<%ls> RecordPauseOrInactive(", + "%is,%i,%i,%i,%i,%i," + "%ls,%ls,%i,%i).\n", + + /* WSTR */ DurangoStats::getUserId(iPad), + + // Sentient // + /* int */ GetSecondsSinceInitialize(), + /* int */ GetMode(iPad), + /* int */ GetSubMode(iPad), + /* int */ GetLevelId(iPad), + /* int */ GetSubLevelId(iPad), + /* int */ GetLevelInstanceID(), + + // Durango // + /* GUID */ guid2str(DurangoStats::getPlayerSession()).c_str(), + /* WSTR */ DurangoStats::getMultiplayerCorrelationId(), + /* int */ mediaDestination, + /* int */ mediaType + ); + } + + return hr == 0; +} + +bool CDurangoTelemetryManager::RecordUpsellPresented(int iPad, ESen_UpsellID upsellId, int marketplaceOfferID) +{ + //CTelemetryManager::RecordUpsellPresented(iPad, upsellId + + ULONG hr = EventWriteUpsellPresented( + DurangoStats::getUserId(iPad), + DurangoStats::getPlayerSession(), + GetSecondsSinceInitialize(), + GetMode(iPad), + GetSubMode(iPad), + GetLevelId(iPad), + GetSubLevelId(iPad), + GetLevelInstanceID(), + &ZERO_GUID, + &ZERO_GUID, + upsellId, + marketplaceOfferID + ); + + if (hr == 0) + { + app.DebugPrintf( + "<%ls> RecordPauseOrInactive(", + "%is,%i,%i,%i,%i,%i," + "%ls,%ls,%i,%i).\n", + + /* WSTR */ DurangoStats::getUserId(iPad), + + // Sentient // + /* int */ GetSecondsSinceInitialize(), + /* int */ GetMode(iPad), + /* int */ GetSubMode(iPad), + /* int */ GetLevelId(iPad), + /* int */ GetSubLevelId(iPad), + /* int */ GetLevelInstanceID(), + + // Durango // + /* GUID */ guid2str(DurangoStats::getPlayerSession()).c_str(), + /* WSTR */ DurangoStats::getMultiplayerCorrelationId(), + /* int */ upsellId, + /* int */ marketplaceOfferID + ); + } + + return hr == 0; +} + +bool CDurangoTelemetryManager::RecordUpsellResponded(int iPad, ESen_UpsellID upsellId, int marketplaceOfferID, ESen_UpsellOutcome upsellOutcome) +{ + ULONG hr = EventWriteUpsellResponded( + DurangoStats::getUserId(iPad), + DurangoStats::getPlayerSession(), + GetSecondsSinceInitialize(), + GetMode(iPad), + GetSubMode(iPad), + GetLevelId(iPad), + GetSubLevelId(iPad), + GetLevelInstanceID(), + &ZERO_GUID, + &ZERO_GUID, + upsellId, + marketplaceOfferID, + upsellOutcome + ); + + if (hr == 0) + { + app.DebugPrintf( + "<%ls> RecordPauseOrInactive(", + "%is,%i,%i,%i,%i,%i," + "%ls,%ls).\n", + + /* WSTR */ DurangoStats::getUserId(iPad), + + // Sentient // + /* int */ GetSecondsSinceInitialize(), + /* int */ GetMode(iPad), + /* int */ GetSubMode(iPad), + /* int */ GetLevelId(iPad), + /* int */ GetSubLevelId(iPad), + /* int */ GetLevelInstanceID(), + + // Durango // + /* GUID */ guid2str(DurangoStats::getPlayerSession()).c_str(), + /* WSTR */ DurangoStats::getMultiplayerCorrelationId(), + /* int */ upsellId, + /* int */ marketplaceOfferID, + /* int */ upsellOutcome + ); + } + + return hr == 0; +} + +bool CDurangoTelemetryManager::RecordPlayerDiedOrFailed(int iPad, int lowResMapX, int lowResMapY, int lowResMapZ, int mapID, int playerWeaponID, int enemyWeaponID, ETelemetryChallenges enemyTypeID) +{ + ULONG hr = EventWritePlayerDiedOrFailed( + DurangoStats::getUserId(iPad), + DurangoStats::getPlayerSession(), + GetSecondsSinceInitialize(), + GetMode(iPad), + GetSubMode(iPad), + GetLevelId(iPad), + GetSubLevelId(iPad), + GetLevelInstanceID(), + &ZERO_GUID, + &ZERO_GUID, + lowResMapX, + lowResMapY, + lowResMapZ, + mapID, + playerWeaponID, + enemyWeaponID, + enemyTypeID + ); + + if (hr == 0) + { + app.DebugPrintf( + "<%ls> RecordPauseOrInactive(", + "%is,%i,%i,%i,%i,%i," + "%ls,%ls,%i,%i,%i,%i,%i,%i,%i).\n", + + /* WSTR */ DurangoStats::getUserId(iPad), + + // Sentient // + /* int */ GetSecondsSinceInitialize(), + /* int */ GetMode(iPad), + /* int */ GetSubMode(iPad), + /* int */ GetLevelId(iPad), + /* int */ GetSubLevelId(iPad), + /* int */ GetLevelInstanceID(), + + // Durango // + /* GUID */ guid2str(DurangoStats::getPlayerSession()).c_str(), + /* WSTR */ DurangoStats::getMultiplayerCorrelationId(), + /* int */ lowResMapX, + /* int */ lowResMapY, + /* int */ lowResMapZ, + /* int */ mapID, + /* int */ playerWeaponID, + /* int */ enemyWeaponID, + /* int */ enemyTypeID + ); + } + + return hr == 0; +} + +bool CDurangoTelemetryManager::RecordEnemyKilledOrOvercome(int iPad, int lowResMapX, int lowResMapY, int lowResMapZ, int mapID, int playerWeaponID, int enemyWeaponID, ETelemetryChallenges enemyTypeID) +{ + ULONG hr = -1; + + if (hr == 0) + { + app.DebugPrintf( + "<%ls> RecordPauseOrInactive(", + "%is,%i,%i,%i,%i,%i," + "%ls,%ls,%i,%i,%i,%i,%i,%i,%i).\n", + + /* WSTR */ DurangoStats::getUserId(iPad), + + // Sentient // + /* int */ GetSecondsSinceInitialize(), + /* int */ GetMode(iPad), + /* int */ GetSubMode(iPad), + /* int */ GetLevelId(iPad), + /* int */ GetSubLevelId(iPad), + /* int */ GetLevelInstanceID(), + + // Durango // + /* GUID */ guid2str(DurangoStats::getPlayerSession()).c_str(), + /* WSTR */ DurangoStats::getMultiplayerCorrelationId(), + /* int */ lowResMapX, + /* int */ lowResMapY, + /* int */ lowResMapZ, + /* int */ mapID, + /* int */ playerWeaponID, + /* int */ enemyWeaponID, + /* int */ enemyTypeID + ); + } + // NO EVENT TO SEND, ALREADY COVERED BY STATISTIC CODE! + + return hr == 0; +} + +bool CDurangoTelemetryManager::RecordTexturePackLoaded(int iPad, int texturePackId, bool purchased) +{ + ULONG hr = EventWriteTexturePackLoaded( + DurangoStats::getUserId(iPad), + DurangoStats::getPlayerSession(), + GetSecondsSinceInitialize(), + GetMode(iPad), + GetSubMode(iPad), + GetLevelId(iPad), + GetSubLevelId(iPad), + GetLevelInstanceID(), + &ZERO_GUID, + &ZERO_GUID, + texturePackId, + purchased + ); + + if (hr == 0) // Debug. + { + app.DebugPrintf( + "<%ls> RecordPauseOrInactive(", + "%is,%i,%i,%i,%i,%i," + "%ls,%ls,%i,%s).\n", + + /* WSTR */ DurangoStats::getUserId(iPad), + + // Sentient // + /* int */ GetSecondsSinceInitialize(), + /* int */ GetMode(iPad), + /* int */ GetSubMode(iPad), + /* int */ GetLevelId(iPad), + /* int */ GetSubLevelId(iPad), + /* int */ GetLevelInstanceID(), + + // Durango // + /* GUID */ guid2str(DurangoStats::getPlayerSession()).c_str(), + /* WSTR */ DurangoStats::getMultiplayerCorrelationId(), + /* int */ texturePackId, + /* bool */ (purchased ? "Purchased" : "NotPurchased") + ); + } + + return hr == 0; +} + +bool CDurangoTelemetryManager::RecordSkinChanged(int iPad, int dwSkinId) +{ + ULONG hr = EventWriteSkinChanged( + DurangoStats::getUserId(iPad), + DurangoStats::getPlayerSession(), + GetSecondsSinceInitialize(), + GetMode(iPad), + GetSubMode(iPad), + GetLevelId(iPad), + GetSubLevelId(iPad), + GetLevelInstanceID(), + &ZERO_GUID, + &ZERO_GUID, + dwSkinId + ); + + if (hr == 0) + { + app.DebugPrintf( + "<%ls> RecordSkinChanged(", + "%is,%i,%i,%i,%i,%i," + "%ls,%ls,%i).\n", + + /* WSTR */ DurangoStats::getUserId(iPad), + + // Sentient // + /* int */ GetSecondsSinceInitialize(), + /* int */ GetMode(iPad), + /* int */ GetSubMode(iPad), + /* int */ GetLevelId(iPad), + /* int */ GetSubLevelId(iPad), + /* int */ GetLevelInstanceID(), + + // Durango // + /* GUID */ guid2str(DurangoStats::getPlayerSession()).c_str(), + /* WSTR */ DurangoStats::getMultiplayerCorrelationId(), + /* int */ dwSkinId + ); + } + + return hr == 0; +} + +bool CDurangoTelemetryManager::RecordBanLevel(int iPad) +{ + ULONG hr = EventWriteBanLevel( + DurangoStats::getUserId(iPad), + DurangoStats::getPlayerSession(), + GetSecondsSinceInitialize(), + GetMode(iPad), + GetSubMode(iPad), + GetLevelId(iPad), + GetSubLevelId(iPad), + GetLevelInstanceID(), + &ZERO_GUID, + &ZERO_GUID + ); + + if (hr == 0) + { + app.DebugPrintf( + "<%ls> RecordBanLevel(", + "%is,%i,%i,%i,%i,%i," + "%ls,%ls).\n", + + /* WSTR */ DurangoStats::getUserId(iPad), + + // Sentient // + /* int */ GetSecondsSinceInitialize(), + /* int */ GetMode(iPad), + /* int */ GetSubMode(iPad), + /* int */ GetLevelId(iPad), + /* int */ GetSubLevelId(iPad), + /* int */ GetLevelInstanceID(), + + // Durango // + /* GUID */ guid2str(DurangoStats::getPlayerSession()).c_str(), + /* WSTR */ DurangoStats::getMultiplayerCorrelationId() + ); + } + + return hr == 0; +} + +bool CDurangoTelemetryManager::RecordUnBanLevel(int iPad) +{ + ULONG hr = EventWriteUnbanLevel( + DurangoStats::getUserId(iPad), + DurangoStats::getPlayerSession(), + GetSecondsSinceInitialize(), + GetMode(iPad), + GetSubMode(iPad), + GetLevelId(iPad), + GetSubLevelId(iPad), + GetLevelInstanceID(), + &ZERO_GUID, + &ZERO_GUID + ); + + if (hr == 0) // Debug. + { + app.DebugPrintf( + "<%ls> RecordUnBanLevel(", + "%is,%i,%i,%i,%i,%i," + "%ls,%ls).\n", + + /* WSTR */ DurangoStats::getUserId(iPad), + + // Sentient // + /* int */ GetSecondsSinceInitialize(), + /* int */ GetMode(iPad), + /* int */ GetSubMode(iPad), + /* int */ GetLevelId(iPad), + /* int */ GetSubLevelId(iPad), + /* int */ GetLevelInstanceID(), + + // Durango // + /* GUID */ guid2str(DurangoStats::getPlayerSession()).c_str(), + /* WSTR */ DurangoStats::getMultiplayerCorrelationId() + ); + } + + return hr == 0; +} + +DurangoStats *CDurangoTelemetryManager::durangoStats() +{ + return (DurangoStats*) GenericStats::getInstance(); +} + +wstring CDurangoTelemetryManager::guid2str(LPCGUID guid) +{ + wstring out = L"GUID<"; + out += _toString(guid->Data1); + out += L":"; + out += _toString(guid->Data2); + out += L":"; + out += _toString(guid->Data3); + //out += L":"; + //out += convStringToWstring(string((char*)&guid->Data4,8)); + out += L">"; + return out; +} \ No newline at end of file diff --git a/Minecraft.Client/Durango/Sentient/DurangoTelemetry.h b/Minecraft.Client/Durango/Sentient/DurangoTelemetry.h new file mode 100644 index 00000000..4f086696 --- /dev/null +++ b/Minecraft.Client/Durango/Sentient/DurangoTelemetry.h @@ -0,0 +1,50 @@ +#pragma once + +#include "..\..\..\Minecraft.World\DurangoStats.h" + +#include "..\..\Common\Telemetry\TelemetryManager.h" + +class CDurangoTelemetryManager : public CTelemetryManager +{ +public: + static GUID ZERO_GUID; + + unordered_map m_multiplayerRoundStartTimes; + + CDurangoTelemetryManager(); + + //virtual HRESULT Init(); + //virtual HRESULT Tick(); + //virtual HRESULT Flush(); + + virtual bool RecordPlayerSessionStart(int iPad); + virtual bool RecordPlayerSessionExit(int iPad, int exitStatus); + //virtual bool RecordHeartBeat(int iPad); + virtual bool RecordLevelStart(int iPad, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, int numberOfLocalPlayers, int numberOfOnlinePlayers); + virtual bool RecordLevelExit(int iPad, ESen_LevelExitStatus levelExitStatus); + virtual bool RecordLevelSaveOrCheckpoint(int iPad, int saveOrCheckPointID, int saveSizeInBytes); + virtual bool RecordLevelResume(int iPad, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, int numberOfLocalPlayers, int numberOfOnlinePlayers, int saveOrCheckPointID); + virtual bool RecordPauseOrInactive(int iPad); + virtual bool RecordUnpauseOrActive(int iPad); + virtual bool RecordMenuShown(int iPad, EUIScene menuID, int optionalMenuSubID); + virtual bool RecordAchievementUnlocked(int iPad, int achievementID, int achievementGamerscore); + virtual bool RecordMediaShareUpload(int iPad, ESen_MediaDestination mediaDestination, ESen_MediaType mediaType); + virtual bool RecordUpsellPresented(int iPad, ESen_UpsellID upsellId, int marketplaceOfferID); + virtual bool RecordUpsellResponded(int iPad, ESen_UpsellID upsellId, int marketplaceOfferID, ESen_UpsellOutcome upsellOutcome); + virtual bool RecordPlayerDiedOrFailed(int iPad, int lowResMapX, int lowResMapY, int lowResMapZ, int mapID, int playerWeaponID, int enemyWeaponID, ETelemetryChallenges enemyTypeID); + virtual bool RecordEnemyKilledOrOvercome(int iPad, int lowResMapX, int lowResMapY, int lowResMapZ, int mapID, int playerWeaponID, int enemyWeaponID, ETelemetryChallenges enemyTypeID); + virtual bool RecordTexturePackLoaded(int iPad, int texturePackId, bool purchased); + + virtual bool RecordSkinChanged(int iPad, int dwSkinId); + virtual bool RecordBanLevel(int iPad); + virtual bool RecordUnBanLevel(int iPad); + + //virtual int GetMultiplayerInstanceID(); + //virtual int GenerateMultiplayerInstanceId(); + //virtual void SetMultiplayerInstanceId(int value); + +protected: + DurangoStats *durangoStats(); + + wstring guid2str(LPCGUID guid); +}; \ No newline at end of file diff --git a/Minecraft.Client/Durango/Sentient/DynamicConfigurations.h b/Minecraft.Client/Durango/Sentient/DynamicConfigurations.h new file mode 100644 index 00000000..61b206eb --- /dev/null +++ b/Minecraft.Client/Durango/Sentient/DynamicConfigurations.h @@ -0,0 +1,68 @@ +#pragma once + +// 4J Stu - This file defines the id's for the dynamic configurations that we are currently using +// as well as the format of the data in them + +/*********************** +* +* TRIAL TIMER +* +************************/ + +#define DYNAMIC_CONFIG_TRIAL_ID 0 +#define DYNAMIC_CONFIG_TRIAL_VERSION 1 +#define DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME 2400 //40 mins 1200 // 20 mins //300; // 5 minutes + +class MinecraftDynamicConfigurations +{ +private: + enum EDynamic_Configs + { + eDynamic_Config_Trial, + + eDynamic_Config_Max, + }; + + /*********************** + * + * TRIAL TIMER + * + ************************/ + + // 4J Stu - The first 4 bytes define a version number, that defines the structure of the data + // After reading those bytes into a DWORD, the remainder of the data should be the size of the + // relevant struct and can be cast to the struct + struct _dynamic_config_trial_data_version1 + { + // The time in seconds that the player can play the trial for + DWORD trialTimeSeconds; + + _dynamic_config_trial_data_version1() { trialTimeSeconds = DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME; } + }; + + typedef _dynamic_config_trial_data_version1 Dynamic_Config_Trial_Data; + + // Stored configurations + static Dynamic_Config_Trial_Data trialData; + + static bool s_bFirstUpdateStarted; + static bool s_bUpdatedConfigs[eDynamic_Config_Max]; + static EDynamic_Configs s_eCurrentConfig; + static size_t s_currentConfigSize; + + static size_t s_dataWrittenSize; + static byte *s_dataWritten; + +public: + static void Tick(); + + static DWORD GetTrialTime(); + +private: + static void UpdateAllConfigurations(); + static void UpdateNextConfiguration(); + static void UpdateConfiguration(EDynamic_Configs id); + + static void GetSizeCompletedCallback(HRESULT taskResult, void *userCallbackData); + static void GetDataCompletedCallback(HRESULT taskResult, void *userCallbackData); +}; \ No newline at end of file diff --git a/Minecraft.Client/Durango/Sentient/MinecraftTelemetry.h b/Minecraft.Client/Durango/Sentient/MinecraftTelemetry.h new file mode 100644 index 00000000..26ef1092 --- /dev/null +++ b/Minecraft.Client/Durango/Sentient/MinecraftTelemetry.h @@ -0,0 +1,3 @@ +#include "SentientTelemetryCommon.h" +#include "TelemetryEnum.h" +#include "SentientStats.h" \ No newline at end of file diff --git a/Minecraft.Client/Durango/Sentient/SentientManager.h b/Minecraft.Client/Durango/Sentient/SentientManager.h new file mode 100644 index 00000000..d5397249 --- /dev/null +++ b/Minecraft.Client/Durango/Sentient/SentientManager.h @@ -0,0 +1,83 @@ +#pragma once +#include "MinecraftTelemetry.h" + +class CSentientManager +{ +public: + enum ETelemetryEvent + { + eTelemetry_PlayerSessionStart, + eTelemetry_PlayerSessionExit, + eTelemetry_HeartBeat, + eTelemetry_LevelStart, + eTelemetry_LevelExit, + eTelemetry_LevelSaveOrCheckpoint, + eTelemetry_PauseOrInactive, + eTelemetry_UnpauseOrActive, + eTelemetry_MenuShown, + eTelemetry_AchievementUnlocked, + eTelemetry_MediaShareUpload, + eTelemetry_UpsellPresented, + eTelemetry_UpsellResponded, + eTelemetry_PlayerDiedOrFailed, + eTelemetry_EnemyKilledOrOvercome, + }; + + HRESULT Init(); + HRESULT Tick(); + + HRESULT Flush(); + + BOOL RecordPlayerSessionStart(DWORD dwUserId); + BOOL RecordPlayerSessionExit(DWORD dwUserId, int exitStatus); + BOOL RecordHeartBeat(DWORD dwUserId); + BOOL RecordLevelStart(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, DWORD numberOfLocalPlayers, DWORD numberOfOnlinePlayers); + BOOL RecordLevelExit(DWORD dwUserId, ESen_LevelExitStatus levelExitStatus); + BOOL RecordLevelSaveOrCheckpoint(DWORD dwUserId, INT saveOrCheckPointID, INT saveSizeInBytes); + BOOL RecordLevelResume(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, DWORD numberOfLocalPlayers, DWORD numberOfOnlinePlayers, INT saveOrCheckPointID); + BOOL RecordPauseOrInactive(DWORD dwUserId); + BOOL RecordUnpauseOrActive(DWORD dwUserId); + BOOL RecordMenuShown(DWORD dwUserId, INT menuID, INT optionalMenuSubID); + BOOL RecordAchievementUnlocked(DWORD dwUserId, INT achievementID, INT achievementGamerscore); + BOOL RecordMediaShareUpload(DWORD dwUserId, ESen_MediaDestination mediaDestination, ESen_MediaType mediaType); + BOOL RecordUpsellPresented(DWORD dwUserId, ESen_UpsellID upsellId, INT marketplaceOfferID); + BOOL RecordUpsellResponded(DWORD dwUserId, ESen_UpsellID upsellId, INT marketplaceOfferID, ESen_UpsellOutcome upsellOutcome); + BOOL RecordPlayerDiedOrFailed(DWORD dwUserId, INT lowResMapX, INT lowResMapY, INT lowResMapZ, INT mapID, INT playerWeaponID, INT enemyWeaponID, ETelemetryChallenges enemyTypeID); + BOOL RecordEnemyKilledOrOvercome(DWORD dwUserId, INT lowResMapX, INT lowResMapY, INT lowResMapZ, INT mapID, INT playerWeaponID, INT enemyWeaponID, ETelemetryChallenges enemyTypeID); + + BOOL RecordSkinChanged(DWORD dwUserId, DWORD dwSkinId); + BOOL RecordBanLevel(DWORD dwUserId); + BOOL RecordUnBanLevel(DWORD dwUserId); + + INT GetMultiplayerInstanceID(); + INT GenerateMultiplayerInstanceId(); + void SetMultiplayerInstanceId(INT value); + +private: + float m_initialiseTime; + float m_lastHeartbeat; + bool m_bFirstFlush; + + float m_fLevelStartTime[XUSER_MAX_COUNT]; + + INT m_multiplayerInstanceID; + DWORD m_levelInstanceID; + + // Helper functions to get the various common settings + INT GetSecondsSinceInitialize(); + INT GetMode(DWORD dwUserId); + INT GetSubMode(DWORD dwUserId); + INT GetLevelId(DWORD dwUserId); + INT GetSubLevelId(DWORD dwUserId); + INT GetTitleBuildId(); + INT GetLevelInstanceID(); + INT GetSingleOrMultiplayer(); + INT GetDifficultyLevel(INT diff); + INT GetLicense(); + INT GetDefaultGameControls(); + INT GetAudioSettings(DWORD dwUserId); + INT GetLevelExitProgressStat1(); + INT GetLevelExitProgressStat2(); +}; + +extern CSentientManager SentientManager; \ No newline at end of file diff --git a/Minecraft.Client/Durango/Sentient/SentientStats.h b/Minecraft.Client/Durango/Sentient/SentientStats.h new file mode 100644 index 00000000..7115e25d --- /dev/null +++ b/Minecraft.Client/Durango/Sentient/SentientStats.h @@ -0,0 +1,88 @@ +/************************************************************************/ +/* THIS FILE WAS AUTOMATICALLY GENERATED */ +/* PLEASE DO NOT MODIFY */ +/************************************************************************/ +// Generated from Version: 20, on (6/19/2012 9:21:23 AM) + +#pragma once + +/************************************************************************/ +/* STATS */ +/************************************************************************/ + +// PlayerSessionStart +// Player signed in or joined +BOOL SenStatPlayerSessionStart ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT TitleBuildID, INT SkeletonDistanceInInches, INT EnrollmentType, INT NumberOfSkeletonsInView ); + +// PlayerSessionExit +// Player signed out or left +BOOL SenStatPlayerSessionExit ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID ); + +// HeartBeat +// Sent every 60 seconds by title +BOOL SenStatHeartBeat ( DWORD dwUserID, INT SecondsSinceInitialize ); + +// LevelStart +// Level started +BOOL SenStatLevelStart ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SingleOrMultiplayer, INT FriendsOrMatch, INT CompeteOrCoop, INT DifficultyLevel, INT NumberOfLocalPlayers, INT NumberOfOnlinePlayers, INT License, INT DefaultGameControls, INT AudioSettings, INT SkeletonDistanceInInches, INT NumberOfSkeletonsInView ); + +// LevelExit +// Level exited +BOOL SenStatLevelExit ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LevelExitStatus, INT LevelExitProgressStat1, INT LevelExitProgressStat2, INT LevelDurationInSeconds ); + +// LevelSaveOrCheckpoint +// Level saved explicitly or implicitly +BOOL SenStatLevelSaveOrCheckpoint ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LevelExitProgressStat1, INT LevelExitProgressStat2, INT LevelDurationInSeconds, INT SaveOrCheckPointID ); + +// LevelResume +// Level resumed from a save or restarted at a checkpoint +BOOL SenStatLevelResume ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SingleOrMultiplayer, INT FriendsOrMatch, INT CompeteOrCoop, INT DifficultyLevel, INT NumberOfLocalPlayers, INT NumberOfOnlinePlayers, INT License, INT DefaultGameControls, INT SaveOrCheckPointID, INT AudioSettings, INT SkeletonDistanceInInches, INT NumberOfSkeletonsInView ); + +// PauseOrInactive +// Player paused game or has become inactive, level and mode are for what the player is leaving +BOOL SenStatPauseOrInactive ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); + +// UnpauseOrActive +// Player unpaused game or has become active, level and mode are for what the player is entering into +BOOL SenStatUnpauseOrActive ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); + +// MenuShown +// A menu screen or major menu area has been shown +BOOL SenStatMenuShown ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT MenuID, INT OptionalMenuSubID, INT LevelInstanceID, INT MultiplayerInstanceID ); + +// AchievementUnlocked +// An achievement was unlocked +BOOL SenStatAchievementUnlocked ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT AchievementID, INT AchievementGamerscore ); + +// MediaShareUpload +// The user uploaded something to Kinect Share +BOOL SenStatMediaShareUpload ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT MediaDestination, INT MediaType ); + +// UpsellPresented +// The user is shown an upsell to purchase something +BOOL SenStatUpsellPresented ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT UpsellID, INT MarketplaceOfferID ); + +// UpsellResponded +// The user responded to the upsell +BOOL SenStatUpsellResponded ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT UpsellID, INT MarketplaceOfferID, INT UpsellOutcome ); + +// PlayerDiedOrFailed +// The player died or failed a challenge - can be used for many types of failure +BOOL SenStatPlayerDiedOrFailed ( DWORD dwUserID, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LowResMapX, INT LowResMapY, INT LowResMapZ, INT MapID, INT PlayerWeaponID, INT EnemyWeaponID, INT EnemyTypeID, INT SecondsSinceInitialize, INT CopyOfSecondsSinceInitialize ); + +// EnemyKilledOrOvercome +// The player killed an enemy or overcame or solved a major challenge +BOOL SenStatEnemyKilledOrOvercome ( DWORD dwUserID, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LowResMapX, INT LowResMapY, INT LowResMapZ, INT MapID, INT PlayerWeaponID, INT EnemyWeaponID, INT EnemyTypeID, INT SecondsSinceInitialize, INT CopyOfSecondsSinceInitialize ); + +// SkinChanged +// The player has changed their skin, level and mode are for what the player is currently in +BOOL SenStatSkinChanged ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SkinID ); + +// BanLevel +// The player has banned a level, level and mode are for what the player is currently in and banning +BOOL SenStatBanLevel ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); + +// UnBanLevel +// The player has ubbanned a level, level and mode are for what the player is currently in and unbanning +BOOL SenStatUnBanLevel ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); + diff --git a/Minecraft.Client/Durango/Sentient/SentientTelemetryCommon.h b/Minecraft.Client/Durango/Sentient/SentientTelemetryCommon.h new file mode 100644 index 00000000..0b9c0e87 --- /dev/null +++ b/Minecraft.Client/Durango/Sentient/SentientTelemetryCommon.h @@ -0,0 +1,190 @@ +#pragma once +// 4J Stu - Enums as defined by the common Sentient telemetry format + +//################################## +// DO NOT CHANGE ANY OF THESE VALUES +//################################## + + +/************************************* + AudioSettings + ************************************* + Are players changing default audio settings? + */ +enum ESen_AudioSettings +{ + eSen_AudioSettings_Undefined = 0, + eSen_AudioSettings_Off = 1, + eSen_AudioSettings_On_Default = 2, + eSen_AudioSettings_On_CustomSetting = 3, +}; + +/************************************* + CompeteOrCoop + ************************************* + Indicates whether players are playing a cooperative mode or a competitive mode. + */ +enum ESen_CompeteOrCoop +{ + eSen_CompeteOrCoop_Undefined = 0, + eSen_CompeteOrCoop_Cooperative = 1, + eSen_CompeteOrCoop_Competitive = 2, + eSen_CompeteOrCoop_Coop_and_Competitive = 3, +}; + +/************************************* + DefaultGameControls + ************************************* + This is intended to capture whether players played using default control scheme or customized the control scheme. + */ +enum ESen_DefaultGameControls +{ + eSen_DefaultGameControls_Undefined = 0, + eSen_DefaultGameControls_Default_controls = 1, + eSen_DefaultGameControls_Custom_controls = 2, +}; + +/************************************* + DifficultyLevel + ************************************* + An in-game setting that differentiates the challenge imposed on the user. Normalized to a standard 5-point scale. + */ +enum ESen_DifficultyLevel +{ + eSen_DifficultyLevel_Undefined = 0, + eSen_DifficultyLevel_Easiest = 1, + eSen_DifficultyLevel_Easier = 2, + eSen_DifficultyLevel_Normal = 3, + eSen_DifficultyLevel_Harder = 4, + eSen_DifficultyLevel_Hardest = 5, +}; + +/************************************* + GameInputType + ************************************* + Used to determine the different modes of input used in the game. For gamepad/keyboard/mouse usage, it is not necessary to call this for every single input. + Also, if polling is used, calling this event occasionally may also work. + */ +enum ESen_GameInputType +{ + eSen_GameInputType_Undefined = 0, + eSen_GameInputType_Xbox_Controller = 1, + eSen_GameInputType_Gesture = 2, + eSen_GameInputType_Voice = 3, + eSen_GameInputType_Voice_and_Gesture_Together = 4, + eSen_GameInputType_Touch = 5, + eSen_GameInputType_Keyboard = 6, + eSen_GameInputType_Mouse = 7, +}; + +/************************************* + LevelExitStatus + ************************************* + Indicates whether the player successfully completed the level. Critical for understanding the difficulty of a game with checkpoints or saves. + */ +enum ESen_LevelExitStatus +{ + eSen_LevelExitStatus_Undefined = 0, + eSen_LevelExitStatus_Exited = 1, + eSen_LevelExitStatus_Succeeded = 2, + eSen_LevelExitStatus_Failed = 3, +}; + +/************************************* + License + ************************************* + Differentiates trial/demo from full purchased titles + */ +enum ESen_License +{ + eSen_License_Undefined = 0, + eSen_License_Trial_or_Demo = 1, + eSen_License_Full_Purchased_Title = 2, +}; + +/************************************* + MediaDestination + ************************************* + Tracks where media is uploaded to (like facebook) + */ +enum ESen_MediaDestination +{ + ESen_MediaDestination_Undefined = 0, + ESen_MediaDestination_Kinect_Share = 1, + ESen_MediaDestination_Facebook = 2, + ESen_MediaDestination_YouTube = 3, + ESen_MediaDestination_Other = 4 +}; + +/************************************* + MediaType + ************************************* + Used to capture the type of media players are uploading to KinectShare + */ +enum ESen_MediaType +{ + eSen_MediaType_Undefined = 0, + eSen_MediaType_Picture = 1, + eSen_MediaType_Video = 2, + eSen_MediaType_Other_UGC = 3, +}; + +/************************************* + SingleOrMultiplayer + ************************************* + Indicates whether the game is being played in single or multiplayer mode and whether multiplayer is being played locally or over live. + */ +enum ESen_SingleOrMultiplayer +{ + eSen_SingleOrMultiplayer_Undefined = 0, + eSen_SingleOrMultiplayer_Single_Player = 1, + eSen_SingleOrMultiplayer_Multiplayer_Local = 2, + eSen_SingleOrMultiplayer_Multiplayer_Live = 3, + eSen_SingleOrMultiplayer_Multiplayer_Both_Local_and_Live = 4, +}; + +/************************************* + FriendOrMatch + ************************************* + Are players playing with friends or were they matched? + */ +enum ESen_FriendOrMatch +{ + eSen_FriendOrMatch_Undefined = 0, // (use if a single player game) + eSen_FriendOrMatch_Playing_With_Invited_Friends = 1, + eSen_FriendOrMatch_Playing_With_Match_Made_Opponents = 2, + eSen_FriendOrMatch_Playing_With_Both_Friends_And_Matched_Opponents = 3, + eSen_FriendOrMatch_Joined_Through_An_Xbox_Live_Party = 4, + eSen_FriendOrMatch_Joined_Through_An_In_Game_Party = 5, +}; + +/************************************* + UpsellID + ************************************* + Which upsell has been presented? + */ +enum ESen_UpsellID +{ + eSen_UpsellID_Undefined = 0, + eSen_UpsellID_Full_Version_Of_Game = 1, + + // Added TU3 + eSet_UpsellID_Skin_DLC = 2, + eSet_UpsellID_Texture_DLC = 3, + + //2-max= Up to game +}; + +/************************************* + UpsellOutcome + ************************************* + What was the outcome of the upsell? + */ +enum ESen_UpsellOutcome +{ + eSen_UpsellOutcome_Undefined = 0, + eSen_UpsellOutcome_Accepted = 1, + eSen_UpsellOutcome_Declined = 2, + eSen_UpsellOutcome_Went_To_Guide = 3, + eSen_UpsellOutcome_Other = 4, +}; diff --git a/Minecraft.Client/Durango/Sentient/TelemetryEnum.h b/Minecraft.Client/Durango/Sentient/TelemetryEnum.h new file mode 100644 index 00000000..3148f33d --- /dev/null +++ b/Minecraft.Client/Durango/Sentient/TelemetryEnum.h @@ -0,0 +1,229 @@ +#pragma once + +/* +AchievementGamerscore Value in gamerscore of the achievement +AchievementID ID of achievement unlocked +EnemyTypeID What type of enemy or challenge was the player facing? To prevent data-loss by overflowing the buffer, we recommend enemy type. +EnemyWeaponID What weapon the enemy is holding or what counter/AI the enemy is taking to overcome a challenge +EnrollmentType How did players enroll? (Using Kinect) +LandscapeOrPortrait Are you currently showing in landscape or portrait mode? (Win8 only) +LevelDurationInSeconds How long, total, has the user been playing in this level - whatever best represents this duration for attempting the level you'd like to track. +LevelExitProgressStat1 Refers to the highest level performance metric for your game.  For example, a performance metric could points earned, race time, total kills, etc. This is entirely up to you and will help us understand how well the player performed, or how far the player progressed  in the level before exiting. +LevelExitProgressStat2 Refers to the highest level performance metric for your game.  For example, a performance metric could points earned, race time, total kills, etc. This is entirely up to you and will help us understand how well the player performed, or how far the player progressed  in the level before exiting. +LevelID This is a more granular view of mode, allowing teams to get a sense of the levels or maps players are playing and providing some insight into how players progress through a game. Teams will have to provide the game mappings that correspond to the integers. The intent is that a level is highest level at which modes can be dissected and provides an indication of player progression in a game. The intent is that level start and ends do not occur more than every 2 minutes or so, otherwise the data reported will be difficult to understand. Levels are unique only within a given modeID - so you can have a ModeID =1, LevelID =1 and a different ModeID=2, LevelID = 1 indicate two completely different levels. LevelID = 0 means undefined or unknown. +LevelInstanceID Generated by the game every time LevelStart or LevelResume is called. This should be a unique ID (can be sequential) within a session. +LowResMapX Player position normalized to 0-255 +LowResMapY Player position normalized to 0-255 +LowResMapZ Player position normalized to 0-255 +MapID Unique ID for the current map the player is on +MarketplaceOfferID Unique ID for the Xbox LIVE marketplace offer that the upsell links to +MicroGoodTypeID Describes the type of consumable or microgood +MultiplayerInstanceID multiplayerinstanceID is a title-generated value that is the same for all players in the same multiplayer session.  +NumberOfLocalPlayers the number of players that are playing together in the game locally in the current session (on the same piece of hardware) +NumberOfOnlinePlayers the number of players that are playing together in the game online in the current session (not on the same piece of hardware) +NumberOfSkeletonsInView the max and min of skeletons that were in view, regardless of enrollment +OptionalSubLevelID Used when a title has more heirarchy required. OptionalSubLevel ID = 0 means undefined or unknown. +OptionalSubModeID Used when a title has more heirarchy required. OptionalSubMode ID = 0 means undefined or unknown. +PlayerLevelUpProgressStat1 Refers to a performance metric for your player when they level or rank up. This is entirely up to you and will help us understand how well the player performed, or how far the player has progressed. +PlayerLevelUpProgressStat2 Refers to a performance metric for your player when they level or rank up. This is entirely up to you and will help us understand how well the player performed, or how far the player has progressed. +PlayerWeaponID What weapon the player is holding or what approach/tact the player is taking to overcome a challenge +PlayspaceFeedbackWarningDirection identifies which side of the playspace players are getting too close to that results in the playspace feedback +SaveOrCheckpointID It is important that you also generate and save a unique SaveOrCheckpointID that can be read and reported when the player resumes from this save file or checkpoint. These IDs should be completely unique across the player’s experience, even if they play the same level multiple times. These IDs are critical to allowing us to re-stitch a player’s experience in your title and provide an accurate measure of time in level. +SecondsSinceInitialize Number of seconds elapsed since Sentient initialize. +SecondsSinceInitializeMax Number of seconds elapsed since Sentient initialize. +SecondsSinceInitializeMin Number of seconds elapsed since Sentient initialize. +SkeletonDistanceInInches Identifies the distance of the skeleton from the Kinect sensor +TitleBuildID Build version of the title, used to track changes in development as well as patches/title updates +*/ + +/* +ModeID +An in-game setting that significantly differentiates the play style of the game. +(This should be captured as an integer and correspond to mode specific to the game.) +Teams will have to provide the game mappings that correspond to the integers. +The intent is to allow teams to capture data on the highest level categories of gameplay in their game. +For example, a game mode could be the name of the specific mini game (eg: golf vs darts) or a specific multiplayer mode (eg: hoard vs beast.) ModeID = 0 means undefined or unknown. +*/ +enum ETelem_ModeId +{ + eTelem_ModeId_Undefined = 0, + eTelem_ModeId_Survival, + eTelem_ModeId_Creative, // Unused in current game version +}; + +/* +OptionalSubModeID +Used when a title has more heirarchy required. +OptionalSubMode ID = 0 means undefined or unknown. +*/ +enum ETelem_SubModeId +{ + eTelem_SubModeId_Undefined = 0, + eTelem_SubModeId_Normal, + eTelem_SubModeId_Tutorial, +}; + +/* +LevelID +This is a more granular view of mode, allowing teams to get a sense of the levels or maps players are playing and providing some insight into how players progress through a game. +Teams will have to provide the game mappings that correspond to the integers. +The intent is that a level is highest level at which modes can be dissected and provides an indication of player progression in a game. +The intent is that level start and ends do not occur more than every 2 minutes or so, otherwise the data reported will be difficult to understand. +Levels are unique only within a given modeID - so you can have a ModeID =1, LevelID =1 and a different ModeID=2, LevelID = 1 indicate two completely different levels. +LevelID = 0 means undefined or unknown. +*/ +enum ETelem_LevelId +{ + eTelem_LevelId_Undefined = 0, + eTelem_LevelId_PlayerGeneratedLevel = 1, + // 4J Stu - We currently do not have any specific levels (other than the tutorial which is tracked as a mode) so this is unused at the moment +}; + +/* +OptionalSubLevelID +Used when a title has more heirarchy required. OptionalSubLevel ID = 0 means undefined or unknown. +*/ +enum ETelem_SubLevelId +{ + eTelem_SubLevelId_Undefined = 0, + eTelem_SubLevelId_Overworld, + eTelem_SubLevelId_Nether, + eTelem_SubLevelId_End +}; + +/* +MenuID +Describes the specific menu seen. MenuID = 0 means undefined or unknown. +*/ +// 4J Stu - FOR REFERENCE ONLY - Should map 1:1 with the CConsoleMinecraftApp:EUIScene enum +// Values that are commented out here are not currently reported +enum ETelem_MenuId +{ + //eTelemMenuId_PartnernetPassword = 0, + //eTelemMenuId_Intro = 1, + //eTelemMenuId_SaveMessage = 2, + //eTelemMenuId_Main = 3, + //eTelemMenuId_FullscreenProgress = 4, + eTelemMenuId_Pause = 5, + //eTelemMenuId_CraftingPanel_2x2 = 6, + //eTelemMenuId_CraftingPanel_3x3 = 7, + //eTelemMenuId_Furnace = 8, + //eTelemMenuId_Container = 9, + //eTelemMenuId_Largecontainer_small = 10,// for splitscreen + //eTelemMenuId_Inventory = 11, + //eTelemMenuId_Trap = 12, + //eTelemMenuId_Debug = 13, + //eTelemMenuId_DebugTips = 14, + //eTelemMenuId_HelpAndOptions = 15, + eTelemMenuId_HowToPlay = 16, + //eTelemMenuId_HowToPlayMenu = 17, + //eTelemMenuId_Controls = 18, + //eTelemMenuId_Settings_Menu = 19, + //eTelemMenuId_Settings_All = 20, + //eTelemMenuId_Leaderboards = 21, + //eTelemMenuId_Credits = 22, + //eTelemMenuId_Death = 23, + //eTelemMenuId_TutorialPopup = 24, + eTelemMenuId_MultiGameCreate = 25, + //eTelemMenuId_MultiGameJoinLoad = 26, + eTelemMenuId_MultiGameInfo = 27, + //eTelemMenuId_SignEntry = 28, + //eTelemMenuId_InGameInfo = 29, + //eTelemMenuId_ConnectingProgress = 30, + eTelemMenuId_DLCOffers = 31, + eTelemMenuId_SocialPost = 32, + //eTelemMenuId_TrialExitUpsell = 33, + eTelemMenuId_LoadSettings = 34, + //eTelemMenuId_Chat = 35, + //eTelemMenuId_Reinstall = 36, +}; + +/* +OptionalSubMenuID +Used when a title has more heirarchy required. OptionalSubMenuID = 0 means undefined or unknown. +*/ +enum ETelemetry_HowToPlay_SubMenuId +{ + eTelemetryHowToPlay_Basics = 0, + eTelemetryHowToPlay_HUD, + eTelemetryHowToPlay_Inventory, + eTelemetryHowToPlay_Chest, + eTelemetryHowToPlay_LargeChest, + eTelemetryHowToPlay_InventoryCrafting, + eTelemetryHowToPlay_CraftTable, + eTelemetryHowToPlay_Furnace, + eTelemetryHowToPlay_Dispenser, + eTelemetryHowToPlay_NetherPortal, +}; + +/* +EnemyTypeID What type of enemy or challenge was the player facing? +To prevent data-loss by overflowing the buffer, we recommend enemy type. +*/ +enum ETelemetryChallenges +{ + eTelemetryChallenges_Unknown = 0, + + eTelemetryTutorial_TrialStart, + eTelemetryTutorial_Halfway, + eTelemetryTutorial_Complete, + + eTelemetryTutorial_Inventory, + eTelemetryTutorial_Crafting, + eTelemetryTutorial_Furnace, + eTelemetryTutorial_Fishing, + eTelemetryTutorial_Minecart, + eTelemetryTutorial_Boat, + eTelemetryTutorial_Bed, + + eTelemetryTutorial_Redstone_And_Pistons, + eTelemetryTutorial_Portal, + eTelemetryTutorial_FoodBar, + eTelemetryTutorial_CreativeMode, + eTelemetryTutorial_BrewingMenu, + + eTelemetryInGame_Ride_Minecart, + eTelemetryInGame_Ride_Boat, + eTelemetryInGame_Ride_Pig, + eTelemetryInGame_UseBed, + + eTelemetryTutorial_CreativeInventory, // Added TU5 + + eTelemetryTutorial_EnchantingMenu, + eTelemetryTutorial_Brewing, + eTelemetryTutorial_Enchanting, + eTelemetryTutorial_Farming, + + eTelemetryPlayerDeathSource_Fall, + eTelemetryPlayerDeathSource_Lava, + eTelemetryPlayerDeathSource_Fire, + eTelemetryPlayerDeathSource_Water, + eTelemetryPlayerDeathSource_Suffocate, + eTelemetryPlayerDeathSource_OutOfWorld, + eTelemetryPlayerDeathSource_Cactus, + + eTelemetryPlayerDeathSource_Player_Weapon, + eTelemetryPlayerDeathSource_Player_Arrow, + + eTelemetryPlayerDeathSource_Explosion_Tnt, + eTelemetryPlayerDeathSource_Explosion_Creeper, + + eTelemetryPlayerDeathSource_Wolf, + eTelemetryPlayerDeathSource_Zombie, + eTelemetryPlayerDeathSource_Skeleton, + eTelemetryPlayerDeathSource_Spider, + eTelemetryPlayerDeathSource_Slime, + eTelemetryPlayerDeathSource_Ghast, + eTelemetryPlayerDeathSource_ZombiePigman, + + eTelemetryTutorial_Breeding, + eTelemetryTutorial_Golem, + + eTelemetryTutorial_Anvil, // Added TU14 + eTelemetryTutorial_AnvilMenu, + eTelemetryTutorial_Trading, + eTelemetryTutorial_TradingMenu, + eTelemetryTutorial_Enderchest, + + // Sent over network as a byte +}; \ No newline at end of file diff --git a/Minecraft.Client/Durango/ServiceConfig/Enums.xlsx b/Minecraft.Client/Durango/ServiceConfig/Enums.xlsx new file mode 100644 index 00000000..b0352c6e Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/Enums.xlsx differ diff --git a/Minecraft.Client/Durango/ServiceConfig/Events-XBLA.8-149E11AEEvents.h b/Minecraft.Client/Durango/ServiceConfig/Events-XBLA.8-149E11AEEvents.h new file mode 100644 index 00000000..5fc80438 --- /dev/null +++ b/Minecraft.Client/Durango/ServiceConfig/Events-XBLA.8-149E11AEEvents.h @@ -0,0 +1,1216 @@ + +//**********************************************************************` +//* This is an include file generated by EtwPlusTool. *` +//* *` +//* Copyright (c) Microsoft Corporation. All Rights Reserved. *` +//**********************************************************************` +#pragma once +#pragma pack(push, 16) + +#include "EtwPlus.h" + +#if defined(__cplusplus) +extern "C" { +#endif + +// Field Descriptors, used in the ETX_EVENT_DESCRIPTOR array below +// +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_AchievementGet_Fields[4] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_AchievemntUnlocked_Fields[13] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_GUID,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_BanLevel_Fields[11] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_GUID,0},{EtxFieldType_GUID,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_BlockBroken_Fields[7] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_UInt64,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_BlockPlaced_Fields[7] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_UInt64,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_ChestfulOfCobblestone_Fields[4] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_EnteredNewBiome_Fields[4] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_GameProgress_Fields[4] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Float,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_IncDistanceTravelled_Fields[6] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_UInt64,0},{EtxFieldType_Int32,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_IncTimePlayed_Fields[5] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_UInt64,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_LeaderboardTotals_Fields[6] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_LevelExit_Fields[12] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_GUID,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_LevelResume_Fields[17] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_GUID,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_LevelSaveOrCheckpoint_Fields[13] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_GUID,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_LevelStart_Fields[16] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_GUID,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_McItemAcquired_Fields[14] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_Int32,0},{EtxFieldType_GUID,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Float,0},{EtxFieldType_Float,0},{EtxFieldType_Float,0},{EtxFieldType_Int32,0},{EtxFieldType_UInt64,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_McItemUsed_Fields[14] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_Int32,0},{EtxFieldType_GUID,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Float,0},{EtxFieldType_Float,0},{EtxFieldType_Float,0},{EtxFieldType_Int32,0},{EtxFieldType_UInt64,0},{EtxFieldType_Int32,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_MenuShown_Fields[13] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_GUID,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_MobInteract_Fields[5] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_MobKilled_Fields[18] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_Int32,0},{EtxFieldType_GUID,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Float,0},{EtxFieldType_Float,0},{EtxFieldType_Float,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_MultiplayerRoundEnd_Fields[11] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_GUID,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Float,0},{EtxFieldType_Int32,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_MultiplayerRoundStart_Fields[9] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_GUID,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_OnARail_Fields[4] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_Overkill_Fields[4] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_PauseOrInactive_Fields[11] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_GUID,0},{EtxFieldType_GUID,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_PlayedMusicDisc_Fields[4] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_PlayerDiedOrFailed_Fields[18] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_GUID,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_PlayerSessionEnd_Fields[7] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_PlayerSessionPause_Fields[4] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_UnicodeString,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_PlayerSessionResume_Fields[6] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_PlayerSessionStart_Fields[6] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_RecordMediaShareUpload_Fields[11] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_GUID,0},{EtxFieldType_GUID,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_RichPresenceState_Fields[4] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_SkinChanged_Fields[12] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_GUID,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_TexturePackLoaded_Fields[13] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_GUID,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Boolean,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_UnbanLevel_Fields[11] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_GUID,0},{EtxFieldType_GUID,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_UnpauseOrActive_Fields[11] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_GUID,0},{EtxFieldType_GUID,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_UpsellPresented_Fields[13] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_GUID,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0}}; +EXTERN_C __declspec(selectany) ETX_FIELD_DESCRIPTOR XBLA_149E11AE_UpsellResponded_Fields[14] = {{EtxFieldType_UnicodeString,0},{EtxFieldType_UnicodeString,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_GUID,0},{EtxFieldType_GUID,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0},{EtxFieldType_Int32,0}}; + +// Event name mapping +// +#define AchievementGet_value 1 +#define AchievemntUnlocked_value 2 +#define BanLevel_value 3 +#define BlockBroken_value 4 +#define BlockPlaced_value 5 +#define ChestfulOfCobblestone_value 6 +#define EnteredNewBiome_value 7 +#define GameProgress_value 8 +#define IncDistanceTravelled_value 9 +#define IncTimePlayed_value 10 +#define LeaderboardTotals_value 11 +#define LevelExit_value 12 +#define LevelResume_value 13 +#define LevelSaveOrCheckpoint_value 14 +#define LevelStart_value 15 +#define McItemAcquired_value 16 +#define McItemUsed_value 17 +#define MenuShown_value 18 +#define MobInteract_value 19 +#define MobKilled_value 20 +#define MultiplayerRoundEnd_value 21 +#define MultiplayerRoundStart_value 22 +#define OnARail_value 23 +#define Overkill_value 24 +#define PauseOrInactive_value 25 +#define PlayedMusicDisc_value 26 +#define PlayerDiedOrFailed_value 27 +#define PlayerSessionEnd_value 28 +#define PlayerSessionPause_value 29 +#define PlayerSessionResume_value 30 +#define PlayerSessionStart_value 31 +#define RecordMediaShareUpload_value 32 +#define RichPresenceState_value 33 +#define SkinChanged_value 34 +#define TexturePackLoaded_value 35 +#define UnbanLevel_value 36 +#define UnpauseOrActive_value 37 +#define UpsellPresented_value 38 +#define UpsellResponded_value 39 + +// Event Descriptor array +// +EXTERN_C __declspec(selectany) ETX_EVENT_DESCRIPTOR XBLA_149E11AEEvents[39] = { + {{ 1, 1, 0, 0, 0, 0, 0x0 }, "AchievementGet", "0.7.IGB-2.1", XBLA_149E11AE_AchievementGet_Fields, 4, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 2, 1, 0, 0, 0, 0, 0x0 }, "AchievemntUnlocked", "0.7.IGB-2.1", XBLA_149E11AE_AchievemntUnlocked_Fields, 13, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 3, 1, 0, 0, 0, 0, 0x0 }, "BanLevel", "0.7.IGB-2.1", XBLA_149E11AE_BanLevel_Fields, 11, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 4, 1, 0, 0, 0, 0, 0x0 }, "BlockBroken", "0.7.IGB-2.1", XBLA_149E11AE_BlockBroken_Fields, 7, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 5, 1, 0, 0, 0, 0, 0x0 }, "BlockPlaced", "0.7.IGB-2.1", XBLA_149E11AE_BlockPlaced_Fields, 7, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 6, 1, 0, 0, 0, 0, 0x0 }, "ChestfulOfCobblestone", "0.7.IGB-2.1", XBLA_149E11AE_ChestfulOfCobblestone_Fields, 4, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 7, 2, 0, 0, 0, 0, 0x0 }, "EnteredNewBiome", "0.7.IGB-2.2", XBLA_149E11AE_EnteredNewBiome_Fields, 4, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 8, 0, 0, 0, 0, 0, 0x0 }, "GameProgress", "0.7.IGGP-2.0", XBLA_149E11AE_GameProgress_Fields, 4, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 9, 2, 0, 0, 0, 0, 0x0 }, "IncDistanceTravelled", "0.7.IGB-2.2", XBLA_149E11AE_IncDistanceTravelled_Fields, 6, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 10, 1, 0, 0, 0, 0, 0x0 }, "IncTimePlayed", "0.7.IGB-2.1", XBLA_149E11AE_IncTimePlayed_Fields, 5, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 11, 1, 0, 0, 0, 0, 0x0 }, "LeaderboardTotals", "0.7.IGB-2.1", XBLA_149E11AE_LeaderboardTotals_Fields, 6, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 12, 1, 0, 0, 0, 0, 0x0 }, "LevelExit", "0.7.IGB-2.1", XBLA_149E11AE_LevelExit_Fields, 12, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 13, 1, 0, 0, 0, 0, 0x0 }, "LevelResume", "0.7.IGB-2.1", XBLA_149E11AE_LevelResume_Fields, 17, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 14, 1, 0, 0, 0, 0, 0x0 }, "LevelSaveOrCheckpoint", "0.7.IGB-2.1", XBLA_149E11AE_LevelSaveOrCheckpoint_Fields, 13, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 15, 1, 0, 0, 0, 0, 0x0 }, "LevelStart", "0.7.IGB-2.1", XBLA_149E11AE_LevelStart_Fields, 16, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 16, 1, 0, 0, 0, 0, 0x0 }, "McItemAcquired", "0.7.IGIA-2.1", XBLA_149E11AE_McItemAcquired_Fields, 14, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 17, 2, 0, 0, 0, 0, 0x0 }, "McItemUsed", "0.7.IGIU-2.2", XBLA_149E11AE_McItemUsed_Fields, 14, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 18, 1, 0, 0, 0, 0, 0x0 }, "MenuShown", "0.7.IGB-2.1", XBLA_149E11AE_MenuShown_Fields, 13, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 19, 2, 0, 0, 0, 0, 0x0 }, "MobInteract", "0.7.IGB-2.2", XBLA_149E11AE_MobInteract_Fields, 5, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 20, 3, 0, 0, 0, 0, 0x0 }, "MobKilled", "0.7.IGED-2.3", XBLA_149E11AE_MobKilled_Fields, 18, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 21, 0, 0, 0, 0, 0, 0x0 }, "MultiplayerRoundEnd", "0.7.IGMRE-2.0", XBLA_149E11AE_MultiplayerRoundEnd_Fields, 11, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 22, 0, 0, 0, 0, 0, 0x0 }, "MultiplayerRoundStart", "0.7.IGMRS-2.0", XBLA_149E11AE_MultiplayerRoundStart_Fields, 9, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 23, 1, 0, 0, 0, 0, 0x0 }, "OnARail", "0.7.IGB-2.1", XBLA_149E11AE_OnARail_Fields, 4, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 24, 1, 0, 0, 0, 0, 0x0 }, "Overkill", "0.7.IGB-2.1", XBLA_149E11AE_Overkill_Fields, 4, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 25, 1, 0, 0, 0, 0, 0x0 }, "PauseOrInactive", "0.7.IGB-2.1", XBLA_149E11AE_PauseOrInactive_Fields, 11, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 26, 1, 0, 0, 0, 0, 0x0 }, "PlayedMusicDisc", "0.7.IGB-2.1", XBLA_149E11AE_PlayedMusicDisc_Fields, 4, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 27, 1, 0, 0, 0, 0, 0x0 }, "PlayerDiedOrFailed", "0.7.IGB-2.1", XBLA_149E11AE_PlayerDiedOrFailed_Fields, 18, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 28, 0, 0, 0, 0, 0, 0x0 }, "PlayerSessionEnd", "0.7.IGPSE-2.0", XBLA_149E11AE_PlayerSessionEnd_Fields, 7, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 29, 0, 0, 0, 0, 0, 0x0 }, "PlayerSessionPause", "0.7.IGPSPA-2.0", XBLA_149E11AE_PlayerSessionPause_Fields, 4, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 30, 0, 0, 0, 0, 0, 0x0 }, "PlayerSessionResume", "0.7.IGPSR-2.0", XBLA_149E11AE_PlayerSessionResume_Fields, 6, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 31, 0, 0, 0, 0, 0, 0x0 }, "PlayerSessionStart", "0.7.IGPSS-2.0", XBLA_149E11AE_PlayerSessionStart_Fields, 6, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 32, 1, 0, 0, 0, 0, 0x0 }, "RecordMediaShareUpload", "0.7.IGB-2.1", XBLA_149E11AE_RecordMediaShareUpload_Fields, 11, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 33, 1, 0, 0, 0, 0, 0x0 }, "RichPresenceState", "0.7.IGB-2.1", XBLA_149E11AE_RichPresenceState_Fields, 4, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 34, 1, 0, 0, 0, 0, 0x0 }, "SkinChanged", "0.7.IGB-2.1", XBLA_149E11AE_SkinChanged_Fields, 12, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 35, 1, 0, 0, 0, 0, 0x0 }, "TexturePackLoaded", "0.7.IGB-2.1", XBLA_149E11AE_TexturePackLoaded_Fields, 13, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 36, 1, 0, 0, 0, 0, 0x0 }, "UnbanLevel", "0.7.IGB-2.1", XBLA_149E11AE_UnbanLevel_Fields, 11, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 37, 1, 0, 0, 0, 0, 0x0 }, "UnpauseOrActive", "0.7.IGB-2.1", XBLA_149E11AE_UnpauseOrActive_Fields, 11, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 38, 1, 0, 0, 0, 0, 0x0 }, "UpsellPresented", "0.7.IGB-2.1", XBLA_149E11AE_UpsellPresented_Fields, 13, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }, + {{ 39, 1, 0, 0, 0, 0, 0x0 }, "UpsellResponded", "0.7.IGB-2.1", XBLA_149E11AE_UpsellResponded_Fields, 14, 0, EtxEventEnabledState_Undefined, EtxEventEnabledState_ProviderDefault, EtxPopulationSample_Undefined, EtxPopulationSample_UseProviderPopulationSample, EtxEventLatency_Undefined, EtxEventLatency_ProviderDefault, EtxEventPriority_Undefined, EtxEventPriority_ProviderDefault }}; + +// Provider Descriptor for XBLA_149E11AE +// +EXTERN_C __declspec(selectany) ETX_PROVIDER_DESCRIPTOR XBLA_149E11AEProvider = {"XBLA_149E11AE", {0xee9ef54b,0xfe67,0x4a89,{0x80,0xa8,0x52,0xcc,0xa1,0x6b,0xe7,0x84}}, 39, (ETX_EVENT_DESCRIPTOR*)&XBLA_149E11AEEvents, 0, EtxProviderEnabledState_Undefined, EtxProviderEnabledState_OnByDefault, 0, 100, EtxProviderLatency_Undefined, EtxProviderLatency_RealTime, EtxProviderPriority_Undefined, EtxProviderPriority_Critical}; + +// ETW handle for XBLA_149E11AE +// +EXTERN_C __declspec(selectany) REGHANDLE XBLA_149E11AEHandle = (REGHANDLE)0; + +/*++ + +Routine Description: + + Register the provider with ETW+. + +Arguments: + + None + +Remarks: + + ERROR_SUCCESS if success or if the provider was already registered. + Otherwise, an error code. + +--*/ +#define EventRegisterXBLA_149E11AE() EtxRegister(&XBLA_149E11AEProvider, &XBLA_149E11AEHandle) + +/*++ + +Routine Description: + + Unregister the provider from ETW+. + +Arguments: + None +Remarks: + ERROR_SUCCESS if success or if the provider was not registered. + Otherwise, an error code. +--*/ +#define EventUnregisterXBLA_149E11AE() EtxUnregister(&XBLA_149E11AEProvider, &XBLA_149E11AEHandle) + +#define EventEnabledAchievementGet() (TRUE) + +// Entry point to log the event AchievementGet +// +__inline +ULONG +EventWriteAchievementGet(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int AchievementId) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_AchievementGet 4 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_AchievementGet]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &AchievementId, sizeof(AchievementId)); + + return EtxEventWrite(&XBLA_149E11AEEvents[0], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_AchievementGet, EventData); +} +#define EventEnabledAchievemntUnlocked() (TRUE) + +// Entry point to log the event AchievemntUnlocked +// +__inline +ULONG +EventWriteAchievemntUnlocked(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId, __in const signed int AchievementId, __in const signed int AchievementGamerscore) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_AchievemntUnlocked 13 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_AchievemntUnlocked]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); + EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); + EventDataDescCreate(&EventData[5], &SubMode, sizeof(SubMode)); + EventDataDescCreate(&EventData[6], &LevelId, sizeof(LevelId)); + EventDataDescCreate(&EventData[7], &SubLevelId, sizeof(SubLevelId)); + EventDataDescCreate(&EventData[8], &LeveInstanceId, sizeof(LeveInstanceId)); + EventDataDescCreate(&EventData[9], PlayerSession, sizeof(GUID)); + EventDataDescCreate(&EventData[10], MultiplayerCorrelationId, sizeof(GUID)); + EventDataDescCreate(&EventData[11], &AchievementId, sizeof(AchievementId)); + EventDataDescCreate(&EventData[12], &AchievementGamerscore, sizeof(AchievementGamerscore)); + + return EtxEventWrite(&XBLA_149E11AEEvents[1], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_AchievemntUnlocked, EventData); +} +#define EventEnabledBanLevel() (TRUE) + +// Entry point to log the event BanLevel +// +__inline +ULONG +EventWriteBanLevel(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_BanLevel 11 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_BanLevel]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); + EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); + EventDataDescCreate(&EventData[5], &SubMode, sizeof(SubMode)); + EventDataDescCreate(&EventData[6], &LevelId, sizeof(LevelId)); + EventDataDescCreate(&EventData[7], &SubLevelId, sizeof(SubLevelId)); + EventDataDescCreate(&EventData[8], &LeveInstanceId, sizeof(LeveInstanceId)); + EventDataDescCreate(&EventData[9], PlayerSession, sizeof(GUID)); + EventDataDescCreate(&EventData[10], MultiplayerCorrelationId, sizeof(GUID)); + + return EtxEventWrite(&XBLA_149E11AEEvents[2], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_BanLevel, EventData); +} +#define EventEnabledBlockBroken() (TRUE) + +// Entry point to log the event BlockBroken +// +__inline +ULONG +EventWriteBlockBroken(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const signed int BlockId, __in const signed int BlockAux, __in const unsigned __int64 BlockCount) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_BlockBroken 7 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_BlockBroken]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &DifficultyLevelId, sizeof(DifficultyLevelId)); + EventDataDescCreate(&EventData[4], &BlockId, sizeof(BlockId)); + EventDataDescCreate(&EventData[5], &BlockAux, sizeof(BlockAux)); + EventDataDescCreate(&EventData[6], &BlockCount, sizeof(BlockCount)); + + return EtxEventWrite(&XBLA_149E11AEEvents[3], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_BlockBroken, EventData); +} +#define EventEnabledBlockPlaced() (TRUE) + +// Entry point to log the event BlockPlaced +// +__inline +ULONG +EventWriteBlockPlaced(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const signed int BlockId, __in const signed int BlockAux, __in const unsigned __int64 BlockCount) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_BlockPlaced 7 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_BlockPlaced]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &DifficultyLevelId, sizeof(DifficultyLevelId)); + EventDataDescCreate(&EventData[4], &BlockId, sizeof(BlockId)); + EventDataDescCreate(&EventData[5], &BlockAux, sizeof(BlockAux)); + EventDataDescCreate(&EventData[6], &BlockCount, sizeof(BlockCount)); + + return EtxEventWrite(&XBLA_149E11AEEvents[4], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_BlockPlaced, EventData); +} +#define EventEnabledChestfulOfCobblestone() (TRUE) + +// Entry point to log the event ChestfulOfCobblestone +// +__inline +ULONG +EventWriteChestfulOfCobblestone(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int Cobblecount) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_ChestfulOfCobblestone 4 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_ChestfulOfCobblestone]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &Cobblecount, sizeof(Cobblecount)); + + return EtxEventWrite(&XBLA_149E11AEEvents[5], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_ChestfulOfCobblestone, EventData); +} +#define EventEnabledEnteredNewBiome() (TRUE) + +// Entry point to log the event EnteredNewBiome +// +__inline +ULONG +EventWriteEnteredNewBiome(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int BiomeId) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_EnteredNewBiome 4 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_EnteredNewBiome]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &BiomeId, sizeof(BiomeId)); + + return EtxEventWrite(&XBLA_149E11AEEvents[6], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_EnteredNewBiome, EventData); +} +#define EventEnabledGameProgress() (TRUE) + +// Entry point to log the event GameProgress +// +__inline +ULONG +EventWriteGameProgress(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const float CompletionPercent) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_GameProgress 4 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_GameProgress]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &CompletionPercent, sizeof(CompletionPercent)); + + return EtxEventWrite(&XBLA_149E11AEEvents[7], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_GameProgress, EventData); +} +#define EventEnabledIncDistanceTravelled() (TRUE) + +// Entry point to log the event IncDistanceTravelled +// +__inline +ULONG +EventWriteIncDistanceTravelled(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const unsigned __int64 Distance, __in const signed int TravelMethodId) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_IncDistanceTravelled 6 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_IncDistanceTravelled]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &DifficultyLevelId, sizeof(DifficultyLevelId)); + EventDataDescCreate(&EventData[4], &Distance, sizeof(Distance)); + EventDataDescCreate(&EventData[5], &TravelMethodId, sizeof(TravelMethodId)); + + return EtxEventWrite(&XBLA_149E11AEEvents[8], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_IncDistanceTravelled, EventData); +} +#define EventEnabledIncTimePlayed() (TRUE) + +// Entry point to log the event IncTimePlayed +// +__inline +ULONG +EventWriteIncTimePlayed(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const unsigned __int64 TimePlayed) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_IncTimePlayed 5 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_IncTimePlayed]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &DifficultyLevelId, sizeof(DifficultyLevelId)); + EventDataDescCreate(&EventData[4], &TimePlayed, sizeof(TimePlayed)); + + return EtxEventWrite(&XBLA_149E11AEEvents[9], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_IncTimePlayed, EventData); +} +#define EventEnabledLeaderboardTotals() (TRUE) + +// Entry point to log the event LeaderboardTotals +// +__inline +ULONG +EventWriteLeaderboardTotals(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const signed int LeaderboardId, __in const signed int Count) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_LeaderboardTotals 6 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_LeaderboardTotals]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &DifficultyLevelId, sizeof(DifficultyLevelId)); + EventDataDescCreate(&EventData[4], &LeaderboardId, sizeof(LeaderboardId)); + EventDataDescCreate(&EventData[5], &Count, sizeof(Count)); + + return EtxEventWrite(&XBLA_149E11AEEvents[10], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_LeaderboardTotals, EventData); +} +#define EventEnabledLevelExit() (TRUE) + +// Entry point to log the event LevelExit +// +__inline +ULONG +EventWriteLevelExit(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID MultiplayerCorrelationId, __in const signed int LevelExitStatus, __in LPCGUID PlayerSession) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_LevelExit 12 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_LevelExit]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); + EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); + EventDataDescCreate(&EventData[5], &SubMode, sizeof(SubMode)); + EventDataDescCreate(&EventData[6], &LevelId, sizeof(LevelId)); + EventDataDescCreate(&EventData[7], &SubLevelId, sizeof(SubLevelId)); + EventDataDescCreate(&EventData[8], &LeveInstanceId, sizeof(LeveInstanceId)); + EventDataDescCreate(&EventData[9], MultiplayerCorrelationId, sizeof(GUID)); + EventDataDescCreate(&EventData[10], &LevelExitStatus, sizeof(LevelExitStatus)); + EventDataDescCreate(&EventData[11], PlayerSession, sizeof(GUID)); + + return EtxEventWrite(&XBLA_149E11AEEvents[11], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_LevelExit, EventData); +} +#define EventEnabledLevelResume() (TRUE) + +// Entry point to log the event LevelResume +// +__inline +ULONG +EventWriteLevelResume(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId, __in const signed int FriendsOrMatch, __in const signed int CompeteOrCoop, __in const signed int DifficultyId, __in const signed int NumberOfLocalPlayers, __in const signed int NumberOfOnlinePlayers, __in const signed int SaveOrCheckpointId) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_LevelResume 17 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_LevelResume]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); + EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); + EventDataDescCreate(&EventData[5], &SubMode, sizeof(SubMode)); + EventDataDescCreate(&EventData[6], &LevelId, sizeof(LevelId)); + EventDataDescCreate(&EventData[7], &SubLevelId, sizeof(SubLevelId)); + EventDataDescCreate(&EventData[8], &LeveInstanceId, sizeof(LeveInstanceId)); + EventDataDescCreate(&EventData[9], PlayerSession, sizeof(GUID)); + EventDataDescCreate(&EventData[10], MultiplayerCorrelationId, sizeof(GUID)); + EventDataDescCreate(&EventData[11], &FriendsOrMatch, sizeof(FriendsOrMatch)); + EventDataDescCreate(&EventData[12], &CompeteOrCoop, sizeof(CompeteOrCoop)); + EventDataDescCreate(&EventData[13], &DifficultyId, sizeof(DifficultyId)); + EventDataDescCreate(&EventData[14], &NumberOfLocalPlayers, sizeof(NumberOfLocalPlayers)); + EventDataDescCreate(&EventData[15], &NumberOfOnlinePlayers, sizeof(NumberOfOnlinePlayers)); + EventDataDescCreate(&EventData[16], &SaveOrCheckpointId, sizeof(SaveOrCheckpointId)); + + return EtxEventWrite(&XBLA_149E11AEEvents[12], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_LevelResume, EventData); +} +#define EventEnabledLevelSaveOrCheckpoint() (TRUE) + +// Entry point to log the event LevelSaveOrCheckpoint +// +__inline +ULONG +EventWriteLevelSaveOrCheckpoint(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId, __in const signed int SaveOrCheckpointId, __in const signed int SaveSizeInBytes) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_LevelSaveOrCheckpoint 13 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_LevelSaveOrCheckpoint]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); + EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); + EventDataDescCreate(&EventData[5], &SubMode, sizeof(SubMode)); + EventDataDescCreate(&EventData[6], &LevelId, sizeof(LevelId)); + EventDataDescCreate(&EventData[7], &SubLevelId, sizeof(SubLevelId)); + EventDataDescCreate(&EventData[8], &LeveInstanceId, sizeof(LeveInstanceId)); + EventDataDescCreate(&EventData[9], PlayerSession, sizeof(GUID)); + EventDataDescCreate(&EventData[10], MultiplayerCorrelationId, sizeof(GUID)); + EventDataDescCreate(&EventData[11], &SaveOrCheckpointId, sizeof(SaveOrCheckpointId)); + EventDataDescCreate(&EventData[12], &SaveSizeInBytes, sizeof(SaveSizeInBytes)); + + return EtxEventWrite(&XBLA_149E11AEEvents[13], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_LevelSaveOrCheckpoint, EventData); +} +#define EventEnabledLevelStart() (TRUE) + +// Entry point to log the event LevelStart +// +__inline +ULONG +EventWriteLevelStart(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID MultiplayerCorrelationId, __in const signed int FriendsOrMatch, __in const signed int CompeteOrCoop, __in const signed int DifficultyId, __in const signed int NumberOfLocalPlayers, __in const signed int NumberOfOnlinePlayers, __in LPCGUID PlayerSession) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_LevelStart 16 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_LevelStart]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); + EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); + EventDataDescCreate(&EventData[5], &SubMode, sizeof(SubMode)); + EventDataDescCreate(&EventData[6], &LevelId, sizeof(LevelId)); + EventDataDescCreate(&EventData[7], &SubLevelId, sizeof(SubLevelId)); + EventDataDescCreate(&EventData[8], &LeveInstanceId, sizeof(LeveInstanceId)); + EventDataDescCreate(&EventData[9], MultiplayerCorrelationId, sizeof(GUID)); + EventDataDescCreate(&EventData[10], &FriendsOrMatch, sizeof(FriendsOrMatch)); + EventDataDescCreate(&EventData[11], &CompeteOrCoop, sizeof(CompeteOrCoop)); + EventDataDescCreate(&EventData[12], &DifficultyId, sizeof(DifficultyId)); + EventDataDescCreate(&EventData[13], &NumberOfLocalPlayers, sizeof(NumberOfLocalPlayers)); + EventDataDescCreate(&EventData[14], &NumberOfOnlinePlayers, sizeof(NumberOfOnlinePlayers)); + EventDataDescCreate(&EventData[15], PlayerSession, sizeof(GUID)); + + return EtxEventWrite(&XBLA_149E11AEEvents[14], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_LevelStart, EventData); +} +#define EventEnabledMcItemAcquired() (TRUE) + +// Entry point to log the event McItemAcquired +// +__inline +ULONG +EventWriteMcItemAcquired(__in_opt PCWSTR UserId, __in const signed int SectionId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int DifficultyLevelId, __in const signed int ItemId, __in const signed int AcquisitionMethodId, __in const float LocationX, __in const float LocationY, __in const float LocationZ, __in const signed int ItemAux, __in const unsigned __int64 ItemCount) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_McItemAcquired 14 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_McItemAcquired]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], &SectionId, sizeof(SectionId)); + EventDataDescCreate(&EventData[3], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[4], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (ULONG)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[5], &GameplayModeId, sizeof(GameplayModeId)); + EventDataDescCreate(&EventData[6], &DifficultyLevelId, sizeof(DifficultyLevelId)); + EventDataDescCreate(&EventData[7], &ItemId, sizeof(ItemId)); + EventDataDescCreate(&EventData[8], &AcquisitionMethodId, sizeof(AcquisitionMethodId)); + EventDataDescCreate(&EventData[9], &LocationX, sizeof(LocationX)); + EventDataDescCreate(&EventData[10], &LocationY, sizeof(LocationY)); + EventDataDescCreate(&EventData[11], &LocationZ, sizeof(LocationZ)); + EventDataDescCreate(&EventData[12], &ItemAux, sizeof(ItemAux)); + EventDataDescCreate(&EventData[13], &ItemCount, sizeof(ItemCount)); + + return EtxEventWrite(&XBLA_149E11AEEvents[15], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_McItemAcquired, EventData); +} +#define EventEnabledMcItemUsed() (TRUE) + +// Entry point to log the event McItemUsed +// +__inline +ULONG +EventWriteMcItemUsed(__in_opt PCWSTR UserId, __in const signed int SectionId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int DifficultyLevelId, __in const signed int ItemId, __in const float LocationX, __in const float LocationY, __in const float LocationZ, __in const signed int ItemAux, __in const unsigned __int64 ItemCount, __in const signed int Hunger) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_McItemUsed 14 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_McItemUsed]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], &SectionId, sizeof(SectionId)); + EventDataDescCreate(&EventData[3], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[4], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (ULONG)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[5], &GameplayModeId, sizeof(GameplayModeId)); + EventDataDescCreate(&EventData[6], &DifficultyLevelId, sizeof(DifficultyLevelId)); + EventDataDescCreate(&EventData[7], &ItemId, sizeof(ItemId)); + EventDataDescCreate(&EventData[8], &LocationX, sizeof(LocationX)); + EventDataDescCreate(&EventData[9], &LocationY, sizeof(LocationY)); + EventDataDescCreate(&EventData[10], &LocationZ, sizeof(LocationZ)); + EventDataDescCreate(&EventData[11], &ItemAux, sizeof(ItemAux)); + EventDataDescCreate(&EventData[12], &ItemCount, sizeof(ItemCount)); + EventDataDescCreate(&EventData[13], &Hunger, sizeof(Hunger)); + + return EtxEventWrite(&XBLA_149E11AEEvents[16], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_McItemUsed, EventData); +} +#define EventEnabledMenuShown() (TRUE) + +// Entry point to log the event MenuShown +// +__inline +ULONG +EventWriteMenuShown(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId, __in const signed int MenuId, __in const signed int SubMenuId) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_MenuShown 13 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_MenuShown]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); + EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); + EventDataDescCreate(&EventData[5], &SubMode, sizeof(SubMode)); + EventDataDescCreate(&EventData[6], &LevelId, sizeof(LevelId)); + EventDataDescCreate(&EventData[7], &SubLevelId, sizeof(SubLevelId)); + EventDataDescCreate(&EventData[8], &LeveInstanceId, sizeof(LeveInstanceId)); + EventDataDescCreate(&EventData[9], PlayerSession, sizeof(GUID)); + EventDataDescCreate(&EventData[10], MultiplayerCorrelationId, sizeof(GUID)); + EventDataDescCreate(&EventData[11], &MenuId, sizeof(MenuId)); + EventDataDescCreate(&EventData[12], &SubMenuId, sizeof(SubMenuId)); + + return EtxEventWrite(&XBLA_149E11AEEvents[17], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_MenuShown, EventData); +} +#define EventEnabledMobInteract() (TRUE) + +// Entry point to log the event MobInteract +// +__inline +ULONG +EventWriteMobInteract(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int MobId, __in const signed int InteractionId) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_MobInteract 5 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_MobInteract]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &MobId, sizeof(MobId)); + EventDataDescCreate(&EventData[4], &InteractionId, sizeof(InteractionId)); + + return EtxEventWrite(&XBLA_149E11AEEvents[18], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_MobInteract, EventData); +} +#define EventEnabledMobKilled() (TRUE) + +// Entry point to log the event MobKilled +// +__inline +ULONG +EventWriteMobKilled(__in_opt PCWSTR UserId, __in const signed int SectionId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int DifficultyLevelId, __in LPCGUID RoundId, __in const signed int PlayerRoleId, __in const signed int PlayerWeaponId, __in const signed int EnemyRoleId, __in const signed int KillTypeId, __in const float LocationX, __in const float LocationY, __in const float LocationZ, __in const signed int EnemyWeaponId, __in const signed int Distance, __in const signed int MobId) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_MobKilled 18 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_MobKilled]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], &SectionId, sizeof(SectionId)); + EventDataDescCreate(&EventData[3], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[4], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (ULONG)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[5], &GameplayModeId, sizeof(GameplayModeId)); + EventDataDescCreate(&EventData[6], &DifficultyLevelId, sizeof(DifficultyLevelId)); + EventDataDescCreate(&EventData[7], RoundId, sizeof(GUID)); + EventDataDescCreate(&EventData[8], &PlayerRoleId, sizeof(PlayerRoleId)); + EventDataDescCreate(&EventData[9], &PlayerWeaponId, sizeof(PlayerWeaponId)); + EventDataDescCreate(&EventData[10], &EnemyRoleId, sizeof(EnemyRoleId)); + EventDataDescCreate(&EventData[11], &KillTypeId, sizeof(KillTypeId)); + EventDataDescCreate(&EventData[12], &LocationX, sizeof(LocationX)); + EventDataDescCreate(&EventData[13], &LocationY, sizeof(LocationY)); + EventDataDescCreate(&EventData[14], &LocationZ, sizeof(LocationZ)); + EventDataDescCreate(&EventData[15], &EnemyWeaponId, sizeof(EnemyWeaponId)); + EventDataDescCreate(&EventData[16], &Distance, sizeof(Distance)); + EventDataDescCreate(&EventData[17], &MobId, sizeof(MobId)); + + return EtxEventWrite(&XBLA_149E11AEEvents[19], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_MobKilled, EventData); +} +#define EventEnabledMultiplayerRoundEnd() (TRUE) + +// Entry point to log the event MultiplayerRoundEnd +// +__inline +ULONG +EventWriteMultiplayerRoundEnd(__in_opt PCWSTR UserId, __in LPCGUID RoundId, __in const signed int SectionId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int MatchTypeId, __in const signed int DifficultyLevelId, __in const float TimeInSeconds, __in const signed int ExitStatusId) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_MultiplayerRoundEnd 11 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_MultiplayerRoundEnd]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], RoundId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &SectionId, sizeof(SectionId)); + EventDataDescCreate(&EventData[4], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[5], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (ULONG)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[6], &GameplayModeId, sizeof(GameplayModeId)); + EventDataDescCreate(&EventData[7], &MatchTypeId, sizeof(MatchTypeId)); + EventDataDescCreate(&EventData[8], &DifficultyLevelId, sizeof(DifficultyLevelId)); + EventDataDescCreate(&EventData[9], &TimeInSeconds, sizeof(TimeInSeconds)); + EventDataDescCreate(&EventData[10], &ExitStatusId, sizeof(ExitStatusId)); + + return EtxEventWrite(&XBLA_149E11AEEvents[20], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_MultiplayerRoundEnd, EventData); +} +#define EventEnabledMultiplayerRoundStart() (TRUE) + +// Entry point to log the event MultiplayerRoundStart +// +__inline +ULONG +EventWriteMultiplayerRoundStart(__in_opt PCWSTR UserId, __in LPCGUID RoundId, __in const signed int SectionId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int MatchTypeId, __in const signed int DifficultyLevelId) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_MultiplayerRoundStart 9 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_MultiplayerRoundStart]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], RoundId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &SectionId, sizeof(SectionId)); + EventDataDescCreate(&EventData[4], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[5], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (ULONG)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[6], &GameplayModeId, sizeof(GameplayModeId)); + EventDataDescCreate(&EventData[7], &MatchTypeId, sizeof(MatchTypeId)); + EventDataDescCreate(&EventData[8], &DifficultyLevelId, sizeof(DifficultyLevelId)); + + return EtxEventWrite(&XBLA_149E11AEEvents[21], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_MultiplayerRoundStart, EventData); +} +#define EventEnabledOnARail() (TRUE) + +// Entry point to log the event OnARail +// +__inline +ULONG +EventWriteOnARail(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int Distance) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_OnARail 4 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_OnARail]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &Distance, sizeof(Distance)); + + return EtxEventWrite(&XBLA_149E11AEEvents[22], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_OnARail, EventData); +} +#define EventEnabledOverkill() (TRUE) + +// Entry point to log the event Overkill +// +__inline +ULONG +EventWriteOverkill(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int Damage) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_Overkill 4 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_Overkill]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &Damage, sizeof(Damage)); + + return EtxEventWrite(&XBLA_149E11AEEvents[23], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_Overkill, EventData); +} +#define EventEnabledPauseOrInactive() (TRUE) + +// Entry point to log the event PauseOrInactive +// +__inline +ULONG +EventWritePauseOrInactive(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_PauseOrInactive 11 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_PauseOrInactive]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); + EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); + EventDataDescCreate(&EventData[5], &SubMode, sizeof(SubMode)); + EventDataDescCreate(&EventData[6], &LevelId, sizeof(LevelId)); + EventDataDescCreate(&EventData[7], &SubLevelId, sizeof(SubLevelId)); + EventDataDescCreate(&EventData[8], &LeveInstanceId, sizeof(LeveInstanceId)); + EventDataDescCreate(&EventData[9], PlayerSession, sizeof(GUID)); + EventDataDescCreate(&EventData[10], MultiplayerCorrelationId, sizeof(GUID)); + + return EtxEventWrite(&XBLA_149E11AEEvents[24], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_PauseOrInactive, EventData); +} +#define EventEnabledPlayedMusicDisc() (TRUE) + +// Entry point to log the event PlayedMusicDisc +// +__inline +ULONG +EventWritePlayedMusicDisc(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DiscId) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_PlayedMusicDisc 4 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_PlayedMusicDisc]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &DiscId, sizeof(DiscId)); + + return EtxEventWrite(&XBLA_149E11AEEvents[25], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_PlayedMusicDisc, EventData); +} +#define EventEnabledPlayerDiedOrFailed() (TRUE) + +// Entry point to log the event PlayerDiedOrFailed +// +__inline +ULONG +EventWritePlayerDiedOrFailed(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId, __in const signed int LowResMapX, __in const signed int LowResMapY, __in const signed int LowResMapZ, __in const signed int MapId, __in const signed int PlayerWeaponId, __in const signed int EnemyWeaponId, __in const signed int EnemyTypeId) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_PlayerDiedOrFailed 18 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_PlayerDiedOrFailed]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); + EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); + EventDataDescCreate(&EventData[5], &SubMode, sizeof(SubMode)); + EventDataDescCreate(&EventData[6], &LevelId, sizeof(LevelId)); + EventDataDescCreate(&EventData[7], &SubLevelId, sizeof(SubLevelId)); + EventDataDescCreate(&EventData[8], &LeveInstanceId, sizeof(LeveInstanceId)); + EventDataDescCreate(&EventData[9], PlayerSession, sizeof(GUID)); + EventDataDescCreate(&EventData[10], MultiplayerCorrelationId, sizeof(GUID)); + EventDataDescCreate(&EventData[11], &LowResMapX, sizeof(LowResMapX)); + EventDataDescCreate(&EventData[12], &LowResMapY, sizeof(LowResMapY)); + EventDataDescCreate(&EventData[13], &LowResMapZ, sizeof(LowResMapZ)); + EventDataDescCreate(&EventData[14], &MapId, sizeof(MapId)); + EventDataDescCreate(&EventData[15], &PlayerWeaponId, sizeof(PlayerWeaponId)); + EventDataDescCreate(&EventData[16], &EnemyWeaponId, sizeof(EnemyWeaponId)); + EventDataDescCreate(&EventData[17], &EnemyTypeId, sizeof(EnemyTypeId)); + + return EtxEventWrite(&XBLA_149E11AEEvents[26], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_PlayerDiedOrFailed, EventData); +} +#define EventEnabledPlayerSessionEnd() (TRUE) + +// Entry point to log the event PlayerSessionEnd +// +__inline +ULONG +EventWritePlayerSessionEnd(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int DifficultyLevelId, __in const signed int ExitStatusId) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_PlayerSessionEnd 7 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_PlayerSessionEnd]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (ULONG)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[4], &GameplayModeId, sizeof(GameplayModeId)); + EventDataDescCreate(&EventData[5], &DifficultyLevelId, sizeof(DifficultyLevelId)); + EventDataDescCreate(&EventData[6], &ExitStatusId, sizeof(ExitStatusId)); + + return EtxEventWrite(&XBLA_149E11AEEvents[27], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_PlayerSessionEnd, EventData); +} +#define EventEnabledPlayerSessionPause() (TRUE) + +// Entry point to log the event PlayerSessionPause +// +__inline +ULONG +EventWritePlayerSessionPause(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_PlayerSessionPause 4 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_PlayerSessionPause]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (ULONG)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + + return EtxEventWrite(&XBLA_149E11AEEvents[28], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_PlayerSessionPause, EventData); +} +#define EventEnabledPlayerSessionResume() (TRUE) + +// Entry point to log the event PlayerSessionResume +// +__inline +ULONG +EventWritePlayerSessionResume(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int DifficultyLevelId) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_PlayerSessionResume 6 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_PlayerSessionResume]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (ULONG)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[4], &GameplayModeId, sizeof(GameplayModeId)); + EventDataDescCreate(&EventData[5], &DifficultyLevelId, sizeof(DifficultyLevelId)); + + return EtxEventWrite(&XBLA_149E11AEEvents[29], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_PlayerSessionResume, EventData); +} +#define EventEnabledPlayerSessionStart() (TRUE) + +// Entry point to log the event PlayerSessionStart +// +__inline +ULONG +EventWritePlayerSessionStart(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int DifficultyLevelId) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_PlayerSessionStart 6 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_PlayerSessionStart]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (ULONG)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[4], &GameplayModeId, sizeof(GameplayModeId)); + EventDataDescCreate(&EventData[5], &DifficultyLevelId, sizeof(DifficultyLevelId)); + + return EtxEventWrite(&XBLA_149E11AEEvents[30], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_PlayerSessionStart, EventData); +} +#define EventEnabledRecordMediaShareUpload() (TRUE) + +// Entry point to log the event RecordMediaShareUpload +// +__inline +ULONG +EventWriteRecordMediaShareUpload(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_RecordMediaShareUpload 11 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_RecordMediaShareUpload]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); + EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); + EventDataDescCreate(&EventData[5], &SubMode, sizeof(SubMode)); + EventDataDescCreate(&EventData[6], &LevelId, sizeof(LevelId)); + EventDataDescCreate(&EventData[7], &SubLevelId, sizeof(SubLevelId)); + EventDataDescCreate(&EventData[8], &LeveInstanceId, sizeof(LeveInstanceId)); + EventDataDescCreate(&EventData[9], PlayerSession, sizeof(GUID)); + EventDataDescCreate(&EventData[10], MultiplayerCorrelationId, sizeof(GUID)); + + return EtxEventWrite(&XBLA_149E11AEEvents[31], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_RecordMediaShareUpload, EventData); +} +#define EventEnabledRichPresenceState() (TRUE) + +// Entry point to log the event RichPresenceState +// +__inline +ULONG +EventWriteRichPresenceState(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int ContextID) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_RichPresenceState 4 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_RichPresenceState]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &ContextID, sizeof(ContextID)); + + return EtxEventWrite(&XBLA_149E11AEEvents[32], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_RichPresenceState, EventData); +} +#define EventEnabledSkinChanged() (TRUE) + +// Entry point to log the event SkinChanged +// +__inline +ULONG +EventWriteSkinChanged(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId, __in const signed int SkinId) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_SkinChanged 12 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_SkinChanged]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); + EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); + EventDataDescCreate(&EventData[5], &SubMode, sizeof(SubMode)); + EventDataDescCreate(&EventData[6], &LevelId, sizeof(LevelId)); + EventDataDescCreate(&EventData[7], &SubLevelId, sizeof(SubLevelId)); + EventDataDescCreate(&EventData[8], &LeveInstanceId, sizeof(LeveInstanceId)); + EventDataDescCreate(&EventData[9], PlayerSession, sizeof(GUID)); + EventDataDescCreate(&EventData[10], MultiplayerCorrelationId, sizeof(GUID)); + EventDataDescCreate(&EventData[11], &SkinId, sizeof(SkinId)); + + return EtxEventWrite(&XBLA_149E11AEEvents[33], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_SkinChanged, EventData); +} +#define EventEnabledTexturePackLoaded() (TRUE) + +// Entry point to log the event TexturePackLoaded +// +__inline +ULONG +EventWriteTexturePackLoaded(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId, __in const signed int TexturePackId, __in const BOOL Purchased) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_TexturePackLoaded 13 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_TexturePackLoaded]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); + EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); + EventDataDescCreate(&EventData[5], &SubMode, sizeof(SubMode)); + EventDataDescCreate(&EventData[6], &LevelId, sizeof(LevelId)); + EventDataDescCreate(&EventData[7], &SubLevelId, sizeof(SubLevelId)); + EventDataDescCreate(&EventData[8], &LeveInstanceId, sizeof(LeveInstanceId)); + EventDataDescCreate(&EventData[9], PlayerSession, sizeof(GUID)); + EventDataDescCreate(&EventData[10], MultiplayerCorrelationId, sizeof(GUID)); + EventDataDescCreate(&EventData[11], &TexturePackId, sizeof(TexturePackId)); + EventDataDescCreate(&EventData[12], &Purchased, sizeof(Purchased)); + + return EtxEventWrite(&XBLA_149E11AEEvents[34], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_TexturePackLoaded, EventData); +} +#define EventEnabledUnbanLevel() (TRUE) + +// Entry point to log the event UnbanLevel +// +__inline +ULONG +EventWriteUnbanLevel(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_UnbanLevel 11 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_UnbanLevel]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); + EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); + EventDataDescCreate(&EventData[5], &SubMode, sizeof(SubMode)); + EventDataDescCreate(&EventData[6], &LevelId, sizeof(LevelId)); + EventDataDescCreate(&EventData[7], &SubLevelId, sizeof(SubLevelId)); + EventDataDescCreate(&EventData[8], &LeveInstanceId, sizeof(LeveInstanceId)); + EventDataDescCreate(&EventData[9], PlayerSession, sizeof(GUID)); + EventDataDescCreate(&EventData[10], MultiplayerCorrelationId, sizeof(GUID)); + + return EtxEventWrite(&XBLA_149E11AEEvents[35], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_UnbanLevel, EventData); +} +#define EventEnabledUnpauseOrActive() (TRUE) + +// Entry point to log the event UnpauseOrActive +// +__inline +ULONG +EventWriteUnpauseOrActive(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_UnpauseOrActive 11 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_UnpauseOrActive]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); + EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); + EventDataDescCreate(&EventData[5], &SubMode, sizeof(SubMode)); + EventDataDescCreate(&EventData[6], &LevelId, sizeof(LevelId)); + EventDataDescCreate(&EventData[7], &SubLevelId, sizeof(SubLevelId)); + EventDataDescCreate(&EventData[8], &LeveInstanceId, sizeof(LeveInstanceId)); + EventDataDescCreate(&EventData[9], PlayerSession, sizeof(GUID)); + EventDataDescCreate(&EventData[10], MultiplayerCorrelationId, sizeof(GUID)); + + return EtxEventWrite(&XBLA_149E11AEEvents[36], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_UnpauseOrActive, EventData); +} +#define EventEnabledUpsellPresented() (TRUE) + +// Entry point to log the event UpsellPresented +// +__inline +ULONG +EventWriteUpsellPresented(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId, __in const signed int UpsellId, __in const signed int MarketplaceOfferId) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_UpsellPresented 13 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_UpsellPresented]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); + EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); + EventDataDescCreate(&EventData[5], &SubMode, sizeof(SubMode)); + EventDataDescCreate(&EventData[6], &LevelId, sizeof(LevelId)); + EventDataDescCreate(&EventData[7], &SubLevelId, sizeof(SubLevelId)); + EventDataDescCreate(&EventData[8], &LeveInstanceId, sizeof(LeveInstanceId)); + EventDataDescCreate(&EventData[9], PlayerSession, sizeof(GUID)); + EventDataDescCreate(&EventData[10], MultiplayerCorrelationId, sizeof(GUID)); + EventDataDescCreate(&EventData[11], &UpsellId, sizeof(UpsellId)); + EventDataDescCreate(&EventData[12], &MarketplaceOfferId, sizeof(MarketplaceOfferId)); + + return EtxEventWrite(&XBLA_149E11AEEvents[37], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_UpsellPresented, EventData); +} +#define EventEnabledUpsellResponded() (TRUE) + +// Entry point to log the event UpsellResponded +// +__inline +ULONG +EventWriteUpsellResponded(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId, __in const signed int UpsellId, __in const signed int MarketplaceOfferId, __in const signed int UpsellOutcome) +{ +#define ARGUMENT_COUNT_XBLA_149E11AE_UpsellResponded 14 + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_XBLA_149E11AE_UpsellResponded]; + UINT8 scratch[64]; + + EtxFillCommonFields_v7(&EventData[0], scratch, 64); + + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); + EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); + EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); + EventDataDescCreate(&EventData[5], &SubMode, sizeof(SubMode)); + EventDataDescCreate(&EventData[6], &LevelId, sizeof(LevelId)); + EventDataDescCreate(&EventData[7], &SubLevelId, sizeof(SubLevelId)); + EventDataDescCreate(&EventData[8], &LeveInstanceId, sizeof(LeveInstanceId)); + EventDataDescCreate(&EventData[9], PlayerSession, sizeof(GUID)); + EventDataDescCreate(&EventData[10], MultiplayerCorrelationId, sizeof(GUID)); + EventDataDescCreate(&EventData[11], &UpsellId, sizeof(UpsellId)); + EventDataDescCreate(&EventData[12], &MarketplaceOfferId, sizeof(MarketplaceOfferId)); + EventDataDescCreate(&EventData[13], &UpsellOutcome, sizeof(UpsellOutcome)); + + return EtxEventWrite(&XBLA_149E11AEEvents[38], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_UpsellResponded, EventData); +} +#if defined(__cplusplus) +}; +#endif + +#pragma pack(pop) diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonA.png b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonA.png new file mode 100644 index 00000000..fc2a9b4d Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonA.png differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonB.png b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonB.png new file mode 100644 index 00000000..18f20888 Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonB.png differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonBack.png b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonBack.png new file mode 100644 index 00000000..b680314c Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonBack.png differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonDpadD.png b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonDpadD.png new file mode 100644 index 00000000..ab99e8f0 Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonDpadD.png differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonDpadL.png b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonDpadL.png new file mode 100644 index 00000000..90dc6d44 Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonDpadL.png differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonDpadR.png b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonDpadR.png new file mode 100644 index 00000000..a50f46e8 Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonDpadR.png differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonDpadU.png b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonDpadU.png new file mode 100644 index 00000000..2e525f6d Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonDpadU.png differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonLS.png b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonLS.png new file mode 100644 index 00000000..e339366d Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonLS.png differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonLeftBumper.png b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonLeftBumper.png new file mode 100644 index 00000000..35830d1f Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonLeftBumper.png differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonLeftStick.png b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonLeftStick.png new file mode 100644 index 00000000..2dc9f5dc Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonLeftStick.png differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonLeftStick_Navigate.png b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonLeftStick_Navigate.png new file mode 100644 index 00000000..3af5eb16 Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonLeftStick_Navigate.png differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonLeftStick_sides.png b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonLeftStick_sides.png new file mode 100644 index 00000000..7820eeb7 Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonLeftStick_sides.png differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonLeftTrigger.png b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonLeftTrigger.png new file mode 100644 index 00000000..33be84fc Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonLeftTrigger.png differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonRS.png b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonRS.png new file mode 100644 index 00000000..a30b2b8d Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonRS.png differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonRightBumper.png b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonRightBumper.png new file mode 100644 index 00000000..bf9a365a Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonRightBumper.png differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonRightStick.png b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonRightStick.png new file mode 100644 index 00000000..9256ccbe Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonRightStick.png differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonRightTrigger.png b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonRightTrigger.png new file mode 100644 index 00000000..93cfcb01 Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonRightTrigger.png differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonStart.png b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonStart.png new file mode 100644 index 00000000..76325a70 Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonStart.png differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonX.png b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonX.png new file mode 100644 index 00000000..28015c57 Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonX.png differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonY.png b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonY.png new file mode 100644 index 00000000..ac82f1cd Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/controls/ButtonY.png differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/index.html b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/index.html new file mode 100644 index 00000000..3c12ef28 --- /dev/null +++ b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/index.html @@ -0,0 +1,184 @@ + + + + Game Help + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + +
+ +
+ Minecraft is a game about placing blocks to build anything you can imagine. At night monsters come out, make sure to build a shelter before that happens. +

+ The game contains a full tutorial, so we recommend that you give that go if you are new to the game. + The game also features in-game tooltips to guide you through your initial learning experience and if you need specific help, there is a comprehensive ‘How to Play’ section, + as well as many customisable settings, all of which you can find in the Help & Options menu. + +
+
+ + +
+ +
+ Xbox One Controller + +

Default layout:

+
+ + +
+
Jump
+
Drop
+
Crafting
+
Inventory
+
Cycle Held Item
+
Cycle Held Item
+
+
+
Use
+
Action
+
Move/Sprint
+
Change Camera Mode
+
Sneak/Look
+
Players/Invite
+
+
+
+ There are alternative controller layouts available as well as Invert Look and Southpaw settings. +
+
+ + +
+ + + +
+ +
+ + +

Xbox Customer Support

+

+ For help with Xbox Live or your Xbox One Console, visit us online at xbox.com/support. For community support visit forums.xbox.com. We are also available on Twitter @XboxSupport. + +
+ +
+
+ + + + + + + diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/left_arrow.png b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/left_arrow.png new file mode 100644 index 00000000..7c92352f Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/left_arrow.png differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/left_arrow_hoverFocus.png b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/left_arrow_hoverFocus.png new file mode 100644 index 00000000..56fc4a96 Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/left_arrow_hoverFocus.png differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/main.css b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/main.css new file mode 100644 index 00000000..6c23af9f --- /dev/null +++ b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/main.css @@ -0,0 +1,279 @@ +/*standard plus html5 specific resets*/ +html, body, body div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, figure, footer, header, hgroup, menu, nav, section, time, mark, audio, video +{ + margin: 0; + padding: 0; + border: 0; + outline: 0; + vertical-align: baseline; + background: transparent; +} + +article, aside, figure, footer, header, hgroup, nav, section +{ + display: block; +} + +img, object, embed +{ + max-width: 100%; +} + +/*end resets*/ + +/*setting default font size so that 1 em will approximately equal 10 pixels and so that we can use media queries to scale the fonts*/ +body +{ + height:100%; + font-size: 62.5%; + overflow: hidden; +} + +button +{ + /*button is a special case and gets a default font size from the browser so we reset it to the same font-size as it's parent container*/ + font-size: 1em; +} + +a +{ + text-decoration: none; +} + +article +{ + overflow: hidden; +} + +.articles article +{ + margin-top: 0; + display: none; +} + +.contentPanel li +{ + list-style-type: none; +} + +article +{ + position: relative; +} + +.menuLink {} /* marker class for links to menu pages */ +.contentLink {} /* marker class for content pages */ + +.contentPanel +{ + width: 388px; + height: 900px; + background-color: #222222; + color: #ebebeb; + float: left; + padding: 64px 28px 64px 64px; + vertical-align: top; + font-size:2.4em; +} + +.helpContent +{ + height: 794px; + overflow: hidden; + background-color: #282828; + padding: 136px 64px 64px 64px; + -moz-column-count: auto; /* Firefox - SmartGlass and console do not need these -moz-XXXX, but if help rendered on regular desktop it could be FF */ + -webkit-column-count: auto; /* Safari and Chrome */ + column-count: auto; + -moz-column-width: 344px; + -webkit-column-width: 344px; + column-width: 344px; + -moz-column-gap: 80px; /* Firefox */ + -webkit-column-gap: 80px; /* Safari and Chrome */ + column-gap: 80px; + /*without this property the columns will always try to have the same amount of content each. + Using auto if you set the height it will only fill as needed*/ + -webkit-column-fill: auto; + -moz-column-fill: auto; + column-fill: auto; + font-size:2.4em; + line-height:1.5; + position: relative; +} + +.contentPanel .articleTitle +{ + font-family: Segoe UI Light, Segoe UI Regular,HelveticaNeue, Droid Sans, Arial, Sans-Serif; + font-weight: 100; + font-size:1.5em; + margin-top:10px; + margin-bottom:32px; +} + +.contentPanel .articleTopic +{ + font-family: Segoe UI Regular,HelveticaNeue, Droid Sans, Arial, Sans-Serif; + font-weight: normal; + /*Because we reset font family here we have to also reset the size or it will get the default body font size. 1em here means the same as it's parent*/ + font-size:1em; + +} + +.panelRule +{ + color: #ebebeb; +} + +.panelButtons +{ + /*if there are additional buttons or other elements in the panel you'll need to adjust this value*/ + margin-top: 680px; + margin-left: 28px; +} + + +/**********button state formats***********/ +.navLinks a +{ + border-bottom:solid 4px #ebebeb; + background-color: rgba(235, 235, 235, 0); + width: 432px; + height: 108px; /*height 108px is the value that includes the focused border.*/ + outline: 4px solid rgba(235, 235, 235, 0); + line-height: 2.4em; + padding: 36px 0 0 18px; +} + +.navLinks a:focus, .pageButton:focus +{ + background-color: rgba(235, 235, 235, 0.1); + outline-color: rgba(235, 235, 235, 1); + border-color:rgba(235, 235, 235, 0); +} + +.navLinks a:hover:not(:focus) +{ + background-color: transparent; + outline: solid 4px rgb(107, 107, 107); + border-bottom:solid 4px transparent; +} + +.pageButton +{ + height: 90px; + color: #ebebeb; + text-align: left; + line-height: 140px; + width: 178px; + margin: 0 10px 0 0; + -ms-attraction: 0% 0% 0% 0%; + border: 1px solid #ebebeb; + background-color: rgba(235, 235, 235, 0); + outline: 4px solid rgba(235, 235, 235, 0); +} + + .pageButton:hover:not(:focus) + { + background-color: transparent; + outline: solid 4px rgb(107, 107, 107); + border:none; + } + +.pageButton.next +{ + line-height: 46px; + float: right; +} + +.panelButtons .pageCounter +{ + display:block; + height:2em; + overflow:hidden; +} + +.pageCounter +{ + display:none; +} + +.win-voice-activelistening .pageCounter +{ + display:none; +} + + .pageButton.previous + { + float: left; + } + +.contentPanel .backLink +{ + background: transparent url(left_arrow.png) no-repeat 28px 62px; + display: block; + height: 5.1em; + width: 5.1em; + margin: -60px 0 0 -24px; + background-size: 49%; + font-size:1em; +} + +.contentPanel .backLink:hover + { + background-color: transparent; + } + +.contentPanel .backLink:focus + { + background: transparent url(left_arrow_hoverFocus.png) no-repeat 28px 62px; + background-size: 49%; + outline:0; + } + + + +.contentPanel a +{ + display: inline; + line-height: 1; + color: #ebebeb; + -ms-attraction: 0% 0% 0% 0%; +} + +.helpMenu li a +{ + color: #ebebeb; + height:4em; + width: 100%; + display: block; + line-height: 4em; + margin:0 0 0 -59px; + padding:0 25px 0 56px; + -ms-attraction: 0% 0% 0% 0%; +} + +.endMark +{ + /*this empty element is given a width so that it will stretch to fill the last column as needed*/ + visibility: hidden; + display: block; + height: 1px; + width: 100%; + break-before: column; +} + +/*note that we use absolute postitioning here instead of static so we reset the margin to 0*/ +article .contentPanel .panelButtons +{ + position: absolute; + margin: 0; + bottom: 44px; /* safe region area */ + left: 64px; /* safe region area on the left: 64px */ + width: 386px; +} + +/* The following styles are only applied when voice commands are in use on the console */ +.win-voice-activelistening[data-win-voice] +{ + color: green; +} diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/mobile.css b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/mobile.css new file mode 100644 index 00000000..ae0014f2 --- /dev/null +++ b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/mobile.css @@ -0,0 +1,160 @@ +/*modify the base font size for mobile devices*/ + body +{ + /*bumping up the font-sizes for higher res displays*/ + font-size:54%; + +} + +@media (max-width: 336px) +{ + body + { + font-size: 44%; + } + + article.helpMenu li a + { + height:2.25em; + line-height:2.25em; + } + +} + +/*for odd Android aspect ratios*/ +@media (max-width: 385px) and (min-width:337px) and (max-height:520px) +{ + body + { + font-size: 44%; + } + + article.helpMenu li a + { + height:2em; + line-height:2em; + } + +} + + +/*gradient for smartglass UI*/ +body +{ + /*gradient for smartglass UI*/ + background: -webkit-linear-gradient(top, #000000 50%, #323232); /* Safari and Chrome*/ + background: -moz-linear-gradient(top, #000000 50%, #323232);/*Firefox*/ + background: -ms-linear-gradient(top, #000000 50%, #323232);/*IE*/ +} + +/*if the element is a main menu or a sub menu hide the placeholder element to the right*/ +.helpMenu .helpContent +{ + display: none; +} + +article .helpContent +{ + height: 75%; + background-color: transparent; + padding: 0; + margin: 0; + position: absolute; + top: 5em; + left: 5%; + width: 90%; + overflow: auto; + -webkit-overflow-scrolling: touch; + line-height:1; +} + +article .contentPanel +{ + width: 96%; + height: 100%; + padding: 0px 2% 1em 2%; + overflow:hidden; +} + +article .helpContent +{ + top:7em; + height: 65%; +} + +.contentPanel .backLink +{ + background-position-x: 1em; + background-position-y: 1em; + /*need to resize the back button due the change in font size for retina displays*/ + background-size:75%; + background-position:.15em .5em; + height:2.5em; + width:2.5em; + float: left; + margin: 0px; +} + +/*note you must re-initialize any background properties if you swap images*/ +.contentPanel .backLink:focus +{ + background-position-x: 1em; + background-position-y: 1em; + background-size:75%; + background-position:.15em .5em; +} + +.articles article:not(.helpMenu) .articleTitle +{ + margin-top: 1.9em; + margin-left: .35em; + height: 2.25em; + +} + +article .contentPanel .articleTitle +{ + margin-top:.25em; + left: 2em; + display: block; + width: 70%; + max-height: 3.8em; + overflow: hidden; +} + +article .contentPanel .navLinks +{ + clear: both; +} + +.helpMenu li a +{ + height: 2.75em; + line-height: 2.75em; +} + +/*remove controller button states*/ +.navLinks a, .navLinks a:focus, .navLinks a:hover:not(:focus) +{ + + border:none; + background-color: transparent; + outline:0; + box-shadow:none; +} + + +article .contentPanel .panelButtons +{ + display: none; +} + +.pageCounter +{ + display:block; + position:fixed; + bottom:.15em; + + right:.5em; +} + diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/sg_logo_20.png b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/sg_logo_20.png new file mode 100644 index 00000000..ce103bd2 Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/sg_logo_20.png differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/skin.css b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/skin.css new file mode 100644 index 00000000..0793ee11 --- /dev/null +++ b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/skin.css @@ -0,0 +1,51 @@ + +/* This file is intended to contain rules that will allow "skinning" of your manual by changeing the colors, fonts and background images. You should not place any rules here +that modify positioning or size or other layout properties*/ + +body +{ + /*these are the standard fallbacks that are design approved for the majority of the supported devices.*/ + font-family:Segoe UI Regular,HelveticaNeue, Droid Sans, Arial, Sans-Serif; + + /*add your skin background here if needed + background:#000 url(background.png) fixed no-repeat 0 20%; + */ + + color:#ebebeb; /*xboxwhite*/ + background-color:#222222; +} + +/*this would for example override the white background and text color on active links*/ +.pageButton:hover, .contentPanel a:hover +{ + /*background-color: #ee4036; + color:#222;*/ +} + +/*and this would modify the focus outline*/ +a:focus, a:hover, button:focus, button:hover +{ + /*outline:thick double #ee4036;*/ +} + + +article a.articleTitle, article a.articleTitle:visited +{ + color:#6b6b6b; +} + +/*Here's an example of using this file to skin based upon a media query, in this case it will work on smartglass tablet devices + Note: this is a duplicate of the media query used inline in the html to load tablet.css for the index page*/ +@media (orientation:landscape) and (max-height: 900px), +(orientation:landscape) and (min-height: 1081px), +(orientation:landscape) and (max-width: 1430px) and (min-height: 901px) and (max-height: 1080px), +(orientation:landscape) and (min-width: 1930px) and (min-height: 901px) and (max-height: 1080px) +{ + /*This would add a background image to the content panel in tablets only. Note: you need an additional selector to give this rule + enough weight to override the existing in tablet.css*/ + .articles article:not(.helpMenu) .contentPanel + { + /*background: url("Forza_Left.png") no-repeat transparent 24px 60px;*/ + } +} + diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/snapped.css b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/snapped.css new file mode 100644 index 00000000..8cf81af4 --- /dev/null +++ b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/snapped.css @@ -0,0 +1,53 @@ +body +{ + width: 480px; +} + +.contentPanel .articleTitle +{ + height: 3.75em; + width: 100%; + overflow: hidden; + margin-top:12px; +} + +/*if the element is a main menu or a sub menu hide the placeholder element to the right*/ +.helpMenu .helpContent +{ + display: none; +} + +nav.contentPanel +{ + padding: 64px 64px 64px 28px; +} + +/*if in snapped we need to modify the positioning scheme to allow us to insert the contents between existing nav elements*/ +article .helpContent +{ + height: 616px; + overflow: hidden; + background-color: transparent; + padding: 0 0 0 28px; + position: absolute; + left: 0px; + top: 10em; + column-width: 424px; +} + +article .contentPanel +{ + height: 100%; +} + +article .contentPanel .panelButtons +{ + left: 28px; /* safe region area on the right side: 480 - 28 - 386 ~ 64px */ +} + +/*in snapped the safe area is on the right so these need to be different than in main.css*/ +.helpMenu li a +{ + margin:16px -22px 0 -22px; + padding:0 56px 0 22px; +} diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument/tablet.css b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/tablet.css new file mode 100644 index 00000000..a98addc7 --- /dev/null +++ b/Minecraft.Client/Durango/ServiceConfig/HelpDocument/tablet.css @@ -0,0 +1,117 @@ +body +{ + font-size:50%; + /*gradient for smartglass UI*/ + background: -webkit-linear-gradient(top, #000000 50%, #323232); /* Safari and Chrome*/ + background: -moz-linear-gradient(top, #000000 50%, #323232);/*Firefox*/ + background: -ms-linear-gradient(top, #000000 50%, #323232);/*IE*/ +} + +/*for smaller android tablets the line height prevents showing all 6 items*/ +@media (max-height:595px) +{ + body + { + font-size:44%; + } + + .helpMenu li a + { + height:2.5em; + line-height: 2.5em; + } +} + +article .contentPanel +{ + padding: 0 0 0 48px; + position: relative; + top: 20%; + height: 80%; + width:300px; + background-color:transparent; +} + +article:not(.helpMenu) .contentPanel +{ + background:url("sg_logo_20.png") no-repeat transparent 56px 110px; +} + +article .contentPanel .panelButtons +{ + display: none; +} + +.pageCounter +{ + display: block; + position: fixed; + right: 2em; + bottom: .5em; + left: auto; +} + +article .helpContent +{ + position: relative; + height: 70%; + top: 20%; + padding: 2% 144px 2% 64px; /* right padding set to be higher than column-gap to allow "peek" (part of next column showing up next to full column). */ + background-color: transparent; + overflow: auto; + -webkit-overflow-scrolling: touch; + line-height:1; +} + +article .contentPanel .backLink +{ + position: fixed; + top: 1em; + left: 1em; + margin: 0; + background-position-y:2.25em; +} + +/*note you must re-initialize any background properties if you swap images*/ +article .contentPanel .backLink:focus +{ + background-position-y:2.25em; +} +.articles article:not(.helpMenu) .articleTitle +{ + top: 3.8em; + left: 1.5em; + height: 2em; +} +#TOC .articleTitle +{ + left:1.75em; +} +article .contentPanel .articleTitle +{ + position: fixed; + top: 1.85em; + left: 4em; + height: 3em; + display: block; + width: 70%; + overflow: hidden; +} + +.helpMenu li a +{ + width: 100%; + display: block; + padding-bottom:.25em; +} + +/*remove controller button states*/ +.navLinks a, .navLinks a:focus, .navLinks a:hover:not(:focus) +{ + + border:none; + background-color: transparent; + outline:0; + box-shadow:none; +} + diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument_de-DE.zip b/Minecraft.Client/Durango/ServiceConfig/HelpDocument_de-DE.zip new file mode 100644 index 00000000..e2f9a872 Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument_de-DE.zip differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument_en-GB.zip b/Minecraft.Client/Durango/ServiceConfig/HelpDocument_en-GB.zip new file mode 100644 index 00000000..d1462afd Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument_en-GB.zip differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument_es-ES.zip b/Minecraft.Client/Durango/ServiceConfig/HelpDocument_es-ES.zip new file mode 100644 index 00000000..3b7edf78 Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument_es-ES.zip differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument_fr-FR.zip b/Minecraft.Client/Durango/ServiceConfig/HelpDocument_fr-FR.zip new file mode 100644 index 00000000..2228e2d5 Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument_fr-FR.zip differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument_it-IT.zip b/Minecraft.Client/Durango/ServiceConfig/HelpDocument_it-IT.zip new file mode 100644 index 00000000..94b512a8 Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument_it-IT.zip differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument_ja-JP.zip b/Minecraft.Client/Durango/ServiceConfig/HelpDocument_ja-JP.zip new file mode 100644 index 00000000..631af8cb Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument_ja-JP.zip differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument_ko-KR.zip b/Minecraft.Client/Durango/ServiceConfig/HelpDocument_ko-KR.zip new file mode 100644 index 00000000..9d352b01 Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument_ko-KR.zip differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument_pt-BR.zip b/Minecraft.Client/Durango/ServiceConfig/HelpDocument_pt-BR.zip new file mode 100644 index 00000000..af602f9a Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument_pt-BR.zip differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument_pt-PT.zip b/Minecraft.Client/Durango/ServiceConfig/HelpDocument_pt-PT.zip new file mode 100644 index 00000000..11da9a73 Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument_pt-PT.zip differ diff --git a/Minecraft.Client/Durango/ServiceConfig/HelpDocument_zh-CHT.zip b/Minecraft.Client/Durango/ServiceConfig/HelpDocument_zh-CHT.zip new file mode 100644 index 00000000..0f6513b2 Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/HelpDocument_zh-CHT.zip differ diff --git a/Minecraft.Client/Durango/ServiceConfig/MakeZips.py b/Minecraft.Client/Durango/ServiceConfig/MakeZips.py new file mode 100644 index 00000000..9b911002 --- /dev/null +++ b/Minecraft.Client/Durango/ServiceConfig/MakeZips.py @@ -0,0 +1,62 @@ + +import os +import shutil +import zipfile + +# 4J-JEV: Takes: +# - Localisation from 'ServiceConfig\loc\ex-EX\index.html' +# - Template help from 'ServiceConfig\HelpDocument\*' +# +# Then: +# - Constructs all zipped files to 'ServiceConfig\HelpDocument_ex-EX.zip'. +# +# NOTE: Make sure to check out 'ServiceConfig\HelpDocument\*' first. + +def formatLoc(str): + [lang,local] = str.split('-') + return ( lang.lower() + "-" + local.upper() ) + +def copyTemplate(dst): + for root, dirs, files in os.walk(".\\HelpDocument\\"): + if not os.path.exists(dst+"\\"+root): + os.makedirs(dst+"\\"+root) + + for f in filter(lambda x: x!="index.html", files): + if not os.path.isdir(root+"\\"+f): + print "Copying to '%s\\%s\\%s'" % (dst,root,f) + shutil.copyfile(root+"\\"+f, dst+"\\"+root+"\\"+f) + +def createZip(name): + os.chdir(".\\"+name) + + zipname = name+".zip" + print "Created "+zipname + + z = zipfile.ZipFile(zipname, 'w') + for root, dirs, files in os.walk(".\\HelpDocument\\"): + for file in files: + print "Adding '%s\\%s'." % (root,file) + z.write(os.path.join(root,file)) + + z.close() + + shutil.move(".\\"+zipname, "..\\"+zipname) + os.chdir("..") + + + + #== MAIN ==# + +if __name__=="__main__": + for loc in map(formatLoc,os.listdir(".\\loc\\")): + tardir = ".\\HelpDocument_"+loc + + if os.path.isdir(tardir): + shutil.rmtree(tardir) + copyTemplate(tardir+"\\") + + print ( "Making '%s'" % tardir ) + shutil.copy(".\\loc\\"+loc+"\\index.html",tardir+"\\HelpDocument\\index.html") + + createZip(tardir) + shutil.rmtree(tardir) \ No newline at end of file diff --git a/Minecraft.Client/Durango/ServiceConfig/Minecraft_Service Config Workbook v1.2.xlsx b/Minecraft.Client/Durango/ServiceConfig/Minecraft_Service Config Workbook v1.2.xlsx new file mode 100644 index 00000000..f897b0b4 Binary files /dev/null and b/Minecraft.Client/Durango/ServiceConfig/Minecraft_Service Config Workbook v1.2.xlsx differ diff --git a/Minecraft.Client/Durango/ServiceConfig/loc/de-DE/index.html b/Minecraft.Client/Durango/ServiceConfig/loc/de-DE/index.html new file mode 100644 index 00000000..111efda4 --- /dev/null +++ b/Minecraft.Client/Durango/ServiceConfig/loc/de-DE/index.html @@ -0,0 +1,170 @@ + + + + Spielhilfe + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + +
+ +
+ Minecraft ist ein Spiel, bei dem du aus Blöcken alles bauen kannst, was du möchtest. Nachts treiben sich Monster herum – du solltest einen Unterschlupf bauen, bevor sie herauskommen. +

+ Im Spiel ist ein vollständiges Tutorial enthalten, das wir dir ans Herz legen möchten, falls du neu dabei bist. + Außerdem helfen dir Tooltips bei deinen ersten Schritten im Spiel. Falls du etwas Bestimmtes wissen möchtest, solltest du im umfassenden Abschnitt „So wird gespielt“ nachsehen; + darüber hinaus findest du im Menü „Hilfe und Optionen“ viele Einstellungen, die du anpassen kannst. + +
+
+ + +
+ +
+ Xbox One Controller + +

Standardlayout:

+
+ + +
+
Springen
+
Ablegen
+
Crafting
+
Inventar
+
Gegenstand wechseln
+
Gegenstand wechseln
+
+
+
Verwenden
+
Aktion
+
Bewegen/Sprinten
+
Kameramodus ändern
+
Schleichen/Schauen
+
Spieler/Einladen
+
+
+
+ Es stehen alternative Controller-Layouts sowie Einstellungen für Linkshänder und zum Umkehren der Sicht zur Verfügung. +
+
+ + +
+ + + +
+ +
+ Website: {*WEBSITE*} +

+ E-Mail-Adresse: {*EMAIL_ADDRESS*} +

+ Telefonnummern: {*LOCALE*} {*PHONE_NUMBER*} + + +
+ +
+
+ + + + + + + diff --git a/Minecraft.Client/Durango/ServiceConfig/loc/en-GB/index.html b/Minecraft.Client/Durango/ServiceConfig/loc/en-GB/index.html new file mode 100644 index 00000000..4aa70322 --- /dev/null +++ b/Minecraft.Client/Durango/ServiceConfig/loc/en-GB/index.html @@ -0,0 +1,170 @@ + + + + Game Help + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + +
+ +
+ Minecraft is a game about placing blocks to build anything you can imagine. At night monsters come out. Make sure to build a shelter before that happens. +

+ The game contains a full tutorial, so we recommend that you give that go if you are new to the game. + The game also features in-game tooltips to guide you through your initial learning experience and if you need specific help, there is a comprehensive ‘How to Play’ section, + as well as many customisable settings, all of which you can find in the Help & Options menu. + +
+
+ + +
+ +
+ Xbox One Controller + +

Default layout:

+
+ + +
+
Jump
+
Drop
+
Crafting
+
Inventory
+
Cycle Held Item
+
Cycle Held Item
+
+
+
Use
+
Action
+
Move/Sprint
+
Change Camera Mode
+
Sneak/Look
+
Players/Invite
+
+
+
+ There are alternative controller layouts available as well as Invert Look and Southpaw settings. +
+
+ + +
+ + + +
+ +
+ Website: {*WEBSITE*} +

+ Email-address: {*EMAIL_ADDRESS*} +

+ Phone Numbers: {*LOCALE*} {*PHONE_NUMBER*} + + +
+ +
+
+ + + + + + + diff --git a/Minecraft.Client/Durango/ServiceConfig/loc/es-ES/index.html b/Minecraft.Client/Durango/ServiceConfig/loc/es-ES/index.html new file mode 100644 index 00000000..36724568 --- /dev/null +++ b/Minecraft.Client/Durango/ServiceConfig/loc/es-ES/index.html @@ -0,0 +1,170 @@ + + + + Ayuda del juego + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + +
+ +
+ Minecraft es un juego de colocar bloques para construir todo lo que puedas imaginar. Por las noches salen los monstruos, así que asegúrate de construir un refugio antes de que esto suceda. +

+ El juego tiene un tutorial completo que te recomendamos seguir si es la primera vez que juegas. + También cuenta con mensajes emergentes que te ayudarán con la experiencia de aprendizaje inicial y, si necesitas ayuda con algo en concreto, existe una exhaustiva sección titulada "Cómo se juega", + además de muchos ajustes personalizables que podrás encontrar en el menú Ayuda y opciones. + +
+
+ + +
+ +
+ Xbox One Controller + +

Configuración predeterminada:

+
+ + +
+
Salto
+
Soltar
+
Crear
+
Inventario
+
Alternar objeto en mano
+
Alternar objeto en mano
+
+
+
Utilizar
+
Acción
+
Moverse/Esprintar
+
Cambiar modo de cámara
+
Acechar/Mirar
+
Jugadores/Invitar
+
+
+
+ También hay disponibles configuraciones de mando alternativas, además de para zurdos y para invertir la vista. +
+
+ + +
+ + + +
+ +
+ Sitio web: {*WEBSITE*} +

+ Correo electrónico: {*EMAIL_ADDRESS*} +

+ Números de teléfono: {*LOCALE*} {*PHONE_NUMBER*} + + +
+ +
+
+ + + + + + + diff --git a/Minecraft.Client/Durango/ServiceConfig/loc/fr-FR/index.html b/Minecraft.Client/Durango/ServiceConfig/loc/fr-FR/index.html new file mode 100644 index 00000000..55ce1572 --- /dev/null +++ b/Minecraft.Client/Durango/ServiceConfig/loc/fr-FR/index.html @@ -0,0 +1,170 @@ + + + + Aide du jeu + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + +
+ +
+ Minecraft est un jeu qui vous permet de placer des blocs pour construire absolument tout ce que vous voulez. Des monstres sortent de leur cachette pendant la nuit, alors n'oubliez pas de construire un abri pour vous protéger. +

+ Le jeu propose un didacticiel très complet, que nous vous recommandons d'effectuer si vous jouez pour la première fois. + Des info-bulles sont aussi disponibles en jeu pour vous guider lors de vos premiers pas. Si vous avez besoin d'aide sur un point spécifique, une section « Comment jouer » détaillée est à votre disposition, + ainsi que de nombreux paramètres personnalisables, dans le menu Aide et options. + +
+
+ + +
+ +
+ Xbox One Controller + +

Commandes par défaut :

+
+ + +
+
Sauter
+
Déposer
+
Artisanat
+
Inventaire
+
Changer d'objet en main
+
Changer d'objet en main
+
+
+
Utiliser
+
Action
+
Se déplacer/Courir
+
Changer de mode caméra
+
Se faufiler/Observer
+
Joueurs/Invitation
+
+
+
+ D'autres dispositions des commandes sur la manette sont disponibles, ainsi que des options Vue inversée et Gaucher. +
+
+ + +
+ + + +
+ +
+ Site Web : {*WEBSITE*} +

+ Adresse électronique : {*EMAIL_ADDRESS*} +

+ Numéros de téléphone : {*LOCALE*} {*PHONE_NUMBER*} + + +
+ +
+
+ + + + + + + diff --git a/Minecraft.Client/Durango/ServiceConfig/loc/it-IT/index.html b/Minecraft.Client/Durango/ServiceConfig/loc/it-IT/index.html new file mode 100644 index 00000000..b65dac5c --- /dev/null +++ b/Minecraft.Client/Durango/ServiceConfig/loc/it-IT/index.html @@ -0,0 +1,170 @@ + + + + Guida di gioco + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + +
+ +
+ Minecraft è un gioco che consente di collocare dei blocchi e di costruire praticamente qualsiasi cosa: l'unico limite è l'immaginazione! Costruisci un riparo per non farti catturare dai mostri che escono di notte. +

+ Nel gioco è presente un tutorial completo, che ti consigliamo di seguire se non hai familiarità con le caratteristiche di Minecraft; + sono inoltre incluse delle descrizioni che ti aiuteranno a muovere i primi passi; se invece vuoi saperne di più su un argomento specifico, puoi consultare la sezione 'Come giocare' + o modificare le numerose impostazioni personalizzabili nel menu Guida e opzioni. + +
+
+ + +
+ +
+ Xbox One Controller + +

Configurazione standard:

+
+ + +
+
Salto
+
Rilascia
+
Produzione
+
Inventario
+
Scorri oggetti attivo
+
Scorri oggetti attivo
+
+
+
Usa
+
Azione
+
Movimento/Scatto
+
Cambia inquadratura
+
Furtività/Osserva
+
Giocatori/Invita
+
+
+
+ Sono disponibili configurazioni dei comandi alternative, nonché una visuale invertita e impostazioni per giocatori mancini. +
+
+ + +
+ + + +
+ +
+ Sito Web: {*WEBSITE*} +

+ Indirizzo e-mail: {*EMAIL_ADDRESS*} +

+ Numeri di telefono: {*LOCALE*} {*PHONE_NUMBER*} + + +
+ +
+
+ + + + + + + diff --git a/Minecraft.Client/Durango/ServiceConfig/loc/ja-JP/index.html b/Minecraft.Client/Durango/ServiceConfig/loc/ja-JP/index.html new file mode 100644 index 00000000..9dba183d --- /dev/null +++ b/Minecraft.Client/Durango/ServiceConfig/loc/ja-JP/index.html @@ -0,0 +1,170 @@ + + + + ゲーム ヘルプ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + +
+ +
+ Minecraft ã¯è‡ªç”±ãªç™ºæƒ³ã§ãƒ–ロックをç©ã¿ä¸Šã’ã¦ã€ã„ã‚ã„ã‚ãªç‰©ã‚’作ã£ã¦ã„ãゲームã§ã™ã€‚夜ã«ãªã‚‹ã¨ãƒ¢ãƒ³ã‚¹ã‚¿ãƒ¼ãŒç¾ã‚Œã‚‹ã®ã§ã€ãã®å‰ã«å®‰å…¨ãªå ´æ‰€ã‚’作ã£ã¦ãŠã‹ãªã‘れã°ãªã‚Šã¾ã›ã‚“ +

+ 本ゲームã«ã¯ãƒãƒ¥ãƒ¼ãƒˆãƒªã‚¢ãƒ«ãŒå«ã¾ã‚Œã¾ã™ã€‚åˆã‚ã¦ã®æ–¹ã¯ã€ãƒãƒ¥ãƒ¼ãƒˆãƒªã‚¢ãƒ«ã‹ã‚‰å§‹ã‚ã‚‹ã“ã¨ã‚’ãŠå‹§ã‚ã—ã¾ã™ã€‚ + ã¾ãŸåˆã‚ã¦ã®ãƒ—レイã®éš›ã«ã¯ã€ã€Œãƒ—レイ中ã®ãƒœã‚¿ãƒ³ã‚¬ã‚¤ãƒ‰ã€ã®æ¡ˆå†…ã«æ²¿ã£ã¦ãƒ—レイを進ã‚ã¦ã„ãã¾ã™ã€‚特定ã®ãƒ˜ãƒ«ãƒ—ãŒå¿…è¦ãªéš›ã¯ã€ã€ŒéŠã³æ–¹ã€ã‚»ã‚¯ã‚·ãƒ§ãƒ³ã‚„〠+ カスタマイズå¯èƒ½ãªè¨­å®šã‚’ã”利用ãã ã•ã„。ã“れらã¯ã™ã¹ã¦ã€ŒéŠã³æ–¹ & オプションã€å†…ã«ã‚りã¾ã™ + +
+
+ + +
+ +
+ Xbox One Controller + +

既定ã®ãƒ¬ã‚¤ã‚¢ã‚¦ãƒˆ:

+
+ + +
+
ジャンプ
+
è½ã¨ã™
+
工作
+
æŒã¡ç‰©
+
手æŒã¡ã‚¢ã‚¤ãƒ†ãƒ ã®åˆ‡ã‚Šæ›¿ãˆ
+
手æŒã¡ã‚¢ã‚¤ãƒ†ãƒ ã®åˆ‡ã‚Šæ›¿ãˆ
+
+
+
使ã†
+
アクション
+
å‹•ã/ダッシュ
+
カメラ モードã®å¤‰æ›´
+
ã—ã®ã³è¶³/見る
+
プレイヤー/招待
+
+
+
+ 上下å転や左利ã設定ã€ãã®ä»–コントローラーã®ãƒ¬ã‚¤ã‚¢ã‚¦ãƒˆè¨­å®šã«ã‚‚変更ã§ãã¾ã™ +
+
+ + +
+ + + +
+ +
+ Web サイト: {*WEBSITE*} +

+ メール アドレス: {*EMAIL_ADDRESS*} +

+ 電話番å·: {*LOCALE*} {*PHONE_NUMBER*} + + +
+ +
+
+ + + + + + + diff --git a/Minecraft.Client/Durango/ServiceConfig/loc/ko-KR/index.html b/Minecraft.Client/Durango/ServiceConfig/loc/ko-KR/index.html new file mode 100644 index 00000000..dee3112f --- /dev/null +++ b/Minecraft.Client/Durango/ServiceConfig/loc/ko-KR/index.html @@ -0,0 +1,170 @@ + + + + 게임 ë„ì›€ë§ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + +
+ +
+ Minecraft는 블ë¡ì„ 배치하여 무엇ì´ë“  ìƒìƒí•œ 대로 만들 수 있는 게임입니다. ë°¤ì—는 ê´´ë¬¼ì´ ì¶œëª°í•˜ë¯€ë¡œ, ê·¸ì— ëŒ€ë¹„í•˜ì—¬ 피신처를 준비해둬야 합니다. +

+ ê²Œìž„ì´ ì²˜ìŒì´ë¼ë©´, 게임 ì†ì— í¬í•¨ëœ íŠœí† ë¦¬ì–¼ì„ ë¨¼ì € 플레ì´í•´ 보십시오. + 게임ì—는 í”Œë ˆì´ ìŠµë“ì„ ë„와줄 게임 ì† ë‹¨ì¶” 설명 표시가 들어가 있으며, ë„ì›€ë§ ë° ì˜µì…˜ 메뉴ì—는 다양한 ì‚¬ìš©ìž ì§€ì • 설정과 ë”불어 + 특정한 ì§ˆë¬¸ì— ëŒ€í•œ ë‹µì„ í™•ì¸í•  수 있는 '게임 방법' ì„¹ì…˜ì´ í¬í•¨ë˜ì–´ 있습니다. + +
+
+ + +
+ +
+ Xbox One Controller + +

기본 배치:

+
+ + +
+
ì í”„
+
버리기
+
제작
+
소지품
+
ì•„ì´í…œ êµì²´
+
ì•„ì´í…œ êµì²´
+
+
+
사용
+
í–‰ë™
+
ì´ë™/질주
+
ì¹´ë©”ë¼ ëª¨ë“œ 변경
+
살금살금 걷기/보기
+
플레ì´ì–´/초대
+
+
+
+ 시야 반전ì´ë‚˜ 왼ì†ìž¡ì´ 설정과 ê°™ì€ ëŒ€ì²´ 컨트롤러 배치를 사용할 수 있습니다. +
+
+ + +
+ + + +
+ +
+ 웹사ì´íЏ: {*WEBSITE*} +

+ ì´ë©”ì¼ ì£¼ì†Œ: {*EMAIL_ADDRESS*} +

+ 전화번호: {*LOCALE*} {*PHONE_NUMBER*} + + +
+ +
+
+ + + + + + + diff --git a/Minecraft.Client/Durango/ServiceConfig/loc/pt-BR/index.html b/Minecraft.Client/Durango/ServiceConfig/loc/pt-BR/index.html new file mode 100644 index 00000000..51cfdb87 --- /dev/null +++ b/Minecraft.Client/Durango/ServiceConfig/loc/pt-BR/index.html @@ -0,0 +1,170 @@ + + + + Ajuda do Jogo + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + +
+ +
+ Minecraft é um jogo sobre colocar blocos para montar qualquer coisa que você imaginar. À noite os monstros chegam, então construa um abrigo antes que isso aconteça. +

+ O jogo possui um tutorial completo, então recomendamos que você dê uma olhada nele se nunca jogou Minecraft antes. + O jogo também possui dicas para guiar o seu aprendizado inicial e, se você precisar de ajuda específica, há uma seção ‘Como Jogar’ fácil de entender, + assim como muitas configurações personalizáveis que você pode encontrar no menu Ajuda e Opções. + +
+
+ + +
+ +
+ Xbox One Controller + +

Layout padrão:

+
+ + +
+
Pular
+
Soltar
+
Criação
+
Inventário
+
Alternar item na mão
+
Alternar item na mão
+
+
+
Usar
+
Ação
+
Andar/Correr
+
Mudar modo da câmera
+
Olhar/Esgueirar
+
Jogadores/Convidar
+
+
+
+ Também existem layouts alternativos de controle, como visão invertida e layout para canhotos. +
+
+ + +
+ + + +
+ +
+ Website: {*WEBSITE*} +

+ Endereço de e-mail: {*EMAIL_ADDRESS*} +

+ Números de telefone: {*LOCALE*} {*PHONE_NUMBER*} + + +
+ +
+
+ + + + + + + diff --git a/Minecraft.Client/Durango/ServiceConfig/loc/pt-PT/index.html b/Minecraft.Client/Durango/ServiceConfig/loc/pt-PT/index.html new file mode 100644 index 00000000..3fcee503 --- /dev/null +++ b/Minecraft.Client/Durango/ServiceConfig/loc/pt-PT/index.html @@ -0,0 +1,170 @@ + + + + Ajuda do Jogo + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + +
+ +
+ Minecraft é um jogo em que usas blocos para construir tudo o que conseguires imaginar. À noite, os monstros andam aí, por isso constrói um abrigo para te protegeres. +

+ O jogo contém um tutorial completo. Consulta-o se nunca tiveres jogado Minecraft. + O jogo também possui descrições do jogo para te orientar durante a experiência de aprendizagem inicial. Se precisares de ajuda específica, consulta a secção ‘Instruções de Jogo’, + bem como as muitas definições personalizáveis, que podes encontrar no menu Ajuda e Opções. + +
+
+ + +
+ +
+ Xbox One Controller + +

Esquema predefinido:

+
+ + +
+
Saltar
+
Largar
+
Criação
+
Inventário
+
Mudar de Objecto Seguro
+
Mudar de Objecto Seguro
+
+
+
Usar
+
Acção
+
Mover/Sprint
+
Alterar Modo Câmara
+
Agachar/Voar Para Baixo
+
Jogadores/Convidar
+
+
+
+ Há esquemas de controladores alternativos, bem como definições Inverter e Esquerdinos. +
+
+ + +
+ + + +
+ +
+ Website: {*WEBSITE*} +

+ E-mail: {*EMAIL_ADDRESS*} +

+ Telefones: {*LOCALE*} {*PHONE_NUMBER*} + + +
+ +
+
+ + + + + + + diff --git a/Minecraft.Client/Durango/ServiceConfig/loc/zh-CHT/index.html b/Minecraft.Client/Durango/ServiceConfig/loc/zh-CHT/index.html new file mode 100644 index 00000000..8962a203 --- /dev/null +++ b/Minecraft.Client/Durango/ServiceConfig/loc/zh-CHT/index.html @@ -0,0 +1,170 @@ + + + + éŠæˆ²èªªæ˜Ž + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + +
+ +
+ Minecraft 是一款é€éŽé…置方塊來創造想åƒä¸–ç•Œçš„ä¸€æ¬¾éŠæˆ²ã€‚在夜間會有怪物出沒,請確ä¿åœ¨ç™¼ç”Ÿä»»ä½•事情之å‰å…ˆæŠŠåº‡è­·æ‰€å»ºé€ å‡ºä¾†ã€‚ +

+ æ­¤éŠæˆ²æœ‰å®Œæ•´çš„æ•™å­¸èª²ç¨‹ï¼Œå¦‚果您是第一次éŠçŽ©ï¼Œæˆ‘å€‘å»ºè­°æ‚¨å…ˆé€²è¡Œæ•™å­¸èª²ç¨‹ã€‚ + éŠæˆ²è£¡é‚„有工具æç¤ºä¾†å°Žå¼•æ‚¨åˆæœŸçš„學習éŽç¨‹ï¼Œå¦‚果您需è¦ç‰¹å®šçš„幫助,請å‰å¾€å«æ‹¬ä¸€åˆ‡çš„“如何éŠçŽ©â€é¸é …, + 跟其它å„種å¯è‡ªè¨‚的設定一樣,您都å¯ä»¥åœ¨â€œå¹«åŠ©èˆ‡é¸é …â€é¸å–®è£¡æ‰¾åˆ°ã€‚ + +
+
+ + +
+ +
+ Xbox One Controller + +

é è¨­é…置:

+
+ + +
+
è·³èº
+
丟棄
+
製作
+
ç‰©å“æ¬„
+
åˆ‡æ›æ‰‹æŒé“å…·
+
åˆ‡æ›æ‰€æŒé“å…·
+
+
+
使用
+
行動
+
移動 / è¡åˆº
+
改變æ”影機模å¼
+
å·çž„ / 觀看
+
玩家 / 邀請
+
+
+
+ éŠæˆ²è£¡é‚„æœ‰åƒæ˜¯å轉視角和慣用左手等å¦é¡žçš„æŽ§åˆ¶å™¨é…ç½®å¯ç”¨ã€‚ +
+
+ + +
+ + + +
+ +
+ 網站:{*WEBSITE*} +

+ é›»å­éƒµä»¶åœ°å€ï¼š{*EMAIL_ADDRESS*} +

+ 電話號碼:{*LOCALE*} {*PHONE_NUMBER*} + + +
+ +
+
+ + + + + + + diff --git a/Minecraft.Client/Durango/SmallLogo.png b/Minecraft.Client/Durango/SmallLogo.png new file mode 100644 index 00000000..00b54071 Binary files /dev/null and b/Minecraft.Client/Durango/SmallLogo.png differ diff --git a/Minecraft.Client/Durango/Social/SocialManager.h b/Minecraft.Client/Durango/Social/SocialManager.h new file mode 100644 index 00000000..0b6f2b2d --- /dev/null +++ b/Minecraft.Client/Durango/Social/SocialManager.h @@ -0,0 +1,137 @@ +// +// Class to handle and manage integration with social networks. +// 4J Studios Ltd, 2011. +// Andy West +// + +#ifndef _SOCIAL_MANAGER_H +#define _SOCIAL_MANAGER_H + +#include + +#define MAX_SOCIALPOST_CAPTION 60 +#define MAX_SOCIALPOST_DESC 100 + +// XDK only provides for facebook so far. Others may follow!? +enum ESocialNetwork +{ + eFacebook = 0, + eNumSocialNetworks +}; + + +// Class follows singleton design pattern. +class CSocialManager +{ +private: + // Default constructor, copy constructor and assignment operator are all private. + CSocialManager(); + CSocialManager( const CSocialManager& ); + CSocialManager& operator= ( const CSocialManager& ); + + // Static private instance. + static CSocialManager* m_pInstance; + + // Bitset of title posting capability flags ( XSOCIAL_CAPABILITY_POSTIMAGE, XSOCIAL_CAPABILITY_POSTLINK ). + DWORD m_dwSocialPostingCapability; + + // Index of user who made current active request. + DWORD m_dwCurrRequestUser; + + // WESTY : Not sure if we even need to get social access key! +/* + // Size of the social network access key text buffer. + DWORD m_dwAccessKeyTextSize; + + // Pointer to the social network access key text buffer. + LPWSTR m_pAccessKeyText; + */ + + // The various states of the manager. + enum EState + { + eStateUnitialised = 0, + eStateReady, + eStateGetPostingCapability, + eStatePostingImage, + eStatePostingLink, + }; + + + // Current state that manager is in. + EState m_eCurrState; + + // For xsocial asyncronous operations. + XOVERLAPPED m_Overlapped; + DWORD m_dwOverlappedResultCode; + + // Social post preview image struct. + XSOCIAL_PREVIEWIMAGE m_PostPreviewImage; + +#ifdef _XBOX + // Social post image params. + XSOCIAL_IMAGEPOSTPARAMS m_PostImageParams; + + // Social post link params. + XSOCIAL_LINKPOSTPARAMS m_PostLinkParams; +#endif + + // Image details for posting an image to social network. + unsigned char* m_pMainImageBuffer; + DWORD m_dwMainImageBufferSize; + + void DestroyMainPostImage(); + void DestroyPreviewPostImage(); + + // WESTY : Not sure if we even need to get social access key! +/* + bool GetSocialNetworkAccessKey( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect, DWORD dwUserTrackingIndex, bool bShowNetworkSignin ); +*/ + +public: + // Retrieve singleton instance. + static CSocialManager* Instance(); + + // To be called once during game init. + void Initialise(); + + // Tick the social manager. Only does anything in async mode, polls for results of async actions. + void Tick(); + + // May need to be called if something changes (i.e. player signs in to live ). + bool RefreshPostingCapability(); + + // Returns true if any social newtork posting is allowed by us, false if not (if false, game must not display any social network UI). + bool IsTitleAllowedToPostAnything(); + + // Returns true if we are allowed to post images to social networks. + bool IsTitleAllowedToPostImages(); + + // Returns true if we are allowed to post links to social networks. + bool IsTitleAllowedToPostLinks(); + + // Returns false if any of the live signed in users have disabled XPRIVILEGE_SOCIAL_NETWORK_SHARING + bool AreAllUsersAllowedToPostImages(); + + // Post a test link to social network. + bool PostLinkToSocialNetwork( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect ); + + // Post a test image to social network. + bool PostImageToSocialNetwork( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect ); + + void SetSocialPostText(LPCWSTR Title, LPCWSTR Caption, LPCWSTR Desc); + + // WESTY : Not sure if we even need to get social access key! +/* + // We do not currently know what this is used for. We may not even need it? + bool ObtainSocialNetworkAccessKey( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect ); + */ + +private: + WCHAR m_wchTitleA[MAX_SOCIALPOST_CAPTION+1]; + WCHAR m_wchCaptionA[MAX_SOCIALPOST_CAPTION+1]; + WCHAR m_wchDescA[MAX_SOCIALPOST_DESC+1]; + +}; + +#endif //_SOCIAL_MANAGER_H diff --git a/Minecraft.Client/Durango/Sound/Minecraft.msscmp b/Minecraft.Client/Durango/Sound/Minecraft.msscmp new file mode 100644 index 00000000..13983f6d Binary files /dev/null and b/Minecraft.Client/Durango/Sound/Minecraft.msscmp differ diff --git a/Minecraft.Client/Durango/SplashScreen.png b/Minecraft.Client/Durango/SplashScreen.png new file mode 100644 index 00000000..948fdad7 Binary files /dev/null and b/Minecraft.Client/Durango/SplashScreen.png differ diff --git a/Minecraft.Client/Durango/StoreLogo.png b/Minecraft.Client/Durango/StoreLogo.png new file mode 100644 index 00000000..679b33da Binary files /dev/null and b/Minecraft.Client/Durango/StoreLogo.png differ diff --git a/Minecraft.Client/Durango/Update.alignmentchunk b/Minecraft.Client/Durango/Update.alignmentchunk new file mode 100644 index 00000000..c2270834 --- /dev/null +++ b/Minecraft.Client/Durango/Update.alignmentchunk @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/Minecraft.Client/Durango/WideLogo.png b/Minecraft.Client/Durango/WideLogo.png new file mode 100644 index 00000000..88bd1af5 Binary files /dev/null and b/Minecraft.Client/Durango/WideLogo.png differ diff --git a/Minecraft.Client/Durango/XML/ATGXmlParser.cpp b/Minecraft.Client/Durango/XML/ATGXmlParser.cpp new file mode 100644 index 00000000..fc5aed08 --- /dev/null +++ b/Minecraft.Client/Durango/XML/ATGXmlParser.cpp @@ -0,0 +1,968 @@ +// 4J-PB - +// The ATG Framework is a common set of C++ class libraries that is used by the samples in the XDK, and was developed by the Advanced Technology Group (ATG). +// The ATG Framework offers a clean and consistent format for the samples. These classes define functions used by all the samples. +// The ATG Framework together with the samples demonstrates best practices and innovative techniques for Xbox 360. There are many useful sections of code in the samples. +// You are encouraged to incorporate this code into your titles. + + +//------------------------------------------------------------------------------------- +// AtgXmlParser.cpp +// +// Simple callback non-validating XML parser implementation. +// +// Xbox Advanced Technology Group. +// Copyright (C) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------------------------------- + +#include "stdafx.h" +#include "AtgXmlParser.h" + +namespace ATG +{ + +//------------------------------------------------------------------------------------- +// Name: XMLParser::XMLParser +//------------------------------------------------------------------------------------- +XMLParser::XMLParser() +{ + m_pWritePtr = m_pWriteBuf; + m_pReadPtr = m_pReadBuf; + m_pISAXCallback = NULL; + m_hFile = INVALID_HANDLE_VALUE; +} + +//------------------------------------------------------------------------------------- +// Name: XMLParser::~XMLParser +//------------------------------------------------------------------------------------- +XMLParser::~XMLParser() +{ +} + + +//------------------------------------------------------------------------------------- +// Name: XMLParser::FillBuffer +// Desc: Reads a block from the current open file +//------------------------------------------------------------------------------------- +VOID XMLParser::FillBuffer() +{ + DWORD NChars; + + m_pReadPtr = m_pReadBuf; + + if( m_hFile == NULL ) + { + if( m_uInXMLBufferCharsLeft > XML_READ_BUFFER_SIZE ) + NChars = XML_READ_BUFFER_SIZE; + else + NChars = m_uInXMLBufferCharsLeft; + + CopyMemory( m_pReadBuf, m_pInXMLBuffer, NChars ); + m_uInXMLBufferCharsLeft -= NChars; + m_pInXMLBuffer += NChars; + } + else + { + if( !ReadFile( m_hFile, m_pReadBuf, XML_READ_BUFFER_SIZE, &NChars, NULL )) + { + return; + } + } + + m_dwCharsConsumed += NChars; + __int64 iProgress = m_dwCharsTotal ? (( (__int64)m_dwCharsConsumed * 1000 ) / (__int64)m_dwCharsTotal) : 0; + m_pISAXCallback->SetParseProgress( (DWORD)iProgress ); + + m_pReadBuf[ NChars ] = '\0'; + m_pReadBuf[ NChars + 1] = '\0'; +} + + +//------------------------------------------------------------------------------------- +// Name: XMLParser::SkipNextAdvance +// Desc: Puts the last character read back on the input stream +//------------------------------------------------------------------------------------- +VOID XMLParser::SkipNextAdvance() +{ + m_bSkipNextAdvance = TRUE; +} + + +//------------------------------------------------------------------------------------- +// Name: XMLParser::ConsumeSpace +// Desc: Skips spaces in the current stream +//------------------------------------------------------------------------------------- +HRESULT XMLParser::ConsumeSpace() +{ + HRESULT hr; + + // Skip spaces + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + + while ( ( m_Ch == ' ' ) || ( m_Ch == '\t' ) || + ( m_Ch == '\n' ) || ( m_Ch == '\r' ) ) + { + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + } + SkipNextAdvance(); + return S_OK; +} + + +//------------------------------------------------------------------------------------- +// Name: XMLParser::ConvertEscape +// Desc: Copies and converts an escape sequence into m_pWriteBuf +//------------------------------------------------------------------------------------- +HRESULT XMLParser::ConvertEscape() +{ + HRESULT hr; + WCHAR wVal = 0; + + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + + // all escape sequences start with &, so ignore the first character + + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + + if ( m_Ch == '#' ) // character as hex or decimal + { + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + if ( m_Ch == 'x' ) // hex number + { + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + + while ( m_Ch != ';' ) + { + wVal *= 16; + + if ( ( m_Ch >= '0' ) && ( m_Ch <= '9' ) ) + { + wVal += m_Ch - '0'; + } + else if ( ( m_Ch >= 'a' ) && ( m_Ch <= 'f' ) ) + { + wVal += m_Ch - 'a' + 10; + } + else if ( ( m_Ch >= 'A' ) && ( m_Ch <= 'F' ) ) + { + wVal += m_Ch - 'A' + 10; + } + else + { + Error( E_INVALID_XML_SYNTAX, "Expected hex digit as part of &#x escape sequence" ); + return E_INVALID_XML_SYNTAX; + } + + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + } + } + else // decimal number + { + while ( m_Ch != ';' ) + { + wVal *= 10; + + if ( ( m_Ch >= '0' ) && ( m_Ch <= '9' ) ) + { + wVal += m_Ch - '0'; + } + else + { + Error( E_INVALID_XML_SYNTAX, "Expected decimal digit as part of &# escape sequence" ); + return E_INVALID_XML_SYNTAX; + } + + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + } + } + + // copy character into the buffer + m_Ch = wVal; + + return S_OK; + } + + // must be an entity reference + + WCHAR *pEntityRefVal = m_pWritePtr; + UINT EntityRefLen; + + SkipNextAdvance(); + if( FAILED( hr = AdvanceName() ) ) + return hr; + + EntityRefLen = (UINT)( m_pWritePtr - pEntityRefVal ); + m_pWritePtr = pEntityRefVal; + + if ( EntityRefLen == 0 ) + { + Error( E_INVALID_XML_SYNTAX, "Expecting entity name after &" ); + return E_INVALID_XML_SYNTAX; + } + + if( !wcsncmp( pEntityRefVal, L"lt", EntityRefLen ) ) + wVal = '<'; + else if( !wcsncmp( pEntityRefVal, L"gt", EntityRefLen ) ) + wVal = '>'; + else if( !wcsncmp( pEntityRefVal, L"amp", EntityRefLen ) ) + wVal = '&'; + else if( !wcsncmp( pEntityRefVal, L"apos", EntityRefLen ) ) + wVal = '\''; + else if( !wcsncmp( pEntityRefVal, L"quot", EntityRefLen ) ) + wVal = '"'; + else + { + Error( E_INVALID_XML_SYNTAX, "Unrecognized entity name after & - (should be lt, gt, amp, apos, or quot)" ); + return E_INVALID_XML_SYNTAX; // return false if unrecognized token sequence + } + + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + + if( m_Ch != ';' ) + { + Error( E_INVALID_XML_SYNTAX, "Expected terminating ; for entity reference" ); + return E_INVALID_XML_SYNTAX; // malformed reference - needs terminating ; + } + + m_Ch = wVal; + return S_OK; +} + + +//------------------------------------------------------------------------------------- +// Name: XMLParser::AdvanceAttrVal +// Desc: Copies an attribute value into m_pWrite buf, skipping surrounding quotes +//------------------------------------------------------------------------------------- +HRESULT XMLParser::AdvanceAttrVal() +{ + HRESULT hr; + WCHAR wQuoteChar; + + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + + if( ( m_Ch != '"' ) && ( m_Ch != '\'' ) ) + { + Error( E_INVALID_XML_SYNTAX, "Attribute values must be enclosed in quotes" ); + return E_INVALID_XML_SYNTAX; + } + + wQuoteChar = m_Ch; + + for( ;; ) + { + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + else if( m_Ch == wQuoteChar ) + break; + else if( m_Ch == '&' ) + { + SkipNextAdvance(); + if( FAILED( hr = ConvertEscape() ) ) + return hr; + } + else if( m_Ch == '<' ) + { + Error( E_INVALID_XML_SYNTAX, "Illegal character '<' in element tag" ); + return E_INVALID_XML_SYNTAX; + } + + // copy character into the buffer + + if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE ) + { + Error( E_INVALID_XML_SYNTAX, "Total element tag size may not be more than %d characters", XML_WRITE_BUFFER_SIZE ); + return E_INVALID_XML_SYNTAX; + } + + *m_pWritePtr = m_Ch; + m_pWritePtr++; + } + return S_OK; +} + + +//------------------------------------------------------------------------------------- +// Name: XMLParser::AdvanceName +// Desc: Copies a name into the m_pWriteBuf - returns TRUE on success, FALSE on failure +// Ignores leading whitespace. Currently does not support unicode names +//------------------------------------------------------------------------------------- +HRESULT XMLParser::AdvanceName() +{ + HRESULT hr; + + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + + if( ( ( m_Ch < 'A' ) || ( m_Ch > 'Z' ) ) && + ( ( m_Ch < 'a' ) || ( m_Ch > 'z' ) ) && + ( m_Ch != '_' ) && ( m_Ch != ':' ) ) + { + Error( E_INVALID_XML_SYNTAX, "Names must start with an alphabetic character or _ or :" ); + return E_INVALID_XML_SYNTAX; + } + + while( ( ( m_Ch >= 'A' ) && ( m_Ch <= 'Z' ) ) || + ( ( m_Ch >= 'a' ) && ( m_Ch <= 'z' ) ) || + ( ( m_Ch >= '0' ) && ( m_Ch <= '9' ) ) || + ( m_Ch == '_' ) || ( m_Ch == ':' ) || + ( m_Ch == '-' ) || ( m_Ch == '.' ) ) + { + + if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE ) + { + Error( E_INVALID_XML_SYNTAX, "Total element tag size may not be more than %d characters", XML_WRITE_BUFFER_SIZE ); + return E_INVALID_XML_SYNTAX; + } + + *m_pWritePtr = m_Ch; + m_pWritePtr++; + + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + } + + SkipNextAdvance(); + return S_OK; +} + + +//------------------------------------------------------------------------------------- +// Name: XMLParser::AdvanceCharacter +// Desc: Copies the character at *m_pReadPtr to m_Ch +// handling difference in UTF16 / UTF8, and big/little endian +// and getting another chunk of the file if needed +// Returns S_OK if there are more characters, E_ABORT for no characters to read +//------------------------------------------------------------------------------------- +HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) +{ + if( m_bSkipNextAdvance ) + { + m_bSkipNextAdvance = FALSE; + return S_OK; + } + + // If we hit EOF in the middle of a character, + // it's ok-- we'll just have a corrupt last character + // (the buffer is padded with double NULLs ) + + if ( ( m_pReadPtr[0] == '\0' ) && ( m_pReadPtr[1] == '\0' ) ) + { + // Read more from the file + FillBuffer(); + + // We are at EOF if it is still NULL + if ( ( m_pReadPtr[0] == '\0' ) && ( m_pReadPtr[1] == '\0' ) ) + { + if( !bOkToFail ) + { + Error( E_INVALID_XML_SYNTAX, "Unexpected EOF while parsing XML file" ); + return E_INVALID_XML_SYNTAX; + } + else + { + return E_FAIL; + } + } + } + + if( m_bUnicode == FALSE ) + { + m_Ch = *((CHAR *)m_pReadPtr); + m_pReadPtr++; + } + else // if( m_bUnicode == TRUE ) + { + m_Ch = *((WCHAR *)m_pReadPtr); + + if( m_bReverseBytes ) + { + m_Ch = ( m_Ch << 8 ) + ( m_Ch >> 8 ); + } + + m_pReadPtr += 2; + } + + if( m_Ch == '\n' ) + { + m_pISAXCallback->m_LineNum++; + m_pISAXCallback->m_LinePos = 0; + } + else if( m_Ch != '\r' ) + m_pISAXCallback->m_LinePos++; + + return S_OK; +} + + +//------------------------------------------------------------------------------------- +// Name: XMLParser::AdvanceElement +// Desc: Builds data, calls callback +//------------------------------------------------------------------------------------- +HRESULT XMLParser::AdvanceElement() +{ + HRESULT hr; + + // write ptr at the beginning of the buffer + m_pWritePtr = m_pWriteBuf; + + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + + // if first character wasn't '<', we wouldn't be here + + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + + if( m_Ch == '!' ) + { + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + if ( m_Ch == '-' ) + { + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + if( m_Ch != '-' ) + { + Error( E_INVALID_XML_SYNTAX, "Expecting '-' after 'ElementEnd( pEntityRefVal, + (UINT) ( m_pWritePtr - pEntityRefVal ) ) ) ) + return E_ABORT; + + if( FAILED( hr = ConsumeSpace() ) ) + return hr; + + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + + if( m_Ch != '>' ) + { + Error( E_INVALID_XML_SYNTAX, "Expecting '>' after name for closing entity reference" ); + return E_INVALID_XML_SYNTAX; + } + } + else if( m_Ch == '?' ) + { + // just skip any xml header tag since not really important after identifying character set + for( ;; ) + { + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + + if ( m_Ch == '>' ) + return S_OK; + } + } + else + { + XMLAttribute Attributes[ XML_MAX_ATTRIBUTES_PER_ELEMENT ]; + UINT NumAttrs; + + WCHAR *pEntityRefVal = m_pWritePtr; + UINT EntityRefLen; + + NumAttrs = 0; + + SkipNextAdvance(); + + // Entity tag + if( FAILED( hr = AdvanceName() ) ) + return hr; + + EntityRefLen = (UINT)( m_pWritePtr - pEntityRefVal ); + + if( FAILED( hr = ConsumeSpace() ) ) + return hr; + + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + + // read attributes + while( ( m_Ch != '>' ) && ( m_Ch != '/' ) ) + { + SkipNextAdvance(); + + if ( NumAttrs >= XML_MAX_ATTRIBUTES_PER_ELEMENT ) + { + Error( E_INVALID_XML_SYNTAX, "Elements may not have more than %d attributes", XML_MAX_ATTRIBUTES_PER_ELEMENT ); + return E_INVALID_XML_SYNTAX; + } + + Attributes[ NumAttrs ].strName = m_pWritePtr; + + // Attribute name + if( FAILED( hr = AdvanceName() ) ) + return hr; + + Attributes[ NumAttrs ].NameLen = (UINT)( m_pWritePtr - Attributes[ NumAttrs ].strName ); + + if( FAILED( hr = ConsumeSpace() ) ) + return hr; + + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + + if( m_Ch != '=' ) + { + Error( E_INVALID_XML_SYNTAX, "Expecting '=' character after attribute name" ); + return E_INVALID_XML_SYNTAX; + } + + if( FAILED( hr = ConsumeSpace() ) ) + return hr; + + Attributes[ NumAttrs ].strValue = m_pWritePtr; + + if( FAILED( hr = AdvanceAttrVal() ) ) + return hr; + + Attributes[ NumAttrs ].ValueLen = (UINT)( m_pWritePtr - + Attributes[ NumAttrs ].strValue ); + + ++NumAttrs; + + if( FAILED( hr = ConsumeSpace() ) ) + return hr; + + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + } + + if( m_Ch == '/' ) + { + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + if( m_Ch != '>' ) + { + Error( E_INVALID_XML_SYNTAX, "Expecting '>' after '/' in element tag" ); + return E_INVALID_XML_SYNTAX; + } + + if( FAILED( m_pISAXCallback->ElementBegin( pEntityRefVal, EntityRefLen, + Attributes, NumAttrs ) ) ) + return E_ABORT; + + if( FAILED( m_pISAXCallback->ElementEnd( pEntityRefVal, EntityRefLen ) ) ) + return E_ABORT; + } + else + { + if( FAILED( m_pISAXCallback->ElementBegin( pEntityRefVal, EntityRefLen, + Attributes, NumAttrs ) ) ) + return E_ABORT; + } + } + + return S_OK; +} + + +//------------------------------------------------------------------------------------- +// Name: XMLParser::AdvanceCDATA +// Desc: Read a CDATA section +//------------------------------------------------------------------------------------- +HRESULT XMLParser::AdvanceCDATA() +{ + HRESULT hr; + WORD wStage = 0; + + if( FAILED( m_pISAXCallback->CDATABegin() ) ) + return E_ABORT; + + for( ;; ) + { + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + + *m_pWritePtr = m_Ch; + m_pWritePtr++; + + if( ( m_Ch == ']' ) && ( wStage == 0 ) ) + wStage = 1; + else if( ( m_Ch == ']' ) && ( wStage == 1 ) ) + wStage = 2; + else if( ( m_Ch == '>' ) && ( wStage == 2 ) ) + { + m_pWritePtr -= 3; + break; + } + else + wStage = 0; + + if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE ) + { + if( FAILED( m_pISAXCallback->CDATAData( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), TRUE ) ) ) + return E_ABORT; + m_pWritePtr = m_pWriteBuf; + } + } + + if( FAILED( m_pISAXCallback->CDATAData( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) ) + return E_ABORT; + + m_pWritePtr = m_pWriteBuf; + + if( FAILED( m_pISAXCallback->CDATAEnd() ) ) + return E_ABORT; + + return S_OK; +} + +//------------------------------------------------------------------------------------- +// Name: XMLParser::AdvanceComment +// Desk: Skips over a comment +//------------------------------------------------------------------------------------- +HRESULT XMLParser::AdvanceComment() +{ + HRESULT hr; + WORD wStage; + + wStage = 0; + for( ;; ) + { + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + + if (( m_Ch == '-' ) && ( wStage == 0 )) + wStage = 1; + else if (( m_Ch == '-' ) && ( wStage == 1 )) + wStage = 2; + else if (( m_Ch == '>' ) && ( wStage == 2 )) + break; + else + wStage = 0; + } + + return S_OK; +} + + +//------------------------------------------------------------------------------------- +// Name: XMLParser::RegisterSAXCallbackInterface +// Desc: Registers callback interface +//------------------------------------------------------------------------------------- +VOID XMLParser::RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback ) +{ + m_pISAXCallback = pISAXCallback; +} + + +//------------------------------------------------------------------------------------- +// Name: XMLParser::GetSAXCallbackInterface +// Desc: Returns current callback interface +//------------------------------------------------------------------------------------- +ISAXCallback* XMLParser::GetSAXCallbackInterface() +{ + return m_pISAXCallback; +} + + +//------------------------------------------------------------------------------------- +// Name: XMLParser::MainParseLoop +// Desc: Main Loop to Parse Data - source agnostic +//------------------------------------------------------------------------------------- +HRESULT XMLParser::MainParseLoop() +{ + BOOL bWhiteSpaceOnly = TRUE; + HRESULT hr = S_OK; + + if( FAILED( m_pISAXCallback->StartDocument() ) ) + return E_ABORT; + + m_pWritePtr = m_pWriteBuf; + + FillBuffer(); + + if ( *((WCHAR *) m_pReadBuf ) == 0xFEFF ) + { + m_bUnicode = TRUE; + m_bReverseBytes = FALSE; + m_pReadPtr += 2; + } + else if ( *((WCHAR *) m_pReadBuf ) == 0xFFFE ) + { + m_bUnicode = TRUE; + m_bReverseBytes = TRUE; + m_pReadPtr += 2; + } + else if ( *((WCHAR *) m_pReadBuf ) == 0x003C ) + { + m_bUnicode = TRUE; + m_bReverseBytes = FALSE; + } + else if ( *((WCHAR *) m_pReadBuf ) == 0x3C00 ) + { + m_bUnicode = TRUE; + m_bReverseBytes = TRUE; + } + else if ( m_pReadBuf[ 0 ] == 0x3C ) + { + m_bUnicode = FALSE; + m_bReverseBytes = FALSE; + } + else + { + Error( E_INVALID_XML_SYNTAX, "Unrecognized encoding (parser does not support UTF-8 language encodings)" ); + return E_INVALID_XML_SYNTAX; + } + + for( ;; ) + { + if( FAILED( AdvanceCharacter( TRUE ) ) ) + { + if ( ( (UINT) ( m_pWritePtr - m_pWriteBuf ) != 0 ) && ( !bWhiteSpaceOnly ) ) + { + if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) ) + return E_ABORT; + + bWhiteSpaceOnly = TRUE; + } + + if( FAILED( m_pISAXCallback->EndDocument() ) ) + return E_ABORT; + + return S_OK; + } + + if( m_Ch == '<' ) + { + if( ( (UINT) ( m_pWritePtr - m_pWriteBuf ) != 0 ) && ( !bWhiteSpaceOnly ) ) + { + if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) ) + return E_ABORT; + + bWhiteSpaceOnly = TRUE; + } + + SkipNextAdvance(); + + m_pWritePtr = m_pWriteBuf; + + if( FAILED( hr = AdvanceElement() ) ) + return hr; + + m_pWritePtr = m_pWriteBuf; + } + else + { + if( m_Ch == '&' ) + { + SkipNextAdvance(); + if( FAILED( hr = ConvertEscape() ) ) + return hr; + } + + if( bWhiteSpaceOnly && ( m_Ch != ' ' ) && ( m_Ch != '\n' ) && ( m_Ch != '\r' ) && + ( m_Ch != '\t' ) ) + { + bWhiteSpaceOnly = FALSE; + } + + *m_pWritePtr = m_Ch; + m_pWritePtr++; + + if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE ) + { + if( !bWhiteSpaceOnly ) + { + if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, + ( UINT ) ( m_pWritePtr - m_pWriteBuf ), + TRUE ) ) ) + { + return E_ABORT; + } + } + + m_pWritePtr = m_pWriteBuf; + bWhiteSpaceOnly = TRUE; + } + } + } +} + + +//------------------------------------------------------------------------------------- +// Name: XMLParser::ParseXMLFile +// Desc: Builds element data +//------------------------------------------------------------------------------------- +HRESULT XMLParser::ParseXMLFile( CONST CHAR *strFilename ) +{ + HRESULT hr; + + if( m_pISAXCallback == NULL ) + return E_NOINTERFACE; + + m_pISAXCallback->m_LineNum = 1; + m_pISAXCallback->m_LinePos = 0; + m_pISAXCallback->m_strFilename = strFilename; // save this off only while we parse the file + + m_bSkipNextAdvance = FALSE; + m_pReadPtr = m_pReadBuf; + + m_pReadBuf[ 0 ] = '\0'; + m_pReadBuf[ 1 ] = '\0'; + + m_pInXMLBuffer = NULL; + m_uInXMLBufferCharsLeft = 0; + + WCHAR wchFilename[ 64 ]; + + swprintf_s(wchFilename,64,L"%s",strFilename); + + m_hFile = CreateFile( wchFilename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL ); + + if( m_hFile == INVALID_HANDLE_VALUE ) + { + Error( E_COULD_NOT_OPEN_FILE, "Error opening file" ); + hr = E_COULD_NOT_OPEN_FILE; + + } + else + { + LARGE_INTEGER iFileSize; + GetFileSizeEx( m_hFile, &iFileSize ); + m_dwCharsTotal = (DWORD)iFileSize.QuadPart; + m_dwCharsConsumed = 0; + hr = MainParseLoop(); + } + + // Close the file + if( m_hFile != INVALID_HANDLE_VALUE ) + CloseHandle( m_hFile ); + m_hFile = INVALID_HANDLE_VALUE; + + // we no longer own strFilename, so un-set it + m_pISAXCallback->m_strFilename = NULL; + + return hr; +} + +//------------------------------------------------------------------------------------- +// Name: XMLParser::ParseXMLFile +// Desc: Builds element data +//------------------------------------------------------------------------------------- +HRESULT XMLParser::ParseXMLBuffer( CONST CHAR *strBuffer, UINT uBufferSize ) +{ + HRESULT hr; + + if( m_pISAXCallback == NULL ) + return E_NOINTERFACE; + + m_pISAXCallback->m_LineNum = 1; + m_pISAXCallback->m_LinePos = 0; + m_pISAXCallback->m_strFilename = ""; // save this off only while we parse the file + + m_bSkipNextAdvance = FALSE; + m_pReadPtr = m_pReadBuf; + + m_pReadBuf[ 0 ] = '\0'; + m_pReadBuf[ 1 ] = '\0'; + + m_hFile = NULL; + m_pInXMLBuffer = strBuffer; + m_uInXMLBufferCharsLeft = uBufferSize; + m_dwCharsTotal = uBufferSize; + m_dwCharsConsumed = 0; + + hr = MainParseLoop(); + + // we no longer own strFilename, so un-set it + m_pISAXCallback->m_strFilename = NULL; + + return hr; +} + +//------------------------------------------------------------------------------------- +// XMLParser::Error() +// Logs an error through the callback interface +//------------------------------------------------------------------------------------- +#ifdef _Printf_format_string_ // VC++ 2008 and later support this annotation +VOID XMLParser::Error( HRESULT hErr, _In_z_ _Printf_format_string_ CONST CHAR* strFormat, ... ) +#else +VOID XMLParser::Error( HRESULT hErr, CONST CHAR* strFormat, ... ) +#endif +{ + CONST INT MAX_OUTPUT_STR = 160; + CHAR strBuffer[ MAX_OUTPUT_STR ]; + va_list pArglist; + va_start( pArglist, strFormat ); + + vsprintf( strBuffer, strFormat, pArglist ); + + m_pISAXCallback->Error( hErr, strBuffer ); + va_end( pArglist ); +} + +} // namespace ATG diff --git a/Minecraft.Client/Durango/XML/ATGXmlParser.h b/Minecraft.Client/Durango/XML/ATGXmlParser.h new file mode 100644 index 00000000..75142e3e --- /dev/null +++ b/Minecraft.Client/Durango/XML/ATGXmlParser.h @@ -0,0 +1,156 @@ +// 4J-PB - +// The ATG Framework is a common set of C++ class libraries that is used by the samples in the XDK, and was developed by the Advanced Technology Group (ATG). +// The ATG Framework offers a clean and consistent format for the samples. These classes define functions used by all the samples. +// The ATG Framework together with the samples demonstrates best practices and innovative techniques for Xbox 360. There are many useful sections of code in the samples. +// You are encouraged to incorporate this code into your titles. + +//------------------------------------------------------------------------------------- +// AtgXmlParser.h +// +// XMLParser and SAX interface declaration +// +// Xbox Advanced Technology Group +// Copyright (C) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------------------------------- + +#pragma once +#ifndef ATGXMLPARSER_H +#define ATGXMLPARSER_H + +namespace ATG +{ + +//----------------------------------------------------------------------------- +// error returns from XMLParse +//----------------------------------------------------------------------------- +#define _ATGFAC 0x61B +#define E_COULD_NOT_OPEN_FILE MAKE_HRESULT(1, _ATGFAC, 0x0001 ) +#define E_INVALID_XML_SYNTAX MAKE_HRESULT(1, _ATGFAC, 0x0002 ) + + +CONST UINT XML_MAX_ATTRIBUTES_PER_ELEMENT = 32; +CONST UINT XML_MAX_NAME_LENGTH = 128; +CONST UINT XML_READ_BUFFER_SIZE = 2048; +CONST UINT XML_WRITE_BUFFER_SIZE = 2048; + +// No tag can be longer than XML_WRITE_BUFFER_SIZE - an error will be returned if +// it is + +//------------------------------------------------------------------------------------- +struct XMLAttribute +{ + WCHAR* strName; + UINT NameLen; + WCHAR* strValue; + UINT ValueLen; +}; + +//------------------------------------------------------------------------------------- +class ISAXCallback +{ +friend class XMLParser; +public: + ISAXCallback() {}; + virtual ~ISAXCallback() {}; + + virtual HRESULT StartDocument() = 0; + virtual HRESULT EndDocument() = 0; + + virtual HRESULT ElementBegin( CONST WCHAR* strName, UINT NameLen, + CONST XMLAttribute *pAttributes, UINT NumAttributes ) = 0; + virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, BOOL More ) = 0; + virtual HRESULT ElementEnd( CONST WCHAR *strName, UINT NameLen ) = 0; + + virtual HRESULT CDATABegin( ) = 0; + virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, BOOL bMore ) = 0; + virtual HRESULT CDATAEnd( ) = 0; + + virtual VOID Error( HRESULT hError, CONST CHAR *strMessage ) = 0; + + virtual VOID SetParseProgress( DWORD dwProgress ) { } + + const CHAR* GetFilename() { return m_strFilename; } + UINT GetLineNumber() { return m_LineNum; } + UINT GetLinePosition() { return m_LinePos; } + +private: + CONST CHAR *m_strFilename; + UINT m_LineNum; + UINT m_LinePos; +}; + + +//------------------------------------------------------------------------------------- +class XMLParser +{ +public: + XMLParser(); + ~XMLParser(); + + // Register an interface inheiriting from ISAXCallback + VOID RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback ); + + // Get the registered interface + ISAXCallback* GetSAXCallbackInterface(); + + // ParseXMLFile returns one of the following: + // E_COULD_NOT_OPEN_FILE - couldn't open the file + // E_INVALID_XML_SYNTAX - bad XML syntax according to this parser + // E_NOINTERFACE - RegisterSAXCallbackInterface not called + // E_ABORT - callback returned a fail code + // S_OK - file parsed and completed + + HRESULT ParseXMLFile( CONST CHAR *strFilename ); + + // Parses from a buffer- if you pass a WCHAR buffer (and cast it), it will + // correctly detect it and use unicode instead. Return codes are the + // same as for ParseXMLFile + + HRESULT ParseXMLBuffer( CONST CHAR* strBuffer, UINT uBufferSize ); + +private: + HRESULT MainParseLoop(); + + HRESULT AdvanceCharacter( BOOL bOkToFail = FALSE ); + VOID SkipNextAdvance(); + + HRESULT ConsumeSpace(); + HRESULT ConvertEscape(); + HRESULT AdvanceElement(); + HRESULT AdvanceName(); + HRESULT AdvanceAttrVal(); + HRESULT AdvanceCDATA(); + HRESULT AdvanceComment(); + + VOID FillBuffer(); + +#ifdef _Printf_format_string_ // VC++ 2008 and later support this annotation + VOID Error( HRESULT hRet, _In_z_ _Printf_format_string_ CONST CHAR* strFormat, ... ); +#else + VOID Error( HRESULT hRet, CONST CHAR* strFormat, ... ); +#endif + + ISAXCallback* m_pISAXCallback; + + HANDLE m_hFile; + CONST CHAR* m_pInXMLBuffer; + UINT m_uInXMLBufferCharsLeft; + DWORD m_dwCharsTotal; + DWORD m_dwCharsConsumed; + + BYTE m_pReadBuf[ XML_READ_BUFFER_SIZE + 2 ]; // room for a trailing NULL + WCHAR m_pWriteBuf[ XML_WRITE_BUFFER_SIZE ]; + + BYTE* m_pReadPtr; + WCHAR* m_pWritePtr; // write pointer within m_pBuf + + BOOL m_bUnicode; // TRUE = 16-bits, FALSE = 8-bits + BOOL m_bReverseBytes; // TRUE = reverse bytes, FALSE = don't reverse + + BOOL m_bSkipNextAdvance; + WCHAR m_Ch; // Current character being parsed +}; + +} // namespace ATG + +#endif diff --git a/Minecraft.Client/Durango/XML/xmlFilesCallback.h b/Minecraft.Client/Durango/XML/xmlFilesCallback.h new file mode 100644 index 00000000..deba843d --- /dev/null +++ b/Minecraft.Client/Durango/XML/xmlFilesCallback.h @@ -0,0 +1,337 @@ + +#pragma once +#ifndef XMLMOJANGCALLBACK_H +#define XMLMOJANGCALLBACK_H +// xml reading + +using namespace ATG; +/* +class xmlMojangCallback : public ATG::ISAXCallback +{ +public: + virtual HRESULT StartDocument() { return S_OK; }; + virtual HRESULT EndDocument() { return S_OK; }; + + virtual HRESULT ElementBegin( CONST WCHAR* strName, UINT NameLen, CONST XMLAttribute *pAttributes, UINT NumAttributes ) + { + WCHAR wTemp[35] = L""; + WCHAR wAttName[32] = L""; + WCHAR wNameXUID[32] = L""; + WCHAR wNameSkin[32] = L""; + WCHAR wNameCloak[32] = L""; + PlayerUID xuid=0LL; + + + if (NameLen >31) + return S_FALSE; + else + wcsncpy( wAttName, strName, NameLen); + + if ( _wcsicmp(wAttName,L"root") == 0) + { + return S_OK; + } + else if ( _wcsicmp(wAttName,L"data") == 0) + { + for(UINT i = 0; i < NumAttributes; i++) + { + wcsncpy_s( wAttName, pAttributes[i].strName, pAttributes[i].NameLen); + if (_wcsicmp(wAttName,L"name")==0) + { + if (pAttributes[i].ValueLen <= 32) + wcsncpy_s( wNameXUID, pAttributes[i].strValue, pAttributes[i].ValueLen); + } + else if (_wcsicmp(wAttName,L"xuid")==0) + { + if (pAttributes[i].ValueLen <= 32) + { + ZeroMemory(wTemp,sizeof(WCHAR)*35); + wcsncpy_s( wTemp, pAttributes[i].strValue, pAttributes[i].ValueLen); + xuid=_wcstoui64(wTemp,NULL,10); + } + } + else if (_wcsicmp(wAttName,L"cape")==0) + { + if (pAttributes[i].ValueLen <= 32) + { + wcsncpy_s( wNameCloak, pAttributes[i].strValue, pAttributes[i].ValueLen); + } + } + else if (_wcsicmp(wAttName,L"skin")==0) + { + if (pAttributes[i].ValueLen <= 32) + { + wcsncpy_s( wNameSkin, pAttributes[i].strValue, pAttributes[i].ValueLen); + } + } + + } + + // if the xuid hasn't been defined, then we can't use the data + if(xuid!=0LL) + { + return CConsoleMinecraftApp::RegisterMojangData(wNameXUID , xuid, wNameSkin, wNameCloak ); + } + else return S_FALSE; + } + else + { + return S_FALSE; + } + }; + + virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, BOOL More ) { return S_OK; }; + + virtual HRESULT ElementEnd( CONST WCHAR *strName, UINT NameLen ){ return S_OK; }; + + virtual HRESULT CDATABegin( ) { return S_OK; }; + + virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, BOOL bMore ){ return S_OK; }; + + virtual HRESULT CDATAEnd( ){ return S_OK; }; + + virtual VOID Error( HRESULT hError, CONST CHAR *strMessage ) { app.DebugPrintf("Error when Parsing xuids.XML\n"); }; + +}; +*/ +class xmlConfigCallback : public ATG::ISAXCallback +{ +public: + virtual HRESULT StartDocument() { return S_OK; }; + virtual HRESULT EndDocument() { return S_OK; }; + + virtual HRESULT ElementBegin( CONST WCHAR* strName, UINT NameLen, CONST XMLAttribute *pAttributes, UINT NumAttributes ) + { + WCHAR wTemp[35] = L""; + WCHAR wType[32] = L""; + WCHAR wAttName[32] = L""; + WCHAR wValue[32] = L""; + int iValue=-1; + + if (NameLen >31) + return S_FALSE; + else + wcsncpy_s( wAttName, strName, NameLen); + + if ( _wcsicmp(wAttName,L"root") == 0) + { + return S_OK; + } + else if ( _wcsicmp(wAttName,L"data") == 0) + { + for(UINT i = 0; i < NumAttributes; i++) + { + wcsncpy_s( wAttName, pAttributes[i].strName, pAttributes[i].NameLen); + if (_wcsicmp(wAttName,L"Type")==0) + { + if (pAttributes[i].ValueLen <= 32) + { + wcsncpy_s( wType, pAttributes[i].strValue, pAttributes[i].ValueLen); + } + } + else if(_wcsicmp(wAttName,L"Value")==0) + { + if (pAttributes[i].ValueLen <= 32) + { + wcsncpy_s( wValue, pAttributes[i].strValue, pAttributes[i].ValueLen); + +#ifdef _XBOX + iValue=_wtoi(wValue); +#else + iValue=wcstol(wValue, NULL, 10); +#endif + } + } + } + + // if the xuid hasn't been defined, then we can't use the data + if(iValue!=-1) + { + #ifdef _DEBUG + wprintf(L"Type - %s, Value - %d, ",wType, iValue); + #endif + + return CConsoleMinecraftApp::RegisterConfigValues(wType, iValue ); + } + else + { + return S_FALSE; + } + } + else + { + return S_FALSE; + } + } + + + virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, BOOL More ) { return S_OK; }; + + virtual HRESULT ElementEnd( CONST WCHAR *strName, UINT NameLen ){ return S_OK; }; + + virtual HRESULT CDATABegin( ) { return S_OK; }; + + virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, BOOL bMore ){ return S_OK; }; + + virtual HRESULT CDATAEnd( ){ return S_OK; }; + + virtual VOID Error( HRESULT hError, CONST CHAR *strMessage ) { app.DebugPrintf("Error when Parsing xuids.XML\n"); }; + +}; + +class xmlDLCInfoCallback : public ATG::ISAXCallback +{ +public: + virtual HRESULT StartDocument() { return S_OK; }; + virtual HRESULT EndDocument() { return S_OK; }; + + virtual HRESULT ElementBegin( CONST WCHAR* strName, UINT NameLen, CONST XMLAttribute *pAttributes, UINT NumAttributes ) + { + WCHAR wTemp[35] = L""; + WCHAR wAttName[32] = L""; + WCHAR wNameBanner[32] = L""; + WCHAR wDataFile[32] = L""; + WCHAR wType[32] = L""; + WCHAR wFirstSkin[32] = L""; + WCHAR wConfig[32] = L""; + WCHAR wUID[64] = L""; + WCHAR wName[64] = L""; + unsigned int uiSortIndex=0L; + int iGender=0; + int iConfig=0; + + if (NameLen >31) + return S_FALSE; + else + wcsncpy_s( wAttName, strName, NameLen); + + if ( _wcsicmp(wAttName,L"root") == 0) + { + return S_OK; + } + else if ( _wcsicmp(wAttName,L"data") == 0) + { + for(UINT i = 0; i < NumAttributes; i++) + { + wcsncpy_s( wAttName, pAttributes[i].strName, pAttributes[i].NameLen); + if (_wcsicmp(wAttName,L"SortIndex")==0) + { + if (pAttributes[i].ValueLen <= 32) + { + ZeroMemory(wTemp,sizeof(WCHAR)*35); + wcsncpy_s( wTemp, pAttributes[i].strValue, pAttributes[i].ValueLen); + uiSortIndex=wcstoul(wTemp,NULL,10); + } + } + else if (_wcsicmp(wAttName,L"Banner")==0) + { + if (pAttributes[i].ValueLen <= 32) + { + wcsncpy_s( wNameBanner, pAttributes[i].strValue, pAttributes[i].ValueLen); + } + } + else if (_wcsicmp(wAttName,L"Full")==0) + { + if (pAttributes[i].ValueLen <= 64) + { + ZeroMemory(wUID,sizeof(WCHAR)*64); + wcsncpy_s( wUID, pAttributes[i].strValue, pAttributes[i].ValueLen); + } + } + else if (_wcsicmp(wAttName,L"Name")==0) + { + if (pAttributes[i].ValueLen <= 64) + { + ZeroMemory(wName,sizeof(WCHAR)*64); + wcsncpy_s( wName, pAttributes[i].strValue, pAttributes[i].ValueLen); + } + } + else if (_wcsicmp(wAttName,L"FirstSkin")==0) + { + if (pAttributes[i].ValueLen <= 32) + { + wcsncpy_s( wFirstSkin, pAttributes[i].strValue, pAttributes[i].ValueLen); + } + } + else if (_wcsicmp(wAttName,L"Type")==0) + { + if (pAttributes[i].ValueLen <= 32) + { + wcsncpy_s( wType, pAttributes[i].strValue, pAttributes[i].ValueLen); + } + } + else if(_wcsicmp(wAttName,L"Config")==0) + { + if (pAttributes[i].ValueLen <= 32) + { + wcsncpy_s( wConfig, pAttributes[i].strValue, pAttributes[i].ValueLen); + +#ifdef _XBOX + iConfig=_wtoi(wConfig); +#else + iConfig=wcstol(wConfig, NULL, 10); +#endif + } + } + else if (_wcsicmp(wAttName,L"DataFile")==0) + { + if (pAttributes[i].ValueLen <= 32) + { + wcsncpy_s( wDataFile, pAttributes[i].strValue, pAttributes[i].ValueLen); + } + } + + } + + // if the xuid hasn't been defined, then we can't use the data + if(wUID[0]!=0) + { +#ifdef _DEBUG + wprintf(L"Type - %ls, Name - %ls, ",wType, wNameBanner); +#endif + + eDLCContentType eDLCType=e_DLC_NotDefined; + if(wType[0]!=0) + { + if(wcscmp(wType,L"Skin")==0) + { + eDLCType=e_DLC_SkinPack; + } + else if(wcscmp(wType,L"MashUpPack")==0) + { + eDLCType=e_DLC_MashupPacks; + } + else if(wcscmp(wType,L"TexturePack")==0) + { + eDLCType=e_DLC_TexturePacks; + } + } + return CConsoleMinecraftApp::RegisterDLCData(eDLCType, wNameBanner , wUID, wName, wFirstSkin, iConfig, uiSortIndex ); + } + else + { + return S_FALSE; + } + } + else + { + return S_FALSE; + } + }; + + virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, BOOL More ) { return S_OK; }; + + virtual HRESULT ElementEnd( CONST WCHAR *strName, UINT NameLen ){ return S_OK; }; + + virtual HRESULT CDATABegin( ) { return S_OK; }; + + virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, BOOL bMore ){ return S_OK; }; + + virtual HRESULT CDATAEnd( ){ return S_OK; }; + + virtual VOID Error( HRESULT hError, CONST CHAR *strMessage ) { app.DebugPrintf("Error when Parsing DLC.XML\n"); }; + +}; + + +#endif \ No newline at end of file diff --git a/Minecraft.Client/Durango/XboxGameMode.cpp b/Minecraft.Client/Durango/XboxGameMode.cpp new file mode 100644 index 00000000..1b55fdd9 --- /dev/null +++ b/Minecraft.Client/Durango/XboxGameMode.cpp @@ -0,0 +1,9 @@ +#include "stdafx.h" +#include "XboxGameMode.h" +#include "..\Common\Tutorial\Tutorial.h" + +XboxGameMode::XboxGameMode(int iPad, Minecraft *minecraft, ClientConnection *connection) + : TutorialMode(iPad, minecraft, connection) +{ + tutorial = new Tutorial(iPad); +} \ No newline at end of file diff --git a/Minecraft.Client/Durango/XboxGameMode.h b/Minecraft.Client/Durango/XboxGameMode.h new file mode 100644 index 00000000..347cdf30 --- /dev/null +++ b/Minecraft.Client/Durango/XboxGameMode.h @@ -0,0 +1,10 @@ +#pragma once +#include "..\Common\Tutorial\TutorialMode.h" + +class XboxGameMode : public TutorialMode +{ +public: + XboxGameMode(int iPad, Minecraft *minecraft, ClientConnection *connection); + + virtual bool isImplemented() { return true; } +}; \ No newline at end of file diff --git a/Minecraft.Client/Durango/Xbox_Awards_enum.h b/Minecraft.Client/Durango/Xbox_Awards_enum.h new file mode 100644 index 00000000..5917022b --- /dev/null +++ b/Minecraft.Client/Durango/Xbox_Awards_enum.h @@ -0,0 +1,46 @@ +#pragma once + +enum eAward +{ + eAward_TakingInventory=0, + eAward_GettingWood, + eAward_Benchmarking, + eAward_TimeToMine, + eAward_HotTopic, + eAward_AquireHardware, + eAward_TimeToFarm, + eAward_BakeBread, + eAward_TheLie, + eAward_GettingAnUpgrade, + eAward_DeliciousFish, + eAward_OnARail, + eAward_TimeToStrike, + eAward_MonsterHunter, + eAward_CowTipper, + eAward_WhenPigsFly, + eAward_LeaderOfThePack, + eAward_MOARTools, + eAward_DispenseWithThis, + eAward_InToTheNether, + eAward_mine100Blocks, + eAward_kill10Creepers, + eAward_eatPorkChop, + eAward_play100Days, + eAward_arrowKillCreeper, + eAward_socialPost, + + // 4J Stu - Does not map to any Xbox achievements + eAward_snipeSkeleton, + eAward_diamonds, + eAward_portal, + eAward_ghast, + eAward_blazeRod, + eAward_potion, + eAward_theEnd, + eAward_winGame, + eAward_enchantments, + eAward_overkill, + eAward_bookcase, + + eAward_Max, +}; \ No newline at end of file diff --git a/Minecraft.Client/Durango/Xbox_BuildVer.h b/Minecraft.Client/Durango/Xbox_BuildVer.h new file mode 100644 index 00000000..1fc3e4c1 --- /dev/null +++ b/Minecraft.Client/Durango/Xbox_BuildVer.h @@ -0,0 +1,53 @@ + +#pragma once + + +#define VER_PRODUCTMAJORVERSION 0 +#define VER_PRODUCTMINORVERSION 0 +#define VER_PRODUCTBUILD 170 +#define VER_PRODUCTBUILD_QFE 0 + +#define VER_FILEVERSION_STRING "1.1" +#define VER_PRODUCTVERSION_STRING VER_FILEVERSION_STRING +#define VER_FILEVERSION_STRING_W L"1.1" +#define VER_PRODUCTVERSION_STRING_W VER_FILEVERSION_STRING_W + +#define VER_FILEBETA_STR "" +#undef VER_FILEVERSION +#define VER_FILEVERSION VER_PRODUCTMAJORVERSION, VER_PRODUCTMINORVERSION, VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE +#define VER_PRODUCTVERSION VER_PRODUCTMAJORVERSION, VER_PRODUCTMINORVERSION, VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE + +#if (VER_PRODUCTBUILD < 10) +#define VER_FILEBPAD "000" +#define VER_FILEBPAD_W L"000" +#elif (VER_PRODUCTBUILD < 100) +#define VER_FILEBPAD "00" +#define VER_FILEBPAD_W L"00" +#elif (VER_PRODUCTBUILD < 1000) +#define VER_FILEBPAD "0" +#define VER_FILEBPAD_W L"0" +#else +#define VER_FILEBPAD +#define VER_FILEBPAD_W +#endif + +#define VER_WIDE_PREFIX(x) L##x + +#define VER_FILEVERSION_STR2(x,y) VER_FILEVERSION_STRING "." VER_FILEBPAD #x "." #y +#define VER_FILEVERSION_STR2_W(x,y) VER_FILEVERSION_STRING_W L"." VER_FILEBPAD_W VER_WIDE_PREFIX(#x) L"." VER_WIDE_PREFIX(#y) +#define VER_FILEVERSION_STR1(x,y) VER_FILEVERSION_STR2(x, y) +#define VER_FILEVERSION_STR1_W(x,y) VER_FILEVERSION_STR2_W(x, y) + +#undef VER_FILEVERSION_STR +#define VER_FILEVERSION_STR VER_FILEVERSION_STR1(VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE) +#define VER_PRODUCTVERSION_STR VER_FILEVERSION_STR1(VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE) + +#define VER_FILEVERSION_STR_W VER_FILEVERSION_STR1_W(VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE) +#define VER_PRODUCTVERSION_STR_W VER_FILEVERSION_STR1_W(VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE) + +#if (VER_PRODUCTBUILD_QFE >= 256) +#error "QFE number cannot exceed 255" +#endif + + + diff --git a/Minecraft.Client/Durango/Xbox_Debug_enum.h b/Minecraft.Client/Durango/Xbox_Debug_enum.h new file mode 100644 index 00000000..685cf3f6 --- /dev/null +++ b/Minecraft.Client/Durango/Xbox_Debug_enum.h @@ -0,0 +1,36 @@ +#pragma once + +enum eDebugSetting +{ + eDebugSetting_LoadSavesFromDisk, + eDebugSetting_WriteSavesToDisk, + eDebugSetting_InterfaceOff, + eDebugSetting_Safearea, + eDebugSetting_MobsDontAttack, + eDebugSetting_FreezeTime, + eDebugSetting_DisableWeather, + eDebugSetting_CraftAnything, + eDebugSetting_UseDpadForDebug, + eDebugSetting_MobsDontTick, + eDebugSetting_InstantDestroy, + eDebugSetting_HandRenderingOff, + eDebugSetting_RemoveAllPlayerData, + eDebugSetting_DebugLeaderboards, + eDebugSetting_TipsAlwaysOn, + //eDebugSetting_LightDarkBackground, + eDebugSetting_RegularLightning, + eDebugSetting_Max, +}; + +enum eDebugButton +{ + eDebugButton_Theme=0, + eDebugButton_Avatar_Item_1, + eDebugButton_Avatar_Item_2, + eDebugButton_Avatar_Item_3, + eDebugButton_Gamerpic_1, + eDebugButton_Gamerpic_2, + eDebugButton_CheckTips, + eDebugButton_WipeLeaderboards, + eDebugButton_Max, +}; \ No newline at end of file diff --git a/Minecraft.Client/Durango/Xbox_Utils.cpp b/Minecraft.Client/Durango/Xbox_Utils.cpp new file mode 100644 index 00000000..ab6186b6 --- /dev/null +++ b/Minecraft.Client/Durango/Xbox_Utils.cpp @@ -0,0 +1,40 @@ +#include "stdafx.h" + +//-------------------------------------------------------------------------------------- +// Name: DebugSpewV() +// Desc: Internal helper function +//-------------------------------------------------------------------------------------- +#ifndef _CONTENT_PACKAGE +static VOID DebugSpewV( const CHAR* strFormat, const va_list pArgList ) +{ +#ifdef __PS3__ + assert(0); +#else + CHAR str[2048]; + // Use the secure CRT to avoid buffer overruns. Specify a count of + // _TRUNCATE so that too long strings will be silently truncated + // rather than triggering an error. + _vsnprintf_s( str, _TRUNCATE, strFormat, pArgList ); + OutputDebugStringA( str ); +#endif +} +#endif + +//-------------------------------------------------------------------------------------- +// Name: DebugSpew() +// Desc: Prints formatted debug spew +//-------------------------------------------------------------------------------------- +#ifdef _Printf_format_string_ // VC++ 2008 and later support this annotation +VOID CDECL DebugSpew( _In_z_ _Printf_format_string_ const CHAR* strFormat, ... ) +#else +VOID CDECL DebugPrintf( const CHAR* strFormat, ... ) +#endif +{ +#ifndef _CONTENT_PACKAGE + va_list pArgList; + va_start( pArgList, strFormat ); + DebugSpewV( strFormat, pArgList ); + va_end( pArgList ); +#endif +} + diff --git a/Minecraft.Client/Durango/manifest.xml b/Minecraft.Client/Durango/manifest.xml new file mode 100644 index 00000000..690ef415 --- /dev/null +++ b/Minecraft.Client/Durango/manifest.xml @@ -0,0 +1,194 @@ + + + + + + + Minecraft: Xbox One Edition + Microsoft Studios + StoreLogo.png + Minecraft + + + + 6.2 + 6.2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ESRB:E10 + PEGI:7 + PEGI-PT:6 + FPB:PG + USK:6 + COB-AU:PG + OFLC-NZ:PG + DJCTQ:L + CERO:A + GRB:All + CSRR:P + PCBP:6 + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Minecraft.Client/Durango/targetver.h b/Minecraft.Client/Durango/targetver.h new file mode 100644 index 00000000..87c0086d --- /dev/null +++ b/Minecraft.Client/Durango/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// Including SDKDDKVer.h defines the highest available Windows platform. + +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. + +#include -- cgit v1.2.3