From d129c7ba62979bd38502abd8876d6b8006ce0b29 Mon Sep 17 00:00:00 2001 From: njohnson Date: Fri, 5 Sep 2025 18:35:17 -0400 Subject: [PATCH] Sorry ut A lotta stuff. --- libs/compression/compression.cpp | 29 +- libs/core/core.pro | 6 + libs/core/enums.h | 22 - libs/core/utils.h | 184 +- libs/ddsfile/ddsfile.cpp | 10 +- libs/ddsfile/ddsfile.h | 10 +- libs/fastfile/360/fastfile_cod10_360.cpp | 13 +- libs/fastfile/360/fastfile_cod10_360.h | 2 +- libs/fastfile/360/fastfile_cod11_360.cpp | 11 +- libs/fastfile/360/fastfile_cod11_360.h | 2 +- libs/fastfile/360/fastfile_cod12_360.cpp | 11 +- libs/fastfile/360/fastfile_cod12_360.h | 2 +- libs/fastfile/360/fastfile_cod2_360.cpp | 13 +- libs/fastfile/360/fastfile_cod2_360.h | 2 +- libs/fastfile/360/fastfile_cod4_360.cpp | 13 +- libs/fastfile/360/fastfile_cod4_360.h | 2 +- libs/fastfile/360/fastfile_cod5_360.cpp | 13 +- libs/fastfile/360/fastfile_cod5_360.h | 2 +- libs/fastfile/360/fastfile_cod6_360.cpp | 25 +- libs/fastfile/360/fastfile_cod6_360.h | 2 +- libs/fastfile/360/fastfile_cod7_360.cpp | 16 +- libs/fastfile/360/fastfile_cod7_360.h | 2 +- libs/fastfile/360/fastfile_cod8_360.cpp | 13 +- libs/fastfile/360/fastfile_cod8_360.h | 2 +- libs/fastfile/360/fastfile_cod9_360.cpp | 13 +- libs/fastfile/360/fastfile_cod9_360.h | 2 +- libs/fastfile/PC/fastfile_cod10_pc.cpp | 13 +- libs/fastfile/PC/fastfile_cod10_pc.h | 2 +- libs/fastfile/PC/fastfile_cod11_pc.cpp | 13 +- libs/fastfile/PC/fastfile_cod11_pc.h | 2 +- libs/fastfile/PC/fastfile_cod12_pc.cpp | 17 +- libs/fastfile/PC/fastfile_cod12_pc.h | 2 +- libs/fastfile/PC/fastfile_cod4_pc.cpp | 13 +- libs/fastfile/PC/fastfile_cod4_pc.h | 2 +- libs/fastfile/PC/fastfile_cod5_pc.cpp | 13 +- libs/fastfile/PC/fastfile_cod5_pc.h | 2 +- libs/fastfile/PC/fastfile_cod6_pc.cpp | 13 +- libs/fastfile/PC/fastfile_cod6_pc.h | 2 +- libs/fastfile/PC/fastfile_cod7_pc.cpp | 16 +- libs/fastfile/PC/fastfile_cod7_pc.h | 2 +- libs/fastfile/PC/fastfile_cod8_pc.cpp | 16 +- libs/fastfile/PC/fastfile_cod8_pc.h | 2 +- libs/fastfile/PC/fastfile_cod9_pc.cpp | 13 +- libs/fastfile/PC/fastfile_cod9_pc.h | 2 +- libs/fastfile/PS3/fastfile_cod10_ps3.cpp | 13 +- libs/fastfile/PS3/fastfile_cod10_ps3.h | 2 +- libs/fastfile/PS3/fastfile_cod11_ps3.cpp | 13 +- libs/fastfile/PS3/fastfile_cod11_ps3.h | 2 +- libs/fastfile/PS3/fastfile_cod12_ps3.cpp | 13 +- libs/fastfile/PS3/fastfile_cod12_ps3.h | 2 +- libs/fastfile/PS3/fastfile_cod4_ps3.cpp | 13 +- libs/fastfile/PS3/fastfile_cod4_ps3.h | 2 +- libs/fastfile/PS3/fastfile_cod5_ps3.cpp | 13 +- libs/fastfile/PS3/fastfile_cod5_ps3.h | 2 +- libs/fastfile/PS3/fastfile_cod6_ps3.cpp | 13 +- libs/fastfile/PS3/fastfile_cod6_ps3.h | 2 +- libs/fastfile/PS3/fastfile_cod7_ps3.cpp | 14 +- libs/fastfile/PS3/fastfile_cod7_ps3.h | 2 +- libs/fastfile/PS3/fastfile_cod8_ps3.cpp | 14 +- libs/fastfile/PS3/fastfile_cod8_ps3.h | 2 +- libs/fastfile/PS3/fastfile_cod9_ps3.cpp | 13 +- libs/fastfile/PS3/fastfile_cod9_ps3.h | 2 +- libs/fastfile/Wii/fastfile_cod4_wii.cpp | 21 +- libs/fastfile/Wii/fastfile_cod4_wii.h | 2 +- libs/fastfile/Wii/fastfile_cod7_wii.cpp | 16 +- libs/fastfile/Wii/fastfile_cod7_wii.h | 2 +- libs/fastfile/Wii/fastfile_cod8_wii.cpp | 16 +- libs/fastfile/Wii/fastfile_cod8_wii.h | 2 +- libs/fastfile/WiiU/fastfile_cod10_wiiu.cpp | 13 +- libs/fastfile/WiiU/fastfile_cod10_wiiu.h | 2 +- libs/fastfile/WiiU/fastfile_cod9_wiiu.cpp | 13 +- libs/fastfile/WiiU/fastfile_cod9_wiiu.h | 2 +- libs/fastfile/fastfile.cpp | 10 +- libs/fastfile/fastfile.h | 13 +- libs/fastfile/fastfile.pro | 6 +- libs/fastfile/fastfile_factory.h | 140 +- libs/iwifile/iwifile.cpp | 12 +- libs/iwifile/iwifile.h | 16 +- libs/xassets/360/assets_cod10_360.cpp | 11 - libs/xassets/360/assets_cod10_360.h | 18 - libs/xassets/360/assets_cod11_360.cpp | 11 - libs/xassets/360/assets_cod11_360.h | 18 - libs/xassets/360/assets_cod12_360.cpp | 11 - libs/xassets/360/assets_cod12_360.h | 18 - libs/xassets/360/assets_cod2_360.cpp | 11 - libs/xassets/360/assets_cod2_360.h | 18 - libs/xassets/360/assets_cod4_360.cpp | 12 - libs/xassets/360/assets_cod4_360.h | 15 - libs/xassets/360/assets_cod5_360.cpp | 11 - libs/xassets/360/assets_cod5_360.h | 18 - libs/xassets/360/assets_cod6_360.cpp | 11 - libs/xassets/360/assets_cod6_360.h | 18 - libs/xassets/360/assets_cod7_360.cpp | 11 - libs/xassets/360/assets_cod7_360.h | 18 - libs/xassets/360/assets_cod8_360.cpp | 11 - libs/xassets/360/assets_cod8_360.h | 18 - libs/xassets/360/assets_cod9_360.cpp | 11 - libs/xassets/360/assets_cod9_360.h | 18 - libs/xassets/PC/assets_cod10_pc.cpp | 11 - libs/xassets/PC/assets_cod10_pc.h | 18 - libs/xassets/PC/assets_cod11_pc.cpp | 11 - libs/xassets/PC/assets_cod11_pc.h | 18 - libs/xassets/PC/assets_cod12_pc.cpp | 11 - libs/xassets/PC/assets_cod12_pc.h | 18 - libs/xassets/PC/assets_cod4_pc.cpp | 11 - libs/xassets/PC/assets_cod4_pc.h | 18 - libs/xassets/PC/assets_cod5_pc.cpp | 11 - libs/xassets/PC/assets_cod5_pc.h | 18 - libs/xassets/PC/assets_cod6_pc.cpp | 11 - libs/xassets/PC/assets_cod6_pc.h | 18 - libs/xassets/PC/assets_cod7_pc.cpp | 11 - libs/xassets/PC/assets_cod7_pc.h | 18 - libs/xassets/PC/assets_cod8_pc.cpp | 11 - libs/xassets/PC/assets_cod8_pc.h | 18 - libs/xassets/PC/assets_cod9_pc.cpp | 11 - libs/xassets/PC/assets_cod9_pc.h | 18 - libs/xassets/PS3/assets_cod10_ps3.cpp | 11 - libs/xassets/PS3/assets_cod10_ps3.h | 18 - libs/xassets/PS3/assets_cod11_ps3.cpp | 11 - libs/xassets/PS3/assets_cod11_ps3.h | 18 - libs/xassets/PS3/assets_cod12_ps3.cpp | 11 - libs/xassets/PS3/assets_cod12_ps3.h | 18 - libs/xassets/PS3/assets_cod4_ps3.cpp | 11 - libs/xassets/PS3/assets_cod4_ps3.h | 18 - libs/xassets/PS3/assets_cod5_ps3.cpp | 11 - libs/xassets/PS3/assets_cod5_ps3.h | 18 - libs/xassets/PS3/assets_cod6_ps3.cpp | 11 - libs/xassets/PS3/assets_cod6_ps3.h | 18 - libs/xassets/PS3/assets_cod7_ps3.cpp | 11 - libs/xassets/PS3/assets_cod7_ps3.h | 18 - libs/xassets/PS3/assets_cod8_ps3.cpp | 11 - libs/xassets/PS3/assets_cod8_ps3.h | 18 - libs/xassets/PS3/assets_cod9_ps3.cpp | 11 - libs/xassets/PS3/assets_cod9_ps3.h | 18 - libs/xassets/Wii/assets_cod4_wii.cpp | 11 - libs/xassets/Wii/assets_cod4_wii.h | 18 - libs/xassets/Wii/assets_cod7_wii.cpp | 11 - libs/xassets/Wii/assets_cod7_wii.h | 18 - libs/xassets/Wii/assets_cod8_wii.cpp | 11 - libs/xassets/Wii/assets_cod8_wii.h | 18 - libs/xassets/WiiU/assets_cod10_wiiu.cpp | 11 - libs/xassets/WiiU/assets_cod10_wiiu.h | 18 - libs/xassets/WiiU/assets_cod9_wiiu.cpp | 11 - libs/xassets/WiiU/assets_cod9_wiiu.h | 18 - libs/xassets/assetlist.cpp | 0 libs/xassets/assetlist.h | 0 libs/xassets/assetmap.h | 60 - libs/xassets/assets.cpp | 9792 ----------------- libs/xassets/assets.h | 2822 ----- libs/xassets/font.cpp | 1 - libs/xassets/font.h | 30 - libs/xassets/gfxworld.cpp | 1 - libs/xassets/gfxworld.h | 357 - libs/xassets/materialtechset.cpp | 1 - libs/xassets/materialtechset.h | 29 - libs/xassets/weapondef.cpp | 1 - libs/xassets/weapondef.h | 531 - libs/xassets/xanimdeltapart.cpp | 35 +- libs/xassets/xanimdeltapart.h | 11 +- libs/xassets/xanimdeltapartquat.cpp | 11 +- libs/xassets/xanimdeltapartquatdata.cpp | 13 - libs/xassets/xanimdeltapartquatdataframes.cpp | 6 +- libs/xassets/xanimdynamicframes.cpp | 41 +- libs/xassets/xanimdynamicframes.h | 16 +- libs/xassets/xanimdynamicindices.cpp | 31 +- libs/xassets/xanimdynamicindices.h | 15 +- libs/xassets/xanimindices.cpp | 37 +- libs/xassets/xanimindices.h | 19 +- libs/xassets/xanimnotifyinfo.cpp | 32 +- libs/xassets/xanimnotifyinfo.h | 17 +- libs/xassets/xanimparts.cpp | 464 +- libs/xassets/xanimparts.h | 143 +- libs/xassets/xanimparttrans.cpp | 61 +- libs/xassets/xanimparttrans.h | 18 +- libs/xassets/xanimparttransdata.cpp | 46 +- libs/xassets/xanimparttransdata.h | 16 +- libs/xassets/xanimparttransframes.cpp | 79 +- libs/xassets/xanimparttransframes.h | 29 +- libs/xassets/xasset.cpp | 398 +- libs/xassets/xasset.h | 16 +- libs/xassets/xassetlist.cpp | 100 +- libs/xassets/xassetlist.h | 20 +- libs/xassets/xassets.pro | 9 +- libs/xassets/xaudiochannelmap.h | 2 + libs/xassets/xaudioformatinfo.h | 2 + libs/xassets/xaudiopacketaligned.h | 3 +- libs/xassets/xaudioseektable.h | 2 +- libs/xassets/xaudiosound.h | 5 +- libs/xassets/xcleafbrushnodechildren.cpp | 61 +- libs/xassets/xcleafbrushnodechildren.h | 30 +- libs/xassets/xcleafbrushnodedata.cpp | 23 +- libs/xassets/xcleafbrushnodedata.h | 17 +- libs/xassets/xcleafbrushnodeleaf.cpp | 25 +- libs/xassets/xcleafbrushnodeleaf.h | 24 +- libs/xassets/xclipmap.cpp | 103 +- libs/xassets/xclipmap.h | 141 +- libs/xassets/xcnode.cpp | 48 +- libs/xassets/xcnode.h | 32 +- libs/xassets/xcollisionaabbtree.cpp | 66 +- libs/xassets/xcollisionaabbtree.h | 37 +- libs/xassets/xcollisionaabbtreeindex.cpp | 22 +- libs/xassets/xcollisionaabbtreeindex.h | 18 +- libs/xassets/xcollisionborder.cpp | 74 +- libs/xassets/xcollisionborder.h | 40 +- libs/xassets/xcollisionpartition.cpp | 68 +- libs/xassets/xcollisionpartition.h | 38 +- libs/xassets/xcomworld.cpp | 28 +- libs/xassets/xcomworld.h | 5 +- libs/xassets/xcstaticmodels.cpp | 93 - libs/xassets/xcstaticmodels.h | 56 - libs/xassets/xcstaticmodelwritable.cpp | 17 +- libs/xassets/xcstaticmodelwritable.h | 12 +- libs/xassets/xd3dbasetexture.cpp | 8 +- libs/xassets/xd3dbasetexture.h | 9 +- libs/xassets/xdmaterial.cpp | 36 +- libs/xassets/xdmaterial.h | 5 +- libs/xassets/xeffectdef.cpp | 38 +- libs/xassets/xeffectdef.h | 204 +- libs/xassets/xeffectdefref.cpp | 1 + libs/xassets/xeffectdefref.h | 5 +- libs/xassets/xfile.cpp | 8 + libs/xassets/xfxelemdef.cpp | 47 +- libs/xassets/xfxelemdef.h | 60 +- libs/xassets/xfxelemdefvisuals.h | 3 +- libs/xassets/xfxelemvisstatesample.cpp | 34 +- libs/xassets/xfxelemvisstatesample.h | 2 +- libs/xassets/xfxelemvisuals.h | 2 +- libs/xassets/xfxtraildef.h | 1 + libs/xassets/xgameworld.h | 4 - libs/xassets/xgameworldmp.cpp | 22 +- libs/xassets/xgameworldmp.h | 4 + libs/xassets/xgameworldsp.cpp | 23 +- libs/xassets/xgameworldsp.h | 9 +- libs/xassets/xgfxcolor.cpp | 10 +- libs/xassets/xgfxcolor.h | 2 + libs/xassets/xgfximage.cpp | 36 + libs/xassets/xgfximage.h | 9 +- libs/xassets/xgfximageloaddef.h | 3 +- libs/xassets/xgfxlight.cpp | 98 +- libs/xassets/xgfxlight.h | 36 +- libs/xassets/xgfxlightdef.cpp | 3 +- libs/xassets/xgfxreflectionprobe.cpp | 53 +- libs/xassets/xgfxreflectionprobe.h | 38 +- libs/xassets/xgfxstreamingaabbtree.cpp | 17 +- libs/xassets/xgfxtexture.cpp | 11 +- libs/xassets/xgfxtexture.h | 8 +- libs/xassets/xgfxvertexshaderloaddef.cpp | 26 +- libs/xassets/xgfxvertexshaderloaddef.h | 9 +- libs/xassets/xgfxworld.cpp | 103 +- libs/xassets/xgfxworld.h | 38 +- libs/xassets/xgfxworldstreaminfo.cpp | 74 +- libs/xassets/xgfxworldstreaminfo.h | 30 +- libs/xassets/xgfxworldvertex.cpp | 117 +- libs/xassets/xgfxworldvertex.h | 50 +- libs/xassets/xgfxworldvertexdata.cpp | 16 +- libs/xassets/xgfxworldvertexdata.h | 19 +- libs/xassets/xgputexturefetchconstant.cpp | 15 +- libs/xassets/xgputexturefetchconstant.h | 13 +- libs/xassets/xloadedsound.cpp | 13 +- libs/xassets/xloadedsound.h | 4 +- libs/xassets/xlocalizeentry.cpp | 3 +- libs/xassets/xmapents.cpp | 3 +- libs/xassets/xmaterial.cpp | 32 +- libs/xassets/xmaterial.h | 19 +- libs/xassets/xmaterialconstantdef.cpp | 2 +- libs/xassets/xmaterialinfo.cpp | 27 +- libs/xassets/xmaterialinfo.h | 1 + libs/xassets/xmaterialpass.cpp | 34 +- libs/xassets/xmaterialpass.h | 19 +- libs/xassets/xmaterialpixelshader.cpp | 3 +- libs/xassets/xmaterialstreamrouting.cpp | 10 +- libs/xassets/xmaterialtechnique.cpp | 33 +- libs/xassets/xmaterialtechnique.h | 6 +- libs/xassets/xmaterialtexturedef.cpp | 2 +- libs/xassets/xmaterialtexturedefinfo.cpp | 14 +- libs/xassets/xmaterialtexturedefinfo.h | 4 +- libs/xassets/xmaterialvertexdeclaration.cpp | 7 + libs/xassets/xmaterialvertexshader.cpp | 11 +- libs/xassets/xmaterialvertexshader.h | 8 +- libs/xassets/xmaterialvertexshaderprogram.cpp | 23 +- libs/xassets/xmaterialvertexshaderprogram.h | 4 +- libs/xassets/xmenudef.cpp | 4 +- libs/xassets/xmenudef.h | 274 +- libs/xassets/xmenulist.cpp | 21 +- libs/xassets/xmenulist.h | 6 +- libs/xassets/xmodel.cpp | 177 +- libs/xassets/xmodel.h | 1 + libs/xassets/xnodetype.h | 5 +- libs/xassets/xpathbasenode.cpp | 49 +- libs/xassets/xpathbasenode.h | 25 +- libs/xassets/xpathdata.cpp | 26 +- libs/xassets/xpathdata.cpp.new | 80 - libs/xassets/xpathdata.h | 12 - libs/xassets/xpathdata.h.new | 45 - libs/xassets/xpathlink.cpp | 53 +- libs/xassets/xpathlink.h | 25 +- libs/xassets/xpathnode.h | 11 - libs/xassets/xpathnodeconstant.cpp | 261 +- libs/xassets/xpathnodeconstant.h | 109 +- libs/xassets/xpathnodedynamic.cpp | 71 +- libs/xassets/xpathnodedynamic.h | 38 +- libs/xassets/xpathnodetransient.cpp | 57 +- libs/xassets/xpathnodetransient.h | 30 +- libs/xassets/xpathnodetree.cpp | 43 +- libs/xassets/xpathnodetree.h | 19 +- libs/xassets/xpathnodetreeinfo.cpp | 29 +- libs/xassets/xpathnodetreeinfo.h | 28 +- libs/xassets/xpathnodetreenodes.cpp | 50 +- libs/xassets/xpathnodetreenodes.h | 23 +- libs/xassets/xphyspreset.cpp | 3 +- libs/xassets/xrawfile.cpp | 3 +- libs/xassets/xscriptstringlist.cpp | 7 +- libs/xassets/xsoundalias.cpp | 5 + libs/xassets/xsoundalias.h | 2 + libs/xassets/xsoundaliaslist.cpp | 10 + libs/xassets/xsoundaliaslist.h | 8 +- libs/xassets/xsoundcurve.cpp | 3 +- libs/xassets/xsounddriverglobals.cpp | 3 +- libs/xassets/xsounddriverglobals.h | 6 +- libs/xassets/xsoundfileref.cpp | 24 +- libs/xassets/xsoundfileref.h | 12 +- libs/xassets/xspeakermap.cpp | 3 + libs/xassets/xstreamfileinfo.h | 7 +- libs/xassets/xstringtable.cpp | 6 +- libs/xassets/xsunlightparseparams.cpp | 148 +- libs/xassets/xsunlightparseparams.h | 59 +- libs/xassets/xweapondef.cpp | 52 +- libs/xassets/xweapondef.h | 437 +- libs/zonefile/360/zonefile_cod10_360.cpp | 62 +- libs/zonefile/360/zonefile_cod10_360.h | 2 +- libs/zonefile/360/zonefile_cod11_360.cpp | 188 +- libs/zonefile/360/zonefile_cod11_360.h | 2 +- libs/zonefile/360/zonefile_cod12_360.cpp | 207 +- libs/zonefile/360/zonefile_cod12_360.h | 2 +- libs/zonefile/360/zonefile_cod2_360.cpp | 69 +- libs/zonefile/360/zonefile_cod2_360.h | 2 +- libs/zonefile/360/zonefile_cod4_360.cpp | 237 +- libs/zonefile/360/zonefile_cod4_360.h | 3 +- libs/zonefile/360/zonefile_cod5_360.cpp | 69 +- libs/zonefile/360/zonefile_cod5_360.h | 2 +- libs/zonefile/360/zonefile_cod6_360.cpp | 246 +- libs/zonefile/360/zonefile_cod6_360.h | 2 +- libs/zonefile/360/zonefile_cod7_360.cpp | 146 +- libs/zonefile/360/zonefile_cod7_360.h | 2 +- libs/zonefile/360/zonefile_cod8_360.cpp | 150 +- libs/zonefile/360/zonefile_cod8_360.h | 2 +- libs/zonefile/360/zonefile_cod9_360.cpp | 62 +- libs/zonefile/360/zonefile_cod9_360.h | 2 +- libs/zonefile/PC/zonefile_cod10_pc.cpp | 65 +- libs/zonefile/PC/zonefile_cod10_pc.h | 2 +- libs/zonefile/PC/zonefile_cod11_pc.cpp | 66 +- libs/zonefile/PC/zonefile_cod11_pc.h | 2 +- libs/zonefile/PC/zonefile_cod12_pc.cpp | 212 +- libs/zonefile/PC/zonefile_cod12_pc.h | 2 +- libs/zonefile/PC/zonefile_cod4_pc.cpp | 79 +- libs/zonefile/PC/zonefile_cod4_pc.h | 2 +- libs/zonefile/PC/zonefile_cod5_pc.cpp | 73 +- libs/zonefile/PC/zonefile_cod5_pc.h | 2 +- libs/zonefile/PC/zonefile_cod6_pc.cpp | 73 +- libs/zonefile/PC/zonefile_cod6_pc.h | 2 +- libs/zonefile/PC/zonefile_cod7_pc.cpp | 148 +- libs/zonefile/PC/zonefile_cod7_pc.h | 2 +- libs/zonefile/PC/zonefile_cod8_pc.cpp | 66 +- libs/zonefile/PC/zonefile_cod8_pc.h | 2 +- libs/zonefile/PC/zonefile_cod9_pc.cpp | 66 +- libs/zonefile/PC/zonefile_cod9_pc.h | 2 +- libs/zonefile/PS3/zonefile_cod10_ps3.cpp | 62 +- libs/zonefile/PS3/zonefile_cod10_ps3.h | 2 +- libs/zonefile/PS3/zonefile_cod11_ps3.cpp | 62 +- libs/zonefile/PS3/zonefile_cod11_ps3.h | 2 +- libs/zonefile/PS3/zonefile_cod12_ps3.cpp | 62 +- libs/zonefile/PS3/zonefile_cod12_ps3.h | 2 +- libs/zonefile/PS3/zonefile_cod4_ps3.cpp | 43 +- libs/zonefile/PS3/zonefile_cod4_ps3.h | 2 +- libs/zonefile/PS3/zonefile_cod5_ps3.cpp | 70 +- libs/zonefile/PS3/zonefile_cod5_ps3.h | 2 +- libs/zonefile/PS3/zonefile_cod6_ps3.cpp | 74 +- libs/zonefile/PS3/zonefile_cod6_ps3.h | 2 +- libs/zonefile/PS3/zonefile_cod7_ps3.cpp | 62 +- libs/zonefile/PS3/zonefile_cod7_ps3.h | 2 +- libs/zonefile/PS3/zonefile_cod8_ps3.cpp | 62 +- libs/zonefile/PS3/zonefile_cod8_ps3.h | 2 +- libs/zonefile/PS3/zonefile_cod9_ps3.cpp | 61 +- libs/zonefile/PS3/zonefile_cod9_ps3.h | 2 +- libs/zonefile/Wii/zonefile_cod4_wii.cpp | 62 +- libs/zonefile/Wii/zonefile_cod4_wii.h | 2 +- libs/zonefile/Wii/zonefile_cod7_wii.cpp | 63 +- libs/zonefile/Wii/zonefile_cod7_wii.h | 2 +- libs/zonefile/Wii/zonefile_cod8_wii.cpp | 62 +- libs/zonefile/Wii/zonefile_cod8_wii.h | 2 +- libs/zonefile/WiiU/zonefile_cod10_wiiu.cpp | 62 +- libs/zonefile/WiiU/zonefile_cod10_wiiu.h | 2 +- libs/zonefile/WiiU/zonefile_cod9_wiiu.cpp | 62 +- libs/zonefile/WiiU/zonefile_cod9_wiiu.h | 2 +- libs/zonefile/zonefile.cpp | 99 +- libs/zonefile/zonefile.h | 42 +- tests/360/autotest_cod10_360.cpp | 2 +- tests/360/autotest_cod11_360.cpp | 2 +- tests/360/autotest_cod12_360.cpp | 2 +- tests/360/autotest_cod2_360.cpp | 2 +- tests/360/autotest_cod4_360.cpp | 2 +- tests/360/autotest_cod5_360.cpp | 2 +- tests/360/autotest_cod6_360.cpp | 2 +- tests/360/autotest_cod7_360.cpp | 2 +- tests/360/autotest_cod8_360.cpp | 2 +- tests/360/autotest_cod9_360.cpp | 2 +- tests/PC/autotest_cod10_pc.cpp | 2 +- tests/PC/autotest_cod11_pc.cpp | 2 +- tests/PC/autotest_cod12_pc.cpp | 2 +- tests/PC/autotest_cod4_pc.cpp | 2 +- tests/PC/autotest_cod5_pc.cpp | 2 +- tests/PC/autotest_cod6_pc.cpp | 2 +- tests/PC/autotest_cod7_pc.cpp | 2 +- tests/PC/autotest_cod8_pc.cpp | 2 +- tests/PC/autotest_cod9_pc.cpp | 2 +- tests/PS3/autotest_cod10_ps3.cpp | 2 +- tests/PS3/autotest_cod11_ps3.cpp | 2 +- tests/PS3/autotest_cod12_ps3.cpp | 2 +- tests/PS3/autotest_cod4_ps3.cpp | 2 +- tests/PS3/autotest_cod5_ps3.cpp | 2 +- tests/PS3/autotest_cod6_ps3.cpp | 2 +- tests/PS3/autotest_cod7_ps3.cpp | 2 +- tests/PS3/autotest_cod8_ps3.cpp | 2 +- tests/PS3/autotest_cod9_ps3.cpp | 2 +- tests/Wii/autotest_cod4_wii.cpp | 2 +- tests/Wii/autotest_cod7_wii.cpp | 2 +- tests/Wii/autotest_cod8_wii.cpp | 2 +- tests/WiiU/autotest_cod10_wiiu.cpp | 2 +- tests/WiiU/autotest_cod9_wiiu.cpp | 2 +- tests/tests.pro | 40 +- tools/asset_assess/asset_assess.pro | 43 +- tools/asset_assess/mainwindow.cpp | 46 +- tools/compro/compro.pro | 40 +- tools/zentry/zentry.pro | 38 +- 434 files changed, 4525 insertions(+), 21465 deletions(-) delete mode 100644 libs/xassets/360/assets_cod10_360.cpp delete mode 100644 libs/xassets/360/assets_cod10_360.h delete mode 100644 libs/xassets/360/assets_cod11_360.cpp delete mode 100644 libs/xassets/360/assets_cod11_360.h delete mode 100644 libs/xassets/360/assets_cod12_360.cpp delete mode 100644 libs/xassets/360/assets_cod12_360.h delete mode 100644 libs/xassets/360/assets_cod2_360.cpp delete mode 100644 libs/xassets/360/assets_cod2_360.h delete mode 100644 libs/xassets/360/assets_cod4_360.cpp delete mode 100644 libs/xassets/360/assets_cod4_360.h delete mode 100644 libs/xassets/360/assets_cod5_360.cpp delete mode 100644 libs/xassets/360/assets_cod5_360.h delete mode 100644 libs/xassets/360/assets_cod6_360.cpp delete mode 100644 libs/xassets/360/assets_cod6_360.h delete mode 100644 libs/xassets/360/assets_cod7_360.cpp delete mode 100644 libs/xassets/360/assets_cod7_360.h delete mode 100644 libs/xassets/360/assets_cod8_360.cpp delete mode 100644 libs/xassets/360/assets_cod8_360.h delete mode 100644 libs/xassets/360/assets_cod9_360.cpp delete mode 100644 libs/xassets/360/assets_cod9_360.h delete mode 100644 libs/xassets/PC/assets_cod10_pc.cpp delete mode 100644 libs/xassets/PC/assets_cod10_pc.h delete mode 100644 libs/xassets/PC/assets_cod11_pc.cpp delete mode 100644 libs/xassets/PC/assets_cod11_pc.h delete mode 100644 libs/xassets/PC/assets_cod12_pc.cpp delete mode 100644 libs/xassets/PC/assets_cod12_pc.h delete mode 100644 libs/xassets/PC/assets_cod4_pc.cpp delete mode 100644 libs/xassets/PC/assets_cod4_pc.h delete mode 100644 libs/xassets/PC/assets_cod5_pc.cpp delete mode 100644 libs/xassets/PC/assets_cod5_pc.h delete mode 100644 libs/xassets/PC/assets_cod6_pc.cpp delete mode 100644 libs/xassets/PC/assets_cod6_pc.h delete mode 100644 libs/xassets/PC/assets_cod7_pc.cpp delete mode 100644 libs/xassets/PC/assets_cod7_pc.h delete mode 100644 libs/xassets/PC/assets_cod8_pc.cpp delete mode 100644 libs/xassets/PC/assets_cod8_pc.h delete mode 100644 libs/xassets/PC/assets_cod9_pc.cpp delete mode 100644 libs/xassets/PC/assets_cod9_pc.h delete mode 100644 libs/xassets/PS3/assets_cod10_ps3.cpp delete mode 100644 libs/xassets/PS3/assets_cod10_ps3.h delete mode 100644 libs/xassets/PS3/assets_cod11_ps3.cpp delete mode 100644 libs/xassets/PS3/assets_cod11_ps3.h delete mode 100644 libs/xassets/PS3/assets_cod12_ps3.cpp delete mode 100644 libs/xassets/PS3/assets_cod12_ps3.h delete mode 100644 libs/xassets/PS3/assets_cod4_ps3.cpp delete mode 100644 libs/xassets/PS3/assets_cod4_ps3.h delete mode 100644 libs/xassets/PS3/assets_cod5_ps3.cpp delete mode 100644 libs/xassets/PS3/assets_cod5_ps3.h delete mode 100644 libs/xassets/PS3/assets_cod6_ps3.cpp delete mode 100644 libs/xassets/PS3/assets_cod6_ps3.h delete mode 100644 libs/xassets/PS3/assets_cod7_ps3.cpp delete mode 100644 libs/xassets/PS3/assets_cod7_ps3.h delete mode 100644 libs/xassets/PS3/assets_cod8_ps3.cpp delete mode 100644 libs/xassets/PS3/assets_cod8_ps3.h delete mode 100644 libs/xassets/PS3/assets_cod9_ps3.cpp delete mode 100644 libs/xassets/PS3/assets_cod9_ps3.h delete mode 100644 libs/xassets/Wii/assets_cod4_wii.cpp delete mode 100644 libs/xassets/Wii/assets_cod4_wii.h delete mode 100644 libs/xassets/Wii/assets_cod7_wii.cpp delete mode 100644 libs/xassets/Wii/assets_cod7_wii.h delete mode 100644 libs/xassets/Wii/assets_cod8_wii.cpp delete mode 100644 libs/xassets/Wii/assets_cod8_wii.h delete mode 100644 libs/xassets/WiiU/assets_cod10_wiiu.cpp delete mode 100644 libs/xassets/WiiU/assets_cod10_wiiu.h delete mode 100644 libs/xassets/WiiU/assets_cod9_wiiu.cpp delete mode 100644 libs/xassets/WiiU/assets_cod9_wiiu.h delete mode 100644 libs/xassets/assetlist.cpp delete mode 100644 libs/xassets/assetlist.h delete mode 100644 libs/xassets/assetmap.h delete mode 100644 libs/xassets/assets.cpp delete mode 100644 libs/xassets/assets.h delete mode 100644 libs/xassets/font.cpp delete mode 100644 libs/xassets/font.h delete mode 100644 libs/xassets/gfxworld.cpp delete mode 100644 libs/xassets/gfxworld.h delete mode 100644 libs/xassets/materialtechset.cpp delete mode 100644 libs/xassets/materialtechset.h delete mode 100644 libs/xassets/weapondef.cpp delete mode 100644 libs/xassets/weapondef.h delete mode 100644 libs/xassets/xcstaticmodels.cpp delete mode 100644 libs/xassets/xcstaticmodels.h delete mode 100644 libs/xassets/xpathdata.cpp.new delete mode 100644 libs/xassets/xpathdata.h.new diff --git a/libs/compression/compression.cpp b/libs/compression/compression.cpp index 2b5f08a..5029276 100644 --- a/libs/compression/compression.cpp +++ b/libs/compression/compression.cpp @@ -1,5 +1,5 @@ #include "compression.h" -#include "minilzo.h" +//#include "minilzo.h" #define XBOXAPI __declspec(dllimport) #include "xcompress.h" @@ -295,22 +295,23 @@ QByteArray Compression::CompressDeflateWithSettings(const QByteArray &aData, int } QByteArray Compression::DecompressLZO(const QByteArray &aCompressedData, quint32 aDestSize) { - static bool ok = (lzo_init() == LZO_E_OK); - if (!ok) - throw std::runtime_error("lzo_init failed"); + QByteArray dst; + // static bool ok = (lzo_init() == LZO_E_OK); + // if (!ok) + // throw std::runtime_error("lzo_init failed"); - QByteArray dst(aDestSize, Qt::Uninitialized); - lzo_uint out = aDestSize; + // dst = QByteArray(aDestSize, Qt::Uninitialized); + // lzo_uint out = aDestSize; - int rc = lzo1x_decompress_safe( - reinterpret_cast(aCompressedData.constData()), - static_cast(aCompressedData.size()), - reinterpret_cast(dst.data()), - &out, - nullptr); + // int rc = lzo1x_decompress_safe( + // reinterpret_cast(aCompressedData.constData()), + // static_cast(aCompressedData.size()), + // reinterpret_cast(dst.data()), + // &out, + // nullptr); - if (rc != LZO_E_OK || out != aDestSize) - throw std::runtime_error("LZO decompression error"); + // if (rc != LZO_E_OK || out != aDestSize) + // throw std::runtime_error("LZO decompression error"); return dst; } diff --git a/libs/core/core.pro b/libs/core/core.pro index 21730ec..503edaf 100644 --- a/libs/core/core.pro +++ b/libs/core/core.pro @@ -5,4 +5,10 @@ CONFIG += staticlib c++17 SOURCES += $$files($$PWD/*.cpp, true) HEADERS += $$files($$PWD/*.h, true) +LIBS += -L$$OUT_PWD/../libs/xassets -lxassets + +INCLUDEPATH += $$PWD/../xassets + +DEPENDPATH += $$PWD/../xassets + DESTDIR = $$OUT_PWD/../ diff --git a/libs/core/enums.h b/libs/core/enums.h index 698fdbe..b35624e 100644 --- a/libs/core/enums.h +++ b/libs/core/enums.h @@ -3,28 +3,6 @@ #include -enum FF_PLATFORM { - FF_PLATFORM_NONE = 0x00, // No platform - FF_PLATFORM_XBOX = 0x01, // Xbox 360 - FF_PLATFORM_PS3 = 0x02, // Playstation 3 - FF_PLATFORM_PC = 0x03, // PC - FF_PLATFORM_WII = 0x04, // WII - FF_PLATFORM_WIIU = 0x05 // WII U -}; - -enum FF_GAME { - FF_GAME_NONE = 0x00, // No game - FF_GAME_COD1 = 0x01, // Call of Duty - FF_GAME_COD2 = 0x02, // Call of Duty 2 - FF_GAME_COD3 = 0x03, // Call of Duty 3 - FF_GAME_COD4 = 0x04, // Modern Warware 1 - FF_GAME_COD5 = 0x05, // World at War - FF_GAME_COD6 = 0x06, // Modern Warfare 2 - FF_GAME_COD7 = 0x07, // Black Ops 1 - FF_GAME_COD8 = 0x08, // Modern Warfare 3 - FF_GAME_COD9 = 0x09, // Black Ops 2 -}; - enum IWI_VERSION { IWI_VERSION_COD2 = 0x05, // 05 CoD2 IWI_VERSION_COD4 = 0x06, // 06 CoD4 diff --git a/libs/core/utils.h b/libs/core/utils.h index 161c2af..4655f6f 100644 --- a/libs/core/utils.h +++ b/libs/core/utils.h @@ -5,6 +5,8 @@ #include "QtZlib/zlib.h" #include "qdir.h" #include "qicon.h" +#include "xasset.h" +#include "xassettype.h" #include #include @@ -12,158 +14,8 @@ class Utils : public QObject { Q_OBJECT + public: - enum AssetType { - ASSET_NONE = 0x00, - ASSET_RAWFILE = 0x01, - ASSET_SCRIPT_PARSE_TREE = 0x02, - ASSET_FX = 0x03, - ASSET_SOUND_CURVE = 0x04, - ASSET_Animation = 0x05, - ASSET_COLLISION_MAP = 0x06, - ASSET_STRINGTABLE = 0x07, - ASSET_XMODEL_SURFS = 0x08, - ASSET_TECHNIQUE_SET = 0x09, - ASSET_GFX_MAP = 0x11, - ASSET_D3DBSP = 0x15, - ASSET_GAME_MAP_SP = 0x17, - ASSET_COL_MAP_SP = 0x18, - ASSET_PHYSPRESET = 0x19, - ASSET_DESTRUCTIBLE = 0x20, - ASSET_LOCALIZE_ENTRY = 0x21, - ASSET_SHADER = 0x22, - ASSET_MP_MAP = 0x23, - ASSET_SP_MAP = 0x24, - ASSET_SNDDRIVER_GLOBALS = 0x26, - ASSET_AI_TYPE = 0x27, - ASSET_COMPUTE_SHADER_SET = 0x29, - ASSET_LIGHT_DESCRIPTION = 0x30, - ASSET_BIT_FIELD = 0x31, - ASSET_STRUCTURED_TABLE = 0x32, - ASSET_LEADERBOARD_DEF = 0x33, - ASSET_DDL = 0x34, - ASSET_KEY_VALUE_PAIRS = 0x35, - ASSET_SCRIPT_BUNDLE = 0x36, - ASSET_SCRIPT_BUNDLE_LIST = 0x37, - ASSET_MAP_TABLE = 0x38, - ASSET_MAP_TABLE_LOADING_IMAGES = 0x39, - ASSET_SURFACE_SOUND_DEF = 0x40, - ASSET_SURFACE_FX_TABLE = 0x41, - ASSET_RUMBLE = 0x42, - ASSET_AIM_TABLE = 0x43, - ASSET_MEDAL = 0x44, - ASSET_MEDAL_TABLE = 0x45, - ASSET_OBJECTIVE = 0x46, - ASSET_OBJECTIVE_LIST = 0x47, - ASSET_LASER = 0x48, - ASSET_BEAM = 0x49, - ASSET_STREAMER_HINT = 0x50, - ASSET_ANIM_SELECTOR_TABLE = 0x51, - ASSET_ANIM_MAPPING_TABLE = 0x52, - ASSET_ANIM_STATE_MACHINE = 0x53, - ASSET_BEHAVIOR_TREE = 0x54, - ASSET_BEHAVIOR_STATE_MACHINE = 0x55, - ASSET_FOOTSTEP_TABLE = 0x56, - ASSET_ENTITY_FX_IMPACTS = 0x57, - ASSET_ENTITY_SOUND_IMPACTS = 0x58, - ASSET_VEHICLE_FX_DEF = 0x59, - ASSET_VEHICLE_SOUND_DEF = 0x60, - ASSET_VEHICLE = 0x61, - ASSET_VEHICLE_TRACER = 0x62, - ASSET_PLAYER_SOUNDS_TABLE = 0x63, - ASSET_PLAYER_FX_TABLE = 0x64, - ASSET_SHARED_WEAPON_SOUNDS = 0x65, - ASSET_ATTACHMENT = 0x66, - ASSET_ATTACHMENT_UNIQUE = 0x67, - ASSET_WEAPON_CAMO = 0x68, - ASSET_CUSTOMIZATION_TABLE = 0x69, - ASSET_CUSTOMIZATION_TABLE_FEIMAGES = 0x70, - ASSET_CUSTOMIZATION_TABLE_COLOR = 0x71, - ASSET_PHYS_CONSTRAINTS = 0x72, - ASSET_DESTRUCTIBLE_DEF = 0x73, - ASSET_XMODEL_MESH = 0x74, - ASSET_S_ANIM = 0x75, - ASSET_FONT_ICON = 0x76, - ASSET_CG_MEDIA_TABLE = 0x77, - ASSET_SHOCK_FILE = 0x78, - ASSET_ZONE_FILE = 0x79, - ASSET_FAST_FILE = 0x80, - ASSET_SOUND_DRIVER_GLOBALS = 0x81, - ASSET_XMODELPIECES = 0x82, - ASSET_XMODEL = 0x85, - ASSET_MATERIAL = 0x86, - ASSET_PIXELSHADER = 0x87, - ASSET_IMAGE = 0x89, - ASSET_SOUND = 0x90, - ASSET_LOADED_SOUND = 0x92, - ASSET_CLIPMAP = 0x93, - ASSET_CLIPMAP_PVS = 0x94, - ASSET_COMWORLD = 0x95, - ASSET_GAMEWORLD_SP = 0x96, - ASSET_GAMEWORLD_MP = 0x97, - ASSET_MAP_ENTS = 0x98, - ASSET_GFXWORLD = 0x99, - ASSET_LIGHT_DEF = 0x100, - ASSET_UI_MAP = 0x101, - ASSET_FONT = 0x102, - ASSET_MENULIST = 0x103, - ASSET_MENU = 0x104, - ASSET_WEAPON = 0x106, - ASSET_IMPACT_FX = 0x109, - ASSET_AITYPE = 0x110, - ASSET_MPTYPE = 0x111, - ASSET_CHARACTER = 0x112, - ASSET_XMODELALIAS = 0x113, - ASSET_COUNT = 0x116, - ASSET_STRING = 0x117, - ASSET_ASSETLIST = 0x118, - ASSET_PHYSCOLLMAP = 0x119, - ASSET_CLIPMAP_SP = 0x120, - ASSET_CLIPMAP_MP = 0x121, - ASSET_FXWORLD = 0x122, - ASSET_LEADERBOARD = 0x123, - ASSET_STRUCTURED_DATA_DEF = 0x124, - ASSET_TRACER = 0x125, - ASSET_ADDON_MAP_ENTS = 0x126, - ASSET_GLASSWORLD = 0x127, - ASSET_PATHDATA = 0x128, - ASSET_VEHICLE_TRACK = 0x129, - ASSET_SURFACE_FX = 0x130, - ASSET_SCRIPTFILE = 0x131, - ASSET_SOUND_SUBMIX = 0x132, - ASSET_SOUND_EVENT = 0x133, - ASSET_LPF_CURVE = 0x134, - ASSET_REVERB_CURVE = 0x135, - ASSET_GFXWORLD_TRANSIENT_ZONE = 0x136, - ASSET_ANIMCLASS = 0x137, - ASSET_NET_CONST_STRINGS = 0x138, - ASSET_REVERB_PRESET = 0x139, - ASSET_LUA_FILE = 0x140, - ASSET_SCRIPTABLE = 0x141, - ASSET_EQUIPMENT_SND_TABLE = 0x142, - ASSET_DOPPLER_PRESET = 0x143, - ASSET_SKELETON_SCRIPT = 0x144, - ASSET_PHYSCONSTRAINTS = 0x145, - ASSET_DESTRUCTIBLEDEF = 0x146, - ASSET_SOUND_PATCH = 0x147, - ASSET_WEAPONDEF = 0x148, - ASSET_WEAPON_VARIANT = 0x149, - ASSET_MPBODY = 0x150, - ASSET_MPHEAD = 0x151, - ASSET_PACK_INDEX = 0x152, - ASSET_XGLOBALS = 0x153, - ASSET_GLASSES = 0x154, - ASSET_EMBLEMSET = 0x155 - }; - Q_ENUM(AssetType) - - static QString AssetTypeToStr(Utils::AssetType aAssetType) { - const QMetaObject &mo = Utils::staticMetaObject; - int index = mo.indexOfEnumerator("AssetType"); - QMetaEnum metaEnum = mo.enumerator(index); - return QString::fromLatin1(metaEnum.valueToKey(aAssetType)); - } - static bool ExportData(const QString aFileName, const QByteArray aData) { QDir workingDir = QDir::currentPath(); workingDir.mkdir("exports"); @@ -182,18 +34,28 @@ public: b = (b & 0xAA) >> 1 | (b & 0x55) << 1; return b; } - static QIcon CreateAssetIcon(Utils::AssetType aAssetType, QColor color = QColor()) { - const QString assetTypeStr = AssetTypeToStr(aAssetType); + static QIcon CreateAssetIcon(XAssetType aAssetType, QColor color = QColor()) { + const QString assetTypeStr = XAsset::XAssetTypeToString(aAssetType); - QString name; - const QStringList parts = assetTypeStr.split('_').mid(1); - foreach (const QString part, parts) { - name += part[0]; + QString assetAbbr; + for (int i = 0; i < assetTypeStr.length(); i++) + { + if (assetTypeStr[i].isUpper()) + { + assetAbbr += assetTypeStr[i]; + } } - if (parts.size() == 1) { - name += parts.first()[1]; - } - return CreateAssetIcon(name, color); + return CreateAssetIcon(assetAbbr, color); + + // QString name; + // const QStringList parts = assetTypeStr.split('_').mid(1); + // foreach (const QString part, parts) { + // name += part[0]; + // } + // if (parts.size() == 1) { + // name += parts.first()[1]; + // } + // return CreateAssetIcon(name, color); } static QIcon CreateAssetIcon(const QString& name, QColor color = QColor()) { constexpr int iconSize = 32; diff --git a/libs/ddsfile/ddsfile.cpp b/libs/ddsfile/ddsfile.cpp index bc99b47..7e7baf1 100644 --- a/libs/ddsfile/ddsfile.cpp +++ b/libs/ddsfile/ddsfile.cpp @@ -35,7 +35,7 @@ DDSPixelFormat DDSFile::CalculatePixelFormat(quint8 aIWIFormat) { return ddsPixelFormat; } -void DDSFile::SetupExportDirs() { +void DDSFile::SetupExportDirs() const { QDir dir = QDir::currentPath(); if (!dir.exists("exports/")) { dir.mkdir("exports/"); @@ -248,7 +248,7 @@ DDSFile &DDSFile::operator=(const DDSFile &other) { } // Write a DDS file from a DDSFile object -bool DDSFile::SaveDDS() { +bool DDSFile::SaveDDS() const { SetupExportDirs(); QFile file("exports/dds/" + fileStem + ".dds"); @@ -268,7 +268,7 @@ bool DDSFile::SaveDDS() { return true; } -bool DDSFile::SaveIWI() { +bool DDSFile::SaveIWI() const { SetupExportDirs(); IWIFile iwiFile(*this); @@ -279,7 +279,7 @@ bool DDSFile::SaveIWI() { return true; } -bool DDSFile::SavePNG() { +bool DDSFile::SavePNG() const { SetupExportDirs(); int mipmapIndex = 1; @@ -311,7 +311,7 @@ bool DDSFile::SavePNG() { return true; } -bool DDSFile::SaveJPG() { +bool DDSFile::SaveJPG() const { SetupExportDirs(); int mipmapIndex = 1; diff --git a/libs/ddsfile/ddsfile.h b/libs/ddsfile/ddsfile.h index a807e62..bf43bbf 100644 --- a/libs/ddsfile/ddsfile.h +++ b/libs/ddsfile/ddsfile.h @@ -68,12 +68,12 @@ public: DDSFile(const DDSFile &ddsFile); DDSFile& operator=(const DDSFile& other); - bool SaveDDS(); - bool SaveIWI(); - bool SavePNG(); - bool SaveJPG(); + bool SaveDDS() const; + bool SaveIWI() const; + bool SavePNG() const; + bool SaveJPG() const; - void SetupExportDirs(); + void SetupExportDirs() const; static DDSPixelFormat CalculatePixelFormat(quint8 aIWIFormat); private: diff --git a/libs/fastfile/360/fastfile_cod10_360.cpp b/libs/fastfile/360/fastfile_cod10_360.cpp index 005d649..04b0086 100644 --- a/libs/fastfile/360/fastfile_cod10_360.cpp +++ b/libs/fastfile/360/fastfile_cod10_360.cpp @@ -36,7 +36,7 @@ FastFile_COD10_360::~FastFile_COD10_360() { } -QByteArray FastFile_COD10_360::GetBinaryData() { +QByteArray FastFile_COD10_360::GetBinaryData() const { return QByteArray(); } @@ -106,10 +106,13 @@ bool FastFile_COD10_360::Load(const QByteArray aData) { } // Load the zone file with the decompressed data (using an Xbox platform flag). - ZoneFile_COD10_360 zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - zoneFile.Load(decompressedData); - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD10_360* zoneFile = new ZoneFile_COD10_360(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/360/fastfile_cod10_360.h b/libs/fastfile/360/fastfile_cod10_360.h index b0574a1..2eacc4d 100644 --- a/libs/fastfile/360/fastfile_cod10_360.h +++ b/libs/fastfile/360/fastfile_cod10_360.h @@ -11,7 +11,7 @@ public: FastFile_COD10_360(const QString aFilePath); ~FastFile_COD10_360(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/360/fastfile_cod11_360.cpp b/libs/fastfile/360/fastfile_cod11_360.cpp index 33477b2..e7bd70c 100644 --- a/libs/fastfile/360/fastfile_cod11_360.cpp +++ b/libs/fastfile/360/fastfile_cod11_360.cpp @@ -38,7 +38,7 @@ FastFile_COD11_360::~FastFile_COD11_360() { } -QByteArray FastFile_COD11_360::GetBinaryData() { +QByteArray FastFile_COD11_360::GetBinaryData() const { return QByteArray(); } @@ -94,14 +94,13 @@ bool FastFile_COD11_360::Load(const QByteArray aData) { Utils::ExportData(GetBaseStem() + ".zone", decompressedData); // Load the zone file with decompressed data - ZoneFile_COD11_360 zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - if (!zoneFile.Load(decompressedData)) { + ZoneFile_COD11_360* zoneFile = new ZoneFile_COD11_360(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { qWarning() << "Failed to load ZoneFile!"; return false; } - - SetZoneFile(std::make_shared(zoneFile)); + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/360/fastfile_cod11_360.h b/libs/fastfile/360/fastfile_cod11_360.h index a14c43c..e4fcca1 100644 --- a/libs/fastfile/360/fastfile_cod11_360.h +++ b/libs/fastfile/360/fastfile_cod11_360.h @@ -11,7 +11,7 @@ public: FastFile_COD11_360(const QString aFilePath); ~FastFile_COD11_360(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/360/fastfile_cod12_360.cpp b/libs/fastfile/360/fastfile_cod12_360.cpp index 8e051b9..8e1b4c2 100644 --- a/libs/fastfile/360/fastfile_cod12_360.cpp +++ b/libs/fastfile/360/fastfile_cod12_360.cpp @@ -38,7 +38,7 @@ FastFile_COD12_360::~FastFile_COD12_360() { } -QByteArray FastFile_COD12_360::GetBinaryData() { +QByteArray FastFile_COD12_360::GetBinaryData() const { return QByteArray(); } @@ -94,14 +94,13 @@ bool FastFile_COD12_360::Load(const QByteArray aData) { Utils::ExportData(GetBaseStem() + ".zone", decompressedData); // Load the zone file with decompressed data - ZoneFile_COD12_360 zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - if (!zoneFile.Load(decompressedData)) { + ZoneFile_COD12_360* zoneFile = new ZoneFile_COD12_360(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { qWarning() << "Failed to load ZoneFile!"; return false; } - - SetZoneFile(std::make_shared(zoneFile)); + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/360/fastfile_cod12_360.h b/libs/fastfile/360/fastfile_cod12_360.h index 082d89a..ef5027d 100644 --- a/libs/fastfile/360/fastfile_cod12_360.h +++ b/libs/fastfile/360/fastfile_cod12_360.h @@ -11,7 +11,7 @@ public: FastFile_COD12_360(const QString aFilePath); ~FastFile_COD12_360(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/360/fastfile_cod2_360.cpp b/libs/fastfile/360/fastfile_cod2_360.cpp index bf234d8..6c33a9f 100644 --- a/libs/fastfile/360/fastfile_cod2_360.cpp +++ b/libs/fastfile/360/fastfile_cod2_360.cpp @@ -38,7 +38,7 @@ FastFile_COD2_360::~FastFile_COD2_360() { } -QByteArray FastFile_COD2_360::GetBinaryData() { +QByteArray FastFile_COD2_360::GetBinaryData() const { return QByteArray(); } @@ -79,10 +79,13 @@ bool FastFile_COD2_360::Load(const QByteArray aData) { Utils::ExportData(GetBaseStem() + ".zone", decompressedData); // Load the zone file with the decompressed data (using an Xbox platform flag). - ZoneFile_COD2_360 zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - zoneFile.Load(decompressedData); - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD2_360* zoneFile = new ZoneFile_COD2_360(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/360/fastfile_cod2_360.h b/libs/fastfile/360/fastfile_cod2_360.h index d1fe760..01ebc41 100644 --- a/libs/fastfile/360/fastfile_cod2_360.h +++ b/libs/fastfile/360/fastfile_cod2_360.h @@ -11,7 +11,7 @@ public: FastFile_COD2_360(const QString aFilePath); ~FastFile_COD2_360(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/360/fastfile_cod4_360.cpp b/libs/fastfile/360/fastfile_cod4_360.cpp index c191177..90fbb14 100644 --- a/libs/fastfile/360/fastfile_cod4_360.cpp +++ b/libs/fastfile/360/fastfile_cod4_360.cpp @@ -39,7 +39,7 @@ FastFile_COD4_360::~FastFile_COD4_360() { } -QByteArray FastFile_COD4_360::GetBinaryData() { +QByteArray FastFile_COD4_360::GetBinaryData() const { return QByteArray(); } @@ -128,10 +128,13 @@ bool FastFile_COD4_360::Load(const QByteArray aData) { } Utils::ExportData(GetBaseStem() + ".zone", decompressedData); - ZoneFile_COD4_360 zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - zoneFile.Load(decompressedData); - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD4_360* zoneFile = new ZoneFile_COD4_360(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/360/fastfile_cod4_360.h b/libs/fastfile/360/fastfile_cod4_360.h index 5f8cdb2..c24fefc 100644 --- a/libs/fastfile/360/fastfile_cod4_360.h +++ b/libs/fastfile/360/fastfile_cod4_360.h @@ -11,7 +11,7 @@ public: FastFile_COD4_360(const QString aFilePath); ~FastFile_COD4_360(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/360/fastfile_cod5_360.cpp b/libs/fastfile/360/fastfile_cod5_360.cpp index 1488c3c..8f6b65e 100644 --- a/libs/fastfile/360/fastfile_cod5_360.cpp +++ b/libs/fastfile/360/fastfile_cod5_360.cpp @@ -39,7 +39,7 @@ FastFile_COD5_360::~FastFile_COD5_360() { } -QByteArray FastFile_COD5_360::GetBinaryData() { +QByteArray FastFile_COD5_360::GetBinaryData() const { return QByteArray(); } @@ -80,10 +80,13 @@ bool FastFile_COD5_360::Load(const QByteArray aData) { Utils::ExportData(GetBaseStem() + ".zone", decompressedData); - ZoneFile_COD5_360 zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - zoneFile.Load(decompressedData); - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD5_360* zoneFile = new ZoneFile_COD5_360(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/360/fastfile_cod5_360.h b/libs/fastfile/360/fastfile_cod5_360.h index 80ba475..5e2dd54 100644 --- a/libs/fastfile/360/fastfile_cod5_360.h +++ b/libs/fastfile/360/fastfile_cod5_360.h @@ -11,7 +11,7 @@ public: FastFile_COD5_360(const QString aFilePath); ~FastFile_COD5_360(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/360/fastfile_cod6_360.cpp b/libs/fastfile/360/fastfile_cod6_360.cpp index 51d2132..a22896d 100644 --- a/libs/fastfile/360/fastfile_cod6_360.cpp +++ b/libs/fastfile/360/fastfile_cod6_360.cpp @@ -39,7 +39,7 @@ FastFile_COD6_360::~FastFile_COD6_360() { } -QByteArray FastFile_COD6_360::GetBinaryData() { +QByteArray FastFile_COD6_360::GetBinaryData() const { return QByteArray(); } @@ -78,31 +78,30 @@ bool FastFile_COD6_360::Load(const QByteArray aData) { } QByteArray compressed = aData.mid(zlibOffset); - // 2. Try plain decompression first ------------------------------ - QByteArray decompressed = Compression::DecompressZLIB(compressed); + QByteArray decompressedData = Compression::DecompressZLIB(compressed); - // 3. If that failed or looks too small, try stripping hash blocks - if (decompressed.isEmpty() || decompressed.size() < 1024) + if (decompressedData.isEmpty() || decompressedData.size() < 1024) { QByteArray stripped = Compression::StripHashBlocks(compressed); QByteArray retry = Compression::DecompressZLIB(stripped); if (!retry.isEmpty()) - decompressed.swap(retry); + decompressedData.swap(retry); } - if (decompressed.isEmpty()) + if (decompressedData.isEmpty()) { qWarning() << "Unable to decompress fast-file"; return false; } - // Optional – keep a copy on disk for quick inspection - Utils::ExportData(GetBaseStem() + ".zone", decompressed); + Utils::ExportData(GetBaseStem() + ".zone", decompressedData); - // 4. Forward to zone-file loader -------------------------------- - auto zoneFile = std::make_shared(); - zoneFile->SetStem(GetStem()); - zoneFile->Load(decompressed); + ZoneFile_COD6_360* zoneFile = new ZoneFile_COD6_360(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } SetZoneFile(zoneFile); return true; diff --git a/libs/fastfile/360/fastfile_cod6_360.h b/libs/fastfile/360/fastfile_cod6_360.h index 8a7f430..89c7eb4 100644 --- a/libs/fastfile/360/fastfile_cod6_360.h +++ b/libs/fastfile/360/fastfile_cod6_360.h @@ -11,7 +11,7 @@ public: FastFile_COD6_360(const QString aFilePath); ~FastFile_COD6_360(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/360/fastfile_cod7_360.cpp b/libs/fastfile/360/fastfile_cod7_360.cpp index 3998536..baf4ee7 100644 --- a/libs/fastfile/360/fastfile_cod7_360.cpp +++ b/libs/fastfile/360/fastfile_cod7_360.cpp @@ -38,7 +38,7 @@ FastFile_COD7_360::~FastFile_COD7_360() { } -QByteArray FastFile_COD7_360::GetBinaryData() { +QByteArray FastFile_COD7_360::GetBinaryData() const { return QByteArray(); } @@ -75,10 +75,6 @@ bool FastFile_COD7_360::Load(const QByteArray aData) { QDataStream fastFileStream(aData); fastFileStream.skipRawData(12); - // Load the zone file with the decompressed data (using an Xbox platform flag). - ZoneFile_COD7_360 zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - // For COD7/COD9, use BigEndian. fastFileStream.setByteOrder(QDataStream::BigEndian); @@ -145,9 +141,13 @@ bool FastFile_COD7_360::Load(const QByteArray aData) { } Utils::ExportData(GetBaseStem() + ".zone", decompressedData); - zoneFile.Load(decompressedData); - - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD7_360* zoneFile = new ZoneFile_COD7_360(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/360/fastfile_cod7_360.h b/libs/fastfile/360/fastfile_cod7_360.h index a30972c..ef4f08f 100644 --- a/libs/fastfile/360/fastfile_cod7_360.h +++ b/libs/fastfile/360/fastfile_cod7_360.h @@ -11,7 +11,7 @@ public: FastFile_COD7_360(const QString aFilePath); ~FastFile_COD7_360(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/360/fastfile_cod8_360.cpp b/libs/fastfile/360/fastfile_cod8_360.cpp index 746fc9e..892fc2c 100644 --- a/libs/fastfile/360/fastfile_cod8_360.cpp +++ b/libs/fastfile/360/fastfile_cod8_360.cpp @@ -36,7 +36,7 @@ FastFile_COD8_360::~FastFile_COD8_360() { } -QByteArray FastFile_COD8_360::GetBinaryData() { +QByteArray FastFile_COD8_360::GetBinaryData() const { return QByteArray(); } @@ -106,10 +106,13 @@ bool FastFile_COD8_360::Load(const QByteArray aData) { } // Load the zone file with the decompressed data (using an Xbox platform flag). - ZoneFile_COD8_360 zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - zoneFile.Load(decompressedData); - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD8_360* zoneFile = new ZoneFile_COD8_360(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/360/fastfile_cod8_360.h b/libs/fastfile/360/fastfile_cod8_360.h index 793cc5a..cd843fa 100644 --- a/libs/fastfile/360/fastfile_cod8_360.h +++ b/libs/fastfile/360/fastfile_cod8_360.h @@ -11,7 +11,7 @@ public: FastFile_COD8_360(const QString aFilePath); ~FastFile_COD8_360(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/360/fastfile_cod9_360.cpp b/libs/fastfile/360/fastfile_cod9_360.cpp index 1362e59..108a68a 100644 --- a/libs/fastfile/360/fastfile_cod9_360.cpp +++ b/libs/fastfile/360/fastfile_cod9_360.cpp @@ -36,7 +36,7 @@ FastFile_COD9_360::~FastFile_COD9_360() { } -QByteArray FastFile_COD9_360::GetBinaryData() { +QByteArray FastFile_COD9_360::GetBinaryData() const { return QByteArray(); } @@ -106,10 +106,13 @@ bool FastFile_COD9_360::Load(const QByteArray aData) { } // Load the zone file with the decompressed data (using an Xbox platform flag). - ZoneFile_COD9_360 zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - zoneFile.Load(decompressedData); - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD9_360* zoneFile = new ZoneFile_COD9_360(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/360/fastfile_cod9_360.h b/libs/fastfile/360/fastfile_cod9_360.h index 84fa4a8..5bdfa85 100644 --- a/libs/fastfile/360/fastfile_cod9_360.h +++ b/libs/fastfile/360/fastfile_cod9_360.h @@ -11,7 +11,7 @@ public: FastFile_COD9_360(const QString aFilePath); ~FastFile_COD9_360(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/PC/fastfile_cod10_pc.cpp b/libs/fastfile/PC/fastfile_cod10_pc.cpp index fcde932..3ce41fb 100644 --- a/libs/fastfile/PC/fastfile_cod10_pc.cpp +++ b/libs/fastfile/PC/fastfile_cod10_pc.cpp @@ -36,7 +36,7 @@ FastFile_COD10_PC::~FastFile_COD10_PC() { } -QByteArray FastFile_COD10_PC::GetBinaryData() { +QByteArray FastFile_COD10_PC::GetBinaryData() const { return QByteArray(); } @@ -128,10 +128,13 @@ bool FastFile_COD10_PC::Load(const QByteArray aData) { } // Load the zone file with the decompressed data (using an Xbox platform flag). - ZoneFile_COD10_PC zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - zoneFile.Load(decompressedData); - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD10_PC* zoneFile = new ZoneFile_COD10_PC(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/PC/fastfile_cod10_pc.h b/libs/fastfile/PC/fastfile_cod10_pc.h index c4041d4..d41a702 100644 --- a/libs/fastfile/PC/fastfile_cod10_pc.h +++ b/libs/fastfile/PC/fastfile_cod10_pc.h @@ -11,7 +11,7 @@ public: FastFile_COD10_PC(const QString aFilePath); ~FastFile_COD10_PC(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/PC/fastfile_cod11_pc.cpp b/libs/fastfile/PC/fastfile_cod11_pc.cpp index 300e1eb..8b059b2 100644 --- a/libs/fastfile/PC/fastfile_cod11_pc.cpp +++ b/libs/fastfile/PC/fastfile_cod11_pc.cpp @@ -36,7 +36,7 @@ FastFile_COD11_PC::~FastFile_COD11_PC() { } -QByteArray FastFile_COD11_PC::GetBinaryData() { +QByteArray FastFile_COD11_PC::GetBinaryData() const { return QByteArray(); } @@ -128,10 +128,13 @@ bool FastFile_COD11_PC::Load(const QByteArray aData) { } // Load the zone file with the decompressed data (using an Xbox platform flag). - ZoneFile_COD11_PC zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - zoneFile.Load(decompressedData); - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD11_PC* zoneFile = new ZoneFile_COD11_PC(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/PC/fastfile_cod11_pc.h b/libs/fastfile/PC/fastfile_cod11_pc.h index cf493d5..033fff4 100644 --- a/libs/fastfile/PC/fastfile_cod11_pc.h +++ b/libs/fastfile/PC/fastfile_cod11_pc.h @@ -11,7 +11,7 @@ public: FastFile_COD11_PC(const QString aFilePath); ~FastFile_COD11_PC(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/PC/fastfile_cod12_pc.cpp b/libs/fastfile/PC/fastfile_cod12_pc.cpp index b405990..189a3eb 100644 --- a/libs/fastfile/PC/fastfile_cod12_pc.cpp +++ b/libs/fastfile/PC/fastfile_cod12_pc.cpp @@ -39,7 +39,7 @@ FastFile_COD12_PC::~FastFile_COD12_PC() { } -QByteArray FastFile_COD12_PC::GetBinaryData() { +QByteArray FastFile_COD12_PC::GetBinaryData() const { return QByteArray(); } @@ -76,10 +76,6 @@ bool FastFile_COD12_PC::Load(const QByteArray aData) { QDataStream fastFileStream(aData); fastFileStream.setByteOrder(QDataStream::LittleEndian); - // Load the zone file with the decompressed data (using an Xbox platform flag). - ZoneFile_COD12_PC zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - // Skip header magic fastFileStream.skipRawData(8); @@ -143,9 +139,14 @@ bool FastFile_COD12_PC::Load(const QByteArray aData) { Utils::ExportData(GetBaseStem() + ".zone", decompressedData); - zoneFile.Load(decompressedData); - - SetZoneFile(std::make_shared(zoneFile)); + // Load the zone file with the decompressed data (using an Xbox platform flag). + ZoneFile_COD12_PC* zoneFile = new ZoneFile_COD12_PC(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/PC/fastfile_cod12_pc.h b/libs/fastfile/PC/fastfile_cod12_pc.h index 5613275..e7168ad 100644 --- a/libs/fastfile/PC/fastfile_cod12_pc.h +++ b/libs/fastfile/PC/fastfile_cod12_pc.h @@ -11,7 +11,7 @@ public: FastFile_COD12_PC(const QString aFilePath); ~FastFile_COD12_PC(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/PC/fastfile_cod4_pc.cpp b/libs/fastfile/PC/fastfile_cod4_pc.cpp index a2fe992..5d64eac 100644 --- a/libs/fastfile/PC/fastfile_cod4_pc.cpp +++ b/libs/fastfile/PC/fastfile_cod4_pc.cpp @@ -39,7 +39,7 @@ FastFile_COD4_PC::~FastFile_COD4_PC() { } -QByteArray FastFile_COD4_PC::GetBinaryData() { +QByteArray FastFile_COD4_PC::GetBinaryData() const { return QByteArray(); } @@ -84,10 +84,13 @@ bool FastFile_COD4_PC::Load(const QByteArray aData) { Utils::ExportData(GetBaseStem() + ".zone", decompressedData); - ZoneFile_COD4_PC zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - zoneFile.Load(decompressedData); - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD4_PC* zoneFile = new ZoneFile_COD4_PC(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/PC/fastfile_cod4_pc.h b/libs/fastfile/PC/fastfile_cod4_pc.h index 3b5e3d0..5580aff 100644 --- a/libs/fastfile/PC/fastfile_cod4_pc.h +++ b/libs/fastfile/PC/fastfile_cod4_pc.h @@ -11,7 +11,7 @@ public: FastFile_COD4_PC(const QString aFilePath); ~FastFile_COD4_PC(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/PC/fastfile_cod5_pc.cpp b/libs/fastfile/PC/fastfile_cod5_pc.cpp index 6cb91f0..57d9b8b 100644 --- a/libs/fastfile/PC/fastfile_cod5_pc.cpp +++ b/libs/fastfile/PC/fastfile_cod5_pc.cpp @@ -39,7 +39,7 @@ FastFile_COD5_PC::~FastFile_COD5_PC() { } -QByteArray FastFile_COD5_PC::GetBinaryData() { +QByteArray FastFile_COD5_PC::GetBinaryData() const { return QByteArray(); } @@ -84,10 +84,13 @@ bool FastFile_COD5_PC::Load(const QByteArray aData) { Utils::ExportData(GetBaseStem() + ".zone", decompressedData); - ZoneFile_COD5_PC zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - zoneFile.Load(decompressedData); - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD5_PC* zoneFile = new ZoneFile_COD5_PC(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/PC/fastfile_cod5_pc.h b/libs/fastfile/PC/fastfile_cod5_pc.h index 7251203..4e2bccd 100644 --- a/libs/fastfile/PC/fastfile_cod5_pc.h +++ b/libs/fastfile/PC/fastfile_cod5_pc.h @@ -11,7 +11,7 @@ public: FastFile_COD5_PC(const QString aFilePath); ~FastFile_COD5_PC(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/PC/fastfile_cod6_pc.cpp b/libs/fastfile/PC/fastfile_cod6_pc.cpp index 00413af..f25c64c 100644 --- a/libs/fastfile/PC/fastfile_cod6_pc.cpp +++ b/libs/fastfile/PC/fastfile_cod6_pc.cpp @@ -39,7 +39,7 @@ FastFile_COD6_PC::~FastFile_COD6_PC() { } -QByteArray FastFile_COD6_PC::GetBinaryData() { +QByteArray FastFile_COD6_PC::GetBinaryData() const { return QByteArray(); } @@ -81,10 +81,13 @@ bool FastFile_COD6_PC::Load(const QByteArray aData) { Utils::ExportData(GetBaseStem() + ".zone", decompressedData); - ZoneFile_COD6_PC zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - zoneFile.Load(decompressedData); - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD6_PC* zoneFile = new ZoneFile_COD6_PC(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/PC/fastfile_cod6_pc.h b/libs/fastfile/PC/fastfile_cod6_pc.h index 8670c99..9e4fb10 100644 --- a/libs/fastfile/PC/fastfile_cod6_pc.h +++ b/libs/fastfile/PC/fastfile_cod6_pc.h @@ -11,7 +11,7 @@ public: FastFile_COD6_PC(const QString aFilePath); ~FastFile_COD6_PC(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/PC/fastfile_cod7_pc.cpp b/libs/fastfile/PC/fastfile_cod7_pc.cpp index 1bebcd9..a2f4ab6 100644 --- a/libs/fastfile/PC/fastfile_cod7_pc.cpp +++ b/libs/fastfile/PC/fastfile_cod7_pc.cpp @@ -39,7 +39,7 @@ FastFile_COD7_PC::~FastFile_COD7_PC() { } -QByteArray FastFile_COD7_PC::GetBinaryData() { +QByteArray FastFile_COD7_PC::GetBinaryData() const { return QByteArray(); } @@ -86,19 +86,19 @@ bool FastFile_COD7_PC::Load(const QByteArray aData) { SetPlatform("360"); SetGame("COD7"); - // Load the zone file with the decompressed data (using an Xbox platform flag). - ZoneFile_COD7_PC zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - // Assume the first 12 bytes are a header; the rest is zlib-compressed zone data. const QByteArray compressedData = aData.mid(12); decompressedData = Compression::DecompressZLIB(compressedData); Utils::ExportData(GetBaseStem() + ".zone", decompressedData); - zoneFile.Load(decompressedData); - - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD7_PC* zoneFile = new ZoneFile_COD7_PC(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/PC/fastfile_cod7_pc.h b/libs/fastfile/PC/fastfile_cod7_pc.h index 5372582..f1ab448 100644 --- a/libs/fastfile/PC/fastfile_cod7_pc.h +++ b/libs/fastfile/PC/fastfile_cod7_pc.h @@ -11,7 +11,7 @@ public: FastFile_COD7_PC(const QString aFilePath); ~FastFile_COD7_PC(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/PC/fastfile_cod8_pc.cpp b/libs/fastfile/PC/fastfile_cod8_pc.cpp index 85629dd..0f47f33 100644 --- a/libs/fastfile/PC/fastfile_cod8_pc.cpp +++ b/libs/fastfile/PC/fastfile_cod8_pc.cpp @@ -39,7 +39,7 @@ FastFile_COD8_PC::~FastFile_COD8_PC() { } -QByteArray FastFile_COD8_PC::GetBinaryData() { +QByteArray FastFile_COD8_PC::GetBinaryData() const { return QByteArray(); } @@ -86,10 +86,6 @@ bool FastFile_COD8_PC::Load(const QByteArray aData) { SetPlatform(pCalculateFFPlatform(version)); SetGame("COD7"); - // Load the zone file with the decompressed data (using an Xbox platform flag). - ZoneFile_COD8_PC zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - // For COD7/COD9, use BigEndian. fastFileStream.setByteOrder(QDataStream::LittleEndian); @@ -162,9 +158,13 @@ bool FastFile_COD8_PC::Load(const QByteArray aData) { sectionIndex++; } - zoneFile.Load(decompressedData); - - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD8_PC* zoneFile = new ZoneFile_COD8_PC(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/PC/fastfile_cod8_pc.h b/libs/fastfile/PC/fastfile_cod8_pc.h index 2476836..392c175 100644 --- a/libs/fastfile/PC/fastfile_cod8_pc.h +++ b/libs/fastfile/PC/fastfile_cod8_pc.h @@ -11,7 +11,7 @@ public: FastFile_COD8_PC(const QString aFilePath); ~FastFile_COD8_PC(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/PC/fastfile_cod9_pc.cpp b/libs/fastfile/PC/fastfile_cod9_pc.cpp index 7bb5b77..f4814a5 100644 --- a/libs/fastfile/PC/fastfile_cod9_pc.cpp +++ b/libs/fastfile/PC/fastfile_cod9_pc.cpp @@ -36,7 +36,7 @@ FastFile_COD9_PC::~FastFile_COD9_PC() { } -QByteArray FastFile_COD9_PC::GetBinaryData() { +QByteArray FastFile_COD9_PC::GetBinaryData() const { return QByteArray(); } @@ -128,10 +128,13 @@ bool FastFile_COD9_PC::Load(const QByteArray aData) { } // Load the zone file with the decompressed data (using an Xbox platform flag). - ZoneFile_COD9_PC zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - zoneFile.Load(decompressedData); - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD9_PC* zoneFile = new ZoneFile_COD9_PC(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/PC/fastfile_cod9_pc.h b/libs/fastfile/PC/fastfile_cod9_pc.h index 144e680..32c2260 100644 --- a/libs/fastfile/PC/fastfile_cod9_pc.h +++ b/libs/fastfile/PC/fastfile_cod9_pc.h @@ -11,7 +11,7 @@ public: FastFile_COD9_PC(const QString aFilePath); ~FastFile_COD9_PC(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/PS3/fastfile_cod10_ps3.cpp b/libs/fastfile/PS3/fastfile_cod10_ps3.cpp index b8535a3..3efd72d 100644 --- a/libs/fastfile/PS3/fastfile_cod10_ps3.cpp +++ b/libs/fastfile/PS3/fastfile_cod10_ps3.cpp @@ -36,7 +36,7 @@ FastFile_COD10_PS3::~FastFile_COD10_PS3() { } -QByteArray FastFile_COD10_PS3::GetBinaryData() { +QByteArray FastFile_COD10_PS3::GetBinaryData() const { return QByteArray(); } @@ -128,10 +128,13 @@ bool FastFile_COD10_PS3::Load(const QByteArray aData) { } // Load the zone file with the decompressed data (using an Xbox platform flag). - ZoneFile_COD10_PS3 zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - zoneFile.Load(decompressedData); - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD10_PS3* zoneFile = new ZoneFile_COD10_PS3(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/PS3/fastfile_cod10_ps3.h b/libs/fastfile/PS3/fastfile_cod10_ps3.h index 885d4cc..0fcaae5 100644 --- a/libs/fastfile/PS3/fastfile_cod10_ps3.h +++ b/libs/fastfile/PS3/fastfile_cod10_ps3.h @@ -11,7 +11,7 @@ public: FastFile_COD10_PS3(const QString aFilePath); ~FastFile_COD10_PS3(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/PS3/fastfile_cod11_ps3.cpp b/libs/fastfile/PS3/fastfile_cod11_ps3.cpp index a2bc836..085c872 100644 --- a/libs/fastfile/PS3/fastfile_cod11_ps3.cpp +++ b/libs/fastfile/PS3/fastfile_cod11_ps3.cpp @@ -36,7 +36,7 @@ FastFile_COD11_PS3::~FastFile_COD11_PS3() { } -QByteArray FastFile_COD11_PS3::GetBinaryData() { +QByteArray FastFile_COD11_PS3::GetBinaryData() const { return QByteArray(); } @@ -128,10 +128,13 @@ bool FastFile_COD11_PS3::Load(const QByteArray aData) { } // Load the zone file with the decompressed data (using an Xbox platform flag). - ZoneFile_COD11_PS3 zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - zoneFile.Load(decompressedData); - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD11_PS3* zoneFile = new ZoneFile_COD11_PS3(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/PS3/fastfile_cod11_ps3.h b/libs/fastfile/PS3/fastfile_cod11_ps3.h index 3424fb5..db12669 100644 --- a/libs/fastfile/PS3/fastfile_cod11_ps3.h +++ b/libs/fastfile/PS3/fastfile_cod11_ps3.h @@ -11,7 +11,7 @@ public: FastFile_COD11_PS3(const QString aFilePath); ~FastFile_COD11_PS3(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/PS3/fastfile_cod12_ps3.cpp b/libs/fastfile/PS3/fastfile_cod12_ps3.cpp index 36d0b04..ce0bcda 100644 --- a/libs/fastfile/PS3/fastfile_cod12_ps3.cpp +++ b/libs/fastfile/PS3/fastfile_cod12_ps3.cpp @@ -36,7 +36,7 @@ FastFile_COD12_PS3::~FastFile_COD12_PS3() { } -QByteArray FastFile_COD12_PS3::GetBinaryData() { +QByteArray FastFile_COD12_PS3::GetBinaryData() const { return QByteArray(); } @@ -128,10 +128,13 @@ bool FastFile_COD12_PS3::Load(const QByteArray aData) { } // Load the zone file with the decompressed data (using an Xbox platform flag). - ZoneFile_COD12_PS3 zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - zoneFile.Load(decompressedData); - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD12_PS3* zoneFile = new ZoneFile_COD12_PS3(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/PS3/fastfile_cod12_ps3.h b/libs/fastfile/PS3/fastfile_cod12_ps3.h index 9f66318..4b96ada 100644 --- a/libs/fastfile/PS3/fastfile_cod12_ps3.h +++ b/libs/fastfile/PS3/fastfile_cod12_ps3.h @@ -11,7 +11,7 @@ public: FastFile_COD12_PS3(const QString aFilePath); ~FastFile_COD12_PS3(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/PS3/fastfile_cod4_ps3.cpp b/libs/fastfile/PS3/fastfile_cod4_ps3.cpp index d21402a..d10bd12 100644 --- a/libs/fastfile/PS3/fastfile_cod4_ps3.cpp +++ b/libs/fastfile/PS3/fastfile_cod4_ps3.cpp @@ -39,7 +39,7 @@ FastFile_COD4_PS3::~FastFile_COD4_PS3() { } -QByteArray FastFile_COD4_PS3::GetBinaryData() { +QByteArray FastFile_COD4_PS3::GetBinaryData() const { return QByteArray(); } @@ -111,10 +111,13 @@ bool FastFile_COD4_PS3::Load(const QByteArray aData) { Utils::ExportData(GetBaseStem() + ".zone", decompressedData); - ZoneFile_COD4_PS3 zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - zoneFile.Load(decompressedData); - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD4_PS3* zoneFile = new ZoneFile_COD4_PS3(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/PS3/fastfile_cod4_ps3.h b/libs/fastfile/PS3/fastfile_cod4_ps3.h index 78cc865..dc2be16 100644 --- a/libs/fastfile/PS3/fastfile_cod4_ps3.h +++ b/libs/fastfile/PS3/fastfile_cod4_ps3.h @@ -11,7 +11,7 @@ public: FastFile_COD4_PS3(const QString aFilePath); ~FastFile_COD4_PS3(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/PS3/fastfile_cod5_ps3.cpp b/libs/fastfile/PS3/fastfile_cod5_ps3.cpp index b341169..fbd6643 100644 --- a/libs/fastfile/PS3/fastfile_cod5_ps3.cpp +++ b/libs/fastfile/PS3/fastfile_cod5_ps3.cpp @@ -39,7 +39,7 @@ FastFile_COD5_PS3::~FastFile_COD5_PS3() { } -QByteArray FastFile_COD5_PS3::GetBinaryData() { +QByteArray FastFile_COD5_PS3::GetBinaryData() const { return QByteArray(); } @@ -111,10 +111,13 @@ bool FastFile_COD5_PS3::Load(const QByteArray aData) { Utils::ExportData(GetBaseStem() + ".zone", decompressedData); - ZoneFile_COD5_PS3 zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - zoneFile.Load(decompressedData); - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD5_PS3* zoneFile = new ZoneFile_COD5_PS3(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/PS3/fastfile_cod5_ps3.h b/libs/fastfile/PS3/fastfile_cod5_ps3.h index 2714960..6587eab 100644 --- a/libs/fastfile/PS3/fastfile_cod5_ps3.h +++ b/libs/fastfile/PS3/fastfile_cod5_ps3.h @@ -11,7 +11,7 @@ public: FastFile_COD5_PS3(const QString aFilePath); ~FastFile_COD5_PS3(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/PS3/fastfile_cod6_ps3.cpp b/libs/fastfile/PS3/fastfile_cod6_ps3.cpp index d6d1b7c..c07851a 100644 --- a/libs/fastfile/PS3/fastfile_cod6_ps3.cpp +++ b/libs/fastfile/PS3/fastfile_cod6_ps3.cpp @@ -39,7 +39,7 @@ FastFile_COD6_PS3::~FastFile_COD6_PS3() { } -QByteArray FastFile_COD6_PS3::GetBinaryData() { +QByteArray FastFile_COD6_PS3::GetBinaryData() const { return QByteArray(); } @@ -95,10 +95,13 @@ bool FastFile_COD6_PS3::Load(const QByteArray aData) { Utils::ExportData(GetBaseStem() + ".zone", decompressedData); - ZoneFile_COD6_PS3 zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - zoneFile.Load(decompressedData); - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD6_PS3* zoneFile = new ZoneFile_COD6_PS3(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/PS3/fastfile_cod6_ps3.h b/libs/fastfile/PS3/fastfile_cod6_ps3.h index aecd2b0..9d47852 100644 --- a/libs/fastfile/PS3/fastfile_cod6_ps3.h +++ b/libs/fastfile/PS3/fastfile_cod6_ps3.h @@ -11,7 +11,7 @@ public: FastFile_COD6_PS3(const QString aFilePath); ~FastFile_COD6_PS3(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/PS3/fastfile_cod7_ps3.cpp b/libs/fastfile/PS3/fastfile_cod7_ps3.cpp index eefe0ff..1bb0eaf 100644 --- a/libs/fastfile/PS3/fastfile_cod7_ps3.cpp +++ b/libs/fastfile/PS3/fastfile_cod7_ps3.cpp @@ -39,7 +39,7 @@ FastFile_COD7_PS3::~FastFile_COD7_PS3() { } -QByteArray FastFile_COD7_PS3::GetBinaryData() { +QByteArray FastFile_COD7_PS3::GetBinaryData() const { return QByteArray(); } @@ -87,8 +87,8 @@ bool FastFile_COD7_PS3::Load(const QByteArray aData) { SetGame("COD7"); // Load the zone file with the decompressed data (using an Xbox platform flag). - ZoneFile_COD7_PS3 zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); + ZoneFile_COD7_PS3* zoneFile = new ZoneFile_COD7_PS3(); + zoneFile->SetStem(GetBaseStem() + ".zone"); // For COD7/COD9, use BigEndian. fastFileStream.setByteOrder(QDataStream::BigEndian); @@ -164,10 +164,12 @@ bool FastFile_COD7_PS3::Load(const QByteArray aData) { sectionIndex++; } - zoneFile.Load(decompressedData); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } } - - SetZoneFile(std::make_shared(zoneFile)); + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/PS3/fastfile_cod7_ps3.h b/libs/fastfile/PS3/fastfile_cod7_ps3.h index 3d1482d..bc3bc09 100644 --- a/libs/fastfile/PS3/fastfile_cod7_ps3.h +++ b/libs/fastfile/PS3/fastfile_cod7_ps3.h @@ -11,7 +11,7 @@ public: FastFile_COD7_PS3(const QString aFilePath); ~FastFile_COD7_PS3(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/PS3/fastfile_cod8_ps3.cpp b/libs/fastfile/PS3/fastfile_cod8_ps3.cpp index 3d10fb5..a186912 100644 --- a/libs/fastfile/PS3/fastfile_cod8_ps3.cpp +++ b/libs/fastfile/PS3/fastfile_cod8_ps3.cpp @@ -39,7 +39,7 @@ FastFile_COD8_PS3::~FastFile_COD8_PS3() { } -QByteArray FastFile_COD8_PS3::GetBinaryData() { +QByteArray FastFile_COD8_PS3::GetBinaryData() const { return QByteArray(); } @@ -86,9 +86,8 @@ bool FastFile_COD8_PS3::Load(const QByteArray aData) { SetPlatform(pCalculateFFPlatform(version)); SetGame("COD7"); - // Load the zone file with the decompressed data (using an Xbox platform flag). - ZoneFile_COD8_PS3 zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); + ZoneFile_COD8_PS3* zoneFile = new ZoneFile_COD8_PS3(); + zoneFile->SetStem(GetBaseStem() + ".zone"); // For COD7/COD9, use BigEndian. fastFileStream.setByteOrder(QDataStream::BigEndian); @@ -164,10 +163,13 @@ bool FastFile_COD8_PS3::Load(const QByteArray aData) { sectionIndex++; } - zoneFile.Load(decompressedData); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } } - SetZoneFile(std::make_shared(zoneFile)); + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/PS3/fastfile_cod8_ps3.h b/libs/fastfile/PS3/fastfile_cod8_ps3.h index 02570b0..70b240b 100644 --- a/libs/fastfile/PS3/fastfile_cod8_ps3.h +++ b/libs/fastfile/PS3/fastfile_cod8_ps3.h @@ -11,7 +11,7 @@ public: FastFile_COD8_PS3(const QString aFilePath); ~FastFile_COD8_PS3(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/PS3/fastfile_cod9_ps3.cpp b/libs/fastfile/PS3/fastfile_cod9_ps3.cpp index e13fdef..ae3c012 100644 --- a/libs/fastfile/PS3/fastfile_cod9_ps3.cpp +++ b/libs/fastfile/PS3/fastfile_cod9_ps3.cpp @@ -36,7 +36,7 @@ FastFile_COD9_PS3::~FastFile_COD9_PS3() { } -QByteArray FastFile_COD9_PS3::GetBinaryData() { +QByteArray FastFile_COD9_PS3::GetBinaryData() const { return QByteArray(); } @@ -128,10 +128,13 @@ bool FastFile_COD9_PS3::Load(const QByteArray aData) { } // Load the zone file with the decompressed data (using an Xbox platform flag). - ZoneFile_COD9_PS3 zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - zoneFile.Load(decompressedData); - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD9_PS3* zoneFile = new ZoneFile_COD9_PS3(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/PS3/fastfile_cod9_ps3.h b/libs/fastfile/PS3/fastfile_cod9_ps3.h index 145f69f..4a93307 100644 --- a/libs/fastfile/PS3/fastfile_cod9_ps3.h +++ b/libs/fastfile/PS3/fastfile_cod9_ps3.h @@ -11,7 +11,7 @@ public: FastFile_COD9_PS3(const QString aFilePath); ~FastFile_COD9_PS3(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/Wii/fastfile_cod4_wii.cpp b/libs/fastfile/Wii/fastfile_cod4_wii.cpp index c2c920c..9830d5f 100644 --- a/libs/fastfile/Wii/fastfile_cod4_wii.cpp +++ b/libs/fastfile/Wii/fastfile_cod4_wii.cpp @@ -36,7 +36,7 @@ FastFile_COD4_Wii::~FastFile_COD4_Wii() { } -QByteArray FastFile_COD4_Wii::GetBinaryData() { +QByteArray FastFile_COD4_Wii::GetBinaryData() const { return QByteArray(); } @@ -67,20 +67,19 @@ bool FastFile_COD4_Wii::Load(const QString aFilePath) { } bool FastFile_COD4_Wii::Load(const QByteArray aData) { - QByteArray decompressedData; - - // Load the zone file with the decompressed data (using an Xbox platform flag). - ZoneFile_COD4_Wii zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - // For COD7, simply decompress from offset 12. - decompressedData = Compression::DecompressZLIB(aData.mid(12)); + QByteArray decompressedData = Compression::DecompressZLIB(aData.mid(12)); Utils::ExportData(GetBaseStem() + ".zone", decompressedData); - zoneFile.Load(decompressedData); - - SetZoneFile(std::make_shared(zoneFile)); + // Load the zone file with the decompressed data (using an Xbox platform flag). + ZoneFile_COD4_Wii* zoneFile = new ZoneFile_COD4_Wii(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/Wii/fastfile_cod4_wii.h b/libs/fastfile/Wii/fastfile_cod4_wii.h index d971c55..4da9144 100644 --- a/libs/fastfile/Wii/fastfile_cod4_wii.h +++ b/libs/fastfile/Wii/fastfile_cod4_wii.h @@ -11,7 +11,7 @@ public: FastFile_COD4_Wii(const QString aFilePath); ~FastFile_COD4_Wii(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/Wii/fastfile_cod7_wii.cpp b/libs/fastfile/Wii/fastfile_cod7_wii.cpp index fed87bc..610307e 100644 --- a/libs/fastfile/Wii/fastfile_cod7_wii.cpp +++ b/libs/fastfile/Wii/fastfile_cod7_wii.cpp @@ -36,7 +36,7 @@ FastFile_COD7_Wii::~FastFile_COD7_Wii() { } -QByteArray FastFile_COD7_Wii::GetBinaryData() { +QByteArray FastFile_COD7_Wii::GetBinaryData() const { return QByteArray(); } @@ -83,10 +83,6 @@ bool FastFile_COD7_Wii::Load(const QByteArray aData) { SetPlatform(pCalculateFFPlatform(version)); SetGame("COD7"); - // Load the zone file with the decompressed data (using an Xbox platform flag). - ZoneFile_COD7_Wii zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - // For COD7/COD9, use BigEndian. fastFileStream.setByteOrder(QDataStream::BigEndian); @@ -105,9 +101,13 @@ bool FastFile_COD7_Wii::Load(const QByteArray aData) { outputFile.write(decompressedData); outputFile.close(); - zoneFile.Load(decompressedData); - - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD7_Wii* zoneFile = new ZoneFile_COD7_Wii(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/Wii/fastfile_cod7_wii.h b/libs/fastfile/Wii/fastfile_cod7_wii.h index 7577422..0e0c0ef 100644 --- a/libs/fastfile/Wii/fastfile_cod7_wii.h +++ b/libs/fastfile/Wii/fastfile_cod7_wii.h @@ -11,7 +11,7 @@ public: FastFile_COD7_Wii(const QString aFilePath); ~FastFile_COD7_Wii(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/Wii/fastfile_cod8_wii.cpp b/libs/fastfile/Wii/fastfile_cod8_wii.cpp index aef0884..cad0309 100644 --- a/libs/fastfile/Wii/fastfile_cod8_wii.cpp +++ b/libs/fastfile/Wii/fastfile_cod8_wii.cpp @@ -36,7 +36,7 @@ FastFile_COD8_Wii::~FastFile_COD8_Wii() { } -QByteArray FastFile_COD8_Wii::GetBinaryData() { +QByteArray FastFile_COD8_Wii::GetBinaryData() const { return QByteArray(); } @@ -80,10 +80,6 @@ bool FastFile_COD8_Wii::Load(const QByteArray aData) { SetMagic(pParseFFMagic(&fastFileStream)); SetVersion(pParseFFVersion(&fastFileStream)); - // Load the zone file with the decompressed data (using an Xbox platform flag). - ZoneFile_COD8_Wii zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - // For COD7/COD9, use BigEndian. fastFileStream.setByteOrder(QDataStream::BigEndian); @@ -92,9 +88,13 @@ bool FastFile_COD8_Wii::Load(const QByteArray aData) { Utils::ExportData(GetBaseStem() + ".zone", decompressedData); - zoneFile.Load(decompressedData); - - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD8_Wii* zoneFile = new ZoneFile_COD8_Wii(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/Wii/fastfile_cod8_wii.h b/libs/fastfile/Wii/fastfile_cod8_wii.h index e5a8bc2..c0782bd 100644 --- a/libs/fastfile/Wii/fastfile_cod8_wii.h +++ b/libs/fastfile/Wii/fastfile_cod8_wii.h @@ -11,7 +11,7 @@ public: FastFile_COD8_Wii(const QString aFilePath); ~FastFile_COD8_Wii(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/WiiU/fastfile_cod10_wiiu.cpp b/libs/fastfile/WiiU/fastfile_cod10_wiiu.cpp index 1bab0e9..8014437 100644 --- a/libs/fastfile/WiiU/fastfile_cod10_wiiu.cpp +++ b/libs/fastfile/WiiU/fastfile_cod10_wiiu.cpp @@ -34,7 +34,7 @@ FastFile_COD10_WiiU::~FastFile_COD10_WiiU() { } -QByteArray FastFile_COD10_WiiU::GetBinaryData() { +QByteArray FastFile_COD10_WiiU::GetBinaryData() const { return QByteArray(); } @@ -126,10 +126,13 @@ bool FastFile_COD10_WiiU::Load(const QByteArray aData) { } // Load the zone file with the decompressed data (using an Xbox platform flag). - ZoneFile_COD10_WiiU zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - zoneFile.Load(decompressedData); - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD10_WiiU *zoneFile = new ZoneFile_COD10_WiiU(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/WiiU/fastfile_cod10_wiiu.h b/libs/fastfile/WiiU/fastfile_cod10_wiiu.h index 85d209d..92de1ba 100644 --- a/libs/fastfile/WiiU/fastfile_cod10_wiiu.h +++ b/libs/fastfile/WiiU/fastfile_cod10_wiiu.h @@ -11,7 +11,7 @@ public: FastFile_COD10_WiiU(const QString aFilePath); ~FastFile_COD10_WiiU(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/WiiU/fastfile_cod9_wiiu.cpp b/libs/fastfile/WiiU/fastfile_cod9_wiiu.cpp index 49e19e0..f0a00eb 100644 --- a/libs/fastfile/WiiU/fastfile_cod9_wiiu.cpp +++ b/libs/fastfile/WiiU/fastfile_cod9_wiiu.cpp @@ -34,7 +34,7 @@ FastFile_COD9_WiiU::~FastFile_COD9_WiiU() { } -QByteArray FastFile_COD9_WiiU::GetBinaryData() { +QByteArray FastFile_COD9_WiiU::GetBinaryData() const { return QByteArray(); } @@ -126,10 +126,13 @@ bool FastFile_COD9_WiiU::Load(const QByteArray aData) { } // Load the zone file with the decompressed data (using an Xbox platform flag). - ZoneFile_COD9_WiiU zoneFile; - zoneFile.SetStem(GetBaseStem() + ".zone"); - zoneFile.Load(decompressedData); - SetZoneFile(std::make_shared(zoneFile)); + ZoneFile_COD9_WiiU* zoneFile = new ZoneFile_COD9_WiiU(); + zoneFile->SetStem(GetBaseStem() + ".zone"); + if (!zoneFile->Load(decompressedData)) { + qWarning() << "Failed to load ZoneFile!"; + return false; + } + SetZoneFile(zoneFile); return true; } diff --git a/libs/fastfile/WiiU/fastfile_cod9_wiiu.h b/libs/fastfile/WiiU/fastfile_cod9_wiiu.h index 3ac7f58..ca70ca3 100644 --- a/libs/fastfile/WiiU/fastfile_cod9_wiiu.h +++ b/libs/fastfile/WiiU/fastfile_cod9_wiiu.h @@ -11,7 +11,7 @@ public: FastFile_COD9_WiiU(const QString aFilePath); ~FastFile_COD9_WiiU(); - QByteArray GetBinaryData() override; + QByteArray GetBinaryData() const override; bool Load(const QString aFilePath) override; bool Load(const QByteArray aData) override; diff --git a/libs/fastfile/fastfile.cpp b/libs/fastfile/fastfile.cpp index dd8f34b..2c824ec 100644 --- a/libs/fastfile/fastfile.cpp +++ b/libs/fastfile/fastfile.cpp @@ -68,7 +68,7 @@ quint32 FastFile::GetVersion() const { return mVersion; } -std::shared_ptr FastFile::GetZoneFile() const { +const ZoneFile* FastFile::GetZoneFile() const { return mZoneFile; } @@ -104,7 +104,7 @@ void FastFile::SetVersion(const quint32 aVersion) { mVersion = aVersion; } -void FastFile::SetZoneFile(const std::shared_ptr aZoneFile) { +void FastFile::SetZoneFile(const ZoneFile* aZoneFile) { mZoneFile = aZoneFile; } @@ -240,7 +240,7 @@ QString FastFile::pCalculateFFGame(quint32 aVersion) { return result; } -std::shared_ptr FastFile::Open(const QString &aFilePath) { +FastFile* FastFile::Open(const QString &aFilePath) { LogManager::instance().addEntry("Processing Fastfile..."); if (aFilePath.isEmpty()) { @@ -267,12 +267,12 @@ std::shared_ptr FastFile::Open(const QString &aFilePath) { const QString fastFileStem = aFilePath.section("/", -1, -1); LogManager::instance().addEntry(QString("Stem: %1").arg(fastFileStem)); - std::shared_ptr fastFile = FastFileFactory::Create(data); + FastFile* fastFile = FastFileFactory::Create(data); fastFile->SetStem(fastFileStem); return fastFile; } -bool FastFile::ExportFastFile(const QString aFastFilePath) { +bool FastFile::ExportFastFile(const QString aFastFilePath) const { QFile fastFile(aFastFilePath); if (!fastFile.open(QIODevice::WriteOnly)) { LogManager::instance().addEntry("Failed to write fast file! " + diff --git a/libs/fastfile/fastfile.h b/libs/fastfile/fastfile.h index a960917..0f3d9d7 100644 --- a/libs/fastfile/fastfile.h +++ b/libs/fastfile/fastfile.h @@ -2,6 +2,7 @@ #define FASTFILE_H #include "enums.h" +#include "utils.h" #include "zonefile.h" #include @@ -20,9 +21,9 @@ public: virtual bool Load(const QString aFilePath) = 0; virtual bool Load(const QByteArray aData) = 0; - virtual bool ExportFastFile(const QString aFastFilePath); + virtual bool ExportFastFile(const QString aFastFilePath) const; - virtual QByteArray GetBinaryData() = 0; + virtual QByteArray GetBinaryData() const = 0; virtual QString GetStem() const; virtual QString GetBaseStem() const; @@ -31,7 +32,7 @@ public: virtual FF_SIGNAGE GetSignage() const; virtual QString GetMagic() const; virtual quint32 GetVersion() const; - virtual std::shared_ptr GetZoneFile() const; + virtual const ZoneFile *GetZoneFile() const; virtual QString GetGame() const; virtual QString GetPlatform() const; @@ -41,7 +42,7 @@ public: virtual void SetSignage(const FF_SIGNAGE aSignage); virtual void SetMagic(const QString aMagic); virtual void SetVersion(const quint32 aVersion); - virtual void SetZoneFile(const std::shared_ptr aZoneFile); + virtual void SetZoneFile(const ZoneFile* aZoneFile); virtual void SetGame(const QString aGame); virtual void SetPlatform(const QString aPlatform); @@ -54,7 +55,7 @@ public: static QString pCalculateFFPlatform(quint32 aVersion); static QString pCalculateFFGame(quint32 aVersion); - static std::shared_ptr Open(const QString& aFilePath); + static FastFile* Open(const QString& aFilePath); private: QString mStem; @@ -63,7 +64,7 @@ private: FF_SIGNAGE mSignage; QString mMagic; quint32 mVersion; - std::shared_ptr mZoneFile; + const ZoneFile* mZoneFile; QString mGame; QString mPlatform; }; diff --git a/libs/fastfile/fastfile.pro b/libs/fastfile/fastfile.pro index 2a49b54..68852f1 100644 --- a/libs/fastfile/fastfile.pro +++ b/libs/fastfile/fastfile.pro @@ -7,7 +7,7 @@ HEADERS += $$files($$PWD/*.h, true) LIBS += \ -L$$OUT_PWD/../libs/core -lcore \ - -L$$OUT_PWD/../libs/core -lassets \ + -L$$OUT_PWD/../libs/core -lxassets \ -L$$OUT_PWD/../libs/compression -lcompression \ -L$$OUT_PWD/../libs/encryption -lencryption \ -L$$OUT_PWD/../libs/zonefile -lzonefile @@ -16,7 +16,7 @@ INCLUDEPATH += \ $$PWD/../core \ $$PWD/../compression \ $$PWD/../encryption \ - $$PWD/../assets \ + $$PWD/../xassets \ $$PWD/../zonefile \ $$PWD/../zonefile/360 \ $$PWD/../zonefile/PC \ @@ -29,7 +29,7 @@ DEPENDPATH += \ $$PWD/../core \ $$PWD/../compression \ $$PWD/../encryption \ - $$PWD/../assets \ + $$PWD/../xassets \ $$PWD/../zonefile \ $$PWD/../zonefile/360 \ $$PWD/../zonefile/PC \ diff --git a/libs/fastfile/fastfile_factory.h b/libs/fastfile/fastfile_factory.h index a2488e2..60dce4d 100644 --- a/libs/fastfile/fastfile_factory.h +++ b/libs/fastfile/fastfile_factory.h @@ -75,7 +75,7 @@ enum FastFile_Game { class FastFileFactory { public: - static std::shared_ptr Create(const QString& aFilePath, FastFile_Platform aPlatform = PLATFORM_NONE, FastFile_Game aGame = GAME_NONE) { + static FastFile* Create(const QString& aFilePath, FastFile_Platform aPlatform = PLATFORM_NONE, FastFile_Game aGame = GAME_NONE) { QFile fastFile(aFilePath); if (!fastFile.open(QIODevice::ReadOnly)) { qDebug() << "Factory failed to open fast file: " << aFilePath; @@ -85,7 +85,7 @@ public: const QString stem = aFilePath.split('/').last().split('.').first(); const QByteArray data = fastFile.readAll(); - std::shared_ptr resultFF = nullptr; + FastFile* resultFF = nullptr; if (aPlatform == PLATFORM_NONE) { aPlatform = pGetPlatform(data); @@ -96,85 +96,85 @@ public: if (aPlatform == PLATFORM_360) { if (aGame == GAME_COD2) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD2_360(aFilePath); } else if (aGame == GAME_COD4) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD4_360(aFilePath); } else if (aGame == GAME_COD5) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD5_360(aFilePath); } else if (aGame == GAME_COD6) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD6_360(aFilePath); } else if (aGame == GAME_COD7) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD7_360(aFilePath); } else if (aGame == GAME_COD8) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD8_360(aFilePath); } else if (aGame == GAME_COD9) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD9_360(aFilePath); } else if (aGame == GAME_COD10) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD10_360(aFilePath); } else if (aGame == GAME_COD11) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD11_360(aFilePath); } else if (aGame == GAME_COD12) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD12_360(aFilePath); } } else if (aPlatform == PLATFORM_PC) { if (aGame == GAME_COD4) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD4_PC(aFilePath); } else if (aGame == GAME_COD5) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD5_PC(aFilePath); } else if (aGame == GAME_COD6) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD6_PC(aFilePath); } else if (aGame == GAME_COD7) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD7_PC(aFilePath); } else if (aGame == GAME_COD8) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD8_PC(aFilePath); } else if (aGame == GAME_COD9) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD9_PC(aFilePath); } else if (aGame == GAME_COD10) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD10_PC(aFilePath); } else if (aGame == GAME_COD11) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD11_PC(aFilePath); } else if (aGame == GAME_COD12) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD12_PC(aFilePath); } } else if (aPlatform == PLATFORM_PS3) { if (aGame == GAME_COD4) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD4_PS3(aFilePath); } else if (aGame == GAME_COD5) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD5_PS3(aFilePath); } else if (aGame == GAME_COD6) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD6_PS3(aFilePath); } else if (aGame == GAME_COD7) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD7_PS3(aFilePath); } else if (aGame == GAME_COD8) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD8_PS3(aFilePath); } else if (aGame == GAME_COD9) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD9_PS3(aFilePath); } else if (aGame == GAME_COD10) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD10_PS3(aFilePath); } else if (aGame == GAME_COD11) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD11_PS3(aFilePath); } else if (aGame == GAME_COD12) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD12_PS3(aFilePath); } } else if (aPlatform == PLATFORM_WII) { if (aGame == GAME_COD4) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD4_Wii(aFilePath); } else if (aGame == GAME_COD7) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD7_Wii(aFilePath); } else if (aGame == GAME_COD8) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD8_Wii(aFilePath); } } else if (aPlatform == PLATFORM_WIIU) { if (aGame == GAME_COD9) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD9_WiiU(aFilePath); } else if (aGame == GAME_COD10) { - resultFF = std::make_shared(aFilePath); + resultFF = new FastFile_COD10_WiiU(aFilePath); } } return resultFF; } - static std::shared_ptr Create(const QByteArray& aData, const QString aStem = "no_name", FastFile_Platform aPlatform = PLATFORM_NONE, FastFile_Game aGame = GAME_NONE) { - std::shared_ptr resultFF = nullptr; + static FastFile* Create(const QByteArray& aData, const QString aStem = "no_name", FastFile_Platform aPlatform = PLATFORM_NONE, FastFile_Game aGame = GAME_NONE) { + FastFile* resultFF = nullptr; if (aPlatform == PLATFORM_NONE) { aPlatform = pGetPlatform(aData); @@ -185,79 +185,79 @@ public: if (aPlatform == PLATFORM_360) { if (aGame == GAME_COD2) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD2_360(aData); } else if (aGame == GAME_COD4) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD4_360(aData); } else if (aGame == GAME_COD5) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD5_360(aData); } else if (aGame == GAME_COD6) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD6_360(aData); } else if (aGame == GAME_COD7) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD7_360(aData); } else if (aGame == GAME_COD8) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD8_360(aData); } else if (aGame == GAME_COD9) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD9_360(aData); } else if (aGame == GAME_COD10) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD10_360(aData); } else if (aGame == GAME_COD11) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD11_360(aData); } else if (aGame == GAME_COD12) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD12_360(aData); } } else if (aPlatform == PLATFORM_PC) { if (aGame == GAME_COD4) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD4_PC(aData); } else if (aGame == GAME_COD5) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD5_PC(aData); } else if (aGame == GAME_COD6) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD6_PC(aData); } else if (aGame == GAME_COD7) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD7_PC(aData); } else if (aGame == GAME_COD8) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD8_PC(aData); } else if (aGame == GAME_COD9) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD9_PC(aData); } else if (aGame == GAME_COD10) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD10_PC(aData); } else if (aGame == GAME_COD11) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD11_PC(aData); } else if (aGame == GAME_COD12) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD12_PC(aData); } } else if (aPlatform == PLATFORM_PS3) { if (aGame == GAME_COD4) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD4_PS3(aData); } else if (aGame == GAME_COD5) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD5_PS3(aData); } else if (aGame == GAME_COD6) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD6_PS3(aData); } else if (aGame == GAME_COD7) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD7_PS3(aData); } else if (aGame == GAME_COD8) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD8_PS3(aData); } else if (aGame == GAME_COD9) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD9_PS3(aData); } else if (aGame == GAME_COD10) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD10_PS3(aData); } else if (aGame == GAME_COD11) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD11_PS3(aData); } else if (aGame == GAME_COD12) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD12_PS3(aData); } } else if (aPlatform == PLATFORM_WII) { if (aGame == GAME_COD4) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD4_Wii(aData); } else if (aGame == GAME_COD7) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD7_Wii(aData); } else if (aGame == GAME_COD8) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD8_Wii(aData); } } else if (aPlatform == PLATFORM_WIIU) { if (aGame == GAME_COD9) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD9_WiiU(aData); } else if (aGame == GAME_COD10) { - resultFF = std::make_shared(aData); + resultFF = new FastFile_COD10_WiiU(aData); } } if (resultFF) { diff --git a/libs/iwifile/iwifile.cpp b/libs/iwifile/iwifile.cpp index 155fe20..8ec6e63 100644 --- a/libs/iwifile/iwifile.cpp +++ b/libs/iwifile/iwifile.cpp @@ -81,7 +81,7 @@ IWIFile::IWIFile(const QString &aFilePath) : file.close(); } -IWIFile::IWIFile(DDSFile &aDDSFile) { +IWIFile::IWIFile(const DDSFile &aDDSFile) { // Ensure the DDS file has mipmaps if (aDDSFile.mipmaps.isEmpty()) { qDebug() << "Error: No mipmaps found in DDS file!"; @@ -136,7 +136,7 @@ IWIFile::~IWIFile() { } -void IWIFile::SetupExportDirs() { +void IWIFile::SetupExportDirs() const { QDir dir = QDir::currentPath(); if (!dir.exists("exports/")) { dir.mkdir("exports/"); @@ -156,7 +156,7 @@ void IWIFile::SetupExportDirs() { } } -bool IWIFile::SaveIWI() { +bool IWIFile::SaveIWI() const { SetupExportDirs(); QFile file("exports/iwi/" + fileStem + ".iwi"); if (!file.open(QIODevice::WriteOnly)) { @@ -210,7 +210,7 @@ bool IWIFile::SaveIWI() { return true; } -bool IWIFile::SaveDDS() { +bool IWIFile::SaveDDS() const { SetupExportDirs(); QFile file("exports/dds/" + fileStem + ".dds"); if (!file.open(QIODevice::WriteOnly)) { @@ -267,7 +267,7 @@ bool IWIFile::SaveDDS() { return true; } -bool IWIFile::SavePNG() { +bool IWIFile::SavePNG() const { DDSFile ddsFile(*this); if (!ddsFile.SavePNG()) { qDebug() << "Error: Failed to save PNG file: " << fileStem + ".png"; @@ -276,7 +276,7 @@ bool IWIFile::SavePNG() { return true; } -bool IWIFile::SaveJPG() { +bool IWIFile::SaveJPG() const { DDSFile ddsFile(*this); if (!ddsFile.SavePNG()) { qDebug() << "Error: Failed to save JPG file: " << fileStem + ".jpg"; diff --git a/libs/iwifile/iwifile.h b/libs/iwifile/iwifile.h index 0af67bd..2daf1e8 100644 --- a/libs/iwifile/iwifile.h +++ b/libs/iwifile/iwifile.h @@ -9,6 +9,8 @@ #include #include +#include "ddsfile.h" + // Supported versions static const QVector supportedVersions = { 0x05, // CoD2 @@ -18,8 +20,6 @@ static const QVector supportedVersions = { 0x1B // CoDBO2 }; -class DDSFile; - struct IWIHeader { char Magic[3]; quint8 Version; @@ -50,16 +50,16 @@ public: IWIFile(); IWIFile(const QString &aFilePath); - IWIFile(DDSFile &aDDSFile); + IWIFile(const DDSFile &aDDSFile); IWIFile(const IWIFile &iwiFile); IWIFile& operator=(const IWIFile& other); ~IWIFile(); - bool SaveIWI(); - bool SaveDDS(); - bool SavePNG(); - bool SaveJPG(); - void SetupExportDirs(); + bool SaveIWI() const; + bool SaveDDS() const; + bool SavePNG() const; + bool SaveJPG() const; + void SetupExportDirs() const; }; #endif // IWIFILE_H diff --git a/libs/xassets/360/assets_cod10_360.cpp b/libs/xassets/360/assets_cod10_360.cpp deleted file mode 100644 index 7a6573d..0000000 --- a/libs/xassets/360/assets_cod10_360.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod10_360.h" - -Assets_COD10_360::Assets_COD10_360() -{ - -} - -Assets_COD10_360::~Assets_COD10_360() -{ - -} diff --git a/libs/xassets/360/assets_cod10_360.h b/libs/xassets/360/assets_cod10_360.h deleted file mode 100644 index cd40fb5..0000000 --- a/libs/xassets/360/assets_cod10_360.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD10_360_H -#define ASSETS_COD10_360_H - -#include "assets.h" - -class Assets_COD10_360 : public Assets -{ -public: - Assets_COD10_360(); - ~Assets_COD10_360(); - -protected: - -private: - -}; - -#endif // ASSETS_COD10_360_H diff --git a/libs/xassets/360/assets_cod11_360.cpp b/libs/xassets/360/assets_cod11_360.cpp deleted file mode 100644 index 0a5d8c0..0000000 --- a/libs/xassets/360/assets_cod11_360.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod11_360.h" - -Assets_COD11_360::Assets_COD11_360() -{ - -} - -Assets_COD11_360::~Assets_COD11_360() -{ - -} diff --git a/libs/xassets/360/assets_cod11_360.h b/libs/xassets/360/assets_cod11_360.h deleted file mode 100644 index 235e3d4..0000000 --- a/libs/xassets/360/assets_cod11_360.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD11_360_H -#define ASSETS_COD11_360_H - -#include "assets.h" - -class Assets_COD11_360 : public Assets -{ -public: - Assets_COD11_360(); - ~Assets_COD11_360(); - -protected: - -private: - -}; - -#endif // ASSETS_COD11_360_H diff --git a/libs/xassets/360/assets_cod12_360.cpp b/libs/xassets/360/assets_cod12_360.cpp deleted file mode 100644 index cb83c85..0000000 --- a/libs/xassets/360/assets_cod12_360.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod12_360.h" - -Assets_COD12_360::Assets_COD12_360() -{ - -} - -Assets_COD12_360::~Assets_COD12_360() -{ - -} diff --git a/libs/xassets/360/assets_cod12_360.h b/libs/xassets/360/assets_cod12_360.h deleted file mode 100644 index b41af4f..0000000 --- a/libs/xassets/360/assets_cod12_360.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD12_360_H -#define ASSETS_COD12_360_H - -#include "assets.h" - -class Assets_COD12_360 : public Assets -{ -public: - Assets_COD12_360(); - ~Assets_COD12_360(); - -protected: - -private: - -}; - -#endif // ASSETS_COD12_360_H diff --git a/libs/xassets/360/assets_cod2_360.cpp b/libs/xassets/360/assets_cod2_360.cpp deleted file mode 100644 index 0820946..0000000 --- a/libs/xassets/360/assets_cod2_360.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod2_360.h" - -Assets_COD2_360::Assets_COD2_360() -{ - -} - -Assets_COD2_360::~Assets_COD2_360() -{ - -} diff --git a/libs/xassets/360/assets_cod2_360.h b/libs/xassets/360/assets_cod2_360.h deleted file mode 100644 index fe98720..0000000 --- a/libs/xassets/360/assets_cod2_360.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD2_360_H -#define ASSETS_COD2_360_H - -#include "assets.h" - -class Assets_COD2_360 : public Assets -{ -public: - Assets_COD2_360(); - ~Assets_COD2_360(); - -protected: - -private: - -}; - -#endif // ASSETS_COD2_360_H diff --git a/libs/xassets/360/assets_cod4_360.cpp b/libs/xassets/360/assets_cod4_360.cpp deleted file mode 100644 index 0d4a566..0000000 --- a/libs/xassets/360/assets_cod4_360.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include "assets_cod4_360.h" - -Assets_COD4_360::Assets_COD4_360(QObject *parent) - : Assets(parent) -{ - -} - -Assets_COD4_360::~Assets_COD4_360() { - -} - diff --git a/libs/xassets/360/assets_cod4_360.h b/libs/xassets/360/assets_cod4_360.h deleted file mode 100644 index a83ed48..0000000 --- a/libs/xassets/360/assets_cod4_360.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef ASSETS_COD4_360_H -#define ASSETS_COD4_360_H - -#include "assets.h" - -class Assets_COD4_360 : public Assets -{ - Q_OBJECT - -public: - explicit Assets_COD4_360(QObject *parent = nullptr); - ~Assets_COD4_360(); -}; - -#endif // ASSETS_COD4_360_H diff --git a/libs/xassets/360/assets_cod5_360.cpp b/libs/xassets/360/assets_cod5_360.cpp deleted file mode 100644 index d53ce05..0000000 --- a/libs/xassets/360/assets_cod5_360.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod5_360.h" - -Assets_COD5_360::Assets_COD5_360() -{ - -} - -Assets_COD5_360::~Assets_COD5_360() -{ - -} diff --git a/libs/xassets/360/assets_cod5_360.h b/libs/xassets/360/assets_cod5_360.h deleted file mode 100644 index 394df0e..0000000 --- a/libs/xassets/360/assets_cod5_360.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD5_360_H -#define ASSETS_COD5_360_H - -#include "assets.h" - -class Assets_COD5_360 : public Assets -{ -public: - Assets_COD5_360(); - ~Assets_COD5_360(); - -protected: - -private: - -}; - -#endif // ASSETS_COD5_360_H diff --git a/libs/xassets/360/assets_cod6_360.cpp b/libs/xassets/360/assets_cod6_360.cpp deleted file mode 100644 index aabac26..0000000 --- a/libs/xassets/360/assets_cod6_360.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod6_360.h" - -Assets_COD6_360::Assets_COD6_360() -{ - -} - -Assets_COD6_360::~Assets_COD6_360() -{ - -} diff --git a/libs/xassets/360/assets_cod6_360.h b/libs/xassets/360/assets_cod6_360.h deleted file mode 100644 index 024e68a..0000000 --- a/libs/xassets/360/assets_cod6_360.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD6_360_H -#define ASSETS_COD6_360_H - -#include "assets.h" - -class Assets_COD6_360 : public Assets -{ -public: - Assets_COD6_360(); - ~Assets_COD6_360(); - -protected: - -private: - -}; - -#endif // ASSETS_COD6_360_H diff --git a/libs/xassets/360/assets_cod7_360.cpp b/libs/xassets/360/assets_cod7_360.cpp deleted file mode 100644 index b50a87d..0000000 --- a/libs/xassets/360/assets_cod7_360.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod7_360.h" - -Assets_COD7_360::Assets_COD7_360() -{ - -} - -Assets_COD7_360::~Assets_COD7_360() -{ - -} diff --git a/libs/xassets/360/assets_cod7_360.h b/libs/xassets/360/assets_cod7_360.h deleted file mode 100644 index 7515638..0000000 --- a/libs/xassets/360/assets_cod7_360.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD7_360_H -#define ASSETS_COD7_360_H - -#include "assets.h" - -class Assets_COD7_360 : public Assets -{ -public: - Assets_COD7_360(); - ~Assets_COD7_360(); - -protected: - -private: - -}; - -#endif // ASSETS_COD7_360_H diff --git a/libs/xassets/360/assets_cod8_360.cpp b/libs/xassets/360/assets_cod8_360.cpp deleted file mode 100644 index 849db72..0000000 --- a/libs/xassets/360/assets_cod8_360.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod8_360.h" - -Assets_COD8_360::Assets_COD8_360() -{ - -} - -Assets_COD8_360::~Assets_COD8_360() -{ - -} diff --git a/libs/xassets/360/assets_cod8_360.h b/libs/xassets/360/assets_cod8_360.h deleted file mode 100644 index 506cfc7..0000000 --- a/libs/xassets/360/assets_cod8_360.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD8_360_H -#define ASSETS_COD8_360_H - -#include "assets.h" - -class Assets_COD8_360 : public Assets -{ -public: - Assets_COD8_360(); - ~Assets_COD8_360(); - -protected: - -private: - -}; - -#endif // ASSETS_COD8_360_H diff --git a/libs/xassets/360/assets_cod9_360.cpp b/libs/xassets/360/assets_cod9_360.cpp deleted file mode 100644 index 12e3edc..0000000 --- a/libs/xassets/360/assets_cod9_360.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod9_360.h" - -Assets_COD9_360::Assets_COD9_360() -{ - -} - -Assets_COD9_360::~Assets_COD9_360() -{ - -} diff --git a/libs/xassets/360/assets_cod9_360.h b/libs/xassets/360/assets_cod9_360.h deleted file mode 100644 index 5aa78c4..0000000 --- a/libs/xassets/360/assets_cod9_360.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD9_360_H -#define ASSETS_COD9_360_H - -#include "assets.h" - -class Assets_COD9_360 : public Assets -{ -public: - Assets_COD9_360(); - ~Assets_COD9_360(); - -protected: - -private: - -}; - -#endif // ASSETS_COD9_360_H diff --git a/libs/xassets/PC/assets_cod10_pc.cpp b/libs/xassets/PC/assets_cod10_pc.cpp deleted file mode 100644 index b12ca72..0000000 --- a/libs/xassets/PC/assets_cod10_pc.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod10_pc.h" - -Assets_COD10_PC::Assets_COD10_PC() -{ - -} - -Assets_COD10_PC::~Assets_COD10_PC() -{ - -} diff --git a/libs/xassets/PC/assets_cod10_pc.h b/libs/xassets/PC/assets_cod10_pc.h deleted file mode 100644 index 6d6f233..0000000 --- a/libs/xassets/PC/assets_cod10_pc.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD10_PC_H -#define ASSETS_COD10_PC_H - -#include "assets.h" - -class Assets_COD10_PC : public Assets -{ -public: - Assets_COD10_PC(); - ~Assets_COD10_PC(); - -protected: - -private: - -}; - -#endif // ASSETS_COD10_PC_H diff --git a/libs/xassets/PC/assets_cod11_pc.cpp b/libs/xassets/PC/assets_cod11_pc.cpp deleted file mode 100644 index 6092536..0000000 --- a/libs/xassets/PC/assets_cod11_pc.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod11_pc.h" - -Assets_COD11_PC::Assets_COD11_PC() -{ - -} - -Assets_COD11_PC::~Assets_COD11_PC() -{ - -} diff --git a/libs/xassets/PC/assets_cod11_pc.h b/libs/xassets/PC/assets_cod11_pc.h deleted file mode 100644 index e7dfb14..0000000 --- a/libs/xassets/PC/assets_cod11_pc.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD11_PC_H -#define ASSETS_COD11_PC_H - -#include "assets.h" - -class Assets_COD11_PC : public Assets -{ -public: - Assets_COD11_PC(); - ~Assets_COD11_PC(); - -protected: - -private: - -}; - -#endif // ASSETS_COD11_PC_H diff --git a/libs/xassets/PC/assets_cod12_pc.cpp b/libs/xassets/PC/assets_cod12_pc.cpp deleted file mode 100644 index 8fc5f7f..0000000 --- a/libs/xassets/PC/assets_cod12_pc.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod12_pc.h" - -Assets_COD12_PC::Assets_COD12_PC() -{ - -} - -Assets_COD12_PC::~Assets_COD12_PC() -{ - -} diff --git a/libs/xassets/PC/assets_cod12_pc.h b/libs/xassets/PC/assets_cod12_pc.h deleted file mode 100644 index 0325eb2..0000000 --- a/libs/xassets/PC/assets_cod12_pc.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD12_PC_H -#define ASSETS_COD12_PC_H - -#include "assets.h" - -class Assets_COD12_PC : public Assets -{ -public: - Assets_COD12_PC(); - ~Assets_COD12_PC(); - -protected: - -private: - -}; - -#endif // ASSETS_COD12_PC_H diff --git a/libs/xassets/PC/assets_cod4_pc.cpp b/libs/xassets/PC/assets_cod4_pc.cpp deleted file mode 100644 index 0882b87..0000000 --- a/libs/xassets/PC/assets_cod4_pc.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod4_pc.h" - -Assets_COD4_PC::Assets_COD4_PC() -{ - -} - -Assets_COD4_PC::~Assets_COD4_PC() -{ - -} diff --git a/libs/xassets/PC/assets_cod4_pc.h b/libs/xassets/PC/assets_cod4_pc.h deleted file mode 100644 index d63b3e5..0000000 --- a/libs/xassets/PC/assets_cod4_pc.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD4_PC_H -#define ASSETS_COD4_PC_H - -#include "assets.h" - -class Assets_COD4_PC : public Assets -{ -public: - Assets_COD4_PC(); - ~Assets_COD4_PC(); - -protected: - -private: - -}; - -#endif // ASSETS_COD4_PC_H diff --git a/libs/xassets/PC/assets_cod5_pc.cpp b/libs/xassets/PC/assets_cod5_pc.cpp deleted file mode 100644 index 7506135..0000000 --- a/libs/xassets/PC/assets_cod5_pc.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod5_pc.h" - -Assets_COD5_PC::Assets_COD5_PC() -{ - -} - -Assets_COD5_PC::~Assets_COD5_PC() -{ - -} diff --git a/libs/xassets/PC/assets_cod5_pc.h b/libs/xassets/PC/assets_cod5_pc.h deleted file mode 100644 index 0e70b03..0000000 --- a/libs/xassets/PC/assets_cod5_pc.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD5_PC_H -#define ASSETS_COD5_PC_H - -#include "assets.h" - -class Assets_COD5_PC : public Assets -{ -public: - Assets_COD5_PC(); - ~Assets_COD5_PC(); - -protected: - -private: - -}; - -#endif // ASSETS_COD5_PC_H diff --git a/libs/xassets/PC/assets_cod6_pc.cpp b/libs/xassets/PC/assets_cod6_pc.cpp deleted file mode 100644 index cdf12a5..0000000 --- a/libs/xassets/PC/assets_cod6_pc.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod6_pc.h" - -Assets_COD6_PC::Assets_COD6_PC() -{ - -} - -Assets_COD6_PC::~Assets_COD6_PC() -{ - -} diff --git a/libs/xassets/PC/assets_cod6_pc.h b/libs/xassets/PC/assets_cod6_pc.h deleted file mode 100644 index 3669055..0000000 --- a/libs/xassets/PC/assets_cod6_pc.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD6_PC_H -#define ASSETS_COD6_PC_H - -#include "assets.h" - -class Assets_COD6_PC : public Assets -{ -public: - Assets_COD6_PC(); - ~Assets_COD6_PC(); - -protected: - -private: - -}; - -#endif // ASSETS_COD6_PC_H diff --git a/libs/xassets/PC/assets_cod7_pc.cpp b/libs/xassets/PC/assets_cod7_pc.cpp deleted file mode 100644 index 7d632e1..0000000 --- a/libs/xassets/PC/assets_cod7_pc.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod7_pc.h" - -Assets_COD7_PC::Assets_COD7_PC() -{ - -} - -Assets_COD7_PC::~Assets_COD7_PC() -{ - -} diff --git a/libs/xassets/PC/assets_cod7_pc.h b/libs/xassets/PC/assets_cod7_pc.h deleted file mode 100644 index 1f8fd96..0000000 --- a/libs/xassets/PC/assets_cod7_pc.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD7_PC_H -#define ASSETS_COD7_PC_H - -#include "assets.h" - -class Assets_COD7_PC : public Assets -{ -public: - Assets_COD7_PC(); - ~Assets_COD7_PC(); - -protected: - -private: - -}; - -#endif // ASSETS_COD7_PC_H diff --git a/libs/xassets/PC/assets_cod8_pc.cpp b/libs/xassets/PC/assets_cod8_pc.cpp deleted file mode 100644 index f4d8c19..0000000 --- a/libs/xassets/PC/assets_cod8_pc.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod8_pc.h" - -Assets_COD8_PC::Assets_COD8_PC() -{ - -} - -Assets_COD8_PC::~Assets_COD8_PC() -{ - -} diff --git a/libs/xassets/PC/assets_cod8_pc.h b/libs/xassets/PC/assets_cod8_pc.h deleted file mode 100644 index 6ff916a..0000000 --- a/libs/xassets/PC/assets_cod8_pc.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD8_PC_H -#define ASSETS_COD8_PC_H - -#include "assets.h" - -class Assets_COD8_PC : public Assets -{ -public: - Assets_COD8_PC(); - ~Assets_COD8_PC(); - -protected: - -private: - -}; - -#endif // ASSETS_COD8_PC_H diff --git a/libs/xassets/PC/assets_cod9_pc.cpp b/libs/xassets/PC/assets_cod9_pc.cpp deleted file mode 100644 index d5a5b6f..0000000 --- a/libs/xassets/PC/assets_cod9_pc.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod9_pc.h" - -Assets_COD9_PC::Assets_COD9_PC() -{ - -} - -Assets_COD9_PC::~Assets_COD9_PC() -{ - -} diff --git a/libs/xassets/PC/assets_cod9_pc.h b/libs/xassets/PC/assets_cod9_pc.h deleted file mode 100644 index 9a5c3d2..0000000 --- a/libs/xassets/PC/assets_cod9_pc.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD9_PC_H -#define ASSETS_COD9_PC_H - -#include "assets.h" - -class Assets_COD9_PC : public Assets -{ -public: - Assets_COD9_PC(); - ~Assets_COD9_PC(); - -protected: - -private: - -}; - -#endif // ASSETS_COD9_PC_H diff --git a/libs/xassets/PS3/assets_cod10_ps3.cpp b/libs/xassets/PS3/assets_cod10_ps3.cpp deleted file mode 100644 index 7b23d12..0000000 --- a/libs/xassets/PS3/assets_cod10_ps3.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod10_ps3.h" - -Assets_COD10_PS3::Assets_COD10_PS3() -{ - -} - -Assets_COD10_PS3::~Assets_COD10_PS3() -{ - -} diff --git a/libs/xassets/PS3/assets_cod10_ps3.h b/libs/xassets/PS3/assets_cod10_ps3.h deleted file mode 100644 index 3b74cad..0000000 --- a/libs/xassets/PS3/assets_cod10_ps3.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD10_PS3_H -#define ASSETS_COD10_PS3_H - -#include "assets.h" - -class Assets_COD10_PS3 : public Assets -{ -public: - Assets_COD10_PS3(); - ~Assets_COD10_PS3(); - -protected: - -private: - -}; - -#endif // ASSETS_COD10_PS3_H diff --git a/libs/xassets/PS3/assets_cod11_ps3.cpp b/libs/xassets/PS3/assets_cod11_ps3.cpp deleted file mode 100644 index cc039e2..0000000 --- a/libs/xassets/PS3/assets_cod11_ps3.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod11_ps3.h" - -Assets_COD11_PS3::Assets_COD11_PS3() -{ - -} - -Assets_COD11_PS3::~Assets_COD11_PS3() -{ - -} diff --git a/libs/xassets/PS3/assets_cod11_ps3.h b/libs/xassets/PS3/assets_cod11_ps3.h deleted file mode 100644 index a80a821..0000000 --- a/libs/xassets/PS3/assets_cod11_ps3.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD11_PS3_H -#define ASSETS_COD11_PS3_H - -#include "assets.h" - -class Assets_COD11_PS3 : public Assets -{ -public: - Assets_COD11_PS3(); - ~Assets_COD11_PS3(); - -protected: - -private: - -}; - -#endif // ASSETS_COD11_PS3_H diff --git a/libs/xassets/PS3/assets_cod12_ps3.cpp b/libs/xassets/PS3/assets_cod12_ps3.cpp deleted file mode 100644 index d0ec7bc..0000000 --- a/libs/xassets/PS3/assets_cod12_ps3.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod12_ps3.h" - -Assets_COD12_PS3::Assets_COD12_PS3() -{ - -} - -Assets_COD12_PS3::~Assets_COD12_PS3() -{ - -} diff --git a/libs/xassets/PS3/assets_cod12_ps3.h b/libs/xassets/PS3/assets_cod12_ps3.h deleted file mode 100644 index 822a285..0000000 --- a/libs/xassets/PS3/assets_cod12_ps3.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD12_PS3_H -#define ASSETS_COD12_PS3_H - -#include "assets.h" - -class Assets_COD12_PS3 : public Assets -{ -public: - Assets_COD12_PS3(); - ~Assets_COD12_PS3(); - -protected: - -private: - -}; - -#endif // ASSETS_COD12_PS3_H diff --git a/libs/xassets/PS3/assets_cod4_ps3.cpp b/libs/xassets/PS3/assets_cod4_ps3.cpp deleted file mode 100644 index 232b71a..0000000 --- a/libs/xassets/PS3/assets_cod4_ps3.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod4_ps3.h" - -Assets_COD4_PS3::Assets_COD4_PS3() -{ - -} - -Assets_COD4_PS3::~Assets_COD4_PS3() -{ - -} diff --git a/libs/xassets/PS3/assets_cod4_ps3.h b/libs/xassets/PS3/assets_cod4_ps3.h deleted file mode 100644 index f729842..0000000 --- a/libs/xassets/PS3/assets_cod4_ps3.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD4_PS3_H -#define ASSETS_COD4_PS3_H - -#include "assets.h" - -class Assets_COD4_PS3 : public Assets -{ -public: - Assets_COD4_PS3(); - ~Assets_COD4_PS3(); - -protected: - -private: - -}; - -#endif // ASSETS_COD4_PS3_H diff --git a/libs/xassets/PS3/assets_cod5_ps3.cpp b/libs/xassets/PS3/assets_cod5_ps3.cpp deleted file mode 100644 index 7e2c653..0000000 --- a/libs/xassets/PS3/assets_cod5_ps3.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod5_ps3.h" - -Assets_COD5_PS3::Assets_COD5_PS3() -{ - -} - -Assets_COD5_PS3::~Assets_COD5_PS3() -{ - -} diff --git a/libs/xassets/PS3/assets_cod5_ps3.h b/libs/xassets/PS3/assets_cod5_ps3.h deleted file mode 100644 index c216f06..0000000 --- a/libs/xassets/PS3/assets_cod5_ps3.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD5_PS3_H -#define ASSETS_COD5_PS3_H - -#include "assets.h" - -class Assets_COD5_PS3 : public Assets -{ -public: - Assets_COD5_PS3(); - ~Assets_COD5_PS3(); - -protected: - -private: - -}; - -#endif // ASSETS_COD5_PS3_H diff --git a/libs/xassets/PS3/assets_cod6_ps3.cpp b/libs/xassets/PS3/assets_cod6_ps3.cpp deleted file mode 100644 index 5a66898..0000000 --- a/libs/xassets/PS3/assets_cod6_ps3.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod6_ps3.h" - -Assets_COD6_PS3::Assets_COD6_PS3() -{ - -} - -Assets_COD6_PS3::~Assets_COD6_PS3() -{ - -} diff --git a/libs/xassets/PS3/assets_cod6_ps3.h b/libs/xassets/PS3/assets_cod6_ps3.h deleted file mode 100644 index 790971d..0000000 --- a/libs/xassets/PS3/assets_cod6_ps3.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD6_PS3_H -#define ASSETS_COD6_PS3_H - -#include "assets.h" - -class Assets_COD6_PS3 : public Assets -{ -public: - Assets_COD6_PS3(); - ~Assets_COD6_PS3(); - -protected: - -private: - -}; - -#endif // ASSETS_COD6_PS3_H diff --git a/libs/xassets/PS3/assets_cod7_ps3.cpp b/libs/xassets/PS3/assets_cod7_ps3.cpp deleted file mode 100644 index 79210e6..0000000 --- a/libs/xassets/PS3/assets_cod7_ps3.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod7_ps3.h" - -Assets_COD7_PS3::Assets_COD7_PS3() -{ - -} - -Assets_COD7_PS3::~Assets_COD7_PS3() -{ - -} diff --git a/libs/xassets/PS3/assets_cod7_ps3.h b/libs/xassets/PS3/assets_cod7_ps3.h deleted file mode 100644 index 9a31f1b..0000000 --- a/libs/xassets/PS3/assets_cod7_ps3.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD7_PS3_H -#define ASSETS_COD7_PS3_H - -#include "assets.h" - -class Assets_COD7_PS3 : public Assets -{ -public: - Assets_COD7_PS3(); - ~Assets_COD7_PS3(); - -protected: - -private: - -}; - -#endif // ASSETS_COD7_PS3_H diff --git a/libs/xassets/PS3/assets_cod8_ps3.cpp b/libs/xassets/PS3/assets_cod8_ps3.cpp deleted file mode 100644 index 668c07f..0000000 --- a/libs/xassets/PS3/assets_cod8_ps3.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod8_ps3.h" - -Assets_COD8_PS3::Assets_COD8_PS3() -{ - -} - -Assets_COD8_PS3::~Assets_COD8_PS3() -{ - -} diff --git a/libs/xassets/PS3/assets_cod8_ps3.h b/libs/xassets/PS3/assets_cod8_ps3.h deleted file mode 100644 index fd02d10..0000000 --- a/libs/xassets/PS3/assets_cod8_ps3.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD8_PS3_H -#define ASSETS_COD8_PS3_H - -#include "assets.h" - -class Assets_COD8_PS3 : public Assets -{ -public: - Assets_COD8_PS3(); - ~Assets_COD8_PS3(); - -protected: - -private: - -}; - -#endif // ASSETS_COD8_PS3_H diff --git a/libs/xassets/PS3/assets_cod9_ps3.cpp b/libs/xassets/PS3/assets_cod9_ps3.cpp deleted file mode 100644 index ea25283..0000000 --- a/libs/xassets/PS3/assets_cod9_ps3.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod9_ps3.h" - -Assets_COD9_PS3::Assets_COD9_PS3() -{ - -} - -Assets_COD9_PS3::~Assets_COD9_PS3() -{ - -} diff --git a/libs/xassets/PS3/assets_cod9_ps3.h b/libs/xassets/PS3/assets_cod9_ps3.h deleted file mode 100644 index e229e18..0000000 --- a/libs/xassets/PS3/assets_cod9_ps3.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD9_PS3_H -#define ASSETS_COD9_PS3_H - -#include "assets.h" - -class Assets_COD9_PS3 : public Assets -{ -public: - Assets_COD9_PS3(); - ~Assets_COD9_PS3(); - -protected: - -private: - -}; - -#endif // ASSETS_COD9_PS3_H diff --git a/libs/xassets/Wii/assets_cod4_wii.cpp b/libs/xassets/Wii/assets_cod4_wii.cpp deleted file mode 100644 index ce4b794..0000000 --- a/libs/xassets/Wii/assets_cod4_wii.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod4_wii.h" - -Assets_COD4_Wii::Assets_COD4_Wii() -{ - -} - -Assets_COD4_Wii::~Assets_COD4_Wii() -{ - -} diff --git a/libs/xassets/Wii/assets_cod4_wii.h b/libs/xassets/Wii/assets_cod4_wii.h deleted file mode 100644 index 51c68f9..0000000 --- a/libs/xassets/Wii/assets_cod4_wii.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD4_WII_H -#define ASSETS_COD4_WII_H - -#include "assets.h" - -class Assets_COD4_Wii : public Assets -{ -public: - Assets_COD4_Wii(); - ~Assets_COD4_Wii(); - -protected: - -private: - -}; - -#endif // ASSETS_COD4_WII_H diff --git a/libs/xassets/Wii/assets_cod7_wii.cpp b/libs/xassets/Wii/assets_cod7_wii.cpp deleted file mode 100644 index 3b6371e..0000000 --- a/libs/xassets/Wii/assets_cod7_wii.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod7_wii.h" - -Assets_COD7_Wii::Assets_COD7_Wii() -{ - -} - -Assets_COD7_Wii::~Assets_COD7_Wii() -{ - -} diff --git a/libs/xassets/Wii/assets_cod7_wii.h b/libs/xassets/Wii/assets_cod7_wii.h deleted file mode 100644 index 33bb038..0000000 --- a/libs/xassets/Wii/assets_cod7_wii.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD7_WII_H -#define ASSETS_COD7_WII_H - -#include "assets.h" - -class Assets_COD7_Wii : public Assets -{ -public: - Assets_COD7_Wii(); - ~Assets_COD7_Wii(); - -protected: - -private: - -}; - -#endif // ASSETS_COD7_WII_H diff --git a/libs/xassets/Wii/assets_cod8_wii.cpp b/libs/xassets/Wii/assets_cod8_wii.cpp deleted file mode 100644 index dd48cf0..0000000 --- a/libs/xassets/Wii/assets_cod8_wii.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod8_wii.h" - -Assets_COD8_Wii::Assets_COD8_Wii() -{ - -} - -Assets_COD8_Wii::~Assets_COD8_Wii() -{ - -} diff --git a/libs/xassets/Wii/assets_cod8_wii.h b/libs/xassets/Wii/assets_cod8_wii.h deleted file mode 100644 index b3a537c..0000000 --- a/libs/xassets/Wii/assets_cod8_wii.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD8_WII_H -#define ASSETS_COD8_WII_H - -#include "assets.h" - -class Assets_COD8_Wii : public Assets -{ -public: - Assets_COD8_Wii(); - ~Assets_COD8_Wii(); - -protected: - -private: - -}; - -#endif // ASSETS_COD8_WII_H diff --git a/libs/xassets/WiiU/assets_cod10_wiiu.cpp b/libs/xassets/WiiU/assets_cod10_wiiu.cpp deleted file mode 100644 index d3be134..0000000 --- a/libs/xassets/WiiU/assets_cod10_wiiu.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod10_wiiu.h" - -Assets_COD10_WiiU::Assets_COD10_WiiU() -{ - -} - -Assets_COD10_WiiU::~Assets_COD10_WiiU() -{ - -} diff --git a/libs/xassets/WiiU/assets_cod10_wiiu.h b/libs/xassets/WiiU/assets_cod10_wiiu.h deleted file mode 100644 index b9c72a9..0000000 --- a/libs/xassets/WiiU/assets_cod10_wiiu.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD10_WIIU_H -#define ASSETS_COD10_WIIU_H - -#include "assets.h" - -class Assets_COD10_WiiU : public Assets -{ -public: - Assets_COD10_WiiU(); - ~Assets_COD10_WiiU(); - -protected: - -private: - -}; - -#endif // ASSETS_COD10_WIIU_H diff --git a/libs/xassets/WiiU/assets_cod9_wiiu.cpp b/libs/xassets/WiiU/assets_cod9_wiiu.cpp deleted file mode 100644 index 01ff127..0000000 --- a/libs/xassets/WiiU/assets_cod9_wiiu.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "assets_cod9_wiiu.h" - -Assets_COD9_WiiU::Assets_COD9_WiiU() -{ - -} - -Assets_COD9_WiiU::~Assets_COD9_WiiU() -{ - -} diff --git a/libs/xassets/WiiU/assets_cod9_wiiu.h b/libs/xassets/WiiU/assets_cod9_wiiu.h deleted file mode 100644 index bb69dd3..0000000 --- a/libs/xassets/WiiU/assets_cod9_wiiu.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASSETS_COD9_WIIU_H -#define ASSETS_COD9_WIIU_H - -#include "assets.h" - -class Assets_COD9_WiiU : public Assets -{ -public: - Assets_COD9_WiiU(); - ~Assets_COD9_WiiU(); - -protected: - -private: - -}; - -#endif // ASSETS_COD9_WIIU_H diff --git a/libs/xassets/assetlist.cpp b/libs/xassets/assetlist.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/libs/xassets/assetlist.h b/libs/xassets/assetlist.h deleted file mode 100644 index e69de29..0000000 diff --git a/libs/xassets/assetmap.h b/libs/xassets/assetmap.h deleted file mode 100644 index 722b353..0000000 --- a/libs/xassets/assetmap.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef ASSETMAP_H -#define ASSETMAP_H - -#include "animparts.h" -#include "xmodel.h" -#include "material.h" -#include "materialpixelshader.h" -#include "materialtechset.h" -#include "xgfximage.h" -#include "soundalias.h" -#include "soundcurve.h" -#include "loadedsound.h" -#include "clipmap.h" -#include "xcomworld.h" -#include "gameworld.h" -#include "mapent.h" -#include "gfxworld.h" -#include "gfxlightdef.h" -#include "xgfximage.h" -#include "font.h" -#include "xmenulist.h" -#include "xmenudef.h" -#include "xlocalizeentry.h" -#include "weapondef.h" -#include "xsounddriverglobals.h" -#include "effectdef.h" -#include "effecttable.h" -#include "xrawfile.h" -#include "xstringtable.h" - -struct AssetMap { - QVector animations; - QVector models; - QVector materials; - QVector pixelShaders; - QVector techSets; - QVector gfxWorlds; - QVector gfxLightDefs; - QVector images; - QVector sounds; - QVector soundCurves; - QVector loadedSounds; - QVector clipMaps; - QVector comWorlds; - QVector gameWorldSPs; - QVector gameWorldMPs; - QVector mapEntities; - QVector fonts; - QVector menuLists; - QVector menuDefinitions; - QVector localizeEntries; - QVector weaponDefinitions; - QVector soundDrivers; - QVector effectDefinitions; - QVector impactTables; - QVector rawFiles; - QVector stringTables; -}; - -#endif // ASSETMAP_H diff --git a/libs/xassets/assets.cpp b/libs/xassets/assets.cpp deleted file mode 100644 index 4b0695b..0000000 --- a/libs/xassets/assets.cpp +++ /dev/null @@ -1,9792 +0,0 @@ -#include "assets.h" -#include "Windows.h" - -#include - -Assets::Assets(QObject *parent) - : QObject(parent) { - -} - -Assets::~Assets() { - -} - - - -QVector Assets::Load_GlyphArray(QDataStream *aStream, int count) -{ - QVector result; - for (int i = 0; i < count; i++) { - Glyph glyph; - - *aStream - >> glyph.letter - >> glyph.x0 - >> glyph.y0 - >> glyph.dx - >> glyph.pixelWidth - >> glyph.pixelHeight - >> glyph.s0 - >> glyph.t0 - >> glyph.s1 - >> glyph.t1; - - result << glyph; - } - return result; -} - - -// ?Load_GfxLightRegionAxisArray@@YAX_NH@Z at 0x822a49a0 -QVector Assets::Load_GfxLightRegionAxisArray(QDataStream *aStream, int count) -{ - QVector result; - for (int i = 0; i < count; i++) { - GfxLightRegionAxis gfxLightRegionAxis; - - *aStream - >> gfxLightRegionAxis.dir[0] - >> gfxLightRegionAxis.dir[1] - >> gfxLightRegionAxis.dir[2] - >> gfxLightRegionAxis.midPoint - >> gfxLightRegionAxis.halfSize; - - result << gfxLightRegionAxis; - } - return result; -} - - -// ?Load_GfxDrawSurfArray@@YAX_NH@Z at 0x822a49c0 -QVector Assets::Load_GfxDrawSurfArray(QDataStream *aStream, int count) -{ - QVector result; - for (int i = 0; i < count; i++) { - GfxDrawSurf gfxDrawSurf; - - *aStream - >> gfxDrawSurf.packed; - - result << gfxDrawSurf; - } - return result; -} - - -// ?Load_GfxSceneDynBrushArray@@YAX_NH@Z at 0x822a49d8 -QVector Assets::Load_GfxSceneDynBrushArray(QDataStream *aStream, int count) -{ - QVector result; - for (int i = 0; i < count; i++) { - GfxSceneDynBrush gfxSceneDynBrush; - - *aStream - >> gfxSceneDynBrush.info.surfId - >> gfxSceneDynBrush.dynEntId; - - result << gfxSceneDynBrush; - } - return result; -} - - -// ?Load_GfxSceneDynModelArray@@YAX_NH@Z at 0x822a49f0 -QVector Assets::Load_GfxSceneDynModelArray(QDataStream *aStream, int count) -{ - QVector result; - for (int i = 0; i < count; i++) { - GfxSceneDynModel gfxSceneDynModel; - - *aStream - >> gfxSceneDynModel.info.lod - >> gfxSceneDynModel.info.surfId - >> gfxSceneDynModel.dynEntId; - - result << gfxSceneDynModel; - } - return result; -} - - -// ?Load_GfxStreamingAabbTreeArray@@YAX_NH@Z at 0x822a4a10 -QVector Assets::Load_GfxStreamingAabbTreeArray(QDataStream *aStream, int count) -{ - QVector result; - for (int i = 0; i < count; i++) { - GfxStreamingAabbTree gfxStreamingAabbTree; - - *aStream - >> gfxStreamingAabbTree.firstItem - >> gfxStreamingAabbTree.itemCount - >> gfxStreamingAabbTree.firstChild - >> gfxStreamingAabbTree.childCount - >> gfxStreamingAabbTree.mins[0] - >> gfxStreamingAabbTree.mins[1] - >> gfxStreamingAabbTree.mins[2] - >> gfxStreamingAabbTree.maxs[0] - >> gfxStreamingAabbTree.maxs[1] - >> gfxStreamingAabbTree.maxs[2]; - - result << gfxStreamingAabbTree; - } - return result; -} - -GfxLightGridColors Assets::Load_GfxLightGridColors(QDataStream *aStream) -{ - GfxLightGridColors result; - - for (int j = 0; j < 56; j++) { - *aStream - >> result.rgb[j][0] - >> result.rgb[j][1] - >> result.rgb[j][2]; - } - return result; -} - -// ?Load_GfxLightGridColorsArray@@YAX_NH@Z at 0x822a4a28 -QVector Assets::Load_GfxLightGridColorsArray(QDataStream *aStream, int count) -{ - QVector result; - for (int i = 0; i < count; i++) { - result << Load_GfxLightGridColors(aStream); - } - return result; -} - - -// ?Load_GfxLightGridEntryArray@@YAX_NH@Z at 0x822a4a40 -QVector Assets::Load_GfxLightGridEntryArray(QDataStream *aStream, int count) -{ - QVector result; - for (int i = 0; i < count; i++) { - GfxLightGridEntry gfxLightGridEntry; - - for (int j = 0; j < 56; j++) { - *aStream - >> gfxLightGridEntry.colorsIndex - >> gfxLightGridEntry.primaryLightIndex - >> gfxLightGridEntry.needsTrace; - } - - result << gfxLightGridEntry; - } - return result; -} - - -// ?Load_GfxCullGroupArray@@YAX_NH@Z at 0x822a4a58 -QVector Assets::Load_GfxCullGroupArray(QDataStream *aStream, int count) -{ - QVector result; - for (int i = 0; i < count; i++) { - GfxCullGroup gfxCullGroup; - - for (int j = 0; j < 56; j++) { - *aStream - >> gfxCullGroup.mins[0] - >> gfxCullGroup.mins[1] - >> gfxCullGroup.mins[2] - >> gfxCullGroup.maxs[0] - >> gfxCullGroup.maxs[1] - >> gfxCullGroup.maxs[2] - >> gfxCullGroup.surfaceCount - >> gfxCullGroup.startSurfIndex; - } - - result << gfxCullGroup; - } - return result; -} - -typedef unsigned __int16 StaticModelIndex; - -// ?Load_StaticModelIndexArray@@YAX_NH@Z at 0x822a4a70 -QVector Assets::Load_StaticModelIndexArray(QDataStream *aStream, int count) -{ - QVector result; - for (int i = 0; i < count; i++) { - StaticModelIndex staticModelIndex; - - *aStream >> staticModelIndex; - - result << staticModelIndex; - } - return result; -} - - -// ?Load_GfxStaticModelInstArray@@YAX_NH@Z at 0x822a4a88 -QVector Assets::Load_GfxStaticModelInstArray(QDataStream *aStream, int count) -{ - QVector result; - for (int i = 0; i < count; i++) { - GfxStaticModelInst gfxStaticModelInst; - - *aStream - >> gfxStaticModelInst.mins[0] - >> gfxStaticModelInst.mins[1] - >> gfxStaticModelInst.mins[2] - >> gfxStaticModelInst.maxs[0] - >> gfxStaticModelInst.maxs[1] - >> gfxStaticModelInst.maxs[2] - >> gfxStaticModelInst.groundLighting.array[0] - >> gfxStaticModelInst.groundLighting.array[1] - >> gfxStaticModelInst.groundLighting.array[2] - >> gfxStaticModelInst.groundLighting.array[3]; - - result << gfxStaticModelInst; - } - return result; -} - -// ?Load_ItemKeyHandler@@YAX_N@Z at 0x822a5f68 -XItemKeyHandler Assets::Load_ItemKeyHandler(QDataStream *aStream) -{ - XItemKeyHandler result; - - *aStream - >> result.key - >> result.actionPtr - >> result.nextPtr; - - if (result.actionPtr == -1) { - result.action = Load_XStringCustom(aStream); - } - - while (result.nextPtr == -1) { - *aStream - >> result.next->key - >> result.next->actionPtr - >> result.next->nextPtr; - } - return result; -} - -typedef XItemKeyHandler ItemKeyHandlerNext; - -// ?Load_ItemKeyHandlerNext@@YAX_N@Z at 0x822a4aa0 -XItemKeyHandler Assets::Load_ItemKeyHandlerNext(QDataStream *aStream) -{ - return Load_ItemKeyHandler(aStream); -} - -// ?Load_EditFieldDef@@YAX_N@Z at 0x822a4af0 -XEditFieldDef Assets::Load_EditFieldDef(QDataStream *aStream) -{ - XEditFieldDef result; - - *aStream - >> result.minVal - >> result.maxVal - >> result.defVal - >> result.range - >> result.maxChars - >> result.maxCharsGotoNext - >> result.maxPaintChars - >> result.paintOffset; - - return result; -} - -// ?Load_Operator@@YAX_N@Z at 0x822a4b08 -OperationEnum Assets::Load_Operator(QDataStream *aStream) -{ - OperationEnum result; - - *aStream >> result; - - return result; -} - -// ?Load_LeafBrushArray@@YAX_NH@Z at 0x822a4b20 -QVector Assets::Load_LeafBrushArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - quint16 leafBrush; - - *aStream >> leafBrush; - - result << leafBrush; - } - return result; -} - - -CLeaf Assets::Load_CLeaf(QDataStream *aStream) -{ - CLeaf result; - - *aStream - >> result.firstCollAabbIndex - >> result.collAabbCount - >> result.brushContents - >> result.terrainContents - >> result.mins[0] - >> result.mins[1] - >> result.mins[2] - >> result.maxs[0] - >> result.maxs[1] - >> result.maxs[2] - >> result.leafBrushNode - >> result.cluster; - - - return result; -} - -// ?Load_CModelArray@@YAX_NH@Z at 0x822a4b38 -QVector Assets::Load_CModelArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - CModel cmodel; - - *aStream - >> cmodel.mins[0] - >> cmodel.mins[1] - >> cmodel.mins[2] - >> cmodel.maxs[0] - >> cmodel.maxs[1] - >> cmodel.maxs[2] - >> cmodel.radius; - - cmodel.leaf = Load_CLeaf(aStream); - - result << cmodel; - } - - return result; -} - - -// ?Load_CollisionAabbTreeArray@@YAX_NH@Z at 0x822a4b58 -QVector Assets::Load_CollisionAabbTreeArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - CollisionAabbTree collisionAabbTree; - - *aStream - >> collisionAabbTree.origin[0] - >> collisionAabbTree.origin[1] - >> collisionAabbTree.origin[2] - >> collisionAabbTree.halfSize[0] - >> collisionAabbTree.halfSize[1] - >> collisionAabbTree.halfSize[2] - >> collisionAabbTree.materialIndex - >> collisionAabbTree.childCount - >> collisionAabbTree.u.firstChildIndex - >> collisionAabbTree.u.partitionIndex; - - result << collisionAabbTree; - } - - return result; -} - -// ?Load_CollisionBorder@@YAX_N@Z at 0x822a4b88 -CollisionBorder Assets::Load_CollisionBorder(QDataStream *aStream) -{ - CollisionBorder result; - - *aStream - >> result.distEq[0] - >> result.distEq[1] - >> result.distEq[2] - >> result.zBase - >> result.zSlope - >> result.start - >> result.length; - - return result; -} - -// ?Load_CollisionBorderArray@@YAX_NH@Z at 0x822a4b70 -QVector Assets::Load_CollisionBorderArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - result << Load_CollisionBorder(aStream); - } - - return result; -} - -// ?Load_cLeafBrushNodeChildren_t@@YAX_N@Z at 0x822a4ba0 -CLeafBrushNodeChildren Assets::Load_cLeafBrushNodeChildren_t(QDataStream *aStream) -{ - CLeafBrushNodeChildren result; - - *aStream - >> result.dist - >> result.range - >> result.childOffset[0] - >> result.childOffset[1]; - - return result; -} - - -// ?Load_cLeaf_tArray@@YAX_NH@Z at 0x822a4c30 -QVector Assets::Load_cLeaf_tArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - result << Load_CLeaf(aStream); - } - - return result; -} - - -// ?Load_DynEntityClientArray@@YAX_NH@Z at 0x822a4c48 -QVector Assets::Load_DynEntityClientArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - DynEntityClient dynEntityClient; - - *aStream - >> dynEntityClient.physObjId - >> dynEntityClient.flags - >> dynEntityClient.lightingHandle - >> dynEntityClient.health; - - result << dynEntityClient; - } - - return result; -} - - -// ?Load_DynEntityPoseArray@@YAX_NH@Z at 0x822a4c68 -QVector Assets::Load_DynEntityPoseArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - DynEntityPose dynEntityPose; - - *aStream - >> dynEntityPose.pose.quat[0] - >> dynEntityPose.pose.quat[1] - >> dynEntityPose.pose.quat[2] - >> dynEntityPose.pose.quat[3] - >> dynEntityPose.pose.origin[0] - >> dynEntityPose.pose.origin[1] - >> dynEntityPose.pose.origin[2] - >> dynEntityPose.radius; - - result << dynEntityPose; - } - - return result; -} - - -// ?Load_DynEntityCollArray@@YAX_NH@Z at 0x822a4c80 -QVector Assets::Load_DynEntityCollArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - DynEntityColl dynEntityColl; - - *aStream - >> dynEntityColl.sector - >> dynEntityColl.nextEntInSector - >> dynEntityColl.linkMins[0] - >> dynEntityColl.linkMins[1] - >> dynEntityColl.linkMaxs[0] - >> dynEntityColl.linkMaxs[1]; - - result << dynEntityColl; - } - - return result; -} - - -// ?Load_FxTrailVertexArray@@YAX_NH@Z at 0x822a4ca0 -QVector Assets::Load_FxTrailVertexArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - FxTrailVertex fxTrailVertex; - - *aStream - >> fxTrailVertex.pos[0] - >> fxTrailVertex.pos[1] - >> fxTrailVertex.normal[0] - >> fxTrailVertex.normal[1] - >> fxTrailVertex.texCoord; - - result << fxTrailVertex; - } - - return result; -} - - -// ?Load_FxElemVelStateSampleArray@@YAX_NH@Z at 0x822a4cc0 -QVector Assets::Load_FxElemVelStateSampleArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - FxElemVelStateSample fxElemVelStateSample; - - *aStream - >> fxElemVelStateSample.local.velocity.base[0] - >> fxElemVelStateSample.local.velocity.base[1] - >> fxElemVelStateSample.local.velocity.base[2] - >> fxElemVelStateSample.local.velocity.amplitude[0] - >> fxElemVelStateSample.local.velocity.amplitude[1] - >> fxElemVelStateSample.local.velocity.amplitude[2] - >> fxElemVelStateSample.local.totalDelta.base[0] - >> fxElemVelStateSample.local.totalDelta.base[1] - >> fxElemVelStateSample.local.totalDelta.base[2] - >> fxElemVelStateSample.local.totalDelta.amplitude[0] - >> fxElemVelStateSample.local.totalDelta.amplitude[1] - >> fxElemVelStateSample.local.totalDelta.amplitude[2] - >> fxElemVelStateSample.world.velocity.base[0] - >> fxElemVelStateSample.world.velocity.base[1] - >> fxElemVelStateSample.world.velocity.base[2] - >> fxElemVelStateSample.world.velocity.amplitude[0] - >> fxElemVelStateSample.world.velocity.amplitude[1] - >> fxElemVelStateSample.world.velocity.amplitude[2] - >> fxElemVelStateSample.world.totalDelta.base[0] - >> fxElemVelStateSample.world.totalDelta.base[1] - >> fxElemVelStateSample.world.totalDelta.base[2] - >> fxElemVelStateSample.world.totalDelta.amplitude[0] - >> fxElemVelStateSample.world.totalDelta.amplitude[1] - >> fxElemVelStateSample.world.totalDelta.amplitude[2]; - - result << fxElemVelStateSample; - } - - return result; -} - -// ?Load_FxElemVisStateSampleArray@@YAX_NH@Z at 0x822a4ce0 -QVector Assets::Load_FxElemVisStateSampleArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - FxElemVisStateSample fxElemVisStateSample; - - *aStream - >> fxElemVisStateSample.base.color[0] - >> fxElemVisStateSample.base.color[1] - >> fxElemVisStateSample.base.color[2] - >> fxElemVisStateSample.base.color[3] - >> fxElemVisStateSample.base.rotationDelta - >> fxElemVisStateSample.base.rotationTotal - >> fxElemVisStateSample.base.size[0] - >> fxElemVisStateSample.base.size[1] - >> fxElemVisStateSample.base.scale; - - result << fxElemVisStateSample; - } - - return result; -} - - -// ?Load_pathbasenode_tArray@@YAX_NH@Z at 0x822a4d60 -QVector Assets::Load_pathbasenode_tArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - PathBaseNode pathbasenode; - - *aStream - >> pathbasenode.vOrigin[0] - >> pathbasenode.vOrigin[1] - >> pathbasenode.vOrigin[2] - >> pathbasenode.type; - - result << pathbasenode; - } - - return result; -} - -typedef PathLink pathlink_t; - -// ?Load_pathlink_tArray@@YAX_NH@Z at 0x822a4d78 -QVector Assets::Load_pathlink_tArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - pathlink_t pathlink; - - *aStream - >> pathlink.fDist - >> pathlink.nodeNum - >> pathlink.disconnectCount - >> pathlink.negotiationLink - >> pathlink.ubBadPlaceCount[0] - >> pathlink.ubBadPlaceCount[1] - >> pathlink.ubBadPlaceCount[2] - >> pathlink.ubBadPlaceCount[3]; - - result << pathlink; - } - - return result; -} - - -// ?Load_XModelHighMipBoundsArray@@YAX_NH@Z at 0x822a4d98 -QVector Assets::Load_XModelHighMipBoundsArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - XModelHighMipBounds xModelHighMipBounds; - - *aStream - >> xModelHighMipBounds.mins[0] - >> xModelHighMipBounds.mins[1] - >> xModelHighMipBounds.mins[2] - >> xModelHighMipBounds.maxs[0] - >> xModelHighMipBounds.maxs[1] - >> xModelHighMipBounds.maxs[2]; - - result << xModelHighMipBounds; - } - - return result; -} - -typedef XModelCollSurf XModelCollSurf; - -// ?Load_XModelCollSurf@@YAX_N@Z at 0x822a4db8 -XModelCollSurf Assets::Load_XModelCollSurf(QDataStream *aStream) -{ - XModelCollSurf result; - - *aStream - >> result.mins[0] - >> result.mins[1] - >> result.maxs[2] - >> result.maxs[0] - >> result.maxs[1] - >> result.maxs[2] - >> result.boneIdx - >> result.contents - >> result.surfFlags; - - return result; -} - -typedef unsigned __int8 cbrushedge_t; - -// ?Load_cbrushedge_t@@YAX_N@Z at 0x822a4de8 -cbrushedge_t Assets::Load_cbrushedge_t(QDataStream *aStream) -{ - cbrushedge_t result; - - *aStream >> result; - - return result; -} - -// ?Load_cbrushedge_tArray@@YAX_NH@Z at 0x822a4dd0 -QVector Assets::Load_cbrushedge_tArray(QDataStream *aStream, size_t count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - result << Load_cbrushedge_t(aStream); - } - - return result; -} - -typedef CPlane cplane_t; - -// ?Load_cplane_t@@YAX_N@Z at 0x822a4e20 -cplane_t Assets::Load_cplane_t(QDataStream *aStream) -{ - cplane_t result; - - *aStream - >> result.normal[0] - >> result.normal[1] - >> result.normal[2] - >> result.dist - >> result.type - >> result.signbits - >> result.pad[0] - >> result.pad[1]; - - return result; -} - -// ?Load_cplane_t@@YAX_N@Z at 0x822a4e20 -CPlane Assets::Load_CPlane(QDataStream *aStream) -{ - CPlane result; - - *aStream - >> result.normal[0] - >> result.normal[1] - >> result.normal[2] - >> result.dist - >> result.type - >> result.signbits - >> result.pad[0] - >> result.pad[1]; - - return result; -} - - -// ?Load_cplane_tArray@@YAX_NH@Z at 0x822a4e00 -QVector Assets::Load_cplane_tArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - result << Load_cplane_t(aStream); - } - - return result; -} - - -// ?Load_MaterialConstantDefArray@@YAX_NH@Z at 0x822a4e38 -QVector Assets::Load_MaterialConstantDefArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - MaterialConstantDef materialConstantDef; - - *aStream >> materialConstantDef.nameHash; - - for (int j = 0; j < 12; j++) { - *aStream >> materialConstantDef.name[j]; - } - - for (int j = 0; j < 4; j++) { - *aStream >> materialConstantDef.literal[j]; - } - - *aStream - >> materialConstantDef.literal[0] - >> materialConstantDef.literal[1] - >> materialConstantDef.literal[2] - >> materialConstantDef.literal[3]; - - result << materialConstantDef; - } - - return result; -} - - -// ?Load_GfxStateBitsArray@@YAX_NH@Z at 0x822a4e50 -QVector Assets::Load_GfxStateBitsArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - GfxStateBits gfxStateBits; - - *aStream - >> gfxStateBits.loadBits[0] - >> gfxStateBits.loadBits[1]; - - result << gfxStateBits; - } - - return result; -} - - -// ?Load_MaterialArgumentCodeConst@@YAX_N@Z at 0x822a4e68 -MaterialArgumentCodeConst Assets::Load_MaterialArgumentCodeConst(QDataStream *aStream) -{ - MaterialArgumentCodeConst result; - - *aStream - >> result.index - >> result.firstRow - >> result.rowCount; - - return result; -} - - -// ?Load_MaterialVertexDeclaration@@YAX_N@Z at 0x822a4e80 -MaterialVertexDeclaration Assets::Load_MaterialVertexDeclaration(QDataStream *aStream) -{ - MaterialVertexDeclaration result; - - *aStream - >> result.streamCount - >> result.hasOptionalSource; - - for (int i = 0; i < 16; i++) { - - *aStream >> result.routing.data[i].source; - *aStream >> result.routing.data[i].dest; - } - - for (int i = 0; i < 15; i++) { - quint32 declPtr; - *aStream >> declPtr; - &result.routing.decl[i] = declPtr; - } - - return result; -} - -// ?Load_byteShaderArray@@YAX_NH@Z at 0x822a4e98 -QVector Assets::Load_byteShaderArray(QDataStream *aStream, size_t count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - quint8 byteShader_; - - *aStream >> byteShader_; - - result << byteShader_; - } - - return result; -} - -typedef unsigned __int8 byte4; - -// ?Load_byte4Array@@YAX_NH@Z at 0x822a4eb0 -QVector Assets::Load_byte4Array(QDataStream *aStream, size_t count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - byte4 byte4_; - - *aStream >> byte4_; - - result << byte4_; - } - - return result; -} - -typedef GfxTexture GfxRawTexture; - -// ?Load_GfxRawTextureArray@@YAX_NH@Z at 0x822a4ec8 -QVector Assets::Load_GfxRawTextureArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - GfxRawTexture gfxRawTexture; - - *aStream - >> gfxRawTexture.basemapPtr - >> gfxRawTexture.mapPtr - >> gfxRawTexture.volmapPtr - >> gfxRawTexture.cubemapPtr - >> gfxRawTexture.loadDefPtr; - - result << gfxRawTexture; - } - - return result; -} - - -// ?Load_IDirect3DCubeTexture9@@YAX_N@Z at 0x822a4ee0 -D3DCubeTexture Assets::Load_IDirect3DCubeTexture9(QDataStream *aStream) -{ - D3DCubeTexture result; - - *aStream - >> result.MipFlush - >> result.Format - >> result.Common - >> result.ReferenceCount - >> result.Fence - >> result.ReadFence - >> result.Identifier - >> result.BaseFlush; - - for (int i = 0; i < 16; i++) { - - *aStream >> result.routing.data[i].source; - *aStream >> result.routing.data[i].dest; - } - - for (int i = 0; i < 15; i++) { - quint32 declPtr; - *aStream >> declPtr; - &result.routing.decl[i] = declPtr; - } - - return result; -} - - -// ?Load_IDirect3DVolumeTexture9@@YAX_N@Z at 0x822a4ef8 -D3DVolumeTexture Assets::Load_IDirect3DVolumeTexture9(QDataStream *aStream) -{ - D3DVolumeTexture result; - - *aStream - >> result.MipFlush - >> result.Format - >> result.Common - >> result.ReferenceCount - >> result.Fence - >> result.ReadFence - >> result.Identifier - >> result.BaseFlush; - - for (int i = 0; i < 16; i++) { - - *aStream >> result.routing.data[i].source; - *aStream >> result.routing.data[i].dest; - } - - for (int i = 0; i < 15; i++) { - quint32 declPtr; - *aStream >> declPtr; - &result.routing.decl[i] = declPtr; - } - - return result; -} - - -// ?Load_IDirect3DTexture9@@YAX_N@Z at 0x822a4f10 -D3DTexture Assets::Load_IDirect3DTexture9(QDataStream *aStream) -{ - D3DTexture result; - - *aStream - >> result.MipFlush - >> result.Format; - - return result; -} - -// ?Load_r_index16_tArray@@YAX_NH@Z at 0x822a4f28 -QVector Assets::Load_r_index16_tArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - quint16 r_index16; - - *aStream >> r_index16; - - result << r_index16; - } - - return result; -} - -// ?Load_r_index_tArray@@YAX_NH@Z at 0x822a4f40 -QVector Assets::Load_r_index_tArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - quint16 r_index; - - *aStream >> r_index; - - result << r_index; - } - - return result; -} - -// ?Load_GfxIndexBuffer@@YAX_N@Z at 0x822a4f58 -D3DIndexBuffer Assets::Load_GfxIndexBuffer(QDataStream *aStream) -{ - D3DIndexBuffer result; - - *aStream - >> result.Address - >> result.Size - >> result.Common - >> result.ReferenceCount - >> result.Fence - >> result.ReadFence - >> result.Identifier - >> result.BaseFlush; - - return result; -} - -// ?Load_XBlendInfoArray@@YAX_NH@Z at 0x822a4f70 -QVector Assets::Load_XBlendInfoArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - quint16 xBlendInfo; - - *aStream >> xBlendInfo; - - result << xBlendInfo; - } - - return result; -} - -typedef D3DVertexBuffer GfxVertexBuffer; - -// ?Load_GfxVertexBuffer@@YAX_N@Z at 0x822a4f88 -GfxVertexBuffer Assets::Load_GfxVertexBuffer(QDataStream *aStream) -{ - GfxVertexBuffer result; - - *aStream - >> result.Format.request.Type - >> result.Format.request.BaseAddress - >> result.Format.request.Endian - >> result.Format.request.Size - >> result.Format.request.AddressClamp - >> result.Format.request. - >> result.Format.request.RequestSize - >> result.Format.request.ClampDisable - >> result.Format.dword[0] - >> result.Format.dword[1] - >> result.Common - >> result.ReferenceCount - >> result.Fence - >> result.ReadFence - >> result.Identifier - >> result.BaseFlush; - - return result; -} - - -// ?Load_XSurfaceCollisionNodeArray@@YAX_NH@Z at 0x822a4fa0 -QVector Assets::Load_XSurfaceCollisionNodeArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - XSurfaceCollisionNode xSurfaceCollisionNode; - - *aStream - >> xSurfaceCollisionNode.aabb.mins[0] - >> xSurfaceCollisionNode.aabb.mins[1] - >> xSurfaceCollisionNode.aabb.mins[2] - >> xSurfaceCollisionNode.aabb.maxs[0] - >> xSurfaceCollisionNode.aabb.maxs[1] - >> xSurfaceCollisionNode.aabb.maxs[2] - >> xSurfaceCollisionNode.childBeginIndex - >> xSurfaceCollisionNode.childCount; - - result << xSurfaceCollisionNode; - } - - return result; -} - -// ?Load_XSurfaceCollisionLeafArray@@YAX_NH@Z at 0x822a4fb8 -QVector Assets::Load_XSurfaceCollisionLeafArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - XSurfaceCollisionLeaf xSurfaceCollisionLeaf; - - *aStream >> xSurfaceCollisionLeaf.triangleBeginIndex; - - result << xSurfaceCollisionLeaf; - } - - return result; -} - - -// ?Load_GfxBrushModelArray@@YAX_NH@Z at 0x822a4fd0 -QVector Assets::Load_GfxBrushModelArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - GfxBrushModel gfxBrushModel; - - *aStream - >> gfxBrushModel.writable.mins[0] - >> gfxBrushModel.writable.mins[1] - >> gfxBrushModel.writable.mins[2] - >> gfxBrushModel.writable.maxs[0] - >> gfxBrushModel.writable.maxs[1] - >> gfxBrushModel.writable.maxs[2] - >> gfxBrushModel.bounds[0][0] - >> gfxBrushModel.bounds[0][1] - >> gfxBrushModel.bounds[0][2] - >> gfxBrushModel.bounds[1][0] - >> gfxBrushModel.bounds[1][1] - >> gfxBrushModel.bounds[1][2] - >> gfxBrushModel.surfaceCount - >> gfxBrushModel.startSurfIndex; - - result << gfxBrushModel; - } - - return result; -} - -typedef GfxPackedVertex GfxPackedVertex0; - -// ?Load_GfxPackedVertex0Array@@YAX_NH@Z at 0x822a4fe8 -QVector Assets::Load_GfxPackedVertex0Array(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - GfxPackedVertex0 gfxPackedVertex0; - - *aStream - >> gfxPackedVertex0.xyz[0] - >> gfxPackedVertex0.xyz[1] - >> gfxPackedVertex0.xyz[2] - >> gfxPackedVertex0.binormalSign - >> gfxPackedVertex0.color.array[0] - >> gfxPackedVertex0.color.array[1] - >> gfxPackedVertex0.color.array[2] - >> gfxPackedVertex0.color.array[3] - >> gfxPackedVertex0.texCoord.packed - >> gfxPackedVertex0.normal.packed - >> gfxPackedVertex0.tangent.packed; - - result << gfxPackedVertex0; - } - - return result; -} - -typedef GfxWorldVertex GfxWorldVertex0; - -// ?Load_GfxWorldVertex0Array@@YAX_NH@Z at 0x822a5000 -void Assets::Load_GfxWorldVertex0Array(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - GfxWorldVertex0 gfxWorldVertex0; - - *aStream - >> gfxWorldVertex0.xyz[0] - >> gfxWorldVertex0.xyz[1] - >> gfxWorldVertex0.xyz[2] - >> gfxWorldVertex0.binormalSign - >> gfxWorldVertex0.color.array[0] - >> gfxWorldVertex0.color.array[1] - >> gfxWorldVertex0.color.array[2] - >> gfxWorldVertex0.color.array[3] - >> gfxWorldVertex0.texCoord[0] - >> gfxWorldVertex0.texCoord[1] - >> gfxWorldVertex0.lmapCoord[0] - >> gfxWorldVertex0.lmapCoord[1] - >> gfxWorldVertex0.normal.packed - >> gfxWorldVertex0.tangent.packed; - - result << gfxPackedVertex0; - } - - return result; -} - - -// ?Load_XAUDIOCHANNELMAPENTRYArray@@YAX_NH@Z at 0x822a5018 -QVector Assets::Load_XAUDIOCHANNELMAPENTRYArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - XAUDIOCHANNELMAPENTRY xAUDIOCHANNELMAPENTRY; - - *aStream - >> xAUDIOCHANNELMAPENTRY.InputChannel - >> xAUDIOCHANNELMAPENTRY.OutputChannel - >> xAUDIOCHANNELMAPENTRY.Volume; - - result << xAUDIOCHANNELMAPENTRY; - } - - return result; -} - - -// ?Load_StreamFileNamePacked@@YAX_N@Z at 0x822a5030 -StreamFileNamePacked Assets::Load_StreamFileNamePacked(QDataStream *aStream) -{ - StreamFileNamePacked result; - - *aStream - >> result.offset - >> result.length; - - return result; -} - - -// ?Load_XaReverbSettingsArray@@YAX_NH@Z at 0x822a5048 -QVector Assets::Load_XaReverbSettingsArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - XAudioReverbSettings xaReverbSettings; - - *aStream - >> xaReverbSettings.presetOverridden - >> xaReverbSettings.reverbSettings.ReflectionsDelay - >> xaReverbSettings.reverbSettings.ReverbDelay - >> xaReverbSettings.reverbSettings.RearDelay - >> xaReverbSettings.reverbSettings.PositionLeft - >> xaReverbSettings.reverbSettings.PositionRight - >> xaReverbSettings.reverbSettings.PositionMatrixLeft - >> xaReverbSettings.reverbSettings.PositionMatrixRight - >> xaReverbSettings.reverbSettings.EarlyDiffusion - >> xaReverbSettings.reverbSettings.LateDiffusion - >> xaReverbSettings.reverbSettings.LowEQGain - >> xaReverbSettings.reverbSettings.LowEQCutoff - >> xaReverbSettings.reverbSettings.HighEQGain - >> xaReverbSettings.reverbSettings.HighEQCutoff - >> xaReverbSettings.reverbSettings.RoomFilterFreq - >> xaReverbSettings.reverbSettings.RoomFilterMain - >> xaReverbSettings.reverbSettings.RoomFilterHF - >> xaReverbSettings.reverbSettings.ReflectionsGain - >> xaReverbSettings.reverbSettings.ReverbGain - >> xaReverbSettings.reverbSettings.DecayTime - >> xaReverbSettings.reverbSettings.Density - >> xaReverbSettings.reverbSettings.RoomSize; - - result << xaReverbSettings; - } - - return result; -} - -typedef char char2048; - -// ?Load_char2048Array@@YAX_NH@Z at 0x822a5060 -QVector Assets::Load_char2048Array(QDataStream *aStream, size_t count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - char2048 char2048_; - - *aStream >> char2048_; - - result << char2048_; - } - - return result; -} - - -// ?Load_DObjAnimMatArray@@YAX_NH@Z at 0x822a5078 -QVector Assets::Load_DObjAnimMatArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - DObjAnimMat dObjAnimMat; - - *aStream - >> dObjAnimMat.quat[0] - >> dObjAnimMat.quat[1] - >> dObjAnimMat.quat[2] - >> dObjAnimMat.quat[3] - >> dObjAnimMat.trans[0] - >> dObjAnimMat.trans[1] - >> dObjAnimMat.trans[2] - >> dObjAnimMat.transWeight; - - result << dObjAnimMat; - } - - return result; -} - - -// ?Load_XBoneInfoArray@@YAX_NH@Z at 0x822a5090 -QVector Assets::Load_XBoneInfoArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - XBoneInfo xBoneInfo; - - *aStream - >> xBoneInfo.bounds[0][0] - >> xBoneInfo.bounds[0][1] - >> xBoneInfo.bounds[0][2] - >> xBoneInfo.bounds[1][0] - >> xBoneInfo.bounds[1][1] - >> xBoneInfo.bounds[1][2] - >> xBoneInfo.offset[0] - >> xBoneInfo.offset[1] - >> xBoneInfo.offset[2] - >> xBoneInfo.radiusSquared; - - result << xBoneInfo; - } - - return result; -} - -typedef unsigned __int16 UShortVec[3]; - -// ?Load_UShortVecArray@@YAX_NH@Z at 0x822a50b0 -QVector Assets::Load_UShortVecArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - UShortVec uShortVec; - - *aStream - >> uShortVec[0] - >> uShortVec[1] - >> uShortVec[2]; - - result << uShortVec; - } - - return result; -} - -typedef unsigned __int8 ByteVec[3]; - -// ?Load_ByteVecArray@@YAX_NH@Z at 0x822a50d0 -QVector Assets::Load_ByteVecArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - ByteVec byteVec; - - *aStream - >> byteVec[0] - >> byteVec[1] - >> byteVec[2]; - - result << byteVec; - } - - return result; -} - - -// ?Load_dmaterial_tArray@@YAX_NH@Z at 0x822a50f0 -QVector Assets::Load_dmaterial_tArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - dmaterial_t dmaterial; - - for (int j = 0; j < 64; j++) { - *aStream >> dmaterial.material[j]; - } - - *aStream - >> dmaterial.surfaceFlags - >> dmaterial.contentFlags; - - result << dmaterial; - } - - return result; -} - - -// ?Load_XString@@YAX_N@Z at 0x822a5110 -void Assets::Load_XString(QDataStream *aStream) -{ - const char *v3; // r11 - - qint32 stringPtr; - *aStream >> stringPtr; - - if (stringPtr) - { - if (stringPtr == -1) - { - //Load_XStringCustom(v1); - } - else - { - // Resolve pointer to g_streamBlocks contents - //*varXString = (const char *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + (((unsigned int)(stringPtr - 1) >> 26) & 0x38)))[(stringPtr - 1) & 0x1FFFFFFF]; - } - } -} - -// See if this actually needs to be const char -//typedef const char ConstChar; -typedef QChar ConstChar; - -// ?Load_ConstCharArray@@YAX_NH@Z at 0x822a51b0 -QVector Assets::Load_ConstCharArray(QDataStream *aStream, size_t count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - ConstChar constChar; - - *aStream >> constChar; - - result << constChar; - } - - return result; -} - -typedef unsigned __int16 ScriptString; - -// ?Load_ScriptString@@YAX_N@Z at 0x822a51c8 -ScriptString Assets::Load_ScriptString(QDataStream *aStream) -{ - ScriptString result; - - *aStream >> result; - - return result; - - // Might need to resolve contents to the value in varXAssetList? - //*varScriptString = (unsigned __int16)*(const char **)((char *)varXAssetList->stringList.strings - // + __ROL4__(*varScriptString, 2)); -} - -typedef unsigned __int16 UnsignedShort; - -// ?Load_UnsignedShortArray@@YAX_NH@Z at 0x822a5220 -QVector Assets::Load_UnsignedShortArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - UnsignedShort unsignedShort; - - *aStream >> unsignedShort; - - result << unsignedShort; - } - - return result; -} - -struct XQuat2 { - __int16 u[2]; -}; - -// ?Load_XQuat2@@YAX_N@Z at 0x822a5250 -XQuat2 Assets::Load_XQuat2(QDataStream *aStream) -{ - XQuat2 xQuat2; - - *aStream - >> xQuat2.u[0] - >> xQuat2.u[1]; - - return xQuat2; -} - -// ?Load_XQuat2Array@@YAX_NH@Z at 0x822a5238 -QVector Assets::Load_XQuat2Array(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - result << Load_XQuat2(aStream); - } - - return result; -} - - -// ?Load_ushortArray@@YAX_NH@Z at 0x822a5268 -QVector Assets::Load_ushortArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - ushort ushort_; - - *aStream >> ushort_; - - result << ushort_; - } - - return result; -} - - -// ?Load_shortArray@@YAX_NH@Z at 0x822a5280 -QVector Assets::Load_shortArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - short short_; - - *aStream >> short_; - - result << short_; - } - - return result; -} - -struct vec3_t { - float v[3]; -}; - -// ?Load_vec3_t@@YAX_N@Z at 0x822a52b8 -vec3_t Assets::Load_vec3_t(QDataStream *aStream) -{ - vec3_t result; - - *aStream - >> result.v[0] - >> result.v[1] - >> result.v[2]; - - return result; -} - -// ?Load_vec3_tArray@@YAX_NH@Z at 0x822a5298 -QVector Assets::Load_vec3_tArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - result << Load_vec3_t(aStream); - } - - return result; -} - -struct vec2_t { - float v[2]; -}; - -// ?Load_vec2_tArray@@YAX_NH@Z at 0x822a52d0 -QVector Assets::Load_vec2_tArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - vec2_t vec2; - - *aStream - >> vec2.v[0] - >> vec2.v[1]; - - result << vec2; - } - - return result; -} - -typedef unsigned __int8 raw_byte16; - -// ?Load_raw_byte16Array@@YAX_NH@Z at 0x822a52e8 -QVector Assets::Load_raw_byte16Array(QDataStream *aStream, size_t count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - raw_byte16 raw_byte16_; - - *aStream >> raw_byte16_; - - result << raw_byte16_; - } - - return result; -} - -typedef unsigned __int8 raw_byte; - -// ?Load_raw_byteArray@@YAX_NH@Z at 0x822a5300 -QVector Assets::Load_raw_byteArray(QDataStream *aStream, size_t count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - raw_byte raw_byte_; - - *aStream >> raw_byte_; - - result << raw_byte_; - } - - return result; -} - -typedef unsigned int raw_uint128; - -// ?Load_raw_uint128Array@@YAX_NH@Z at 0x822a5318 -QVector Assets::Load_raw_uint128Array(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - raw_uint128 raw_uint128_; - - *aStream >> raw_uint128_; - - result << raw_uint128_; - } - - return result; -} - -typedef unsigned int raw_uint; - -// ?Load_raw_uintArray@@YAX_NH@Z at 0x822a5330 -QVector Assets::Load_raw_uintArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - raw_uint raw_uint_; - - *aStream >> raw_uint_; - - result << raw_uint_; - } - - return result; -} - - -// ?Load_float@@YAX_N@Z at 0x822a5360 -float Assets::Load_float(QDataStream *aStream) -{ - float result; - - *aStream >> result; - - return result; -} - - -// ?Load_floatArray@@YAX_NH@Z at 0x822a5348 -QVector Assets::Load_floatArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - result << Load_float(aStream); - } - - return result; -} - - -// ?Load_uint@@YAX_N@Z at 0x822a5390 -uint Assets::Load_uint(QDataStream *aStream) -{ - uint result; - - *aStream >> result; - - return result; -} - - -// ?Load_uintArray@@YAX_NH@Z at 0x822a5378 -QVector Assets::Load_uintArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - result << Load_uint(aStream); - } - - return result; -} - - -// ?Load_DWORDArray@@YAX_NH@Z at 0x822a53a8 -QVector Assets::Load_DWORDArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - DWORD DWORD_; - - *aStream >> DWORD_; - - result << DWORD_; - } - - return result; -} - -typedef unsigned __int8 byte4096; - -// ?Load_byte4096Array@@YAX_NH@Z at 0x822a53c0 -QVector Assets::Load_byte4096Array(QDataStream *aStream, size_t count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - byte4096 byte4096_; - - *aStream >> byte4096_; - - result << byte4096_; - } - - return result; -} - - -// ?Load_int@@YAX_N@Z at 0x822a53f0 -int Assets::Load_int(QDataStream *aStream) -{ - int result; - - *aStream >> result; - - return result; -} - - -// ?Load_intArray@@YAX_NH@Z at 0x822a53d8 -QVector Assets::Load_intArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - result << Load_int(aStream); - } - - return result; -} - - -// ?Load_char@@YAX_N@Z at 0x822a5420 -char Assets::Load_char(QDataStream *aStream) -{ - char result; - - *aStream >> result; - - return result; -} - - -// ?Load_charArray@@YAX_NH@Z at 0x822a5408 -QVector Assets::Load_charArray(QDataStream *aStream, size_t count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - result << Load_char(aStream); - } - - return result; -} - - -// ?Load_byteArray@@YAX_NH@Z at 0x822a5438 -QVector Assets::Load_byteArray(QDataStream *aStream, size_t count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - byte byte_; - - *aStream >> byte_; - - result << byte_; - } - - return result; -} - - -// ?Load_GfxWorldDpvsPlanes@@YAX_N@Z at 0x822a5450 -GfxWorldDpvsPlanes Assets::Load_GfxWorldDpvsPlanes(QDataStream *aStream, GfxWorld aGfxWorld) -{ - GfxWorldDpvsPlanes result; - *aStream - >> result.cellCount - >> result.planesPtr - >> result.nodesPtr - >> result.sceneEntCellBitsPtr; - - if (result.planesPtr) - { - if (result.planesPtr == -1) - { - for (int i = 0; i < aGfxWorld.planeCount; i++) { - gfxWorldDpvsPlanes.planes << Load_cplane_t(aStream); - } - } - else - { - // Resolve to content in g_streamBlocks - //varGfxWorldDpvsPlanes->planes = (cplane_s *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + (((unsigned int)&varGfxWorldDpvsPlanes->planes[-1].pad[1] >> 26) & 0x38)))[(int)&varGfxWorldDpvsPlanes->planes[-1].pad[1] & 0x1FFFFFFF]; - } - } - if (result.nodesPtr) - { - for (int i = 0; i < aGfxWorld.nodeCount; i++) { - ushort ushort_; - - *aStream >> ushort_; - - result.nodes << ushort_; - } - } - if (result.sceneEntCellBitsPtr) - { - for (int i = 0; i < (result.cellCount << 10); i++) { - unsigned int uint_; - - *aStream >> uint_; - - result.sceneEntCellBits << uint_; - } - } - return result; -} - - -// ?Load_GfxWorldDpvsDynamic@@YAX_N@Z at 0x822a5580 -GfxWorldDpvsDynamic Assets::Load_GfxWorldDpvsDynamic(QDataStream *aStream, GfxWorld aGfxWorld) -{ - GfxWorldDpvsDynamic result; - *aStream - >> result.dynEntClientWordCount[0] - >> result.dynEntClientWordCount[1] - >> result.dynEntClientCount[0] - >> result.dynEntClientCount[1] - >> result.dynEntCellBitsPtrs[0] - >> result.dynEntCellBitsPtrs[1] - >> result.dynEntVisDataPtrs[0][0] - >> result.dynEntVisDataPtrs[0][1] - >> result.dynEntVisDataPtrs[0][2] - >> result.dynEntVisDataPtrs[1][0] - >> result.dynEntVisDataPtrs[1][1] - >> result.dynEntVisDataPtrs[1][2]; - - - if (result.dynEntCellBitsPtrs[0]) - { - //for (int i = 0; i < aGfxWorld.dpvsPlanes.cellCount * gfxWorldDpvsDynamic.dynEntClientWordCount[0]; i++) { - *aStream >> result.dynEntCellBits[0]; - //} - } - if (result.dynEntCellBitsPtrs[1]) - { - //for (int i = 0; i < aGfxWorld.dpvsPlanes.cellCount * gfxWorldDpvsDynamic.dynEntClientWordCount[0]; i++) { - *aStream >> result.dynEntCellBits[1]; - //} - } - if (result.dynEntVisDataPtrs[0][0]) - { - //for (int i = 0; i < gfxWorldDpvsDynamic.dynEntClientWordCount[0]; i++) { - *aStream >> result.dynEntVisData[0][0]; - //} - } - if (result.dynEntVisDataPtrs[1][0]) - { - //for (int i = 0; i < gfxWorldDpvsDynamic.dynEntClientWordCount[1]; i++) { - *aStream >> result.dynEntVisData[1][0]; - //} - } - if (result.dynEntVisDataPtrs[0][1]) - { - //for (int i = 0; i < gfxWorldDpvsDynamic.dynEntClientWordCount[0]; i++) { - *aStream >> result.dynEntVisData[0][1]; - //} - } - if (result.dynEntVisDataPtrs[1][1]) - { - //for (int i = 0; i < gfxWorldDpvsDynamic.dynEntClientWordCount[1]; i++) { - *aStream >> result.dynEntVisData[1][1]; - //} - } - if (result.dynEntVisDataPtrs[0][2]) - { - //for (int i = 0; i < gfxWorldDpvsDynamic.dynEntClientWordCount[0]; i++) { - *aStream >> result.dynEntVisData[0][2]; - //} - } - if (result.dynEntVisDataPtrs[1][2]) - { - //for (int i = 0; i < gfxWorldDpvsDynamic.dynEntClientWordCount[1]; i++) { - *aStream >> result.dynEntVisData[1][2]; - //} - } - return result; -} - - -// ?Load_GfxLightRegionHull@@YAX_N@Z at 0x822a57d0 -GfxLightRegionHull Assets::Load_GfxLightRegionHull(QDataStream *aStream) -{ - unsigned int axisCount; // r11 - unsigned __int8 *v2; // r4 - - GfxLightRegionHull result; - *aStream - >> result.kdopMidPoint[0] - >> result.kdopMidPoint[1] - >> result.kdopMidPoint[2] - >> result.kdopMidPoint[3] - >> result.kdopMidPoint[4] - >> result.kdopMidPoint[5] - >> result.kdopMidPoint[6] - >> result.kdopMidPoint[7] - >> result.kdopMidPoint[8] - >> result.kdopHalfSize[0] - >> result.kdopHalfSize[1] - >> result.kdopHalfSize[2] - >> result.kdopHalfSize[3] - >> result.kdopHalfSize[4] - >> result.kdopHalfSize[5] - >> result.kdopHalfSize[6] - >> result.kdopHalfSize[7] - >> result.kdopHalfSize[8] - >> result.axisCount - >> result.axisPtr; - - if (result.axisPtr) - { - for (int i = 0; i < result.axisCount; i++) { - GfxLightRegionAxis axis; - - *aStream - >> axis.dir[0] - >> axis.dir[1] - >> axis.dir[2] - >> axis.midPoint - >> axis.halfSize; - - result.axis << axis; - } - } - return result; -} - -unsigned __int16 __ROL4__(unsigned __int16 value, unsigned __int16 bits) { - // Ensure that the rotation is within bounds - bits = bits % 32; // In case someone passes a value greater than 31 - - return (value << bits) | (value >> (8 - bits)); -} - -// ?Load_GfxShadowGeometry@@YAX_N@Z at 0x822a5850 -GfxShadowGeometry Assets::Load_GfxShadowGeometry(QDataStream *aStream) -{ - GfxShadowGeometry result; - *aStream - >> result.surfaceCount - >> result.smodelCount - >> result.sortedSurfIndexPtr - >> result.smodelIndexPtr; - - if (result.sortedSurfIndexPtr) - { - for (int i = 0; i < __ROL4__(result.surfaceCount, 1); i++) { - unsigned __int16 surfIndex; - - *aStream >> surfIndex; - - result.sortedSurfIndex << surfIndex; - } - } - if (result.smodelIndexPtr) - { - for (int i = 0; i < __ROL4__(result.smodelCount, 1); i++) { - unsigned __int16 smodelIndex; - - *aStream >> smodelIndex; - - result.smodelIndex << smodelIndex; - } - } - return result; -} - - -// ?Load_GfxWorldStreamInfo@@YAX_N@Z at 0x822a58f0 -GfxWorldStreamInfo Assets::Load_GfxWorldStreamInfo(QDataStream *aStream) -{ - GfxWorldStreamInfo result; - *aStream - >> result.aabbTreeCount - >> result.aabbTreesPtr - >> result.leafRefCount - >> result.leafRefsPtr; - - if (result.aabbTreesPtr) - { - for (int i = 0; i < result.aabbTreeCount; i++) { - GfxStreamingAabbTree aabbTree; - - *aStream - >> aabbTree.firstItem - >> aabbTree.itemCount - >> aabbTree.firstChild - >> aabbTree.childCount - >> aabbTree.mins[0] - >> aabbTree.mins[1] - >> aabbTree.mins[2] - >> aabbTree.maxs[0] - >> aabbTree.maxs[1] - >> aabbTree.maxs[2]; - - result.aabbTrees << aabbTree; - } - } - if (result.leafRefsPtr) - { - for (int i = 0; i < result.leafRefCount; i++) { - int leafRef; - - *aStream >> leafRef; - - result.leafRefs << leafRef; - } - } - return result; -} - - -// ?Load_GfxLightGrid@@YAX_N@Z at 0x822a59b0 -GfxLightGrid Assets::Load_GfxLightGrid(QDataStream *aStream) -{ - GfxLightGrid result; - - *aStream - >> result.hasLightRegions - >> result.sunPrimaryLightIndex - >> result.mins[0] - >> result.mins[1] - >> result.mins[2] - >> result.maxs[0] - >> result.maxs[1] - >> result.maxs[2] - >> result.rowAxis - >> result.colAxis - >> result.rowDataStartPtr - >> result.rawRowDataSize - >> result.rawRowDataPtr - >> result.entryCount - >> result.entriesPtr - >> result.colorCount - >> result.colorsPtr; - - if (result.rowDataStartPtr) - { - for (int i = 0; i < (result.maxs[result.rowAxis] - result.mins[result.rowAxis] + 1); i++) { - unsigned __int16 rowDataStart; - - *aStream >> rowDataStart; - - result.rowDataStart << rowDataStart; - } - } - if (result.rawRowDataPtr) - { - for (int i = 0; i < result.rawRowDataSize; i++) { - unsigned __int16 rawRowData; - - *aStream >> rawRowData; - - result.rawRowData << rawRowData; - } - } - if (result.entriesPtr) - { - for (int i = 0; i < result.entryCount; i++) { - GfxLightGridEntry entry; - - *aStream - >> entry.colorsIndex - >> entry.primaryLightIndex - >> entry.needsTrace; - - result.entries << entry; - } - } - if (result.colorsPtr) - { - for (int i = 0; i < result.colorCount; i++) { - result.colors << Load_GfxLightGridColors(aStream); - } - } -} - - -// ?Load_GfxWorldVertexLayerData@@YAX_N@Z at 0x822a5af8 -GfxWorldVertexLayerData Assets::Load_GfxWorldVertexLayerData(QDataStream *aStream, GfxWorld aGfxWorld) -{ - GfxWorldVertexLayerData result; - - *aStream - >> result.dataPtr - >> result.layerVb.Format.__s0.Type - >> result.layerVb.Format.__s0.BaseAddress - >> result.layerVb.Format.__s0.Endian - >> result.layerVb.Format.__s0.Size - >> result.layerVb.Format.__s0.AddressClamp - //>> result.layerVb.Format.__s0.: 1; - >> result.layerVb.Format.__s0.RequestSize - >> result.layerVb.Format.__s0.ClampDisable - >> result.layerVb.Format.dword[0] - >> result.layerVb.Format.dword[1] - >> result.layerVb.Common - >> result.layerVb.ReferenceCount - >> result.layerVb.Fence - >> result.layerVb.ReadFence - >> result.layerVb.Identifier - >> result.layerVb.BaseFlush; - - if (result.dataPtr) - { - for (int i = 0; i < aGfxWorld.vertexLayerDataSize; i++) { - unsigned __int8 dataPart; - - *aStream >> dataPart; - - result.data << dataPart; - } - } - aStream->skipRawData(0x20); - return result; -} - - -// ?Load_GfxWorldVertexData@@YAX_N@Z at 0x822a5bd0 -GfxWorldVertexData Assets::Load_GfxWorldVertexData(QDataStream *aStream, GfxWorld aGfxWorld) -{ - GfxWorldVertexData *v1; // r11 - GfxWorldVertex *v2; // r4 - unsigned int vertexCount; // r11 - D3DVertexBuffer *p_worldVb; // r31 - GfxWorldVertex *vertices; // r30 - - GfxWorldVertexData result; - *aStream - >> result.verticesPtr - >> result.worldVb.Format.__s0.Type - >> result.worldVb.Format.__s0.BaseAddress - >> result.worldVb.Format.__s0.Endian - >> result.worldVb.Format.__s0.Size - >> result.worldVb.Format.__s0.AddressClamp - //>> result.worldVb.Format.__s0.: 1; - >> result.worldVb.Format.__s0.RequestSize - >> result.worldVb.Format.__s0.ClampDisable - >> result.worldVb.Format.dword[0] - >> result.worldVb.Format.dword[1] - >> result.worldVb.Common - >> result.worldVb.ReferenceCount - >> result.worldVb.Fence - >> result.worldVb.ReadFence - >> result.worldVb.Identifier - >> result.worldVb.BaseFlush; - - if (result.verticesPtr) - { - for (int i = 0; i < aGfxWorld.vertexCount; i++) { - GfxWorldVertex gfxWorldVertex; - - *aStream - >> gfxWorldVertex.xyz[0] - >> gfxWorldVertex.xyz[1] - >> gfxWorldVertex.xyz[2] - >> gfxWorldVertex.binormalSign - >> gfxWorldVertex.color.array[0] - >> gfxWorldVertex.color.array[1] - >> gfxWorldVertex.color.array[2] - >> gfxWorldVertex.color.array[3] - >> gfxWorldVertex.texCoord[0] - >> gfxWorldVertex.texCoord[1] - >> gfxWorldVertex.lmapCoord[0] - >> gfxWorldVertex.lmapCoord[1] - >> gfxWorldVertex.normal.packed - >> gfxWorldVertex.tangent.packed; - - result.vertices << gfxWorldVertex; - } - } - return result; -} - - -// ?Load_GfxAabbTree@@YAX_N@Z at 0x822a5da8 -GfxAabbTree Assets::Load_GfxAabbTree(QDataStream *aStream) -{ - unsigned __int16 *smodelIndexes; // r10 - size_t v2; // r5 - unsigned __int8 *v3; // r4 - - GfxAabbTree result; - *aStream - >> result.mins[0] - >> result.mins[1] - >> result.mins[2] - >> result.maxs[0] - >> result.maxs[1] - >> result.maxs[2] - >> result.childCount - >> result.surfaceCount - >> result.startSurfIndex - >> result.smodelIndexCount - >> result.smodelIndexesPtr - >> result.childrenOffset; - - if (result.smodelIndexesPtr) - { - if (result.smodelIndexesPtr == -1) - { - for (int i = 0; i < result.smodelIndexCount; i++) { - unsigned __int16 smodelIndex; - - *aStream >> smodelIndex; - - result.smodelIndexes << smodelIndex; - } - } - else - { - // Resolve contents from g_streamBlocks - //varGfxAabbTree->smodelIndexes = (unsigned __int16 *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + ((((unsigned int)varGfxAabbTree->smodelIndexes - // - 1) >> 26) & 0x38)))[((int)varGfxAabbTree->smodelIndexes - 1) & 0x1FFFFFFF]; - } - } - return result; -} - - -// ?Load_GfxAabbTreeArray@@YAX_NH@Z at 0x822a75f0 -QVector Assets::Load_GfxAabbTreeArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - result << Load_GfxAabbTree(aStream); - } - - return result; -} - - -// ?Load_GfxCell@@YAX_N@Z at 0x822a8af0 -GfxCell Assets::Load_GfxCell(QDataStream *aStream) -{ - GfxCell result; - - *aStream - >> result.mins[0] - >> result.mins[1] - >> result.mins[2] - >> result.maxs[0] - >> result.maxs[1] - >> result.maxs[2] - >> result.aabbTreeCount - >> result.aabbTreePtr - >> result.portalCount - >> result.portalsPtr - >> result.cullGroupCount - >> result.cullGroupsPtr - >> result.reflectionProbeCount - >> result.reflectionProbesPtr; - - if (result.aabbTreePtr) - { - result.aabbTree = Load_GfxAabbTreeArray(aStream, result.aabbTreeCount); - } - if (result.portalsPtr) - { - result.portals = Load_GfxPortalArray(1, result.portalCount); - } - if (result.cullGroupsPtr) - { - v4 = 4 * v1->cullGroupCount; - v5 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v5; - varint = (int *)v5; - v1->cullGroups = (int *)v5; - Load_Stream(1, v5, v4); - v1 = varGfxCell; - } - if (result.reflectionProbesPtr) - { - v6 = g_streamPos; - reflectionProbeCount = v1->reflectionProbeCount; - varbyte = g_streamPos; - v1->reflectionProbes = g_streamPos; - Load_Stream(1, v6, reflectionProbeCount); - } -} - - -// ?Load_GfxPortal@@YAX_N@Z at 0x822a5cb8 -GfxPortal Assets::Load_GfxPortal(QDataStream *aStream) -{ - GfxPortal *v1; // r11 - GfxCell *cell; // r10 - int vertexCount; // r10 - unsigned __int8 *v4; // r4 - - GfxPortal result; - *aStream - >> result.writable.isQueued - >> result.writable.isAncestor - >> result.writable.recursionDepth - >> result.writable.hullPointCount - >> result.writable.hullPointPtrs[0] - >> result.writable.hullPointPtrs[1] - >> result.writable.queuedParentPtr - >> result.plane.coeffs[0] - >> result.plane.coeffs[1] - >> result.plane.coeffs[2] - >> result.plane.coeffs[3] - >> result.plane.side[0] - >> result.plane.side[1] - >> result.plane.side[2] - >> result.plane.pad - >> result.cellPtr - >> result.verticesPtr - >> result.vertexCount - >> result.hullAxis[0][0] - >> result.hullAxis[0][1] - >> result.hullAxis[0][2] - >> result.hullAxis[1][0] - >> result.hullAxis[1][1] - >> result.hullAxis[1][2]; - - if (result.cellPtr) - { - if (result.cellPtr == -1) - { - result.cell = Load_GfxCell(aStream); - } - else - { - // Resolve contents to g_streamBlocks - //varGfxPortal->cell = (GfxCell *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + ((((unsigned int)&varGfxPortal->cell[-1].reflectionProbes - // + 3) >> 26) & 0x38)))[((int)&varGfxPortal->cell[-1].reflectionProbes - // + 3) & 0x1FFFFFFF]; - } - } - if (result.verticesPtr) - { - for (int i = 0; i < vertexCount + __ROL4__(vertexCount, 1); i++) { - float vertex; - - *aStream >> vertex; - - result.vertices[i] = vertex; - } - } - - return result; -} - -// ?Load_GfxPortalArray@@YAX_NH@Z at 0x822a7598 -QVector Assets::Load_GfxPortalArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - result << Load_GfxPortal(aStream); - } - - return result; -} - -QString Assets::Load_XStringCustom(QDataStream *aStream) { - QString result; - - char stringChar; - - *aStream >> stringChar; - while (stringChar != '\0') { - result += stringChar; - - *aStream >> stringChar; - } - - return result; -} - -QString Assets::Load_XString(QDataStream *aStream) -{ - QString result; - - qint32 stringPtr; - *aStream >> stringPtr; - - if (stringPtr == -1) { - result = Load_XStringCustom(aStream); - } else { - // Resolve to contents in g_streamBlocks - //*varXString = (const char *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + (((unsigned int)(v2 - 1) >> 26) & 0x38)))[(v2 - 1) & 0x1FFFFFFF]; - } - - return result; -} - -// ?Load_RawFile@@YAX_N@Z at 0x822a5e60 -RawFile Assets::Load_RawFile(QDataStream *aStream) -{ - RawFile result; - - *aStream - >> result.namePtr - >> result.len - >> result.bufferPtr; - - result.name = Load_XString(aStream); - if (result.bufferPtr) - { - QByteArray buffer(result.len + 1, Qt::Uninitialized); - aStream->readRawData(buffer.data(), result.len + 1); - result.buffer = QString::fromUtf8(buffer); - } - - return result -} - - -// ?Load_LocalizeEntry@@YAX_N@Z at 0x822a5ef0 -XLocalizeEntry Assets::Load_LocalizeEntry(QDataStream *aStream) -{ - XLocalizeEntry result; - - *aStream - >> result.valuePtr - >> result.namePtr; - - if (result.valuePtr == -1) { - result.value = Load_XStringCustom(aStream); - } - if (result.namePtr == -1) { - result.name = Load_XStringCustom(aStream); - } - - return result; -} - - -// ?Load_operandInternalDataUnion@@YAX_N@Z at 0x822a6058 -void Assets::Load_operandInternalDataUnion(QDataStream *aStream) -{ - XOperand *varOperand = new XOperand; - QString varXString; - if ( varOperand->dataType == VAL_STRING ) - { - varXString = (const char **)varoperandInternalDataUnion; - Load_XString(0); - } -} - - -// ?Load_ComPrimaryLight@@YAX_N@Z at 0x822a6098 -XComPrimaryLight Assets::Load_ComPrimaryLight(QDataStream *aStream) -{ - XComPrimaryLight result; - - *aStream - >> result.type - >> result.canUseShadowMap - >> result.exponent - >> result.unused - >> result.color[0] - >> result.color[1] - >> result.color[2] - >> result.dir[0] - >> result.dir[1] - >> result.dir[2] - >> result.origin[0] - >> result.origin[1] - >> result.origin[2] - >> result.radius - >> result.cosHalfFovOuter - >> result.cosHalfFovInner - >> result.cosHalfFovExpanded - >> result.rotationLimit - >> result.translationLimit - >> result.defNamePtr; - - if (result.defNamePtr == -1) { - result.defName = Load_XStringCustom(aStream); - } - - return result; -} - - -// ?Load_CollisionPartition@@YAX_N@Z at 0x822a60e8 -CollisionPartition Assets::Load_CollisionPartition(QDataStream *aStream) -{ - CollisionPartition result; - - *aStream - >> result.triCount - >> result.borderCount - >> result.firstTri - >> result.bordersPtr; - - if (result.bordersPtr) - { - if (result.bordersPtr == -1) - { - result.borders = Load_CollisionBorder(aStream); - } - else - { - // Resolve contents from g_streamBlock - //varCollisionPartition->borders = (CollisionBorder *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + ((((unsigned int)&varCollisionPartition->borders[-1].length - // + 3) >> 26) & 0x38)))[((int)&varCollisionPartition->borders[-1].length + 3) & 0x1FFFFFFF]; - } - } - - return result; -} - -CLeafBrushNodeLeaf Assets::Load_CLeafBrushNodeLeaf(QDataStream *aStream, int leafBrushCount) -{ - CLeafBrushNodeLeaf result; - - *aStream >> result.brushesPtr; - - if (result.brushesPtr) { - if (result.brushesPtr == -1) - { - for (int i = 0; i < leafBrushCount; i++) { - unsigned int brush; - - *aStream >> brush; - - result.brushes << brush; - } - } - else - { - // Resolve contents from g_streamBlocks - //varcLeafBrushNodeLeaf_t->brushes = (unsigned __int16 *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + ((((unsigned int)varcLeafBrushNodeLeaf_t->brushes - // - 1) >> 26) & 0x38)))[((int)varcLeafBrushNodeLeaf_t->brushes - 1) & 0x1FFFFFFF]; - } - } - return result; -} - -// ?Load_CLeafBrushNodeData@@YAX_N@Z at 0x822a61a0 -CLeafBrushNodeData Assets::Load_CLeafBrushNodeData(QDataStream *aStream, int aNodeCount) -{ - CLeafBrushNodeData result; - - if (aNodeCount > 0) - { - result = Load_CLeafBrushNodeLeaf(aStream, aNodeCount); - } - - return result; -} - - -// ?Load_MapEnts@@YAX_N@Z at 0x822a6278 -MapEnts Assets::Load_MapEnts(QDataStream *aStream) -{ - MapEnts results; - - *aStream - >> results.namePtr - >> results.entityStringPtr - >> results.numEntityChars; - - if (results.namePtr == -1) { - results.name = Assets::Load_XString(aStream); - } - - if (results.entityStringPtr) - { - QByteArray entityData(results.numEntityChars, Qt::Uninitialized); - - aStream->readRawData(entityData.data(), results.numEntityChars); - - results.entityString = QString::fromUtf8(entityData); - } - - return results; -} - - -// ?Load_FxTrailDef@@YAX_N@Z at 0x822a6308 -FxTrailDef Assets::Load_FxTrailDef(QDataStream *aStream) -{ - FxTrailDef result; - - *aStream - >> result.scrollTimeMsec - >> result.repeatDist - >> result.splitDist - >> result.vertCount - >> result.vertsPtr - >> result.indCount - >> result.indsPtr; - - - if (result.vertsPtr) - { - for (int i = 0; i < result.vertCount; i++) { - FxTrailVertex fxTrailVertex; - - *aStream - >> fxTrailVertex.pos[0] - >> fxTrailVertex.pos[1] - >> fxTrailVertex.normal[0] - >> fxTrailVertex.normal[1] - >> fxTrailVertex.texCoord; - - result.verts << fxTrailVertex; - } - } - if (result.indsPtr) - { - for (int i = 0; i < result.indCount; i++) { - ushort ind; - - *aStream >> ind; - - result.inds << ind; - } - } - - return result; -} - - -// ?Load_FxEffectDefRef@@YAX_N@Z at 0x822a63d0 -FxEffectDefRef Assets::Load_FxEffectDefRef(QDataStream *aStream) -{ - FxEffectDefRef result; - *aStream >> result.namePtr; - if (result.namePtr == -1) { - Load_XStringCustom(aStream); - } - - //if ( varFxEffectDefRef->handle ) - // v2->handle = (const FxEffectDef *)DB_FindXAssetHeader( - // (XAssetHeader *)0x1A, - // (XAssetType)varFxEffectDefRef->handle, - // v1); - return result; -} - - -// ?Load_GameWorldMp@@YAX_N@Z at 0x822a6430 -GameWorldMp Assets::Load_GameWorldMp(QDataStream *aStream) -{ - GameWorldMp result; - - *aStream >> result.namePtr; - - if (result.namePtr == -1) { - result.name = Load_XStringCustom(aStream); - } - - return result; -} - - -// ?LoadPathNodeTreeArray@@YAX_NH@Z at 0x822a6488 -QVector Assets::LoadPathNodeTreeArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - PathNodeTree pathnode_tree; - - *aStream - >> pathnode_tree.axis - >> pathnode_tree.dist - >> pathnode_tree.infoPtr; - - if (pathnode_tree.infoPtr) - { - if (pathnode_tree.infoPtr == -1 ) - { - Load_PathNodeTree(1); - } - else - { - // Resolve contents from g_streamBlocks - //*varpathnode_tree_ptr = (pathnode_tree_t *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + (((unsigned int)(v4 - 1) >> 26) & 0x38)))[(v4 - 1) & 0x1FFFFFFF]; - } - } - - result << pathnode_tree; - } - return result; -} - - -// ?Load_PathNodeTreeNodes@@YAX_N@Z at 0x822a6540 -PathNodeTreeNodes Assets::Load_PathNodeTreeNodes(QDataStream *aStream) -{ - PathNodeTreeNodes result; - - *aStream >> result.nodeCount; - - for (int i = 0; i < result.nodeCount; i++) { - quint16 node; - *aStream >> node; - result.nodes << node; - } - return result; -} - - -// ?Load_PathNodeConstant@@YAX_N@Z at 0x822a65b8 -PathNodeConstant Assets::Load_PathNodeConstant(QDataStream *aStream) -{ - PathNodeConstant result; - - *aStream - >> result.type - >> result.spawnflags - >> result.targetname - >> result.script_linkName - >> result.script_noteworthy - >> result.target - >> result.animscript - >> result.animscriptfunc - >> result.vOrigin[0] - >> result.vOrigin[1] - >> result.vOrigin[2] - >> result.fAngle - >> result.forward[0] - >> result.forward[1] - >> result.fRadius - >> result.minUseDistSq - >> result.wOverlapNode[0] - >> result.wOverlapNode[1] - >> result.wChainId - >> result.wChainDepth - >> result.wChainParent - >> result.totalLinkCount - >> result.wChainId - >> result.LinksPtr; - - // idfk what this does - // Load_Stream(0, varpathnode_constant_t, 0x44u); - // varScriptString = &varpathnode_constant_t->targetname; - // Load_Stream(0, &varpathnode_constant_t->targetname, 2u); - // *varScriptString = (unsigned __int16)*(const char **)((char *)varXAssetList->stringList.strings - // + __ROL4__(*varScriptString, 2)); - // varScriptString = &varpathnode_constant_t->script_linkName; - // Load_Stream(0, &varpathnode_constant_t->script_linkName, 2u); - // *varScriptString = (unsigned __int16)*(const char **)((char *)varXAssetList->stringList.strings - // + __ROL4__(*varScriptString, 2)); - // varScriptString = &varpathnode_constant_t->script_noteworthy; - // Load_Stream(0, &varpathnode_constant_t->script_noteworthy, 2u); - // *varScriptString = (unsigned __int16)*(const char **)((char *)varXAssetList->stringList.strings - // + __ROL4__(*varScriptString, 2)); - // varScriptString = &varpathnode_constant_t->target; - // Load_Stream(0, &varpathnode_constant_t->target, 2u); - // *varScriptString = (unsigned __int16)*(const char **)((char *)varXAssetList->stringList.strings - // + __ROL4__(*varScriptString, 2)); - // varScriptString = &varpathnode_constant_t->animscript; - // Load_Stream(0, &varpathnode_constant_t->animscript, 2u); - // v1 = varpathnode_constant_t; - // *varScriptString = (unsigned __int16)*(const char **)((char *)varXAssetList->stringList.strings - // + __ROL4__(*varScriptString, 2)); - // if (result.LinksPtr) - // { - // totalLinkCount = v1->totalLinkCount; - // v3 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - // v1->Links = (PathLink *)v3; - // g_streamPos = v3; - // varpathlink_t = (pathlink_s *)v3; - // Load_Stream(1, v3, 4 * (totalLinkCount + __ROL4__(totalLinkCount, 1))); - // } -} - - -// ?Load_XModelCollSurfArray@@YAX_NH@Z at 0x822a6780 -QVector Assets::Load_XModelCollSurfArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - XModelCollSurf xModelCollSurf_s; - - *aStream - >> xModelCollSurf_s.mins[0] - >> xModelCollSurf_s.mins[1] - >> xModelCollSurf_s.mins[2] - >> xModelCollSurf_s.maxs[0] - >> xModelCollSurf_s.maxs[1] - >> xModelCollSurf_s.maxs[2] - >> xModelCollSurf_s.boneIdx - >> xModelCollSurf_s.contents - >> xModelCollSurf_s.surfFlags; - - result << xModelCollSurf_s; - } - return result; -} - - -// ?Load_PhysPreset@@YAX_N@Z at 0x822a6850 -PhysPreset Assets::Load_PhysPreset(QDataStream *aStream) -{ - PhysPreset result; - - *aStream - >> result.namePtr - >> result.type - >> result.mass - >> result.bounce - >> result.friction - >> result.bulletForceScale - >> result.explosiveForceScale - >> result.sndAliasPrefixPtr - >> result.piecesSpreadFraction - >> result.piecesUpwardVelocity - >> result.tempDefaultToCylinder; - - if (result.namePtr == -1) { - result.name = Load_XStringCustom(aStream); - } - if (result.sndAliasPrefixPtr == -1) { - result.sndAliasPrefix = Load_XStringCustom(aStream); - } - - return result; -} - - -// ?Load_MaterialArgumentDef@@YAX_N@Z at 0x822a68c8 -MaterialArgumentDef Assets::Load_MaterialArgumentDef(QDataStream *aStream, MaterialShaderArgument aArgument) -{ - MaterialArgumentDef result; - - if (aArgument.type == 1 || aArgument.type == 7) - { - if (aArgument.u.codeSampler) - { - if (aArgument.u.codeSampler == -1) - { - //varMaterialArgumentDef->codeSampler = (unsigned int)v3; - //varfloat = (float *)v3; - //Load_Stream(1, v3, 0x10u); - } - else - { - // Resolve contents from g_streamBlocks - //varMaterialArgumentDef->codeSampler = (unsigned int)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + (((codeSampler - 1) >> 26) & 0x38)))[(codeSampler - 1) & 0x1FFFFFFF]; - } - } - } - return result; -} - - -// ?Load_GfxPixelShaderLoadDef@@YAX_N@Z at 0x822a6950 -GfxPixelShaderLoadDef Assets::Load_GfxPixelShaderLoadDef(QDataStream *aStream) -{ - GfxPixelShaderLoadDef result; - - *aStream - >> result.cachedPartPtr - >> result.physicalPartPtr - >> result.cachedPartSize - >> result.physicalPartSize; - - if (result.physicalPartPtr) - { - for (int i = 0; i < result.physicalPartSize; i++) { - unsigned __int8 physicalPart; - - *aStream >> physicalPart; - - result.physicalPart << physicalPart; - } - } - if (result.cachedPartPtr) - { - for (int i = 0; i < result.cachedPartSize; i++) { - unsigned __int8 cachedPart; - - *aStream >> cachedPart; - - result.cachedPart << cachedPart; - } - } - - return result; -} - - -// ?Load_GfxVertexShaderLoadDef@@YAX_N@Z at 0x822a69f8 -GfxVertexShaderLoadDef Assets::Load_GfxVertexShaderLoadDef(QDataStream *aStream) -{ - GfxVertexShaderLoadDef result; - - *aStream - >> result.cachedPartPtr - >> result.physicalPartPtr - >> result.cachedPartSize - >> result.physicalPartSize; - - if (result.physicalPartPtr) - { - for (int i = 0; i < result.physicalPartSize; i++) { - unsigned __int8 physicalPart; - - *aStream >> physicalPart; - - result.physicalPart << physicalPart; - } - } - if (result.cachedPartPtr) - { - for (int i = 0; i < result.cachedPartSize; i++) { - unsigned __int8 cachedPart; - - *aStream >> cachedPart; - - result.cachedPart << cachedPart; - } - } - return result; -} - - -// ?Load_GfxImagePixels@@YAX_N@Z at 0x822a6aa0 -QVector Assets::Load_GfxImagePixels(QDataStream *aStream, GfxImage aGfxImage) -{ - QVector result; - - if (aGfxImage.pixelsPtr) - { - aStream->skipRawData(aGfxImage.cardMemory.platform[0]); - } - - return result; -} - - -// ?Load_GfxTexture@@YAX_N@Z at 0x822a6b28 -GfxTexture Assets::Load_GfxTexture(QDataStream *aStream, GfxTexture aGfxTexture, GfxImageLoadDef aGfxImageLoadDef) -{ - unsigned __int8 *v1; // r4 - D3DBaseTexture *basemap; // r11 - unsigned __int8 *v3; // r4 - unsigned __int8 *v4; // r4 - - if ((aGfxImageLoadDef.flags & 4) != 0) - { - if (aGfxTexture.basemap) - { - v1 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v1; - varGfxTexture->basemap = (D3DBaseTexture *)v1; - varIDirect3DCubeTexture9 = (D3DCubeTexture *)v1; - Load_Stream(1, v1, 0x34u); - } - } - else - { - basemap = aGfxTexture.basemap; - if ( (aGfxImageLoadDef.flags & 8) != 0 ) - { - if ( basemap ) - { - v3 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v3; - aGfxTexture.basemap = (D3DBaseTexture *)v3; - varIDirect3DVolumeTexture9 = (D3DVolumeTexture *)v3; - Load_Stream(1, v3, 0x34u); - } - } - else if ( basemap ) - { - v4 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v4; - aGfxTexture.basemap = (D3DBaseTexture *)v4; - varIDirect3DTexture9 = (D3DTexture *)v4; - Load_Stream(1, v4, 0x34u); - } - } -} - - -// ?Load_XSurfaceVertexInfo@@YAX_N@Z at 0x822a6c08 -XSurfaceVertexInfo Assets::Load_XSurfaceVertexInfo(QDataStream *aStream) -{ - unsigned __int16 *vertsBlend; // r10 - int v2; // r10 - int v3; // r9 - int v4; // r8 - int v5; // r6 - unsigned __int8 *v6; // r4 - - XSurfaceVertexInfo result; - - *aStream - >> result.vertCount[0] - >> result.vertCount[1] - >> result.vertCount[2] - >> result.vertCount[3] - >> result.vertsBlendPtr; - - if (result.vertsBlendPtr) - { - if (result.vertsBlendPtr == -1) - { - aStream->skipRawData(2 * (7 * result.vertCount[3] + 5 * result.vertCount[2] + 3 * result.vertCount[1] + result.vertCount[0])); - } - else - { - // Resolve contents from g_streamBlocks - //varXSurfaceVertexInfo->vertsBlend = (unsigned __int16 *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + ((((unsigned int)varXSurfaceVertexInfo->vertsBlend - // - 1) >> 26) & 0x38)))[((int)varXSurfaceVertexInfo->vertsBlend - 1) & 0x1FFFFFFF]; - } - } -} - - -// ?Load_XSurfaceCollisionTree@@YAX_N@Z at 0x822a6d00 -XSurfaceCollisionTree Assets::Load_XSurfaceCollisionTree(QDataStream *aStream) -{ - XSurfaceCollisionTree result; - - *aStream - >> result.trans[0] - >> result.trans[1] - >> result.trans[2] - >> result.scale[0] - >> result.scale[1] - >> result.scale[2] - >> result.nodeCount - >> result.leafCount; - - for (int i = 0; i < result.nodeCount; i++) { - XSurfaceCollisionNode collisionNode; - - *aStream - >> collisionNode.aabb.mins[0] - >> collisionNode.aabb.mins[1] - >> collisionNode.aabb.mins[2] - >> collisionNode.aabb.maxs[0] - >> collisionNode.aabb.maxs[1] - >> collisionNode.aabb.maxs[2] - >> collisionNode.childBeginIndex - >> collisionNode.childCount; - - result.nodes << collisionNode; - } - for (int i = 0; i < result.leafCount; i++) { - XSurfaceCollisionLeaf collisionLeaf; - - *aStream >> collisionLeaf.triangleBeginIndex; - - result.leafs << collisionLeaf; - } - return result; -} - - -// ?Load_MaterialInfo@@YAX_N@Z at 0x822a6dc0 -MaterialInfo Assets::Load_MaterialInfo(QDataStream *aStream) -{ - MaterialInfo result; - - *aStream - >> result.namePtr - >> result.gameFlags - >> result.sortKey - >> result.textureAtlasRowCount - >> result.textureAtlasColumnCount - >> result.drawSurf.objectId - >> result.drawSurf.reflectionProbeIndex - >> result.drawSurf.customIndex - >> result.drawSurf.materialSortedIndex - >> result.drawSurf.prepass - >> result.drawSurf.primaryLightIndex - >> result.drawSurf.surfType - >> result.drawSurf.primarySortKey - >> result.drawSurf.unused - >> result.surfaceTypeBits; - - result.name = Load_XStringCustom(aStream); - - return result; -} - - -// ?Load_XAUDIOCHANNELMAP@@YAX_N@Z at 0x822a6e10 -XAUDIOCHANNELMAP Assets::Load_XAUDIOCHANNELMAP(QDataStream *aStream) -{ - XAUDIOCHANNELMAP result; - - *aStream - >> result.EntryCount - >> result.paEntriesPtr; - - if (result.paEntriesPtr) - { - for (int i = 0; i < result.EntryCount; i++) { - XAUDIOCHANNELMAPENTRY entry; - - *aStream - >> entry.InputChannel - >> entry.OutputChannel - >> entry.Volume; - - result.paEntries << entry; - } - } - return result; -} - - -// ?Load_SndCurve@@YAX_N@Z at 0x822a6e88 -SndCurve Assets::Load_SndCurve(QDataStream *aStream) -{ - SndCurve result; - - *aStream - >> result.filenamePtr - >> result.knotCount; - - for (int i = 0; i < 8; i++) { - *aStream - >> result.knots[i][0] - >> result.knots[i][1]; - } - - if (result.filenamePtr == -1) { - result.filename = Load_XStringCustom(aStream); - } - return result; -} - - -// ?Load_StreamFileNameRaw@@YAX_N@Z at 0x822a6ee0 -StreamFileNameRaw Assets::Load_StreamFileNameRaw(QDataStream *aStream) -{ - StreamFileNameRaw result; - - *aStream - >> result.dirPtr - >> result.namePtr; - - if (result.dirPtr == -1) { - result.dir = Load_XStringCustom(aStream); - } - if (result.namePtr == -1) { - result.name = Load_XStringCustom(aStream); - } - - return result; -} - - -// ?Load_SndDriverGlobals@@YAX_N@Z at 0x822a6f48 -XSoundDriverGlobals Assets::Load_SndDriverGlobals(QDataStream *aStream) -{ - XSoundDriverGlobals result; - - *aStream - >> result.reverbSettingsPtr - >> result.namePtr; - - if (result.reverbSettingsPtr) - { - XAudioReverbSettings xaReverbSettings; - - *aStream - >> xaReverbSettings.presetOverridden - >> xaReverbSettings.reverbSettings.ReflectionsDelay - >> xaReverbSettings.reverbSettings.ReverbDelay - >> xaReverbSettings.reverbSettings.RearDelay - >> xaReverbSettings.reverbSettings.PositionLeft - >> xaReverbSettings.reverbSettings.PositionRight - >> xaReverbSettings.reverbSettings.PositionMatrixLeft - >> xaReverbSettings.reverbSettings.PositionMatrixRight - >> xaReverbSettings.reverbSettings.EarlyDiffusion - >> xaReverbSettings.reverbSettings.LateDiffusion - >> xaReverbSettings.reverbSettings.LowEQGain - >> xaReverbSettings.reverbSettings.LowEQCutoff - >> xaReverbSettings.reverbSettings.HighEQGain - >> xaReverbSettings.reverbSettings.HighEQCutoff - >> xaReverbSettings.reverbSettings.RoomFilterFreq - >> xaReverbSettings.reverbSettings.RoomFilterMain - >> xaReverbSettings.reverbSettings.RoomFilterHF - >> xaReverbSettings.reverbSettings.ReflectionsGain - >> xaReverbSettings.reverbSettings.ReverbGain - >> xaReverbSettings.reverbSettings.DecayTime - >> xaReverbSettings.reverbSettings.Density - >> xaReverbSettings.reverbSettings.RoomSize; - - result.reverbSettings = xaReverbSettings; - } - if (result.namePtr == -1) { - result.name = Load_XStringCustom(aStream); - } -} - - -// ?Load_XaSeekTable@@YAX_N@Z at 0x822a6fe0 -XaSeekTable Assets::Load_XaSeekTable(QDataStream *aStream) -{ - XaSeekTable result; - - *aStream - >> result.size - >> result.dataPtr; - - if (result.dataPtr) - { - for (int i = 0; i < result.size; i++) { - unsigned int data; - - *aStream >> data; - - result.data << data; - } - } -} - - -// ?Load_XAUDIOPACKET_ALIGNED@@YAX_N@Z at 0x822a7058 -XAUDIOPACKET_ALIGNED Assets::Load_XAUDIOPACKET_ALIGNED(QDataStream *aStream) -{ - XAUDIOPACKET_ALIGNED result; - - *aStream - >> result.pBufferPtr - >> result.BufferSize - >> result.LoopCount; - - for (int i = 0; i < 6; i++) { - *aStream - >> result.XMALoop[i].LoopStart - >> result.XMALoop[i].LoopEnd - >> result.XMALoop[i].LoopSubframeEnd - >> result.XMALoop[i].LoopSubframeSkip; - } - - *aStream >> result.pContextPtr; - - if (result.pBufferPtr) - { - for (int i = 0; i < result.BufferSize; i++) { - char bufferChar; - - *aStream >> bufferChar; - - result.pBuffer << bufferChar; - } - } - if (result.pContextPtr) - { - *aStream >> result.pContext; - } -} - - -// ?Load_XAnimNotifyInfo@@YAX_N@Z at 0x822a70f8 -XAnimNotifyInfo Assets::Load_XAnimNotifyInfo(QDataStream *aStream) -{ - XAnimNotifyInfo result; - - *aStream - >> result.name - >> result.time; - - // Fill out parsing - aStream->skipRawData(2); - - return result; -} - - -// ?Load_XAnimDynamicFrames@@YAX_N@Z at 0x822a7168 -XAnimDynamicFrames Assets::Load_XAnimDynamicFrames(QDataStream *aStream, - XAnimPartTrans aXAnimPartTrans, - XAnimDynamicIndices aXAnimDynamicIndices, - XAnimDynamicFrames aXAnimDynamicFrames) -{ - XAnimDynamicFrames result; - - if (aXAnimPartTrans.smallTrans) - { - if (aXAnimDynamicIndices._1[0]) // Check this should be [0] - { - int readSize = aXAnimPartTrans.size + 1; - if (aXAnimPartTrans.size == 0) - readSize = 0; - // Fill out parsing - aStream->skipRawData(3 * readSize); - } - } - else if (aXAnimDynamicFrames._1) - { - int readSize = aXAnimPartTrans.size + 1; - if (aXAnimPartTrans.size == 0) - readSize = 0; - // Fill out parsing - aStream->skipRawData(6 * readSize); - } - - return result; -} - - -// ?Load_XAnimDynamicIndicesTrans@@YAX_N@Z at 0x822a7228 -XAnimDynamicIndices Assets::Load_XAnimDynamicIndicesTrans(QDataStream *aStream, - XAnimParts aXAnimParts, - XAnimPartTrans aXAnimPartTrans) -{ - if (aXAnimParts.numframes >= 0x100u) - { - // Fill out parsing - aStream->skipRawData(2 * (aXAnimPartTrans.size + 1)); - } - else - { - // Fill out parsing - aStream->skipRawData(aXAnimPartTrans.size + 1); - } -} - - -// ?Load_XAnimDynamicIndicesDeltaQuat@@YAX_N@Z at 0x822a7278 -XAnimDynamicIndices Assets::Load_XAnimDynamicIndicesDeltaQuat(QDataStream *aStream, - XAnimDeltaPartQuat aXAnimDeltaPartQuat, - XAnimParts aXAnimParts) -{ - XAnimDynamicIndices result; - - if (aXAnimParts.numframes >= 0x100u) - { - // Fill out parsing - aStream->skipRawData(2 * (aXAnimDeltaPartQuat.size + 1)); - } - else - { - // Fill out parsing - aStream->skipRawData(aXAnimDeltaPartQuat.size + 1); - } - - return result; -} - - -// ?Load_XAnimIndices@@YAX_N@Z at 0x822a72c8 -XAnimIndices Assets::Load_XAnimIndices(QDataStream *aStream, - XAnimParts aXAnimParts, - XAnimIndices aXAnimIndices) -{ - XAnimIndices result; - - if (aXAnimParts.numframes >= 0x100u) - { - if (aXAnimIndices._1) - { - // Fill out parsing - aStream->skipRawData(2 * aXAnimParts.indexCount); - } - } - else if (aXAnimIndices._1) - { - // Fill out parsing - aStream->skipRawData(aXAnimParts.indexCount); - } - return result; -} - - -// ?Load_XStringArray@@YAX_NH@Z at 0x822a73b8 -QStringList Assets::Load_XStringArray(QDataStream *aStream, int count) -{ - QStringList result; - - for (int i = 0; i < count; i++) { - result << Load_XString(aStream); - } - - return result; -} - - -// ?Load_ScriptStringArray@@YAX_NH@Z at 0x822a7460 -QVector Assets::Load_ScriptStringArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - result << Load_ScriptString(aStream); - } - - return result; -} - - -// ?Load_GfxLightRegionHullArray@@YAX_NH@Z at 0x822a74d8 -QVector Assets::Load_GfxLightRegionHullArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - result << Load_GfxLightRegionHull(aStream); - } - - return result; -} - - -// ?Load_GfxShadowGeometryArray@@YAX_NH@Z at 0x822a7538 -QVector Assets::Load_GfxShadowGeometryArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - result << Load_GfxShadowGeometry(aStream); - } - - return result; -} - - -// ?Load_StringTable@@YAX_N@Z at 0x822a7650 -StringTable Assets::Load_StringTable(QDataStream *aStream) -{ - StringTable result; - - *aStream - >> result.namePtr - >> result.columnCount - >> result.rowCount - >> result.valuesPtr; - - if (result.namePtr == -1) { - result.name = Load_XStringCustom(aStream); - } - if (result.valuesPtr) - { - result.values = Load_XStringArray(aStream, result.rowCount * result.columnCount); - } - - return result; -} - - -// ?Load_RawFilePtr@@YAX_N@Z at 0x822a76e8 -RawFile Assets::Load_RawFilePtr(QDataStream *aStream) -{ - RawFile result; - qint32 rawFilePtr; - - *aStream >> rawFilePtr; - - if (rawFilePtr) - { - if (rawFilePtr != -1 && rawFilePtr != -2) - { - // Resolve contents from g_streamBlocks - //*varRawFilePtr = *(RawFile **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - //DB_PopStreamPos(); - return result; - } - result = Load_RawFile(aStream); - } - return result; -} - - -// ?Load_LocalizeEntryPtr@@YAX_N@Z at 0x822a77d0 -XLocalizeEntry Assets::Load_LocalizeEntryPtr(QDataStream *aStream) -{ - XLocalizeEntry result; - qint32 localizeEntryPtr; - - *aStream >> localizeEntryPtr; - - if (localizeEntryPtr) - { - if (localizeEntryPtr != -1 && localizeEntryPtr != -2) - { - //*varLocalizeEntryPtr = *(LocalizeEntry **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - //DB_PopStreamPos(); - return result; - } - result = Load_LocalizeEntry(aStream); - } - return result; -} - -// ?Load_MultiDef@@YAX_N@Z at 0x822a78b8 -XMultiDef Assets::Load_MultiDef(QDataStream *aStream) -{ - XMultiDef result; - - for (int i = 0; i < 32; i++) { - *aStream >> result.dvarListPtrs[i]; - } - for (int i = 0; i < 32; i++) { - *aStream >> result.dvarStrPtrs[i]; - } - for (int i = 0; i < 32; i++) { - *aStream >> result.dvarValue[i]; - } - - *aStream - >> result.count - >> result.strDef; - - for (int i = 0; i < 32; i++) { - if (result.dvarListPtrs[i] == -1) { - result.dvarList << Load_XStringCustom(aStream); - } - } - for (int i = 0; i < 32; i++) { - if (result.dvarStrPtrs[i] == -1) { - result.dvarStr << Load_XStringCustom(aStream); - } - } - - return result; -} - - -// ?Load_Operand@@YAX_N@Z at 0x822a7958 -XOperand Assets::Load_Operand(QDataStream *aStream) -{ - XOperand result; - - *aStream >> result.dataType; - - if (result.dataType == VAL_STRING) - { - result.stringVal = Load_XString(aStream); - } - else if (result.dataType == VAL_FLOAT) - { - *aStream >> result.floatVal; - } - else if (result.dataType == VAL_INT) - { - *aStream >> result.intVal; - } - - return result; -} - - -// ?Load_ComPrimaryLightArray@@YAX_NH@Z at 0x822a79d0 -QVector Assets::Load_ComPrimaryLightArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - XComPrimaryLight comPrimaryLight; - - *aStream - >> comPrimaryLight.type - >> comPrimaryLight.canUseShadowMap - >> comPrimaryLight.exponent - >> comPrimaryLight.unused - >> comPrimaryLight.color[0] - >> comPrimaryLight.color[1] - >> comPrimaryLight.color[2] - >> comPrimaryLight.dir[0] - >> comPrimaryLight.dir[1] - >> comPrimaryLight.dir[2] - >> comPrimaryLight.origin[0] - >> comPrimaryLight.origin[1] - >> comPrimaryLight.origin[2] - >> comPrimaryLight.radius - >> comPrimaryLight.cosHalfFovOuter - >> comPrimaryLight.cosHalfFovInner - >> comPrimaryLight.cosHalfFovExpanded - >> comPrimaryLight.rotationLimit - >> comPrimaryLight.translationLimit - >> comPrimaryLight.defNamePtr; - - result << comPrimaryLight; - } - return result; -} - - -CBrushSide Assets::Load_cbrushside_t(QDataStream *aStream) -{ - CBrushSide result; - - *aStream - >> result.planePtr - >> result.materialNum - >> result.firstAdjacentSideOffset - >> result.edgeCount; - - if (result.planePtr == -1) { - result.plane = Load_CPlane(aStream); - } - - return result; -} - - -// ?Load_CBrush@@YAX_N@Z at 0x822a7a48 -CBrush Assets::Load_CBrush(QDataStream *aStream) -{ - CBrush result; - - *aStream - >> result.mins[0] - >> result.mins[1] - >> result.mins[2] - >> result.contents - >> result.maxs[0] - >> result.maxs[1] - >> result.maxs[2] - >> result.numsides - >> result.sidesPtr - >> result.axialMaterialNum[0][0] - >> result.axialMaterialNum[0][1] - >> result.axialMaterialNum[0][2] - >> result.axialMaterialNum[1][0] - >> result.axialMaterialNum[1][1] - >> result.axialMaterialNum[1][2] - >> result.baseAdjacentSidePtr - >> result.firstAdjacentSideOffsets[0][0] - >> result.firstAdjacentSideOffsets[0][1] - >> result.firstAdjacentSideOffsets[0][2] - >> result.firstAdjacentSideOffsets[1][0] - >> result.firstAdjacentSideOffsets[1][1] - >> result.firstAdjacentSideOffsets[1][2] - >> result.edgeCount[0][0] - >> result.edgeCount[0][1] - >> result.edgeCount[0][2] - >> result.edgeCount[1][0] - >> result.edgeCount[1][1] - >> result.edgeCount[1][2]; - - if (result.sidesPtr) - { - if (result.sidesPtr == -1) - { - for (int i = 0; i < result.numsides; i++) { - result.sides << Load_cbrushside_t(aStream); - } - } - else - { - // Resolve from g_streamBlocks - //varcbrush_t->sides = (cbrushside_t *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + (((unsigned int)(&varcbrush_t->sides[-1].edgeCount + 1) >> 26) & 0x38)))[(int)(&varcbrush_t->sides[-1].edgeCount + 1) & 0x1FFFFFFF]; - } - } - if (result.baseAdjacentSidePtr) - { - if (result.baseAdjacentSidePtr == -1) - { - *aStream >> result.baseAdjacentSide; - } - else - { - // Resolve from g_streamBlocks - //v1->baseAdjacentSide = &(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + (((unsigned int)(v1->baseAdjacentSide - 1) >> 26) & 0x38)))[(int)(v1->baseAdjacentSide - 1) & 0x1FFFFFFF]; - } - } - - return result; -} - - -// ?Load_CollisionPartitionArray@@YAX_NH@Z at 0x822a7b50 -QVector Assets::Load_CollisionPartitionArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - result << Load_CollisionPartition(aStream); - } - - return result; -} - - -// ?Load_CLeafBrushNode@@YAX_N@Z at 0x822a7bb0 -CLeafBrushNode Assets::Load_CLeafBrushNode(QDataStream *aStream) -{ - CLeafBrushNode result; - - *aStream - >> result.axis - >> result.leafBrushCount - >> result.contents - >> result.data; - - result.data = Load_CLeafBrushNodeData(aStream); - - return result; -} - - -// ?Load_cNode_tArray@@YAX_NH@Z at 0x822a7c00 -QVector Assets::Load_cNode_tArray(QDataStream *aStream, int count) -{ - QVector result; - - - for (int i = 0; i < count; i++) { - cNode_t cNode; - - *aStream - >> cNode.planePtr - >> cNode.children[0] - >> cNode.children[1]; - - if (cNode.planePtr) - { - if (cNode.planePtr == -1) - { - cNode.plane = Assets::Load_CPlane(aStream); - } - else - { - // Resolve contents from g_streamBlocks - //varcNode_t->plane = (cplane_s *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + (((unsigned int)&plane[-1].pad[1] >> 26) & 0x38)))[(unsigned int)&plane[-1].pad[1] & 0x1FFFFFFF]; - } - } - - result << cNode; - } - - return result; -} - - -// ?Load_MapEntsPtr@@YAX_N@Z at 0x822a7cc8 -void Assets::Load_MapEntsPtr(QDataStream *aStream) -{ - int v1; // r11 - bool v2; // cr58 - unsigned __int8 *v3; // r11 - const void **inserted; // r30 - MapEnts **v5; // r31 - XAssetHeader *v6; // r5 - - Load_Stream(0, varMapEntsPtr, 4u); - DB_PushStreamPos(0); - v1 = (int)*varMapEntsPtr; - if ( *varMapEntsPtr ) - { - if ( v1 != -1 && v1 != -2 ) - { - *varMapEntsPtr = *(MapEnts **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - DB_PopStreamPos(); - return; - } - v2 = v1 == -2; - v3 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v3; - *varMapEntsPtr = (MapEnts *)v3; - varMapEnts = (MapEnts *)v3; - if ( v2 ) - inserted = DB_InsertPointer(); - else - inserted = 0; - Load_MapEnts(1); - v5 = varMapEntsPtr; - *v5 = (MapEnts *)DB_AddXAsset((XAssetHeader *)0x10, (XAssetHeader *)*varMapEntsPtr, v6); - if ( inserted ) - *inserted = *varMapEntsPtr; - } - DB_PopStreamPos(); -} - - -// ?Load_GameWorldMpPtr@@YAX_N@Z at 0x822a7db0 -void Assets::Load_GameWorldMpPtr(QDataStream *aStream) -{ - int v1; // r11 - bool v2; // cr58 - unsigned __int8 *v3; // r11 - const void **inserted; // r30 - GameWorldMp **v5; // r31 - XAssetHeader *v6; // r5 - - Load_Stream(0, varGameWorldMpPtr, 4u); - DB_PushStreamPos(0); - v1 = (int)*varGameWorldMpPtr; - if ( *varGameWorldMpPtr ) - { - if ( v1 != -1 && v1 != -2 ) - { - *varGameWorldMpPtr = *(GameWorldMp **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - DB_PopStreamPos(); - return; - } - v2 = v1 == -2; - v3 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v3; - *varGameWorldMpPtr = (GameWorldMp *)v3; - varGameWorldMp = (GameWorldMp *)v3; - if ( v2 ) - inserted = DB_InsertPointer(); - else - inserted = 0; - Load_GameWorldMp(1); - v5 = varGameWorldMpPtr; - *v5 = (GameWorldMp *)DB_AddXAsset((XAssetHeader *)0xF, (XAssetHeader *)*varGameWorldMpPtr, v6); - if ( inserted ) - *inserted = *varGameWorldMpPtr; - } - DB_PopStreamPos(); -} - - -// ?Load_pathnode_tree_info_t@@YAX_N@Z at 0x822a7e98 -void Assets::Load_pathnode_tree_info_t(QDataStream *aStream) -{ - if ( varpathnode_tree_t->axis < 0 ) - { - varpathnode_tree_nodes_t = (PathNodeTreeNodes *)varpathnode_tree_info_t; - Load_PathNodeTreeNodes(0); - } - else - { - varpathnode_tree_ptr = (pathnode_tree_t **)varpathnode_tree_info_t; - LoadPathNodeTreeArray(0, 2); - } -} - - -// ?Load_pathnode_t@@YAX_N@Z at 0x822a7ed8 -void Assets::Load_pathnode_t(QDataStream *aStream) -{ - Load_Stream(0, varpathnode_t, 0x80u); - varpathnode_constant_t = &varpathnode_t->constant; - Load_PathNodeConstant(0); -} - - -// ?Load_cbrushside_tArray@@YAX_NH@Z at 0x822a7f28 -void Assets::Load_cbrushside_tArray(QDataStream *aStream, int count) -{ - int v2; // r31 - CBrushSide *v3; // r30 - CPlane *plane; // r11 - unsigned __int8 *v5; // r4 - - v2 = count; - Load_Stream(1, varcbrushside_t, 12 * count); - v3 = varcbrushside_t; - if ( v2 > 0 ) - { - do - { - varcbrushside_t = v3; - Load_Stream(0, v3, 0xCu); - plane = varcbrushside_t->plane; - if ( varcbrushside_t->plane ) - { - if ( plane == (CPlane *)-1 ) - { - v5 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v5; - varcplane_t = (cplane_s *)v5; - varcbrushside_t->plane = (cplane_s *)v5; - Load_Stream(1, v5, 0x14u); - } - else - { - varcbrushside_t->plane = (cplane_s *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)&plane[-1].pad[1] >> 26) & 0x38)))[(unsigned int)&plane[-1].pad[1] & 0x1FFFFFFF]; - } - } - --v2; - ++v3; - } - while ( v2 ); - } -} - - -// ?Load_PhysPresetPtr@@YAX_N@Z at 0x822a7ff8 -void Assets::Load_PhysPresetPtr(QDataStream *aStream) -{ - int v1; // r11 - bool v2; // cr58 - unsigned __int8 *v3; // r11 - const void **inserted; // r30 - PhysPreset **v5; // r31 - XAssetHeader *v6; // r5 - - Load_Stream(0, varPhysPresetPtr, 4u); - DB_PushStreamPos(0); - v1 = (int)*varPhysPresetPtr; - if ( *varPhysPresetPtr ) - { - if ( v1 != -1 && v1 != -2 ) - { - *varPhysPresetPtr = *(PhysPreset **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - DB_PopStreamPos(); - return; - } - v2 = v1 == -2; - v3 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v3; - *varPhysPresetPtr = (PhysPreset *)v3; - varPhysPreset = (PhysPreset *)v3; - if ( v2 ) - inserted = DB_InsertPointer(); - else - inserted = 0; - Load_PhysPreset(1); - v5 = varPhysPresetPtr; - *v5 = (PhysPreset *)DB_AddXAsset((XAssetHeader *)1, (XAssetHeader *)*varPhysPresetPtr, v6); - if ( inserted ) - *inserted = *varPhysPresetPtr; - } - DB_PopStreamPos(); -} - - -// ?Load_MaterialShaderArgument@@YAX_N@Z at 0x822a80e0 -MaterialShaderArgument Assets::Load_MaterialShaderArgument(QDataStream *aStream) -{ - MaterialShaderArgument result; - - *aStream - >> result.type - >> result.dest; - - result.u = Assets::Load_MaterialArgumentDef(aStream, result); -} - - -// ?Load_MaterialPixelShaderProgram@@YAX_N@Z at 0x822a8130 -MaterialPixelShaderProgram Assets::Load_MaterialPixelShaderProgram(QDataStream *aStream) -{ - MaterialPixelShaderProgram result; - - *aStream >> result.psPtr; - - result.loadDef = Load_GfxPixelShaderLoadDef(aStream); - - if ( varMaterialPixelShader->prog.loadDef.physicalPartSize ) - { - ps = varMaterialPixelShader->prog.ps; - HIDWORD(v2) = varMaterialPixelShader->prog.loadDef.physicalPart; - LODWORD(v2) = 0; - *(_QWORD *)&ps->Common = v2; - *(_QWORD *)&ps->Fence = v2; - *(_QWORD *)&ps->Identifier = v2; - *(_QWORD *)&ps[1].Common = v2; - *(_QWORD *)&ps[1].Fence = v2; - ps->Common = 7; - ps->ReferenceCount = 1; - ps->BaseFlush = -65536; - ps[1].Common = HIDWORD(v2); - } - else - { - varMaterialPixelShader->prog.ps = 0; - } - - return result; -} - - -// ?Load_MaterialVertexShaderProgram@@YAX_N@Z at 0x822a81e8 -void Assets::Load_MaterialVertexShaderProgram(QDataStream *aStream) -{ - Load_Stream(0, varMaterialVertexShaderProgram, 0xCu); - varGfxVertexShaderLoadDef = (GfxVertexShaderLoadDef *)varMaterialVertexShaderProgram; - Load_GfxVertexShaderLoadDef(0); - XGRegisterVertexShader( - varMaterialVertexShader->prog.vs, - (unsigned int)varMaterialVertexShader->prog.loadDef.physicalPart); -} - - -// ?Load_GfxImageLoadDef@@YAX_N@Z at 0x822a8248 -GfxImageLoadDef Assets::Load_GfxImageLoadDef(QDataStream *aStream) -{ - GfxImageLoadDef result; - - *aStream - >> result.levelCount - >> result.flags - >> result.dimensions[0] - >> result.dimensions[1] - >> result.dimensions[2] - >> result.format; - - result.texture = Assets::Load_GfxTexture(aStream); - - return result; -} - -typedef GfxTexture GfxTextureLoad; - -// ?Load_GfxTextureLoad@@YAX_N@Z at 0x822a82a8 -GfxTextureLoad Assets::Load_GfxTextureLoad(QDataStream *aStream) -{ - GfxTextureLoad result; - - *aStream >> result.basemapPtr; - - if (result.basemapPtr) - { - if (result.basemapPtr == -1 || result.basemapPtr == -2) - { - result.loadDef = Assets::Load_GfxImageLoadDef(aStream); - } - else - { - // Resolve contents from g_streamBlocks - //varGfxTextureLoad->basemap = *(D3DBaseTexture **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + ((((unsigned int)&basemap[-1].Format.dword[5] - // + 3) >> 26) & 0x38)))[((unsigned int)&basemap[-1].Format.dword[5] + 3) & 0x1FFFFFFF]; - } - } - - return result; -} - - -// ?Load_XRigidVertList@@YAX_N@Z at 0x822a83a0 -XRigidVertList Assets::Load_XRigidVertList(QDataStream *aStream) -{ - XRigidVertList result; - - *aStream - >> result.boneOffset - >> result.vertCount - >> result.triOffset - >> result.triCount - >> result.collisionTreePtr; - - if (result.collisionTreePtr) - { - if (result.collisionTreePtr == -1) - { - result.collisionTree = Assets::Load_XSurfaceCollisionTree(aStream); - } - else - { - // Resolve contents from g_streamBlocks - //varXRigidVertList->collisionTree = (XSurfaceCollisionTree *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + ((((unsigned int)&varXRigidVertList->collisionTree[-1].leafs - // + 3) >> 26) & 0x38)))[((int)&varXRigidVertList->collisionTree[-1].leafs + 3) & 0x1FFFFFFF]; - } - } -} - - -// ?Load_snd_alias_list_name@@YAX_N@Z at 0x822a8450 -void Assets::Load_snd_alias_list_name(QDataStream *aStream) -{ - Load_Stream(0, varsnd_alias_list_name, 4u); - Load_SndAliasCustom(varsnd_alias_list_name); -} - - -// ?Load_XAUDIOCHANNELMAPArray@@YAX_NH@Z at 0x822a8490 -QVector Assets::Load_XAUDIOCHANNELMAPArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - result << Assets::Load_XAUDIOCHANNELMAP(aStream); - } - - return result; -} - - -// ?Load_SndCurvePtr@@YAX_N@Z at 0x822a8528 -SndCurve Assets::Load_SndCurvePtr(QDataStream *aStream) -{ - SndCurve result; - qint32 sndCurvePtr; - - *aStream >> sndCurvePtr; - - if (sndCurvePtr) - { - if (sndCurvePtr == -1 || sndCurvePtr == -2) - { - result = Assets::Load_SndCurve(aStream); - } - else { - // Resolve contents from g_streamBlocks - //*varSndCurvePtr = *(SndCurve **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - } - } - return result; -} - - -// ?Load_StreamFileInfo@@YAX_N@Z at 0x822a8610 -void Assets::Load_StreamFileInfo(QDataStream *aStream) -{ - if ( !varStreamFileName->fileIndex ) - { - varStreamFileNameRaw = &varStreamFileInfo->raw; - Load_StreamFileNameRaw(0); - } -} - - -// ?Load_SndDriverGlobalsPtr@@YAX_N@Z at 0x822a8640 -void Assets::Load_SndDriverGlobalsPtr(QDataStream *aStream) -{ - XSoundDriverGlobals result; - qint32 sndDriverGlobalsPtr; - - *aStream >> sndDriverGlobalsPtr; - - if (sndDriverGlobalsPtr) - { - if (sndDriverGlobalsPtr == -1 || sndDriverGlobalsPtr == -2) - { - result = Assets::Load_SndDriverGlobals(aStream); - } - else - { - // Resolve contents for g_streamBlocks - //*varSndDriverGlobalsPtr = *(SndDriverGlobals **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - } - } -} - - -// ?Load_XaSound@@YAX_N@Z at 0x822a8728 -XaSound Assets::Load_XaSound(QDataStream *aStream) -{ - XaSound result; - - *aStream - >> result.packet.pBufferPtr - >> result.packet.BufferSize - >> result.packet.LoopCount; - - for (int i = 0; i < 6; i++) { - *aStream - >> result.packet.XMALoop[i].LoopStart - >> result.packet.XMALoop[i].LoopEnd - >> result.packet.XMALoop[i].LoopSubframeEnd - >> result.packet.XMALoop[i].LoopSubframeSkip; - } - *aStream - >> result.packet.pContextPtr - >> result.packet.pContext - >> result.format.SampleType - >> result.format.___u1.NumStreams - >> result.format.___u1.ChannelCount; - - for (int i = 0; i < 6; i++) { - *aStream - >> result.format.___u2.Stream[i].SampleRate - >> result.format.___u2.Stream[i].ChannelCount - >> result.format.___u2.Stream[i].DecodeBufferSize; - } - *aStream - >> result.packet.pContextPtr - >> result.xaIwXmaDataInfo.totalMsec - >> result.seekTable.size - >> result.seekTable.dataPtr; - - result.packet = Assets::Load_XAUDIOPACKET_ALIGNED(aStream); - result.seekTable = Assets::Load_XaSeekTable(aStream); - - return result; -} - - -// ?Load_XAnimNotifyInfoArray@@YAX_NH@Z at 0x822a8790 -QVector Assets::Load_XAnimNotifyInfoArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - XAnimNotifyInfo xAnimNotifyInfo; - - *aStream - >> xAnimNotifyInfo.name - >> xAnimNotifyInfo.time; - - result << xAnimNotifyInfo; - } - return result; -} - -// ?Load_XAnimPartTransFrames@@YAX_N@Z at 0x822a8828 -void Assets::Load_XAnimPartTransFrames(QDataStream *aStream) -{ - unsigned int numframes; // r9 - int size; // r11 - size_t v3; // r5 - - Load_Stream(1, varXAnimPartTransFrames, 0x1Cu); - numframes = varXAnimParts->numframes; - varXAnimDynamicIndicesTrans = &varXAnimPartTransFrames->indices; - size = varXAnimPartTrans->size; - if ( numframes >= 0x100 ) - { - v3 = 2 * (size + 1); - varUnsignedShort = varXAnimPartTransFrames->indices._2; - } - else - { - v3 = size + 1; - varbyte = varXAnimPartTransFrames->indices._1; - } - Load_Stream(1, &varXAnimPartTransFrames->indices, v3); - varXAnimDynamicFrames = &varXAnimPartTransFrames->frames; - Load_XAnimDynamicFrames(0); -} - - -// ?Load_XAnimDeltaPartQuatDataFrames@@YAX_N@Z at 0x822a88d0 -void Assets::Load_XAnimDeltaPartQuatDataFrames(QDataStream *aStream) -{ - unsigned int numframes; // r9 - int size; // r11 - size_t v3; // r5 - unsigned __int8 *v4; // r4 - int v5; // r11 - bool v6; // cr58 - int v7; // r11 - - Load_Stream(1, varXAnimDeltaPartQuatDataFrames, 4u); - numframes = varXAnimParts->numframes; - varXAnimDynamicIndicesDeltaQuat = &varXAnimDeltaPartQuatDataFrames->indices; - size = varXAnimDeltaPartQuat->size; - if ( numframes >= 0x100 ) - { - v3 = 2 * (size + 1); - varUnsignedShort = varXAnimDeltaPartQuatDataFrames->indices._2; - } - else - { - v3 = size + 1; - varbyte = varXAnimDeltaPartQuatDataFrames->indices._1; - } - Load_Stream(1, &varXAnimDeltaPartQuatDataFrames->indices, v3); - if ( varXAnimDeltaPartQuatDataFrames->frames ) - { - v4 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v4; - varXAnimDeltaPartQuatDataFrames->frames = (__int16 (*)[2])v4; - varXQuat2 = (__int16 (*)[2])v4; - v5 = varXAnimDeltaPartQuat->size; - v6 = v5 == 0; - v7 = v5 + 1; - if ( v6 ) - v7 = 0; - Load_Stream(1, v4, 4 * v7); - } -} - - -// ?Load_TempStringArray@@YAX_NH@Z at 0x822a89c0 -void Assets::Load_TempStringArray(QDataStream *aStream, int count) -{ - int v2; // r31 - const char **v3; // r30 - const char **v4; // r3 - int v5; // r11 - - v2 = count; - Load_Stream(1, varTempString, 4 * count); - v3 = varTempString; - if ( v2 > 0 ) - { - do - { - varTempString = v3; - Load_Stream(0, v3, 4u); - v4 = varTempString; - v5 = (int)*varTempString; - if ( *varTempString ) - { - if ( v5 == -1 ) - { - varConstChar = (const char *)g_streamPos; - *varTempString = (const char *)g_streamPos; - Load_TempStringCustom(v4); - } - else - { - *varTempString = (const char *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)(v5 - 1) >> 26) & 0x38)))[(v5 - 1) & 0x1FFFFFFF]; - } - } - --v2; - ++v3; - } - while ( v2 ); - } -} - - -// ?Load_GfxLightRegion@@YAX_N@Z at 0x822a8a78 -GfxLightRegion Assets::Load_GfxLightRegion(QDataStream *aStream) -{ - GfxLightRegion result; - - *aStream - >> result.hullCount - >> result.hullsPtr; - - if (result.hullsPtr) - { - result.hulls << Assets::Load_GfxLightRegionHullArray(aStream, result.hullCount); - } - - return result; -} - - -// ?Load_StringTablePtr@@YAX_N@Z at 0x822a8c10 -StringTable Assets::Load_StringTablePtr(QDataStream *aStream) -{ - StringTable result; - qint32 stringTablePtr; - - *aStream >> stringTablePtr; - - if (stringTablePtr) - { - if (stringTablePtr == -1) - { - result = Assets::Load_StringTable(aStream); - } - else - { - // Resolve contents from g_streamBlocks - //*varStringTablePtr = (StringTable *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - } - } -} - - -// ?Load_entryInternalData@@YAX_N@Z at 0x822a8d00 -void Assets::Load_entryInternalData(QDataStream *aStream) -{ - if ( varexpressionEntry->type ) - { - varOperand = (Operand *)varentryInternalData; - Load_Operand(0); - } -} - - -// ?Load_ComWorld@@YAX_N@Z at 0x822a8d30 -ComWorld Assets::Load_ComWorld(QDataStream *aStream) -{ - ComWorld result; - - *aStream - >> result.namePtr - >> result.isInUse - >> result.primaryLightCount - >> result.primaryLightsPtr; - - if (result.namePtr) { - result.name = Assets::Load_XStringCustom(aStream); - } - if (result.primaryLightsPtr) - { - result.primaryLights << Assets::Load_ComPrimaryLightArray(aStream, result.primaryLightCount); - } -} - - -// ?Load_cbrush_tArray@@YAX_NH@Z at 0x822a8dc8 -QVector Assets::Load_cbrush_tArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - result << Assets::Load_CBrush(aStream); - } - - return result; -} - - -// ?Load_cLeafBrushNode_tArray@@YAX_NH@Z at 0x822a8e28 -QVector Assets::Load_cLeafBrushNode_tArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - cLeafBrushNode_t cLeafBrushNode = Assets::Load_CLeafBrushNode(aStream); - Assets::Load_CLeafBrushNode(aStream); - if (cLeafBrushNode.leafBrushCount > 0) { - if (cLeafBrushNode.data.leaf.brushesPtr) { - cLeafBrushNode.data = Assets::Load_CLeafBrushNodeLeaf(count); - } - } - - result << cLeafBrushNode; - } - - return result; -} - - -// ?Load_PathNodeTree@@YAX_N@Z at 0x822a8ed8 -PathNodeTree Assets::Load_PathNodeTree(QDataStream *aStream) -{ - PathNodeTree result; - - *aStream - >> result.axis - >> result.dist - >> result.infoPtr; - - if (result.axis < 0) - { - varpathnode_tree_nodes_t = (PathNodeTreeNodes *)&varpathnode_tree_t->u; - Load_PathNodeTreeNodes(0); - } - else - { - varpathnode_tree_ptr = varpathnode_tree_t->u.child; - LoadPathNodeTreeArray(0, 2); - } -} - - -// ?Load_pathnode_tArray@@YAX_NH@Z at 0x822a8f60 -void Assets::Load_pathnode_tArray(QDataStream *aStream, int count) -{ - int v2; // r30 - pathnode_t *v3; // r31 - - v2 = count; - Load_Stream(1, varpathnode_t, count << 7); - v3 = varpathnode_t; - if ( v2 > 0 ) - { - do - { - varpathnode_t = v3; - Load_Stream(0, v3, 0x80u); - varpathnode_constant_t = &varpathnode_t->constant; - Load_PathNodeConstant(0); - --v2; - ++v3; - } - while ( v2 ); - } -} - - -// ?Load_BrushWrapper@@YAX_N@Z at 0x822a8fd0 -BrushWrapper Assets::Load_BrushWrapper(QDataStream *aStream) -{ - BrushWrapper result; - - *aStream - >> result.mins[0] - >> result.mins[1] - >> result.mins[2] - >> result.contents - >> result.maxs[0] - >> result.maxs[1] - >> result.maxs[2] - >> result.numsides - >> result.sidesPtr - >> result.axialMaterialNum[0][0] - >> result.axialMaterialNum[0][1] - >> result.axialMaterialNum[0][2] - >> result.axialMaterialNum[1][0] - >> result.axialMaterialNum[1][1] - >> result.axialMaterialNum[1][2] - >> result.baseAdjacentSidePtr - >> result.firstAdjacentSideOffsets[0][0] - >> result.firstAdjacentSideOffsets[0][1] - >> result.firstAdjacentSideOffsets[0][2] - >> result.firstAdjacentSideOffsets[1][0] - >> result.firstAdjacentSideOffsets[1][1] - >> result.firstAdjacentSideOffsets[1][2] - >> result.edgeCount[0][0] - >> result.edgeCount[0][1] - >> result.edgeCount[0][2] - >> result.edgeCount[1][0] - >> result.edgeCount[1][1] - >> result.edgeCount[1][2] - >> result.totalEdgeCount - >> result.planesPtr; - - if (result.sidesPtr) - { - result.sides = Assets::Load_cbrushside_tArray(aStream, result.numsides); - } - if (result.baseAdjacentSidePtr) - { - result.baseAdjacentSide = Assets::Load_cbrushedge_t(aStream); - } - if (result.planesPtr) - { - if (result.planesPtr == -1) - { - for (int i = 0; i < result.numsides; i++) { - result.planes << Assets::Load_CPlane(aStream); - } - } - else - { - // Resolve contents from g_streamBlocks - //v1->planes = (cplane_s *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + (((unsigned int)&v1->planes[-1].pad[1] >> 26) & 0x38)))[(int)&v1->planes[-1].pad[1] & 0x1FFFFFFF]; - } - } -} - - -// ?Load_MaterialShaderArgumentArray@@YAX_NH@Z at 0x822a90f0 -void Assets::Load_MaterialShaderArgumentArray(QDataStream *aStream, int count) -{ - int v2; // r30 - MaterialShaderArgument *v3; // r31 - - v2 = count; - Load_Stream(1, varMaterialShaderArgument, 8 * count); - v3 = varMaterialShaderArgument; - if ( v2 > 0 ) - { - do - { - varMaterialShaderArgument = v3; - Load_Stream(0, v3, 8u); - varMaterialArgumentDef = &varMaterialShaderArgument->u; - Load_MaterialArgumentDef(0); - --v2; - ++v3; - } - while ( v2 ); - } -} - - -// ?Load_MaterialPixelShader@@YAX_N@Z at 0x822a9168 -MaterialPixelShader Assets::Load_MaterialPixelShader(QDataStream *aStream) -{ - MaterialPixelShader result; - Load_Stream(1, varMaterialPixelShader, 0x10u); - DB_PushStreamPos(4u); - varXString = &varMaterialPixelShader->name; - Load_XString(0); - varMaterialPixelShaderProgram = &varMaterialPixelShader->prog; - Load_MaterialPixelShaderProgram(0); - - return result; -} - - -// ?Load_MaterialVertexShader@@YAX_N@Z at 0x822a91d8 -void Assets::Load_MaterialVertexShader(QDataStream *aStream) -{ - Load_Stream(1, varMaterialVertexShader, 0x10u); - varXString = &varMaterialVertexShader->name; - Load_XString(0); - varMaterialVertexShaderProgram = &varMaterialVertexShader->prog; - Load_MaterialVertexShaderProgram(0); -} - - -// ?Load_GfxImage@@YAX_N@Z at 0x822a9240 -GfxImage Assets::Load_GfxImage(QDataStream *aStream) -{ - GfxImage result; - - *aStream - >> result.mapType - //>> result.texture.map - >> result.semantic - >> result.cardMemory - >> result.width - >> result.height - >> result.depth - >> result.category - >> result.delayLoadPixels - >> result.pixelsPtr - >> result.baseSize - >> result.streamSlot - >> result.streaming - >> result.namePtr; - - if (result.namePtr == -1) { - result.name = Assets::Load_XStringCustom(aStream); - } - if (result.pixelsPtr) { - result.pixels = Assets::Load_GfxImagePixels(aStream); - } - - result.texture = Assets::Load_GfxTextureLoad(aStream); - - *aStream >> result.texture - - varGfxTextureLoad = &varGfxImage->texture; - Load_GfxTextureLoad(0); - return result; -} - - -// ?Load_XRigidVertListArray@@YAX_NH@Z at 0x822a92d0 -void Assets::Load_XRigidVertListArray(QDataStream *aStream, int count) -{ - int v2; // r31 - XRigidVertList *v3; // r30 - - v2 = count; - Load_Stream(1, varXRigidVertList, 12 * count); - v3 = varXRigidVertList; - if ( v2 > 0 ) - { - do - { - varXRigidVertList = v3; - Load_XRigidVertList(0); - --v2; - ++v3; - } - while ( v2 ); - } -} - - -// ?Load_snd_alias_list_nameArray@@YAX_NH@Z at 0x822a9330 -void Assets::Load_snd_alias_list_nameArray(QDataStream *aStream, int count) -{ - SoundAliasList **v2; // r31 - int v3; // r30 - - Load_Stream(1, varsnd_alias_list_name, 0x74u); - v2 = varsnd_alias_list_name; - v3 = 29; - do - { - varsnd_alias_list_name = v2; - Load_Stream(0, v2, 4u); - Load_SndAliasCustom(varsnd_alias_list_name); - --v3; - ++v2; - } - while ( v3 ); -} - - -// ?Load_SpeakerMapChannel@@YAX_N@Z at 0x822a9390 -void Assets::Load_SpeakerMapChannel(QDataStream *aStream) -{ - Load_Stream(0, varSpeakerMapChannel, 0x10u); - varXAUDIOCHANNELMAP = (XAUDIOCHANNELMAP *)varSpeakerMapChannel; - Load_XAUDIOCHANNELMAPArray(0, 2); -} - - -// ?Load_LoadedSound@@YAX_N@Z at 0x822a93e0 -void Assets::Load_LoadedSound(QDataStream *aStream) -{ - Load_Stream(1, varLoadedSound, 0xA0u); - DB_PushStreamPos(4u); - varXString = &varLoadedSound->name; - Load_XString(0); - varXaSound = &varLoadedSound->sound; - Load_XaSound(0); - DB_PopStreamPos(); -} - - -// ?Load_StreamFileName@@YAX_N@Z at 0x822a9450 -void Assets::Load_StreamFileName(QDataStream *aStream) -{ - unsigned int fileIndex; // r9 - - Load_Stream(0, varStreamFileName, 0xCu); - fileIndex = varStreamFileName->fileIndex; - varStreamFileInfo = &varStreamFileName->info; - if ( !fileIndex ) - { - varStreamFileNameRaw = &varStreamFileName->info.raw; - Load_StreamFileNameRaw(0); - } -} - - -// ?Load_XAnimPartTransData@@YAX_N@Z at 0x822a94b8 -void Assets::Load_XAnimPartTransData(QDataStream *aStream) -{ - if ( varXAnimPartTrans->size ) - { - varXAnimPartTransFrames = &varXAnimPartTransData->frames; - Load_XAnimPartTransFrames(1); - } - else - { - varvec3_t = (float (*)[3])varXAnimPartTransData; - Load_Stream(1, varXAnimPartTransData, 0xCu); - } -} - - -// ?Load_XAnimDeltaPartQuatData@@YAX_N@Z at 0x822a94f8 -void Assets::Load_XAnimDeltaPartQuatData(QDataStream *aStream) -{ - if ( varXAnimDeltaPartQuat->size ) - { - varXAnimDeltaPartQuatDataFrames = &varXAnimDeltaPartQuatData->frames; - Load_XAnimDeltaPartQuatDataFrames(1); - } - else - { - varXQuat2 = (__int16 (*)[2])varXAnimDeltaPartQuatData; - Load_Stream(1, varXAnimDeltaPartQuatData, 4u); - } -} - - -// ?Load_ScriptStringList@@YAX_N@Z at 0x822a9538 -void Assets::Load_ScriptStringList(QDataStream *aStream) -{ - int count; // r4 - unsigned __int8 *v2; // r11 - - Load_Stream(0, varScriptStringList, 8u); - DB_PushStreamPos(4u); - if ( varScriptStringList->strings ) - { - count = varScriptStringList->count; - v2 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v2; - varScriptStringList->strings = (const char **)v2; - varTempString = (const char **)v2; - Load_TempStringArray(1, count); - } - DB_PopStreamPos(); -} - - -// ?Load_GfxLightRegionArray@@YAX_NH@Z at 0x822a95b8 -void Assets::Load_GfxLightRegionArray(QDataStream *aStream, int count) -{ - int v2; // r31 - GfxLightRegion *v3; // r29 - unsigned int hullCount; // r4 - - v2 = count; - Load_Stream(1, varGfxLightRegion, 8 * count); - v3 = varGfxLightRegion; - if ( v2 > 0 ) - { - do - { - varGfxLightRegion = v3; - Load_Stream(0, v3, 8u); - if ( varGfxLightRegion->hulls ) - { - hullCount = varGfxLightRegion->hullCount; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varGfxLightRegionHull = (GfxLightRegionHull *)g_streamPos; - varGfxLightRegion->hulls = (GfxLightRegionHull *)g_streamPos; - Load_GfxLightRegionHullArray(1, hullCount); - } - --v2; - ++v3; - } - while ( v2 ); - } -} - - -// ?Load_GfxCellArray@@YAX_NH@Z at 0x822a9650 -void Assets::Load_GfxCellArray(QDataStream *aStream, int count) -{ - int v2; // r31 - GfxCell *v3; // r30 - - v2 = count; - Load_Stream(1, varGfxCell, 56 * count); - v3 = varGfxCell; - if ( v2 > 0 ) - { - do - { - varGfxCell = v3; - Load_GfxCell(0); - --v2; - ++v3; - } - while ( v2 ); - } -} - - -// ?Load_expressionEntry@@YAX_N@Z at 0x822a96a8 -void Assets::Load_expressionEntry(QDataStream *aStream) -{ - int type; // r9 - - Load_Stream(1, varexpressionEntry, 0xCu); - type = varexpressionEntry->type; - varentryInternalData = &varexpressionEntry->data; - if ( type ) - { - varOperand = (Operand *)&varexpressionEntry->data; - Load_Operand(0); - } -} - - -// ?Load_ComWorldPtr@@YAX_N@Z at 0x822a9710 -void Assets::Load_ComWorldPtr(QDataStream *aStream) -{ - int v1; // r11 - bool v2; // cr58 - unsigned __int8 *v3; // r11 - const void **inserted; // r30 - ComWorld **v5; // r31 - XAssetHeader *v6; // r5 - - Load_Stream(0, varComWorldPtr, 4u); - DB_PushStreamPos(0); - v1 = (int)*varComWorldPtr; - if ( *varComWorldPtr ) - { - if ( v1 != -1 && v1 != -2 ) - { - *varComWorldPtr = *(ComWorld **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - DB_PopStreamPos(); - return; - } - v2 = v1 == -2; - v3 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v3; - *varComWorldPtr = (ComWorld *)v3; - varComWorld = (ComWorld *)v3; - if ( v2 ) - inserted = DB_InsertPointer(); - else - inserted = 0; - Load_ComWorld(1); - v5 = varComWorldPtr; - *v5 = (ComWorld *)DB_AddXAsset((XAssetHeader *)0xD, (XAssetHeader *)*varComWorldPtr, v6); - if ( inserted ) - *inserted = *varComWorldPtr; - } - DB_PopStreamPos(); -} - - -// ?Load_pathnode_tree_tArray@@YAX_NH@Z at 0x822a97f8 -void Assets::Load_pathnode_tree_tArray(QDataStream *aStream, int count) -{ - int v2; // r31 - PathNodeTree *v3; // r30 - - v2 = count; - Load_Stream(1, varpathnode_tree_t, 16 * count); - v3 = varpathnode_tree_t; - if ( v2 > 0 ) - { - do - { - varpathnode_tree_t = v3; - Load_PathNodeTree(0); - --v2; - ++v3; - } - while ( v2 ); - } -} - - -// ?Load_MaterialPixelShaderPtr@@YAX_N@Z at 0x822a98b0 -void Assets::Load_MaterialPixelShaderPtr(QDataStream *aStream) -{ - int v1; // r11 - bool v2; // cr58 - unsigned __int8 *v3; // r11 - const void **inserted; // r30 - MaterialPixelShader **v5; // r31 - XAssetHeader *v6; // r5 - - Load_Stream(0, varMaterialPixelShaderPtr, 4u); - DB_PushStreamPos(0); - v1 = (int)*varMaterialPixelShaderPtr; - if ( *varMaterialPixelShaderPtr ) - { - if ( v1 != -1 && v1 != -2 ) - { - *varMaterialPixelShaderPtr = *(MaterialPixelShader **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - DB_PopStreamPos(); - return; - } - v2 = v1 == -2; - v3 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v3; - *varMaterialPixelShaderPtr = (MaterialPixelShader *)v3; - varMaterialPixelShader = (MaterialPixelShader *)v3; - if ( v2 ) - inserted = DB_InsertPointer(); - else - inserted = 0; - Load_MaterialPixelShader(1); - v5 = varMaterialPixelShaderPtr; - *v5 = (MaterialPixelShader *)DB_AddXAsset((XAssetHeader *)5, (XAssetHeader *)*varMaterialPixelShaderPtr, v6); - if ( inserted ) - *inserted = *varMaterialPixelShaderPtr; - } - DB_PopStreamPos(); -} - - -// ?Load_GfxImagePtr@@YAX_N@Z at 0x822a9a40 -void Assets::Load_GfxImagePtr(QDataStream *aStream) -{ - int v1; // r11 - bool v2; // cr58 - unsigned __int8 *v3; // r11 - const void **inserted; // r31 - - Load_Stream(0, varGfxImagePtr, 4u); - DB_PushStreamPos(0); - v1 = (int)*varGfxImagePtr; - if ( *varGfxImagePtr ) - { - if ( v1 == -1 || v1 == -2 ) - { - v2 = v1 == -2; - v3 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v3; - *varGfxImagePtr = (GfxImage *)v3; - varGfxImage = (GfxImage *)v3; - if ( v2 ) - inserted = DB_InsertPointer(); - else - inserted = 0; - Load_GfxImage(1); - Load_GfxImageAsset(varGfxImagePtr); - if ( inserted ) - *inserted = *varGfxImagePtr; - } - else - { - *varGfxImagePtr = *(GfxImage **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - } - } - DB_PopStreamPos(); -} - - -// ?Load_XSurface@@YAX_N@Z at 0x822a9b30 -void Assets::Load_XSurface(QDataStream *aStream) -{ - XSurface *v1; // r11 - GfxPackedVertex *verts0; // r10 - size_t v3; // r5 - unsigned __int8 *v4; // r4 - XSurface *v5; // r11 - D3DVertexBuffer *p_vb0; // r28 - GfxPackedVertex *v7; // r30 - XRigidVertList *vertList; // r10 - int vertListCount; // r4 - unsigned __int16 *triIndices; // r10 - int triCount; // r10 - unsigned __int8 *v12; // r4 - D3DIndexBuffer *p_indexBuffer; // r31 - unsigned __int16 *v14; // r30 - - Load_Stream(0, varXSurface, 0x74u); - varXSurfaceVertexInfo = &varXSurface->vertInfo; - Load_XSurfaceVertexInfo(0); - v1 = varXSurface; - verts0 = varXSurface->verts0; - if ( verts0 ) - { - if ( verts0 == (GfxPackedVertex *)-1 ) - { - v3 = __ROL4__(varXSurface->vertCount, 5); - v4 = (unsigned __int8 *)((unsigned int)(g_streamPos + 15) & 0xFFFFFFF0); - g_streamPos = v4; - varGfxPackedVertex0 = (GfxPackedVertex *)v4; - varXSurface->verts0 = (GfxPackedVertex *)v4; - Load_Stream(1, v4, v3); - v1 = varXSurface; - } - else - { - varXSurface->verts0 = (GfxPackedVertex *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + ((((unsigned int)&varXSurface->verts0[-1].tangent.packed - + 3) >> 26) & 0x38)))[((int)&varXSurface->verts0[-1].tangent.packed - + 3) & 0x1FFFFFFF]; - } - } - varGfxVertexBuffer = &v1->vb0; - Load_Stream(0, &v1->vb0, 0x20u); - v5 = varXSurface; - p_vb0 = &varXSurface->vb0; - v7 = varXSurface->verts0; - if ( v7 ) - { - XGSetVertexBufferHeader(__ROL4__(varXSurface->vertCount, 5), 0, 0, 0, p_vb0); - XGOffsetResourceAddress(p_vb0, v7); - v5 = varXSurface; - } - vertList = v5->vertList; - if ( vertList ) - { - if ( vertList == (XRigidVertList *)-1 ) - { - vertListCount = v5->vertListCount; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varXRigidVertList = (XRigidVertList *)g_streamPos; - v5->vertList = (XRigidVertList *)g_streamPos; - Load_XRigidVertListArray(1, vertListCount); - v5 = varXSurface; - } - else - { - v5->vertList = (XRigidVertList *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + ((((unsigned int)&v5->vertList[-1].collisionTree + 3) >> 26) & 0x38)))[((int)&v5->vertList[-1].collisionTree + 3) & 0x1FFFFFFF]; - } - } - triIndices = v5->triIndices; - if ( triIndices ) - { - if ( triIndices == (unsigned __int16 *)-1 ) - { - triCount = v5->triCount; - v12 = (unsigned __int8 *)((unsigned int)(g_streamPos + 15) & 0xFFFFFFF0); - v5->triIndices = (unsigned __int16 *)v12; - g_streamPos = v12; - varr_index16_t = (unsigned __int16 *)v12; - Load_Stream(1, v12, 2 * (triCount + __ROL4__(triCount, 1))); - v5 = varXSurface; - } - else - { - v5->triIndices = (unsigned __int16 *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + ((((unsigned int)v5->triIndices - 1) >> 26) & 0x38)))[((int)v5->triIndices - 1) & 0x1FFFFFFF]; - } - } - varGfxIndexBuffer = &v5->indexBuffer; - Load_Stream(0, &v5->indexBuffer, 0x20u); - p_indexBuffer = &varXSurface->indexBuffer; - v14 = varXSurface->triIndices; - XGSetIndexBufferHeader( - 2 * (varXSurface->triCount + __ROL4__(varXSurface->triCount, 1)), - 0, - D3DFMT_INDEX16, - 0, - 0, - &varXSurface->indexBuffer); - XGOffsetResourceAddress(p_indexBuffer, v14); -} - - -// ?Load_SpeakerMapChannelArray@@YAX_NH@Z at 0x822a9d68 -void Assets::Load_SpeakerMapChannelArray(QDataStream *aStream, int count) -{ - XAUDIOCHANNELMAP *v2; // r31 - int v3; // r30 - - Load_Stream(0, varSpeakerMapChannel, 0x20u); - v2 = (XAUDIOCHANNELMAP *)varSpeakerMapChannel; - v3 = 2; - do - { - varSpeakerMapChannel = (XAUDIOCHANNELMAP (*)[2])v2; - Load_Stream(0, v2, 0x10u); - varXAUDIOCHANNELMAP = (XAUDIOCHANNELMAP *)varSpeakerMapChannel; - Load_XAUDIOCHANNELMAPArray(0, 2); - --v3; - v2 += 2; - } - while ( v3 ); -} - - -// ?Load_StreamedSound@@YAX_N@Z at 0x822a9dd8 -void Assets::Load_StreamedSound(QDataStream *aStream) -{ - Load_Stream(0, varStreamedSound, 0xCu); - varStreamFileName = &varStreamedSound->filename; - Load_StreamFileName(0); -} - - -// ?Load_LoadedSoundPtr@@YAX_N@Z at 0x822a9e28 -void Assets::Load_LoadedSoundPtr(QDataStream *aStream) -{ - int v1; // r11 - bool v2; // cr58 - unsigned __int8 *v3; // r11 - const void **inserted; // r30 - LoadedSound **v5; // r31 - XAssetHeader *v6; // r5 - - Load_Stream(0, varLoadedSoundPtr, 4u); - DB_PushStreamPos(0); - v1 = (int)*varLoadedSoundPtr; - if ( *varLoadedSoundPtr ) - { - if ( v1 != -1 && v1 != -2 ) - { - *varLoadedSoundPtr = *(LoadedSound **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - DB_PopStreamPos(); - return; - } - v2 = v1 == -2; - v3 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v3; - *varLoadedSoundPtr = (LoadedSound *)v3; - varLoadedSound = (LoadedSound *)v3; - if ( v2 ) - inserted = DB_InsertPointer(); - else - inserted = 0; - Load_LoadedSound(1); - v5 = varLoadedSoundPtr; - *v5 = (LoadedSound *)DB_AddXAsset((XAssetHeader *)0xA, (XAssetHeader *)*varLoadedSoundPtr, v6); - if ( inserted ) - *inserted = *varLoadedSoundPtr; - } - DB_PopStreamPos(); -} - - -// ?Load_XAnimPartTrans@@YAX_N@Z at 0x822a9f10 -void Assets::Load_XAnimPartTrans(QDataStream *aStream) -{ - int size; // r9 - - Load_Stream(1, varXAnimPartTrans, 4u); - size = varXAnimPartTrans->size; - varXAnimPartTransData = &varXAnimPartTrans->u; - if ( size ) - { - varXAnimPartTransFrames = &varXAnimPartTrans->u.frames; - Load_XAnimPartTransFrames(1); - } - else - { - varvec3_t = (float (*)[3])&varXAnimPartTrans->u; - Load_Stream(1, &varXAnimPartTrans->u, 0xCu); - } -} - - -// ?Load_XAnimDeltaPartQuat@@YAX_N@Z at 0x822a9f98 -void Assets::Load_XAnimDeltaPartQuat(QDataStream *aStream) -{ - int size; // r9 - - Load_Stream(1, varXAnimDeltaPartQuat, 4u); - size = varXAnimDeltaPartQuat->size; - varXAnimDeltaPartQuatData = &varXAnimDeltaPartQuat->u; - if ( size ) - { - varXAnimDeltaPartQuatDataFrames = &varXAnimDeltaPartQuat->u.frames; - Load_XAnimDeltaPartQuatDataFrames(1); - } - else - { - varXQuat2 = (__int16 (*)[2])&varXAnimDeltaPartQuat->u; - Load_Stream(1, &varXAnimDeltaPartQuat->u, 4u); - } -} - - -// ?Load_GfxReflectionProbe@@YAX_N@Z at 0x822aa020 -void Assets::Load_GfxReflectionProbe(QDataStream *aStream) -{ - Load_Stream(0, varGfxReflectionProbe, 0x10u); - varGfxImagePtr = &varGfxReflectionProbe->reflectionImage; - Load_GfxImagePtr(0); -} - - -// ?Load_PathData@@YAX_N@Z at 0x822aa0a0 -void Assets::Load_PathData(QDataStream *aStream) -{ - PathData *v1; // r31 - unsigned int nodeCount; // r4 - bool v3; // r3 - size_t v4; // r5 - unsigned __int8 *v5; // r4 - size_t v6; // r5 - unsigned __int8 *v7; // r4 - size_t v8; // r5 - unsigned __int8 *v9; // r4 - unsigned __int8 *v10; // r4 - size_t visBytes; // r5 - int nodeTreeCount; // r4 - - Load_Stream(0, varPathData, 0x28u); - v1 = varPathData; - if ( varPathData->nodes ) - { - nodeCount = varPathData->nodeCount; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varpathnode_t = (pathnode_t *)g_streamPos; - varPathData->nodes = (pathnode_t *)g_streamPos; - Load_pathnode_tArray(1, nodeCount); - v1 = varPathData; - } - DB_PushStreamPos(1u); - if ( v1->basenodes ) - { - v4 = 16 * v1->nodeCount; - v5 = (unsigned __int8 *)((unsigned int)(g_streamPos + 15) & 0xFFFFFFF0); - g_streamPos = v5; - varpathbasenode_t = (pathbasenode_t *)v5; - v1->basenodes = (PathBaseNode *)v5; - Load_Stream(v3, v5, v4); - v1 = varPathData; - } - DB_PopStreamPos(); - if ( v1->chainNodeForNode ) - { - v6 = 2 * v1->nodeCount; - v7 = (unsigned __int8 *)((unsigned int)(g_streamPos + 1) & 0xFFFFFFFE); - g_streamPos = v7; - varUnsignedShort = (unsigned __int16 *)v7; - v1->chainNodeForNode = (unsigned __int16 *)v7; - Load_Stream(1, v7, v6); - v1 = varPathData; - } - if ( v1->nodeForChainNode ) - { - v8 = 2 * v1->nodeCount; - v9 = (unsigned __int8 *)((unsigned int)(g_streamPos + 1) & 0xFFFFFFFE); - g_streamPos = v9; - varUnsignedShort = (unsigned __int16 *)v9; - v1->nodeForChainNode = (unsigned __int16 *)v9; - Load_Stream(1, v9, v8); - v1 = varPathData; - } - if ( v1->pathVis ) - { - v10 = g_streamPos; - visBytes = v1->visBytes; - varbyte = g_streamPos; - v1->pathVis = g_streamPos; - Load_Stream(1, v10, visBytes); - v1 = varPathData; - } - if ( v1->nodeTree ) - { - nodeTreeCount = v1->nodeTreeCount; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varpathnode_tree_t = (pathnode_tree_t *)g_streamPos; - v1->nodeTree = (pathnode_tree_t *)g_streamPos; - Load_pathnode_tree_tArray(1, nodeTreeCount); - } -} - - -// ?Load_PhysGeomInfoArray@@YAX_NH@Z at 0x822aa228 -void Assets::Load_PhysGeomInfoArray(QDataStream *aStream, int count) -{ - int v2; // r31 - PhysGeomInfo *v3; // r30 - BrushWrapper *brush; // r11 - - v2 = count; - Load_Stream(1, varPhysGeomInfo, 68 * count); - v3 = varPhysGeomInfo; - if ( v2 > 0 ) - { - do - { - varPhysGeomInfo = v3; - Load_Stream(0, v3, 0x44u); - brush = varPhysGeomInfo->brush; - if ( varPhysGeomInfo->brush ) - { - if ( brush == (BrushWrapper *)-1 ) - { - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varBrushWrapper = (BrushWrapper *)g_streamPos; - varPhysGeomInfo->brush = (BrushWrapper *)g_streamPos; - Load_BrushWrapper(1); - } - else - { - varPhysGeomInfo->brush = (BrushWrapper *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + ((((unsigned int)&brush[-1].planes + 3) >> 26) & 0x38)))[((unsigned int)&brush[-1].planes + 3) & 0x1FFFFFFF]; - } - } - --v2; - ++v3; - } - while ( v2 ); - } -} - - -// ?Load_GfxLightmapArray@@YAX_N@Z at 0x822aa2e8 -void Assets::Load_GfxLightmapArray(QDataStream *aStream) -{ - Load_Stream(0, varGfxLightmapArray, 8u); - varGfxImagePtr = &varGfxLightmapArray->primary; - Load_GfxImagePtr(0); - varGfxImagePtr = &varGfxLightmapArray->secondary; - Load_GfxImagePtr(0); -} - - -// ?Load_GfxLightImage@@YAX_N@Z at 0x822aa350 -void Assets::Load_GfxLightImage(QDataStream *aStream) -{ - Load_Stream(0, varGfxLightImage, 8u); - varGfxImagePtr = &varGfxLightImage->image; - Load_GfxImagePtr(0); -} - - -// ?Load_MaterialVertexShaderPtrArray@@YAX_NH@Z at 0x822aa3a0 -void Assets::Load_MaterialVertexShaderPtrArray(QDataStream *aStream, int count) -{ - MaterialVertexShader **v2; // r31 - int v3; // r29 - bool v4; // r3 - - Load_Stream(0, varMaterialVertexShaderPtr, 0x3Cu); - v2 = varMaterialVertexShaderPtr; - v3 = 15; - do - { - varMaterialVertexShaderPtr = v2; - Load_Stream(0, v2, 4u); - if ( *varMaterialVertexShaderPtr ) - Load_MaterialVertexShaderPtr(v4); - --v3; - ++v2; - } - while ( v3 ); -} - - -// ?Load_water_t@@YAX_N@Z at 0x822aa408 -void Assets::Load_water_t(QDataStream *aStream) -{ - water_t *v1; // r11 - int N; // r9 - int M; // r8 - unsigned __int8 *v4; // r4 - int v5; // r9 - int v6; // r8 - unsigned __int8 *v7; // r4 - int v8; // r9 - int v9; // r8 - unsigned __int8 *v10; // r4 - - Load_Stream(1, varwater_t, 0x48u); - v1 = varwater_t; - if ( varwater_t->H0X ) - { - N = varwater_t->N; - M = varwater_t->M; - v4 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v4; - varwater_t->H0X = (float *)v4; - varfloat = (float *)v4; - Load_Stream(1, v4, 4 * N * M); - v1 = varwater_t; - } - if ( v1->H0Y ) - { - v5 = v1->N; - v6 = v1->M; - v7 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v7; - v1->H0Y = (float *)v7; - varfloat = (float *)v7; - Load_Stream(1, v7, 4 * v5 * v6); - v1 = varwater_t; - } - if ( v1->wTerm ) - { - v8 = v1->N; - v9 = v1->M; - v10 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v10; - v1->wTerm = (float *)v10; - varfloat = (float *)v10; - Load_Stream(1, v10, 4 * v8 * v9); - v1 = varwater_t; - } - varGfxImagePtr = &v1->image; - Load_GfxImagePtr(0); -} - - -// ?Load_XSurfaceArray@@YAX_NH@Z at 0x822aa510 -void Assets::Load_XSurfaceArray(QDataStream *aStream, int count) -{ - int v2; // r31 - XSurface *v3; // r30 - - v2 = count; - Load_Stream(1, varXSurface, 116 * count); - v3 = varXSurface; - if ( v2 > 0 ) - { - do - { - varXSurface = v3; - Load_XSurface(0); - --v2; - ++v3; - } - while ( v2 ); - } -} - - -// ?Load_SpeakerMap@@YAX_N@Z at 0x822aa568 -void Assets::Load_SpeakerMap(QDataStream *aStream) -{ - Load_Stream(1, varSpeakerMap, 0x28u); - varXString = &varSpeakerMap->name; - Load_XString(0); - varSpeakerMapChannel = varSpeakerMap->channelMaps; - Load_SpeakerMapChannelArray(0, 2); -} - - -// ?Load_SoundFileRef@@YAX_N@Z at 0x822aa5d8 -void Assets::Load_SoundFileRef(QDataStream *aStream) -{ - if ( varSoundFile->type == 1 ) - { - varLoadedSoundPtr = &varSoundFileRef->loadSnd; - Load_LoadedSoundPtr(0); - } - else - { - varStreamedSound = (StreamedSound *)varSoundFileRef; - Load_Stream(0, varSoundFileRef, 0xCu); - varStreamFileName = &varStreamedSound->filename; - Load_StreamFileName(0); - } -} - - -// ?Load_XAnimDeltaPart@@YAX_N@Z at 0x822aa668 -void Assets::Load_XAnimDeltaPart(QDataStream *aStream) -{ - XAnimDeltaPart *v1; // r11 - - Load_Stream(1, varXAnimDeltaPart, 8u); - v1 = varXAnimDeltaPart; - if ( varXAnimDeltaPart->trans ) - { - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varXAnimPartTrans = (XAnimPartTrans *)g_streamPos; - varXAnimDeltaPart->trans = (XAnimPartTrans *)g_streamPos; - Load_XAnimPartTrans(1); - v1 = varXAnimDeltaPart; - } - if ( v1->quat ) - { - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varXAnimDeltaPartQuat = (XAnimDeltaPartQuat *)g_streamPos; - v1->quat = (XAnimDeltaPartQuat *)g_streamPos; - Load_XAnimDeltaPartQuat(1); - } -} - - -// ?Load_GfxReflectionProbeArray@@YAX_NH@Z at 0x822aa718 -void Assets::Load_GfxReflectionProbeArray(QDataStream *aStream, int count) -{ - int v2; // r30 - GfxReflectionProbe *v3; // r31 - - v2 = count; - Load_Stream(1, varGfxReflectionProbe, 16 * count); - v3 = varGfxReflectionProbe; - if ( v2 > 0 ) - { - do - { - varGfxReflectionProbe = v3; - Load_Stream(0, v3, 0x10u); - varGfxImagePtr = &varGfxReflectionProbe->reflectionImage; - Load_GfxImagePtr(0); - --v2; - ++v3; - } - while ( v2 ); - } -} - - -// ?Load_expressionEntry_ptrArray@@YAX_NH@Z at 0x822aa790 -void Assets::Load_expressionEntry_ptrArray(QDataStream *aStream, int count) -{ - XExpressionEntry **v3; // r28 - int v4; // r26 - unsigned __int8 *v5; // r4 - int type; // r10 - - Load_Stream(1, varexpressionEntry_ptr, 4 * count); - v3 = varexpressionEntry_ptr; - if ( count > 0 ) - { - v4 = count; - do - { - varexpressionEntry_ptr = v3; - Load_Stream(0, v3, 4u); - if ( *varexpressionEntry_ptr ) - { - v5 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v5; - varexpressionEntry = (expressionEntry *)v5; - *varexpressionEntry_ptr = (expressionEntry *)v5; - Load_Stream(1, v5, 0xCu); - type = varexpressionEntry->type; - varentryInternalData = &varexpressionEntry->data; - if ( type ) - { - varOperand = (Operand *)&varexpressionEntry->data; - Load_Operand(0); - } - } - --v4; - ++v3; - } - while ( v4 ); - } -} - - -// ?Load_GameWorldSp@@YAX_N@Z at 0x822aa858 -void Assets::Load_GameWorldSp(QDataStream *aStream) -{ - Load_Stream(1, varGameWorldSp, 0x2Cu); - DB_PushStreamPos(4u); - varXString = &varGameWorldSp->name; - Load_XString(0); - varPathData = &varGameWorldSp->path; - Load_PathData(0); - DB_PopStreamPos(); -} - - -// ?Load_PhysGeomList@@YAX_N@Z at 0x822aa8c8 -void Assets::Load_PhysGeomList(QDataStream *aStream) -{ - unsigned int count; // r4 - unsigned __int8 *v2; // r11 - - Load_Stream(1, varPhysGeomList, 0x2Cu); - if ( varPhysGeomList->geoms ) - { - count = varPhysGeomList->count; - v2 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v2; - varPhysGeomList->geoms = (PhysGeomInfo *)v2; - varPhysGeomInfo = (PhysGeomInfo *)v2; - Load_PhysGeomInfoArray(1, count); - } -} - - -// ?Load_GfxLightmapArrayArray@@YAX_NH@Z at 0x822aa940 -void Assets::Load_GfxLightmapArrayArray(QDataStream *aStream, int count) -{ - int v2; // r29 - GfxLightmapArray *v3; // r31 - - v2 = count; - Load_Stream(1, varGfxLightmapArray, 8 * count); - v3 = varGfxLightmapArray; - if ( v2 > 0 ) - { - do - { - varGfxLightmapArray = v3; - Load_Stream(0, v3, 8u); - varGfxImagePtr = &varGfxLightmapArray->primary; - Load_GfxImagePtr(0); - varGfxImagePtr = &varGfxLightmapArray->secondary; - Load_GfxImagePtr(0); - --v2; - ++v3; - } - while ( v2 ); - } -} - - -// ?Load_GfxLightDef@@YAX_N@Z at 0x822aa9c8 -void Assets::Load_GfxLightDef(QDataStream *aStream) -{ - Load_Stream(1, varGfxLightDef, 0x10u); - DB_PushStreamPos(4u); - varXString = &varGfxLightDef->name; - Load_XString(0); - varGfxLightImage = &varGfxLightDef->attenuation; - Load_Stream(0, &varGfxLightDef->attenuation, 8u); - varGfxImagePtr = &varGfxLightImage->image; - Load_GfxImagePtr(0); - DB_PopStreamPos(); -} - - -// ?Load_MaterialTextureDefInfo@@YAX_N@Z at 0x822aaa50 -void Assets::Load_MaterialTextureDefInfo(QDataStream *aStream) -{ - GfxImage *image; // r11 - unsigned __int8 *v2; // r11 - - if ( varMaterialTextureDef->semantic == 11 ) - { - image = varMaterialTextureDefInfo->image; - if ( varMaterialTextureDefInfo->image ) - { - if ( image == (GfxImage *)-1 ) - { - v2 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v2; - varMaterialTextureDefInfo->image = (GfxImage *)v2; - varwater_t = (water_t *)v2; - Load_water_t(1); - } - else - { - varMaterialTextureDefInfo->image = (GfxImage *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + ((((unsigned int)&image[-1].name + 3) >> 26) & 0x38)))[((unsigned int)&image[-1].name + 3) & 0x1FFFFFFF]; - } - } - } - else - { - varGfxImagePtr = &varMaterialTextureDefInfo->image; - Load_GfxImagePtr(0); - } -} - - -// ?Load_MaterialPass@@YAX_N@Z at 0x822aaae0 -void Assets::Load_MaterialPass(QDataStream *aStream) -{ - MaterialPass *v1; // r11 - MaterialVertexDeclaration *vertexDecl; // r10 - MaterialVertexDeclaration *v3; // r4 - MaterialPass *v4; // r11 - MaterialVertexShader *vertexShader; // r10 - int v6; // r4 - - Load_Stream(0, varMaterialPass, 0x54u); - v1 = varMaterialPass; - vertexDecl = varMaterialPass->vertexDecl; - if ( varMaterialPass->vertexDecl ) - { - if ( vertexDecl == (MaterialVertexDeclaration *)-1 ) - { - v3 = (MaterialVertexDeclaration *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = &v3->streamCount; - varMaterialVertexDeclaration = v3; - varMaterialPass->vertexDecl = v3; - Load_Stream(1, v3, 0x40u); - Load_BuildVertexDecl(&varMaterialPass->vertexDecl); - v1 = varMaterialPass; - } - else - { - varMaterialPass->vertexDecl = (MaterialVertexDeclaration *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + ((((unsigned int)&vertexDecl[-1].routing.decl[14] - + 3) >> 26) & 0x38)))[((unsigned int)&vertexDecl[-1].routing.decl[14] + 3) & 0x1FFFFFFF]; - } - } - varMaterialVertexShaderPtr = v1->vertexShaderArray; - Load_MaterialVertexShaderPtrArray(0, 15); - v4 = varMaterialPass; - vertexShader = varMaterialPass->vertexShader; - if ( vertexShader ) - { - if ( vertexShader == (MaterialVertexShader *)-1 ) - { - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varMaterialVertexShader = (MaterialVertexShader *)g_streamPos; - varMaterialPass->vertexShader = (MaterialVertexShader *)g_streamPos; - Load_MaterialVertexShader(1); - v4 = varMaterialPass; - } - else - { - varMaterialPass->vertexShader = (MaterialVertexShader *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + ((((unsigned int)&varMaterialPass->vertexShader[-1].prog.loadDef.physicalPartSize - + 1) >> 26) & 0x38)))[((int)&varMaterialPass->vertexShader[-1].prog.loadDef.physicalPartSize + 1) & 0x1FFFFFFF]; - } - } - varMaterialPixelShaderPtr = &v4->pixelShader; - Load_MaterialPixelShaderPtr(0); - if ( varMaterialPass->args ) - { - v6 = varMaterialPass->stableArgCount + varMaterialPass->perObjArgCount + varMaterialPass->perPrimArgCount; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varMaterialShaderArgument = (MaterialShaderArgument *)g_streamPos; - varMaterialPass->args = (MaterialShaderArgument *)g_streamPos; - Load_MaterialShaderArgumentArray(1, v6); - } -} - - -// ?Load_SoundFile@@YAX_N@Z at 0x822aac58 -void Assets::Load_SoundFile(QDataStream *aStream) -{ - Load_Stream(1, varSoundFile, 0x10u); - varSoundFileRef = &varSoundFile->u; - Load_SoundFileRef(0); -} - - -// ?Load_XAnimParts@@YAX_N@Z at 0x822aaca8 -void Assets::Load_XAnimParts(QDataStream *aStream) -{ - XAnimParts *v1; // r11 - int v2; // r4 - int notifyCount; // r4 - unsigned __int8 *v4; // r4 - size_t dataByteCount; // r5 - size_t v6; // r5 - unsigned __int8 *v7; // r4 - size_t v8; // r5 - unsigned __int8 *v9; // r4 - size_t v10; // r5 - unsigned __int8 *v11; // r4 - unsigned __int8 *v12; // r4 - size_t randomDataByteCount; // r5 - size_t v14; // r5 - unsigned __int8 *v15; // r4 - - Load_Stream(1, varXAnimParts, 0x5Cu); // 92 - DB_PushStreamPos(4u); - varXString = &varXAnimParts->name; - Load_XString(0); - v1 = varXAnimParts; - if ( varXAnimParts->names ) - { - v2 = varXAnimParts->boneCount[11]; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 1) & 0xFFFFFFFE); - varScriptString = (unsigned __int16 *)g_streamPos; - varXAnimParts->names = (unsigned __int16 *)g_streamPos; - Load_ScriptStringArray(1, v2); - v1 = varXAnimParts; - } - if ( v1->notify ) - { - notifyCount = v1->notifyCount; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varXAnimNotifyInfo = (XAnimNotifyInfo *)g_streamPos; - v1->notify = (XAnimNotifyInfo *)g_streamPos; - Load_XAnimNotifyInfoArray(1, notifyCount); - v1 = varXAnimParts; - } - if ( v1->deltaPart ) - { - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varXAnimDeltaPart = (XAnimDeltaPart *)g_streamPos; - v1->deltaPart = (XAnimDeltaPart *)g_streamPos; - Load_XAnimDeltaPart(1); - v1 = varXAnimParts; - } - if ( v1->dataByte ) - { - v4 = g_streamPos; - dataByteCount = v1->dataByteCount; - varbyte = g_streamPos; - v1->dataByte = g_streamPos; - Load_Stream(1, v4, dataByteCount); - v1 = varXAnimParts; - } - if ( v1->dataShort ) - { - v6 = __ROL4__(v1->dataShortCount, 1); - v7 = (unsigned __int8 *)((unsigned int)(g_streamPos + 1) & 0xFFFFFFFE); - g_streamPos = v7; - varshort = (__int16 *)v7; - v1->dataShort = (__int16 *)v7; - Load_Stream(1, v7, v6); - v1 = varXAnimParts; - } - if ( v1->dataInt ) - { - v8 = __ROL4__(v1->dataIntCount, 2); - v9 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v9; - varint = (int *)v9; - v1->dataInt = (int *)v9; - Load_Stream(1, v9, v8); - v1 = varXAnimParts; - } - if ( v1->randomDataShort ) - { - v10 = 2 * v1->randomDataShortCount; - v11 = (unsigned __int8 *)((unsigned int)(g_streamPos + 1) & 0xFFFFFFFE); - g_streamPos = v11; - varshort = (__int16 *)v11; - v1->randomDataShort = (__int16 *)v11; - Load_Stream(1, v11, v10); - v1 = varXAnimParts; - } - if ( v1->randomDataByte ) - { - v12 = g_streamPos; - randomDataByteCount = v1->randomDataByteCount; - varbyte = g_streamPos; - v1->randomDataByte = g_streamPos; - Load_Stream(1, v12, randomDataByteCount); - v1 = varXAnimParts; - } - if ( v1->randomDataInt ) - { - v14 = __ROL4__(v1->randomDataIntCount, 2); - v15 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v15; - varint = (int *)v15; - v1->randomDataInt = (int *)v15; - Load_Stream(1, v15, v14); - v1 = varXAnimParts; - } - varXAnimIndices = &v1->indices; - Load_XAnimIndices(0); - DB_PopStreamPos(); -} - - -// ?Load_statement@@YAX_N@Z at 0x822aaef8 -void Assets::Load_statement(QDataStream *aStream) -{ - int numEntries; // r4 - unsigned __int8 *v2; // r11 - - Load_Stream(0, varstatement, 8u); - if ( varstatement->entries ) - { - numEntries = varstatement->numEntries; - v2 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v2; - varstatement->entries = (expressionEntry **)v2; - varexpressionEntry_ptr = (expressionEntry **)v2; - Load_expressionEntry_ptrArray(1, numEntries); - } -} - - -// ?Load_GameWorldSpPtr@@YAX_N@Z at 0x822aaf70 -void Assets::Load_GameWorldSpPtr(QDataStream *aStream) -{ - int v1; // r11 - bool v2; // cr58 - unsigned __int8 *v3; // r11 - const void **inserted; // r30 - GameWorldSp **v5; // r31 - XAssetHeader *v6; // r5 - - Load_Stream(0, varGameWorldSpPtr, 4u); - DB_PushStreamPos(0); - v1 = (int)*varGameWorldSpPtr; - if ( *varGameWorldSpPtr ) - { - if ( v1 != -1 && v1 != -2 ) - { - *varGameWorldSpPtr = *(GameWorldSp **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - DB_PopStreamPos(); - return; - } - v2 = v1 == -2; - v3 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v3; - *varGameWorldSpPtr = (GameWorldSp *)v3; - varGameWorldSp = (GameWorldSp *)v3; - if ( v2 ) - inserted = DB_InsertPointer(); - else - inserted = 0; - Load_GameWorldSp(1); - v5 = varGameWorldSpPtr; - *v5 = (GameWorldSp *)DB_AddXAsset((XAssetHeader *)0xE, (XAssetHeader *)*varGameWorldSpPtr, v6); - if ( inserted ) - *inserted = *varGameWorldSpPtr; - } - DB_PopStreamPos(); -} - - -// ?Load_GfxLightDefPtr@@YAX_N@Z at 0x822ab058 -void Assets::Load_GfxLightDefPtr(QDataStream *aStream) -{ - int v1; // r11 - bool v2; // cr58 - unsigned __int8 *v3; // r11 - const void **inserted; // r30 - XGfxLightDef **v5; // r31 - XAssetHeader *v6; // r5 - - Load_Stream(0, varGfxLightDefPtr, 4u); - DB_PushStreamPos(0); - v1 = (int)*varGfxLightDefPtr; - if ( *varGfxLightDefPtr ) - { - if ( v1 != -1 && v1 != -2 ) - { - *varGfxLightDefPtr = *(GfxLightDef **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - DB_PopStreamPos(); - return; - } - v2 = v1 == -2; - v3 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v3; - *varGfxLightDefPtr = (GfxLightDef *)v3; - varGfxLightDef = (GfxLightDef *)v3; - if ( v2 ) - inserted = DB_InsertPointer(); - else - inserted = 0; - Load_GfxLightDef(1); - v5 = varGfxLightDefPtr; - *v5 = (GfxLightDef *)DB_AddXAsset((XAssetHeader *)0x12, (XAssetHeader *)*varGfxLightDefPtr, v6); - if ( inserted ) - *inserted = *varGfxLightDefPtr; - } - DB_PopStreamPos(); -} - - -// ?Load_MaterialTextureDef@@YAX_N@Z at 0x822ab140 -void Assets::Load_MaterialTextureDef(QDataStream *aStream) -{ - Load_Stream(0, varMaterialTextureDef, 0xCu); - varMaterialTextureDefInfo = &varMaterialTextureDef->u; - Load_MaterialTextureDefInfo(0); -} - - -// ?Load_MaterialPassArray@@YAX_NH@Z at 0x822ab190 -void Assets::Load_MaterialPassArray(QDataStream *aStream, int count) -{ - int v2; // r31 - MaterialPass *v3; // r30 - - v2 = count; - Load_Stream(1, varMaterialPass, 84 * count); - v3 = varMaterialPass; - if ( v2 > 0 ) - { - do - { - varMaterialPass = v3; - Load_MaterialPass(0); - --v2; - ++v3; - } - while ( v2 ); - } -} - - -// ?Load_snd_alias_t@@YAX_N@Z at 0x822ab1e8 -void Assets::Load_snd_alias_t(QDataStream *aStream) -{ - snd_alias_t *v1; // r11 - SoundFile *soundFile; // r10 - SpeakerMap *speakerMap; // r10 - - Load_Stream(0, varsnd_alias_t, 0x5Cu); - varXString = &varsnd_alias_t->aliasName; - Load_XString(0); - varXString = &varsnd_alias_t->subtitle; - Load_XString(0); - varXString = &varsnd_alias_t->secondaryAliasName; - Load_XString(0); - varXString = &varsnd_alias_t->chainAliasName; - Load_XString(0); - v1 = varsnd_alias_t; - soundFile = varsnd_alias_t->soundFile; - if ( soundFile ) - { - if ( soundFile == (SoundFile *)-1 ) - { - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varSoundFile = (SoundFile *)g_streamPos; - varsnd_alias_t->soundFile = (SoundFile *)g_streamPos; - Load_SoundFile(1); - v1 = varsnd_alias_t; - } - else - { - varsnd_alias_t->soundFile = (SoundFile *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + ((((unsigned int)&varsnd_alias_t->soundFile[-1].u.streamSnd.filename.info.packed.length - + 3) >> 26) & 0x38)))[((int)&varsnd_alias_t->soundFile[-1].u.streamSnd.filename.info.packed.length - + 3) & 0x1FFFFFFF]; - } - } - varSndCurvePtr = &v1->volumeFalloffCurve; - Load_SndCurvePtr(0); - speakerMap = varsnd_alias_t->speakerMap; - if ( speakerMap ) - { - if ( speakerMap == (SpeakerMap *)-1 ) - { - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varSpeakerMap = (SpeakerMap *)g_streamPos; - varsnd_alias_t->speakerMap = (SpeakerMap *)g_streamPos; - Load_SpeakerMap(1); - } - else - { - varsnd_alias_t->speakerMap = (SpeakerMap *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + ((((unsigned int)&varsnd_alias_t->speakerMap[-1].channelMaps[1][1].paEntries - + 3) >> 26) & 0x38)))[((int)&varsnd_alias_t->speakerMap[-1].channelMaps[1][1].paEntries - + 3) & 0x1FFFFFFF]; - } - } -} - - -// ?Load_XAnimPartsPtr@@YAX_N@Z at 0x822ab348 -void Assets::Load_XAnimPartsPtr(QDataStream *aStream) -{ - int v1; // r11 - bool v2; // cr58 - unsigned __int8 *v3; // r11 - const void **inserted; // r30 - XAnimParts **v5; // r31 - XAssetHeader *v6; // r5 - - Load_Stream(0, varXAnimPartsPtr, 4u); - DB_PushStreamPos(0); - v1 = (int)*varXAnimPartsPtr; - if ( *varXAnimPartsPtr ) - { - if ( v1 != -1 && v1 != -2 ) - { - *varXAnimPartsPtr = *(XAnimParts **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - DB_PopStreamPos(); - return; - } - v2 = v1 == -2; - v3 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v3; - *varXAnimPartsPtr = (XAnimParts *)v3; - varXAnimParts = (XAnimParts *)v3; - if ( v2 ) - inserted = DB_InsertPointer(); - else - inserted = 0; - Load_XAnimParts(1); - v5 = varXAnimPartsPtr; - *v5 = (XAnimParts *)DB_AddXAsset((XAssetHeader *)2, (XAssetHeader *)*varXAnimPartsPtr, v6); - if ( inserted ) - *inserted = *varXAnimPartsPtr; - } - DB_PopStreamPos(); -} - - -// ?Load_GfxLight@@YAX_N@Z at 0x822ab430 -void Assets::Load_GfxLight(QDataStream *aStream) -{ - Load_Stream(1, varGfxLight, 0x40u); - varGfxLightDefPtr = &varGfxLight->def; - Load_GfxLightDefPtr(0); -} - - -// ?Load_MaterialTextureDefArray@@YAX_NH@Z at 0x822ab480 -void Assets::Load_MaterialTextureDefArray(QDataStream *aStream, int count) -{ - int v2; // r30 - MaterialTextureDef *v3; // r31 - - v2 = count; - Load_Stream(1, varMaterialTextureDef, 12 * count); - v3 = varMaterialTextureDef; - if ( v2 > 0 ) - { - do - { - varMaterialTextureDef = v3; - Load_Stream(0, v3, 0xCu); - varMaterialTextureDefInfo = &varMaterialTextureDef->u; - Load_MaterialTextureDefInfo(0); - --v2; - ++v3; - } - while ( v2 ); - } -} - - -// ?Load_MaterialTechnique@@YAX_N@Z at 0x822ab500 -void Assets::Load_MaterialTechnique(QDataStream *aStream) -{ - int passCount; // r4 - - Load_Stream(1, varMaterialTechnique, 8u); - passCount = varMaterialTechnique->passCount; - varMaterialPass = varMaterialTechnique->passArray; - Load_MaterialPassArray(1, passCount); - varXString = &varMaterialTechnique->name; - Load_XString(0); -} - - -// ?Load_snd_alias_tArray@@YAX_NH@Z at 0x822ab568 -void Assets::Load_snd_alias_tArray(QDataStream *aStream, int count) -{ - int v2; // r31 - snd_alias_t *v3; // r30 - - v2 = count; - Load_Stream(1, varsnd_alias_t, 92 * count); - v3 = varsnd_alias_t; - if ( v2 > 0 ) - { - do - { - varsnd_alias_t = v3; - Load_snd_alias_t(0); - --v2; - ++v3; - } - while ( v2 ); - } -} - - -// ?Load_snd_alias_list_t@@YAX_N@Z at 0x822ab620 -void Assets::Load_snd_alias_list_t(QDataStream *aStream) -{ - snd_alias_t *head; // r10 - int count; // r4 - unsigned __int8 *v3; // r10 - - Load_Stream(1, varsnd_alias_list_t, 0xCu); - DB_PushStreamPos(4u); - varXString = &varsnd_alias_list_t->aliasName; - Load_XString(0); - head = varsnd_alias_list_t->head; - if ( head ) - { - if ( head == (snd_alias_t *)-1 ) - { - count = varsnd_alias_list_t->count; - v3 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v3; - varsnd_alias_list_t->head = (snd_alias_t *)v3; - varsnd_alias_t = (snd_alias_t *)v3; - Load_snd_alias_tArray(1, count); - } - else - { - varsnd_alias_list_t->head = (snd_alias_t *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + ((((unsigned int)&varsnd_alias_list_t->head[-1].speakerMap - + 3) >> 26) & 0x38)))[((int)&varsnd_alias_list_t->head[-1].speakerMap - + 3) & 0x1FFFFFFF]; - } - } - DB_PopStreamPos(); -} - - -// ?Load_MaterialTechniquePtrArray@@YAX_NH@Z at 0x822ab6e8 -void Assets::Load_MaterialTechniquePtrArray(QDataStream *aStream, int count) -{ - MaterialTechnique **v2; // r31 - int v3; // r26 - int v4; // r11 - - Load_Stream(0, varMaterialTechniquePtr, 0x68u); - v2 = varMaterialTechniquePtr; - v3 = 26; - do - { - varMaterialTechniquePtr = v2; - Load_Stream(0, v2, 4u); - v4 = (int)*varMaterialTechniquePtr; - if ( *varMaterialTechniquePtr ) - { - if ( v4 == -1 ) - { - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varMaterialTechnique = (MaterialTechnique *)g_streamPos; - *varMaterialTechniquePtr = (MaterialTechnique *)g_streamPos; - Load_MaterialTechnique(1); - } - else - { - *varMaterialTechniquePtr = (MaterialTechnique *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)(v4 - 1) >> 26) & 0x38)))[(v4 - 1) & 0x1FFFFFFF]; - } - } - --v3; - ++v2; - } - while ( v3 ); -} - - -// ?Load_snd_alias_list_ptr@@YAX_N@Z at 0x822ab7a0 -void Assets::Load_snd_alias_list_ptr(QDataStream *aStream) -{ - int v1; // r11 - bool v2; // cr58 - unsigned __int8 *v3; // r11 - const void **inserted; // r30 - SoundAliasList **v5; // r31 - XAssetHeader *v6; // r5 - - Load_Stream(0, varsnd_alias_list_ptr, 4u); - DB_PushStreamPos(0); - v1 = (int)*varsnd_alias_list_ptr; - if ( *varsnd_alias_list_ptr ) - { - if ( v1 != -1 && v1 != -2 ) - { - *varsnd_alias_list_ptr = *(snd_alias_list_t **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - DB_PopStreamPos(); - return; - } - v2 = v1 == -2; - v3 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v3; - *varsnd_alias_list_ptr = (snd_alias_list_t *)v3; - varsnd_alias_list_t = (snd_alias_list_t *)v3; - if ( v2 ) - inserted = DB_InsertPointer(); - else - inserted = 0; - Load_snd_alias_list_t(1); - v5 = varsnd_alias_list_ptr; - *v5 = (snd_alias_list_t *)DB_AddXAsset((XAssetHeader *)8, (XAssetHeader *)*varsnd_alias_list_ptr, v6); - if ( inserted ) - *inserted = *varsnd_alias_list_ptr; - } - DB_PopStreamPos(); -} - - -// ?Load_MaterialTechniqueSet@@YAX_N@Z at 0x822ab888 -void Assets::Load_MaterialTechniqueSet(QDataStream *aStream) -{ - Load_Stream(1, varMaterialTechniqueSet, 116); - DB_PushStreamPos(4u); - varXString = &varMaterialTechniqueSet->name; - Load_XString(0); - varMaterialTechniquePtr = varMaterialTechniqueSet->techniques; - Load_MaterialTechniquePtrArray(0, 26); - DB_PopStreamPos(); -} - - -// ?Load_MaterialTechniqueSetPtr@@YAX_N@Z at 0x822ab900 -void Assets::Load_MaterialTechniqueSetPtr(QDataStream *aStream) -{ - int v1; // r11 - bool v2; // cr58 - unsigned __int8 *v3; // r11 - const void **inserted; // r30 - MaterialTechniqueSet **v5; // r31 - XAssetHeader *v6; // r5 - XAssetHeader *v7; // r3 - - Load_Stream(0, varMaterialTechniqueSetPtr, 4); - DB_PushStreamPos(0); - v1 = (int)*varMaterialTechniqueSetPtr; - if ( *varMaterialTechniqueSetPtr ) - { - if ( v1 != -1 && v1 != -2 ) - { - *varMaterialTechniqueSetPtr = *(MaterialTechniqueSet **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - DB_PopStreamPos(); - return; - } - v2 = v1 == -2; - v3 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v3; - *varMaterialTechniqueSetPtr = (MaterialTechniqueSet *)v3; - varMaterialTechniqueSet = (MaterialTechniqueSet *)v3; - if ( v2 ) - inserted = DB_InsertPointer(); - else - inserted = 0; - Load_MaterialTechniqueSet(1); - v5 = varMaterialTechniqueSetPtr; - v7 = DB_AddXAsset((XAssetHeader *)6, (XAssetType)*varMaterialTechniqueSetPtr, v6); - *v5 = (MaterialTechniqueSet *)v7; - v7[2].xmodelPieces = (XModelPieces *)v7; - if ( inserted ) - *inserted = *varMaterialTechniqueSetPtr; - } - DB_PopStreamPos(); -} - - -// ?Load_Material@@YAX_N@Z at 0x822ab9f0 -void Assets::Load_Material(QDataStream *aStream) -{ - Material *v1; // r11 - MaterialTextureDef *textureTable; // r10 - int textureCount; // r4 - MaterialConstantDef *constantTable; // r10 - size_t v5; // r5 - unsigned __int8 *v6; // r4 - GfxStateBits *stateBitsTable; // r10 - size_t v8; // r5 - unsigned __int8 *v9; // r4 - - Load_Stream(1, varMaterial, 0x48u); - DB_PushStreamPos(4u); - varMaterialInfo = &varMaterial->info; - Load_Stream(0, varMaterial, 0x18u); - varXString = &varMaterialInfo->name; - Load_XString(0); - varMaterialTechniqueSetPtr = &varMaterial->techniqueSet; - Load_MaterialTechniqueSetPtr(0); - v1 = varMaterial; - textureTable = varMaterial->textureTable; - if ( textureTable ) - { - if ( textureTable == (MaterialTextureDef *)-1 ) - { - textureCount = varMaterial->textureCount; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varMaterialTextureDef = (MaterialTextureDef *)g_streamPos; - varMaterial->textureTable = (MaterialTextureDef *)g_streamPos; - Load_MaterialTextureDefArray(1, textureCount); - v1 = varMaterial; - } - else - { - varMaterial->textureTable = (MaterialTextureDef *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + ((((unsigned int)&varMaterial->textureTable[-1].u.water - + 3) >> 26) & 0x38)))[((int)&varMaterial->textureTable[-1].u.water + 3) & 0x1FFFFFFF]; - } - } - constantTable = v1->constantTable; - if ( constantTable ) - { - if ( constantTable == (MaterialConstantDef *)-1 ) - { - v5 = __ROL4__(v1->constantCount, 5); - v6 = (unsigned __int8 *)((unsigned int)(g_streamPos + 15) & 0xFFFFFFF0); - g_streamPos = v6; - varMaterialConstantDef = (MaterialConstantDef *)v6; - v1->constantTable = (MaterialConstantDef *)v6; - Load_Stream(1, v6, v5); - v1 = varMaterial; - } - else - { - v1->constantTable = (MaterialConstantDef *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + ((((unsigned int)&v1->constantTable[-1].literal[3] - + 3) >> 26) & 0x38)))[((int)&v1->constantTable[-1].literal[3] - + 3) & 0x1FFFFFFF]; - } - } - stateBitsTable = v1->stateBitsTable; - if ( stateBitsTable ) - { - if ( stateBitsTable == (GfxStateBits *)-1 ) - { - v8 = __ROL4__(v1->stateBitsCount, 3); - v9 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v9; - varGfxStateBits = (GfxStateBits *)v9; - v1->stateBitsTable = (GfxStateBits *)v9; - Load_Stream(1, v9, v8); - DB_PopStreamPos(); - return; - } - v1->stateBitsTable = (GfxStateBits *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + ((((unsigned int)&v1->stateBitsTable[-1].loadBits[1] + 3) >> 26) & 0x38)))[((int)&v1->stateBitsTable[-1].loadBits[1] + 3) & 0x1FFFFFFF]; - } - DB_PopStreamPos(); -} - - -// ?Load_MaterialHandle@@YAX_N@Z at 0x822abbb0 -void Assets::Load_MaterialHandle(QDataStream *aStream) -{ - int v1; // r11 - bool v2; // cr58 - unsigned __int8 *v3; // r11 - const void **inserted; // r30 - Material **v5; // r31 - XAssetHeader *v6; // r5 - - Load_Stream(0, varMaterialHandle, 4u); - DB_PushStreamPos(0); - v1 = (int)*varMaterialHandle; - if ( *varMaterialHandle ) - { - if ( v1 != -1 && v1 != -2 ) - { - *varMaterialHandle = *(Material **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - DB_PopStreamPos(); - return; - } - v2 = v1 == -2; - v3 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v3; - *varMaterialHandle = (Material *)v3; - varMaterial = (Material *)v3; - if ( v2 ) - inserted = DB_InsertPointer(); - else - inserted = 0; - Load_Material(1); - v5 = varMaterialHandle; - *v5 = (Material *)DB_AddXAsset((XAssetHeader *)4, (XAssetHeader *)*varMaterialHandle, v6); - if ( inserted ) - *inserted = *varMaterialHandle; - } - DB_PopStreamPos(); -} - - -// ?Load_Font@@YAX_N@Z at 0x822abc98 -void Assets::Load_Font(QDataStream *aStream) -{ - Glyph *glyphs; // r10 - int glyphCount; // r10 - Glyph *v3; // r4 - - Load_Stream(1, varFont, 0x18u); - DB_PushStreamPos(4u); - varXString = &varFont->fontName; - Load_XString(0); - varMaterialHandle = &varFont->material; - Load_MaterialHandle(0); - varMaterialHandle = &varFont->glowMaterial; - Load_MaterialHandle(0); - glyphs = varFont->glyphs; - if ( glyphs ) - { - if ( glyphs == (Glyph *)-1 ) - { - glyphCount = varFont->glyphCount; - v3 = (Glyph *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varFont->glyphs = v3; - g_streamPos = (unsigned __int8 *)v3; - varGlyph = v3; - Load_Stream(1, v3, 24 * glyphCount); - } - else - { - varFont->glyphs = (Glyph *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + ((((unsigned int)&varFont->glyphs[-1].t1 + 3) >> 26) & 0x38)))[((int)&varFont->glyphs[-1].t1 + 3) & 0x1FFFFFFF]; - } - } - DB_PopStreamPos(); -} - - -// ?Load_MaterialMemory@@YAX_N@Z at 0x822abda0 -void Assets::Load_MaterialMemory(QDataStream *aStream) -{ - Load_Stream(0, varMaterialMemory, 8u); - varMaterialHandle = &varMaterialMemory->material; - Load_MaterialHandle(0); -} - - -// ?Load_sunflare_t@@YAX_N@Z at 0x822abdf0 -void Assets::Load_sunflare_t(QDataStream *aStream) -{ - Load_Stream(0, varsunflare_t, 0x60u); - varMaterialHandle = &varsunflare_t->spriteMaterial; - Load_MaterialHandle(0); - varMaterialHandle = &varsunflare_t->flareMaterial; - Load_MaterialHandle(0); -} - - -// ?Load_windowDef_t@@YAX_N@Z at 0x822abe60 -void Assets::Load_windowDef_t(QDataStream *aStream) -{ - Load_Stream(0, varwindowDef_t, 0xA8u); - varXString = &varwindowDef_t->name; - Load_XString(0); - varXString = &varwindowDef_t->group; - Load_XString(0); - varMaterialHandle = &varwindowDef_t->background; - Load_MaterialHandle(0); -} - - -// ?Load_listBoxDef_t@@YAX_N@Z at 0x822abee0 -void Assets::Load_listBoxDef_t(QDataStream *aStream) -{ - Load_Stream(1, varlistBoxDef_t, 0x168u); - varXString = &varlistBoxDef_t->doubleClick; - Load_XString(0); - varMaterialHandle = &varlistBoxDef_t->selectIcon; - Load_MaterialHandle(0); -} - - -// ?Load_GfxSurface@@YAX_N@Z at 0x822abf48 -void Assets::Load_GfxSurface(QDataStream *aStream) -{ - Load_Stream(0, varGfxSurface, 0x48u); - varMaterialHandle = &varGfxSurface->material; - Load_MaterialHandle(0); -} - - -// ?Load_MaterialHandleArray@@YAX_NH@Z at 0x822abf98 -void Assets::Load_MaterialHandleArray(QDataStream *aStream, int count) -{ - int v2; // r30 - Material **v3; // r31 - - v2 = count; - Load_Stream(atStreamStart, varMaterialHandle, 4 * count); - v3 = varMaterialHandle; - if ( v2 > 0 ) - { - do - { - varMaterialHandle = v3; - Load_MaterialHandle(0); - --v2; - ++v3; - } - while ( v2 ); - } -} - - -// ?Load_FontHandle@@YAX_N@Z at 0x822abfe8 -void Assets::Load_FontHandle(QDataStream *aStream) -{ - int v1; // r11 - bool v2; // cr58 - unsigned __int8 *v3; // r11 - const void **inserted; // r30 - Font_s **v5; // r31 - XAssetHeader *v6; // r5 - - Load_Stream(0, varFontHandle, 4u); - DB_PushStreamPos(0); - v1 = (int)*varFontHandle; - if ( *varFontHandle ) - { - if ( v1 != -1 && v1 != -2 ) - { - *varFontHandle = *(Font_s **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - DB_PopStreamPos(); - return; - } - v2 = v1 == -2; - v3 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v3; - *varFontHandle = (Font_s *)v3; - varFont = (Font_s *)v3; - if ( v2 ) - inserted = DB_InsertPointer(); - else - inserted = 0; - Load_Font(1); - v5 = varFontHandle; - *v5 = (Font_s *)DB_AddXAsset((XAssetHeader *)0x14, (XAssetHeader *)*varFontHandle, v6); - if ( inserted ) - *inserted = *varFontHandle; - } - DB_PopStreamPos(); -} - - -// ?Load_MaterialMemoryArray@@YAX_NH@Z at 0x822ac0d0 -void Assets::Load_MaterialMemoryArray(QDataStream *aStream, int count) -{ - int v2; // r30 - MaterialMemory *v3; // r31 - - v2 = count; - Load_Stream(1, varMaterialMemory, 8 * count); - v3 = varMaterialMemory; - if ( v2 > 0 ) - { - do - { - varMaterialMemory = v3; - Load_Stream(0, v3, 8u); - varMaterialHandle = &varMaterialMemory->material; - Load_MaterialHandle(0); - --v2; - ++v3; - } - while ( v2 ); - } -} - - -// ?Load_Window@@YAX_N@Z at 0x822ac140 -void Assets::Load_Window(QDataStream *aStream) -{ - Load_Stream(0, varWindow, 0xA8u); - varwindowDef_t = varWindow; - Load_windowDef_t(0); -} - - -// ?Load_FxElemMarkVisuals@@YAX_N@Z at 0x822ac1c0 -void Assets::Load_FxElemMarkVisuals(QDataStream *aStream) -{ - Material **v1; // r30 - int v2; // r31 - - Load_Stream(0, varFxElemMarkVisuals, 8u); - varMaterialHandle = (Material **)varFxElemMarkVisuals; - Load_Stream(0, varFxElemMarkVisuals, 8u); - v1 = varMaterialHandle; - v2 = 2; - do - { - varMaterialHandle = v1; - Load_MaterialHandle(0); - --v2; - ++v1; - } - while ( v2 ); -} - - -// ?Load_XModel@@YAX_N@Z at 0x822ac228 -void Assets::Load_XModel(QDataStream *aStream) -{ - XModel *v1; // r11 - unsigned __int16 *boneNames; // r10 - int numBones; // r4 - unsigned __int8 *parentList; // r10 - unsigned __int8 *v5; // r4 - size_t v6; // r5 - __int16 *quats; // r10 - unsigned __int8 *v8; // r4 - size_t v9; // r5 - float *trans; // r10 - unsigned __int8 *v11; // r4 - size_t v12; // r5 - unsigned __int8 *partClassification; // r10 - unsigned __int8 *v14; // r4 - size_t v15; // r5 - DObjAnimMat *baseMat; // r10 - size_t v17; // r5 - unsigned __int8 *v18; // r4 - int numsurfs; // r4 - int v20; // r4 - int numCollSurfs; // r4 - int v22; // r10 - unsigned __int8 *v23; // r4 - XModelHighMipBounds *v24; // r4 - PhysGeomList *physGeoms; // r10 - - Load_Stream(1, varXModel, 0xCCu); - DB_PushStreamPos(4u); - varXString = &varXModel->name; - Load_XString(0); - v1 = varXModel; - boneNames = varXModel->boneNames; - if ( boneNames ) - { - if ( boneNames == (unsigned __int16 *)-1 ) - { - numBones = varXModel->numBones; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 1) & 0xFFFFFFFE); - varScriptString = (unsigned __int16 *)g_streamPos; - varXModel->boneNames = (unsigned __int16 *)g_streamPos; - Load_ScriptStringArray(1, numBones); - v1 = varXModel; - } - else - { - varXModel->boneNames = (unsigned __int16 *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + ((((unsigned int)varXModel->boneNames - 1) >> 26) & 0x38)))[((int)varXModel->boneNames - 1) & 0x1FFFFFFF]; - } - } - parentList = v1->parentList; - if ( parentList ) - { - if ( parentList == (unsigned __int8 *)-1 ) - { - v5 = g_streamPos; - v6 = v1->numBones - v1->numRootBones; - varbyte = g_streamPos; - v1->parentList = g_streamPos; - Load_Stream(1, v5, v6); - v1 = varXModel; - } - else - { - v1->parentList = &(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)(v1->parentList - 1) >> 26) & 0x38)))[(int)(v1->parentList - 1) & 0x1FFFFFFF]; - } - } - quats = v1->quats; - if ( quats ) - { - if ( quats == (__int16 *)-1 ) - { - v8 = (unsigned __int8 *)((unsigned int)(g_streamPos + 1) & 0xFFFFFFFE); - v9 = 8 * (v1->numBones - v1->numRootBones); - g_streamPos = v8; - v1->quats = (__int16 *)v8; - varshort = (__int16 *)v8; - Load_Stream(1, v8, v9); - v1 = varXModel; - } - else - { - v1->quats = (__int16 *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + ((((unsigned int)v1->quats - 1) >> 26) & 0x38)))[((int)v1->quats - 1) & 0x1FFFFFFF]; - } - } - trans = v1->trans; - if ( trans ) - { - if ( trans == (float *)-1 ) - { - v11 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - v12 = 16 * (v1->numBones - v1->numRootBones); - g_streamPos = v11; - v1->trans = (float *)v11; - varfloat = (float *)v11; - Load_Stream(1, v11, v12); - v1 = varXModel; - } - else - { - v1->trans = (float *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + ((((unsigned int)v1->trans - 1) >> 26) & 0x38)))[((int)v1->trans - 1) & 0x1FFFFFFF]; - } - } - partClassification = v1->partClassification; - if ( partClassification ) - { - if ( partClassification == (unsigned __int8 *)-1 ) - { - v14 = g_streamPos; - v15 = v1->numBones; - varbyte = g_streamPos; - v1->partClassification = g_streamPos; - Load_Stream(1, v14, v15); - v1 = varXModel; - } - else - { - v1->partClassification = &(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)(v1->partClassification - 1) >> 26) & 0x38)))[(int)(v1->partClassification - 1) & 0x1FFFFFFF]; - } - } - baseMat = v1->baseMat; - if ( baseMat ) - { - if ( baseMat == (DObjAnimMat *)-1 ) - { - v17 = __ROL4__(v1->numBones, 5); - v18 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v18; - varDObjAnimMat = (DObjAnimMat *)v18; - v1->baseMat = (DObjAnimMat *)v18; - Load_Stream(1, v18, v17); - v1 = varXModel; - } - else - { - v1->baseMat = (DObjAnimMat *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + ((((unsigned int)&v1->baseMat[-1].transWeight + 3) >> 26) & 0x38)))[((int)&v1->baseMat[-1].transWeight + 3) & 0x1FFFFFFF]; - } - } - if ( v1->surfs ) - { - numsurfs = v1->numsurfs; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varXSurface = (XSurface *)g_streamPos; - v1->surfs = (XSurface *)g_streamPos; - Load_XSurfaceArray(1, numsurfs); - v1 = varXModel; - } - if ( v1->materialHandles ) - { - v20 = v1->numsurfs; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varMaterialHandle = (Material **)g_streamPos; - v1->materialHandles = (Material **)g_streamPos; - Load_MaterialHandleArray(1, v20); - v1 = varXModel; - } - if ( v1->collSurfs ) - { - numCollSurfs = v1->numCollSurfs; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varXModelCollSurf = (XModelCollSurf_s *)g_streamPos; - v1->collSurfs = (XModelCollSurf_s *)g_streamPos; - Load_XModelCollSurfArray(1, numCollSurfs); - v1 = varXModel; - } - if ( v1->boneInfo ) - { - v22 = v1->numBones; - v23 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - v1->boneInfo = (XBoneInfo *)v23; - g_streamPos = v23; - varXBoneInfo = (XBoneInfo *)v23; - Load_Stream(1, v23, 8 * (v22 + __ROL4__(v22, 2))); - v1 = varXModel; - } - varXModelStreamInfo = &v1->streamInfo; - Load_Stream(0, &v1->streamInfo, 4u); - if ( varXModelStreamInfo->highMipBounds ) - { - v24 = (XModelHighMipBounds *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varXModelStreamInfo->highMipBounds = v24; - varXModelHighMipBounds = v24; - g_streamPos = (unsigned __int8 *)v24; - Load_Stream(1, v24, 8 * (varXModel->lodInfo[0].numsurfs + __ROL4__(varXModel->lodInfo[0].numsurfs, 1))); - } - varPhysPresetPtr = &varXModel->physPreset; - Load_PhysPresetPtr(0); - physGeoms = varXModel->physGeoms; - if ( physGeoms ) - { - if ( physGeoms == (PhysGeomList *)-1 ) - { - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varPhysGeomList = (PhysGeomList *)g_streamPos; - varXModel->physGeoms = (PhysGeomList *)g_streamPos; - Load_PhysGeomList(1); - DB_PopStreamPos(); - return; - } - varXModel->physGeoms = (PhysGeomList *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + ((((unsigned int)&varXModel->physGeoms[-1].mass.productsOfInertia[2] - + 3) >> 26) & 0x38)))[((int)&varXModel->physGeoms[-1].mass.productsOfInertia[2] - + 3) & 0x1FFFFFFF]; - } - DB_PopStreamPos(); -} - - -// ?Load_GfxSurfaceArray@@YAX_NH@Z at 0x822ac6b0 -void Assets::Load_GfxSurfaceArray(QDataStream *aStream, int count) -{ - int v2; // r30 - GfxSurface *v3; // r31 - - v2 = count; - Load_Stream(1, varGfxSurface, 72 * count); - v3 = varGfxSurface; - if ( v2 > 0 ) - { - do - { - varGfxSurface = v3; - Load_Stream(0, v3, 0x48u); - varMaterialHandle = &varGfxSurface->material; - Load_MaterialHandle(0); - --v2; - ++v3; - } - while ( v2 ); - } -} - - -// ?Load_itemDefData_t@@YAX_N@Z at 0x822ac730 -void Assets::Load_itemDefData_t(QDataStream *aStream) -{ - int type; // r11 - unsigned __int8 *v2; // r11 - unsigned __int8 *v3; // r11 - unsigned __int8 *v4; // r4 - - type = varitemDef_t->type; - switch ( type ) - { - case 6: - varlistBoxDef_ptr = &varitemDefData_t->listBox; - Load_Stream(0, varitemDefData_t, 4u); - if ( *varlistBoxDef_ptr ) - { - v2 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v2; - *varlistBoxDef_ptr = (listBoxDef_s *)v2; - varlistBoxDef_t = (listBoxDef_s *)v2; - Load_listBoxDef_t(1); - } - break; - case 4: - case 9: - case 16: - case 18: - case 11: - case 14: - case 10: - case 0: - case 17: - vareditFieldDef_ptr = (editFieldDef_s **)varitemDefData_t; - Load_Stream(0, varitemDefData_t, 4u); - if ( *vareditFieldDef_ptr ) - { - v4 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v4; - *vareditFieldDef_ptr = (editFieldDef_s *)v4; - vareditFieldDef_t = (editFieldDef_s *)v4; - Load_Stream(1, v4, 0x20u); - } - break; - case 12: - varmultiDef_ptr = (multiDef_s **)varitemDefData_t; - Load_Stream(0, varitemDefData_t, 4u); - if ( *varmultiDef_ptr ) - { - v3 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v3; - *varmultiDef_ptr = (multiDef_s *)v3; - varMultiDef = (multiDef_s *)v3; - Load_MultiDef(1); - } - break; - case 13: - varXString = (const char **)varitemDefData_t; - Load_XString(0); - break; - } -} - - -// ?Load_FxElemMarkVisualsArray@@YAX_NH@Z at 0x822ac918 -void Assets::Load_FxElemMarkVisualsArray(QDataStream *aStream, int count) -{ - int v2; // r31 - FxElemMarkVisuals *v3; // r30 - - v2 = count; - Load_Stream(1, varFxElemMarkVisuals, 8 * count); - v3 = varFxElemMarkVisuals; - if ( v2 > 0 ) - { - do - { - varFxElemMarkVisuals = v3; - Load_FxElemMarkVisuals(0); - --v2; - ++v3; - } - while ( v2 ); - } -} - - -// ?Load_XModelPtr@@YAX_N@Z at 0x822ac970 -void Assets::Load_XModelPtr(QDataStream *aStream) -{ - int v1; // r11 - bool v2; // cr58 - unsigned __int8 *v3; // r11 - const void **inserted; // r30 - XModel **v5; // r31 - XAssetHeader *v6; // r5 - - Load_Stream(0, varXModelPtr, 4u); - DB_PushStreamPos(0); - v1 = (int)*varXModelPtr; - if ( *varXModelPtr ) - { - if ( v1 != -1 && v1 != -2 ) - { - *varXModelPtr = *(XModel **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - DB_PopStreamPos(); - return; - } - v2 = v1 == -2; - v3 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v3; - *varXModelPtr = (XModel *)v3; - varXModel = (XModel *)v3; - if ( v2 ) - inserted = DB_InsertPointer(); - else - inserted = 0; - Load_XModel(1); - v5 = varXModelPtr; - *v5 = (XModel *)DB_AddXAsset((XAssetHeader *)3, (XAssetHeader *)*varXModelPtr, v6); - if ( inserted ) - *inserted = *varXModelPtr; - } - DB_PopStreamPos(); -} - - -// ?Load_GfxStaticModelDrawInst@@YAX_N@Z at 0x822aca58 -void Assets::Load_GfxStaticModelDrawInst(QDataStream *aStream) -{ - Load_Stream(0, varGfxStaticModelDrawInst, 0x2Cu); - varXModelPtr = &varGfxStaticModelDrawInst->model; - Load_XModelPtr(0); -} - - -// ?Load_itemDef_t@@YAX_N@Z at 0x822acaa8 -void Assets::Load_itemDef_t(QDataStream *aStream) -{ - ItemDef *v1; // r11 - unsigned __int8 *v2; // r10 - - Load_Stream(1, varitemDef_t, 0x1D4u); - varWindow = &varitemDef_t->window; - Load_Stream(0, varitemDef_t, 0xA8u); - varwindowDef_t = varWindow; - Load_windowDef_t(0); - varXString = &varitemDef_t->text; - Load_XString(0); - varXString = &varitemDef_t->mouseEnterText; - Load_XString(0); - varXString = &varitemDef_t->mouseExitText; - Load_XString(0); - varXString = &varitemDef_t->mouseEnter; - Load_XString(0); - varXString = &varitemDef_t->mouseExit; - Load_XString(0); - varXString = &varitemDef_t->action; - Load_XString(0); - varXString = &varitemDef_t->onAccept; - Load_XString(0); - varXString = &varitemDef_t->onFocus; - Load_XString(0); - varXString = &varitemDef_t->leaveFocus; - Load_XString(0); - varXString = &varitemDef_t->dvar; - Load_XString(0); - varXString = &varitemDef_t->dvarTest; - Load_XString(0); - v1 = varitemDef_t; - if ( varitemDef_t->onKey ) - { - v2 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v2; - varitemDef_t->onKey = (XItemKeyHandler *)v2; - varItemKeyHandler = (XItemKeyHandler *)v2; - Load_ItemKeyHandler(1); - v1 = varitemDef_t; - } - varXString = &v1->enableDvar; - Load_XString(0); - varsnd_alias_list_ptr = &varitemDef_t->focusSound; - Load_snd_alias_list_ptr(0); - varitemDefData_t = &varitemDef_t->typeData; - Load_itemDefData_t(0); - varstatement = &varitemDef_t->visibleExp; - Load_statement(0); - varstatement = &varitemDef_t->textExp; - Load_statement(0); - varstatement = &varitemDef_t->materialExp; - Load_statement(0); - varstatement = &varitemDef_t->rectXExp; - Load_statement(0); - varstatement = &varitemDef_t->rectYExp; - Load_statement(0); - varstatement = &varitemDef_t->rectWExp; - Load_statement(0); - varstatement = &varitemDef_t->rectHExp; - Load_statement(0); - varstatement = &varitemDef_t->forecolorAExp; - Load_statement(0); -} - - -// ?Load_cStaticModel_t@@YAX_N@Z at 0x822acd18 -void Assets::Load_cStaticModel_t(QDataStream *aStream) -{ - Load_Stream(0, varcStaticModel_t, 0x50u); - varXModelPtr = &varcStaticModel_t->xmodel; - Load_XModelPtr(0); -} - - -// ?Load_FxElemVisuals@@YAX_N@Z at 0x822acd68 -void Assets::Load_FxElemVisuals(QDataStream *aStream) -{ - int elemType; // r11 - - elemType = varFxElemDef->elemType; - switch ( elemType ) - { - case 5: - varXModelPtr = (XModel **)varFxElemVisuals; - Load_XModelPtr(0); - break; - case 10: - varFxEffectDefRef = (FxEffectDefRef *)varFxElemVisuals; - Load_FxEffectDefRef(0); - break; - case 8: - varXString = (const char **)varFxElemVisuals; - Load_XString(0); - break; - default: - if ( elemType != 6 && elemType != 7 ) - { - varMaterialHandle = (Material **)varFxElemVisuals; - Load_MaterialHandle(0); - } - break; - } -} - - -// ?Load_XModelPiece@@YAX_N@Z at 0x822ace00 -void Assets::Load_XModelPiece(QDataStream *aStream) -{ - Load_Stream(0, varXModelPiece, 0x10u); - varXModelPtr = &varXModelPiece->model; - Load_XModelPtr(0); -} - - -// ?Load_XModelPtrArray@@YAX_NH@Z at 0x822ace50 -void Assets::Load_XModelPtrArray(QDataStream *aStream, int count) -{ - XModel **v2; // r30 - int v3; // r31 - - Load_Stream(0, varXModelPtr, 0x40u); - v2 = varXModelPtr; - v3 = 16; - do - { - varXModelPtr = v2; - Load_XModelPtr(0); - --v3; - ++v2; - } - while ( v3 ); -} - - -// ?Load_GfxStaticModelDrawInstArray@@YAX_NH@Z at 0x822acea0 -void Assets::Load_GfxStaticModelDrawInstArray(QDataStream *aStream, int count) -{ - int v2; // r30 - GfxStaticModelDrawInst *v3; // r31 - - v2 = count; - Load_Stream(1, varGfxStaticModelDrawInst, 44 * count); - v3 = varGfxStaticModelDrawInst; - if ( v2 > 0 ) - { - do - { - varGfxStaticModelDrawInst = v3; - Load_Stream(0, v3, 0x2Cu); - varXModelPtr = &varGfxStaticModelDrawInst->model; - Load_XModelPtr(0); - --v2; - ++v3; - } - while ( v2 ); - } -} - - -// ?Load_cStaticModel_tArray@@YAX_NH@Z at 0x822acf48 -void Assets::Load_cStaticModel_tArray(QDataStream *aStream, int count) -{ - int v2; // r30 - cStaticModel_s *v3; // r31 - - v2 = count; - Load_Stream(1, varcStaticModel_t, 80 * count); - v3 = varcStaticModel_t; - if ( v2 > 0 ) - { - do - { - varcStaticModel_t = v3; - Load_Stream(0, v3, 0x50u); - varXModelPtr = &varcStaticModel_t->xmodel; - Load_XModelPtr(0); - --v2; - ++v3; - } - while ( v2 ); - } -} - - -// ?Load_FxElemVisualsArray@@YAX_NH@Z at 0x822acfc8 -void Assets::Load_FxElemVisualsArray(QDataStream *aStream, int count) -{ - int v2; // r31 - FxElemVisuals *v3; // r30 - - v2 = count; - Load_Stream(1, varFxElemVisuals, 4 * count); - v3 = varFxElemVisuals; - if ( v2 > 0 ) - { - do - { - varFxElemVisuals = v3; - Load_FxElemVisuals(0); - --v2; - ++v3; - } - while ( v2 ); - } -} - - -// ?Load_XModelPieceArray@@YAX_NH@Z at 0x822ad020 -void Assets::Load_XModelPieceArray(QDataStream *aStream, int count) -{ - int v2; // r30 - XModelPiece *v3; // r31 - - v2 = count; - Load_Stream(1, varXModelPiece, 16 * count); - v3 = varXModelPiece; - if ( v2 > 0 ) - { - do - { - varXModelPiece = v3; - Load_Stream(0, v3, 0x10u); - varXModelPtr = &varXModelPiece->model; - Load_XModelPtr(0); - --v2; - ++v3; - } - while ( v2 ); - } -} - - -// ?Load_GfxWorldDpvsStatic@@YAX_N@Z at 0x822ad090 -void Assets::Load_GfxWorldDpvsStatic(QDataStream *aStream) -{ - bool v1; // r3 - GfxWorldDpvsStatic *v2; // r31 - unsigned __int8 *v3; // r4 - size_t smodelCount; // r5 - bool v5; // r3 - unsigned __int8 *v6; // r4 - size_t v7; // r5 - bool v8; // r3 - unsigned __int8 *v9; // r4 - size_t v10; // r5 - bool v11; // r3 - unsigned __int8 *v12; // r4 - size_t staticSurfaceCount; // r5 - bool v14; // r3 - unsigned __int8 *v15; // r4 - size_t v16; // r5 - bool v17; // r3 - unsigned __int8 *v18; // r4 - size_t v19; // r5 - bool v20; // r3 - size_t v21; // r5 - unsigned __int8 *v22; // r4 - size_t v23; // r5 - unsigned __int8 *v24; // r4 - size_t v25; // r5 - unsigned __int8 *v26; // r4 - unsigned __int8 *v27; // r11 - GfxCullGroup *v28; // r4 - int v29; // r4 - bool v30; // r3 - size_t v31; // r5 - unsigned __int8 *v32; // r4 - bool v33; // r3 - size_t v34; // r5 - unsigned __int8 *v35; // r4 - - Load_Stream(0, varGfxWorldDpvsStatic, 0x64u); - DB_PushStreamPos(1u); - v2 = varGfxWorldDpvsStatic; - if ( varGfxWorldDpvsStatic->smodelVisData[0] ) - { - v3 = g_streamPos; - smodelCount = varGfxWorldDpvsStatic->smodelCount; - varraw_byte = g_streamPos; - varGfxWorldDpvsStatic->smodelVisData[0] = g_streamPos; - Load_Stream(v1, v3, smodelCount); - v2 = varGfxWorldDpvsStatic; - } - DB_PopStreamPos(); - DB_PushStreamPos(1u); - if ( v2->smodelVisData[1] ) - { - v6 = g_streamPos; - v7 = v2->smodelCount; - varraw_byte = g_streamPos; - v2->smodelVisData[1] = g_streamPos; - Load_Stream(v5, v6, v7); - v2 = varGfxWorldDpvsStatic; - } - DB_PopStreamPos(); - DB_PushStreamPos(1u); - if ( v2->smodelVisData[2] ) - { - v9 = g_streamPos; - v10 = v2->smodelCount; - varraw_byte = g_streamPos; - v2->smodelVisData[2] = g_streamPos; - Load_Stream(v8, v9, v10); - v2 = varGfxWorldDpvsStatic; - } - DB_PopStreamPos(); - DB_PushStreamPos(1u); - if ( v2->surfaceVisData[0] ) - { - v12 = g_streamPos; - staticSurfaceCount = v2->staticSurfaceCount; - varraw_byte = g_streamPos; - v2->surfaceVisData[0] = g_streamPos; - Load_Stream(v11, v12, staticSurfaceCount); - v2 = varGfxWorldDpvsStatic; - } - DB_PopStreamPos(); - DB_PushStreamPos(1u); - if ( v2->surfaceVisData[1] ) - { - v15 = g_streamPos; - v16 = v2->staticSurfaceCount; - varraw_byte = g_streamPos; - v2->surfaceVisData[1] = g_streamPos; - Load_Stream(v14, v15, v16); - v2 = varGfxWorldDpvsStatic; - } - DB_PopStreamPos(); - DB_PushStreamPos(1u); - if ( v2->surfaceVisData[2] ) - { - v18 = g_streamPos; - v19 = v2->staticSurfaceCount; - varraw_byte = g_streamPos; - v2->surfaceVisData[2] = g_streamPos; - Load_Stream(v17, v18, v19); - v2 = varGfxWorldDpvsStatic; - } - DB_PopStreamPos(); - DB_PushStreamPos(1u); - if ( v2->lodData ) - { - v21 = 8 * v2->smodelVisDataCount; - v22 = (unsigned __int8 *)((unsigned int)(g_streamPos + 127) & 0xFFFFFF80); - g_streamPos = v22; - varraw_uint128 = (unsigned int *)v22; - v2->lodData = (unsigned int *)v22; - Load_Stream(v20, v22, v21); - v2 = varGfxWorldDpvsStatic; - } - DB_PopStreamPos(); - if ( v2->sortedSurfIndex ) - { - v23 = 2 * v2->staticSurfaceCount; - v24 = (unsigned __int8 *)((unsigned int)(g_streamPos + 1) & 0xFFFFFFFE); - g_streamPos = v24; - varushort = (unsigned __int16 *)v24; - v2->sortedSurfIndex = (unsigned __int16 *)v24; - Load_Stream(1, v24, v23); - v2 = varGfxWorldDpvsStatic; - } - if ( v2->smodelInsts ) - { - v25 = 28 * v2->smodelCount; - v26 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v26; - v2->smodelInsts = (GfxStaticModelInst *)v26; - varGfxStaticModelInst = (GfxStaticModelInst *)v26; - Load_Stream(1, v26, v25); - v2 = varGfxWorldDpvsStatic; - } - if ( v2->surfaces ) - { - v27 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - v2->surfaces = (GfxSurface *)v27; - g_streamPos = v27; - varGfxSurface = (GfxSurface *)v27; - Load_GfxSurfaceArray(1, varGfxWorld->surfaceCount); - v2 = varGfxWorldDpvsStatic; - } - if ( v2->cullGroups ) - { - v28 = (GfxCullGroup *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - v2->cullGroups = v28; - varGfxCullGroup = v28; - g_streamPos = (unsigned __int8 *)v28; - Load_Stream(1, v28, 32 * varGfxWorld->cullGroupCount); - v2 = varGfxWorldDpvsStatic; - } - if ( v2->smodelDrawInsts ) - { - v29 = v2->smodelCount; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varGfxStaticModelDrawInst = (GfxStaticModelDrawInst *)g_streamPos; - v2->smodelDrawInsts = (GfxStaticModelDrawInst *)g_streamPos; - Load_GfxStaticModelDrawInstArray(1, v29); - v2 = varGfxWorldDpvsStatic; - } - DB_PushStreamPos(1u); - if ( v2->surfaceMaterials ) - { - v31 = 8 * v2->staticSurfaceCount; - v32 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v32; - varGfxDrawSurfFields = (GfxDrawSurfFields *)v32; - v2->surfaceMaterials = (GfxDrawSurfFields *)v32; - Load_Stream(v30, v32, v31); - v2 = varGfxWorldDpvsStatic; - } - DB_PopStreamPos(); - DB_PushStreamPos(1u); - if ( v2->surfaceCastsSunShadow ) - { - v34 = 4 * v2->surfaceVisDataCount; - v35 = (unsigned __int8 *)((unsigned int)(g_streamPos + 127) & 0xFFFFFF80); - g_streamPos = v35; - varraw_uint128 = (unsigned int *)v35; - v2->surfaceCastsSunShadow = (unsigned int *)v35; - Load_Stream(v33, v35, v34); - } - DB_PopStreamPos(); -} - - -// ?Load_itemDef_ptrArray@@YAX_NH@Z at 0x822ad3f0 -void Assets::Load_itemDef_ptrArray(QDataStream *aStream, int count) -{ - int v2; // r31 - ItemDef **v3; // r29 - - v2 = count; - Load_Stream(1, varitemDef_ptr, 4 * count); - v3 = varitemDef_ptr; - if ( v2 > 0 ) - { - do - { - varitemDef_ptr = v3; - Load_Stream(0, v3, 4u); - if ( *varitemDef_ptr ) - { - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varitemDef_t = (ItemDef *)g_streamPos; - *varitemDef_ptr = (ItemDef *)g_streamPos; - Load_itemDef_t(1); - } - --v2; - ++v3; - } - while ( v2 ); - } -} - - -// ?Load_FxElemDefVisuals@@YAX_N@Z at 0x822ad488 -void Assets::Load_FxElemDefVisuals(QDataStream *aStream) -{ - FxElemDef *v1; // r9 - unsigned __int8 *v2; // r11 - int visualCount; // r4 - unsigned __int8 *v4; // r11 - int v5; // r4 - - v1 = varFxElemDef; - if ( varFxElemDef->elemType == 9 ) - { - if ( varFxElemDefVisuals->markArray ) - { - v2 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v2; - varFxElemDefVisuals->markArray = (FxElemMarkVisuals *)v2; - visualCount = v1->visualCount; - varFxElemMarkVisuals = (FxElemMarkVisuals *)v2; - Load_FxElemMarkVisualsArray(1, visualCount); - } - } - else if ( varFxElemDef->visualCount > 1u ) - { - if ( varFxElemDefVisuals->markArray ) - { - v4 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v4; - varFxElemDefVisuals->markArray = (FxElemMarkVisuals *)v4; - v5 = v1->visualCount; - varFxElemVisuals = (FxElemVisuals *)v4; - Load_FxElemVisualsArray(1, v5); - } - } - else - { - varFxElemVisuals = (FxElemVisuals *)varFxElemDefVisuals; - Load_FxElemVisuals(0); - } -} - - -// ?Load_XModelPieces@@YAX_N@Z at 0x822ad540 -void Assets::Load_XModelPieces(QDataStream *aStream) -{ - int numpieces; // r4 - unsigned __int8 *v2; // r11 - - Load_Stream(1, varXModelPieces, 0xCu); - varXString = &varXModelPieces->name; - Load_XString(0); - if ( varXModelPieces->pieces ) - { - numpieces = varXModelPieces->numpieces; - v2 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v2; - varXModelPieces->pieces = (XModelPiece *)v2; - varXModelPiece = (XModelPiece *)v2; - Load_XModelPieceArray(1, numpieces); - } -} - - -// ?Load_GfxWorld@@YAX_N@Z at 0x822ad5c8 -void Assets::Load_GfxWorld(QDataStream *aStream) -{ - GfxWorld *v1; // r11 - size_t v2; // r5 - unsigned __int8 *v3; // r4 - D3DIndexBuffer *p_indexBuffer; // r30 - unsigned __int16 *indices; // r28 - GfxWorld *v6; // r11 - size_t v7; // r5 - unsigned __int8 *v8; // r4 - GfxWorld *v9; // r30 - GfxLight *sunLight; // r11 - int reflectionProbeCount; // r4 - bool v12; // r3 - size_t v13; // r5 - unsigned __int8 *v14; // r4 - GfxWorld *v15; // r11 - int cellCount; // r4 - int lightmapCount; // r4 - bool v18; // r3 - GfxWorld *v19; // r30 - size_t v20; // r5 - unsigned __int8 *v21; // r4 - bool v22; // r3 - size_t v23; // r5 - unsigned __int8 *v24; // r4 - size_t v25; // r5 - unsigned __int8 *v26; // r4 - int materialMemoryCount; // r4 - bool v28; // r3 - GfxWorld *v29; // r30 - unsigned __int8 *v30; // r4 - int v31; // r11 - bool v32; // r3 - unsigned int v33; // r11 - unsigned __int8 *v34; // r4 - bool v35; // r3 - size_t v36; // r5 - unsigned __int8 *v37; // r4 - bool v38; // r3 - unsigned __int8 *v39; // r4 - size_t v40; // r5 - bool v41; // r3 - unsigned __int8 *v42; // r4 - int v43; // r11 - bool v44; // r3 - unsigned __int8 *v45; // r4 - int v46; // r11 - bool v47; // r3 - unsigned __int8 *v48; // r4 - size_t v49; // r5 - int primaryLightCount; // r4 - int v51; // r4 - - Load_Stream(1, varGfxWorld, 0x33Cu); - DB_PushStreamPos(4u); - varXString = &varGfxWorld->name; - Load_XString(0); - varXString = &varGfxWorld->baseName; - Load_XString(0); - v1 = varGfxWorld; - if ( varGfxWorld->indices ) - { - v2 = 2 * varGfxWorld->indexCount; - v3 = (unsigned __int8 *)((unsigned int)(g_streamPos + 1) & 0xFFFFFFFE); - g_streamPos = v3; - varr_index_t = (unsigned __int16 *)v3; - varGfxWorld->indices = (unsigned __int16 *)v3; - Load_Stream(1, v3, v2); - v1 = varGfxWorld; - } - varGfxIndexBuffer = &v1->indexBuffer; - Load_Stream(0, &v1->indexBuffer, 0x20u); - p_indexBuffer = &varGfxWorld->indexBuffer; - indices = varGfxWorld->indices; - XGSetIndexBufferHeader(2 * varGfxWorld->indexCount, 0, D3DFMT_INDEX16, 0, 0, &varGfxWorld->indexBuffer); - XGOffsetResourceAddress(p_indexBuffer, indices); - varGfxWorldStreamInfo = &varGfxWorld->streamInfo; - Load_GfxWorldStreamInfo(0); - v6 = varGfxWorld; - if ( varGfxWorld->skyStartSurfs ) - { - v7 = 4 * varGfxWorld->skySurfCount; - v8 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v8; - varint = (int *)v8; - varGfxWorld->skyStartSurfs = (int *)v8; - Load_Stream(1, v8, v7); - v6 = varGfxWorld; - } - varGfxImagePtr = &v6->skyImage; - Load_GfxImagePtr(0); - v9 = varGfxWorld; - sunLight = varGfxWorld->sunLight; - if ( sunLight ) - { - if ( sunLight == (GfxLight *)-1 ) - { - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varGfxLight = (GfxLight *)g_streamPos; - varGfxWorld->sunLight = (GfxLight *)g_streamPos; - Load_GfxLight(1); - v9 = varGfxWorld; - } - else - { - varGfxWorld->sunLight = (GfxLight *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + ((((unsigned int)&varGfxWorld->sunLight[-1].def + 3) >> 26) & 0x38)))[((int)&varGfxWorld->sunLight[-1].def + 3) & 0x1FFFFFFF]; - } - } - if ( v9->reflectionProbes ) - { - reflectionProbeCount = v9->reflectionProbeCount; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varGfxReflectionProbe = (GfxReflectionProbe *)g_streamPos; - v9->reflectionProbes = (GfxReflectionProbe *)g_streamPos; - Load_GfxReflectionProbeArray(1, reflectionProbeCount); - v9 = varGfxWorld; - } - DB_PushStreamPos(1u); - if ( v9->reflectionProbeTextures ) - { - v13 = 4 * v9->reflectionProbeCount; - v14 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v14; - varGfxRawTexture = (GfxTexture *)v14; - v9->reflectionProbeTextures = (GfxTexture *)v14; - Load_Stream(v12, v14, v13); - v9 = varGfxWorld; - } - DB_PopStreamPos(); - varGfxWorldDpvsPlanes = &v9->dpvsPlanes; - Load_GfxWorldDpvsPlanes(0); - v15 = varGfxWorld; - if ( varGfxWorld->cells ) - { - cellCount = varGfxWorld->dpvsPlanes.cellCount; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varGfxCell = (GfxCell *)g_streamPos; - varGfxWorld->cells = (GfxCell *)g_streamPos; - Load_GfxCellArray(1, cellCount); - v15 = varGfxWorld; - } - if ( v15->lightmaps ) - { - lightmapCount = v15->lightmapCount; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varGfxLightmapArray = (GfxLightmapArray *)g_streamPos; - v15->lightmaps = (GfxLightmapArray *)g_streamPos; - Load_GfxLightmapArrayArray(1, lightmapCount); - v15 = varGfxWorld; - } - varGfxLightGrid = &v15->lightGrid; - Load_GfxLightGrid(0); - DB_PushStreamPos(1u); - v19 = varGfxWorld; - if ( varGfxWorld->lightmapPrimaryTextures ) - { - v20 = 4 * varGfxWorld->lightmapCount; - v21 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v21; - varGfxRawTexture = (GfxTexture *)v21; - varGfxWorld->lightmapPrimaryTextures = (GfxTexture *)v21; - Load_Stream(v18, v21, v20); - v19 = varGfxWorld; - } - DB_PopStreamPos(); - DB_PushStreamPos(1u); - if ( v19->lightmapSecondaryTextures ) - { - v23 = 4 * v19->lightmapCount; - v24 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v24; - varGfxRawTexture = (GfxTexture *)v24; - v19->lightmapSecondaryTextures = (GfxTexture *)v24; - Load_Stream(v22, v24, v23); - v19 = varGfxWorld; - } - DB_PopStreamPos(); - if ( v19->models ) - { - v25 = 56 * v19->modelCount; - v26 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v26; - v19->models = (GfxBrushModel *)v26; - varGfxBrushModel = (GfxBrushModel *)v26; - Load_Stream(1, v26, v25); - v19 = varGfxWorld; - } - if ( v19->materialMemory ) - { - materialMemoryCount = v19->materialMemoryCount; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varMaterialMemory = (MaterialMemory *)g_streamPos; - v19->materialMemory = (MaterialMemory *)g_streamPos; - Load_MaterialMemoryArray(1, materialMemoryCount); - v19 = varGfxWorld; - } - varGfxWorldVertexData = &v19->vd; - Load_GfxWorldVertexData(0); - varGfxWorldVertexLayerData = &varGfxWorld->vld; - Load_GfxWorldVertexLayerData(0); - varsunflare_t = &varGfxWorld->sun; - Load_sunflare_t(0); - varGfxImagePtr = &varGfxWorld->outdoorImage; - Load_GfxImagePtr(0); - DB_PushStreamPos(1u); - v29 = varGfxWorld; - if ( varGfxWorld->cellCasterBits ) - { - v30 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - v31 = ((varGfxWorld->dpvsPlanes.cellCount + 31) >> 5) * varGfxWorld->dpvsPlanes.cellCount; - g_streamPos = v30; - varraw_uint = (unsigned int *)v30; - varGfxWorld->cellCasterBits = (unsigned int *)v30; - Load_Stream(v28, v30, 4 * v31); - v29 = varGfxWorld; - } - DB_PopStreamPos(); - DB_PushStreamPos(1u); - if ( v29->sceneDynModel ) - { - v33 = v29->dpvsDyn.dynEntClientCount[0]; - v34 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v34; - varGfxSceneDynModel = (GfxSceneDynModel *)v34; - v29->sceneDynModel = (GfxSceneDynModel *)v34; - Load_Stream(v32, v34, 6 * v33); - v29 = varGfxWorld; - } - DB_PopStreamPos(); - DB_PushStreamPos(1u); - if ( v29->sceneDynBrush ) - { - v36 = 4 * v29->dpvsDyn.dynEntClientCount[1]; - v37 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v37; - varGfxSceneDynBrush = (GfxSceneDynBrush *)v37; - v29->sceneDynBrush = (GfxSceneDynBrush *)v37; - Load_Stream(v35, v37, v36); - v29 = varGfxWorld; - } - DB_PopStreamPos(); - DB_PushStreamPos(1u); - if ( v29->primaryLightEntityShadowVis ) - { - v39 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - v40 = (v29->primaryLightCount - v29->sunPrimaryLightIndex - 1) << 14; - g_streamPos = v39; - varraw_uint = (unsigned int *)v39; - v29->primaryLightEntityShadowVis = (unsigned int *)v39; - Load_Stream(v38, v39, v40); - v29 = varGfxWorld; - } - DB_PopStreamPos(); - DB_PushStreamPos(1u); - if ( v29->primaryLightDynEntShadowVis[0] ) - { - v42 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - v43 = (v29->primaryLightCount - v29->sunPrimaryLightIndex - 1) * v29->dpvsDyn.dynEntClientCount[0]; - g_streamPos = v42; - v29->primaryLightDynEntShadowVis[0] = (unsigned int *)v42; - varraw_uint = (unsigned int *)v42; - Load_Stream(v41, v42, 4 * v43); - v29 = varGfxWorld; - } - DB_PopStreamPos(); - DB_PushStreamPos(1u); - if ( v29->primaryLightDynEntShadowVis[1] ) - { - v45 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - v46 = (v29->primaryLightCount - v29->sunPrimaryLightIndex - 1) * v29->dpvsDyn.dynEntClientCount[1]; - g_streamPos = v45; - v29->primaryLightDynEntShadowVis[1] = (unsigned int *)v45; - varraw_uint = (unsigned int *)v45; - Load_Stream(v44, v45, 4 * v46); - v29 = varGfxWorld; - } - DB_PopStreamPos(); - DB_PushStreamPos(1u); - if ( v29->nonSunPrimaryLightForModelDynEnt ) - { - v48 = g_streamPos; - v49 = v29->dpvsDyn.dynEntClientCount[0]; - varraw_byte = g_streamPos; - v29->nonSunPrimaryLightForModelDynEnt = g_streamPos; - Load_Stream(v47, v48, v49); - v29 = varGfxWorld; - } - DB_PopStreamPos(); - if ( v29->shadowGeom ) - { - primaryLightCount = v29->primaryLightCount; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varGfxShadowGeometry = (GfxShadowGeometry *)g_streamPos; - v29->shadowGeom = (GfxShadowGeometry *)g_streamPos; - Load_GfxShadowGeometryArray(1, primaryLightCount); - v29 = varGfxWorld; - } - if ( v29->lightRegion ) - { - v51 = v29->primaryLightCount; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varGfxLightRegion = (GfxLightRegion *)g_streamPos; - v29->lightRegion = (GfxLightRegion *)g_streamPos; - Load_GfxLightRegionArray(1, v51); - v29 = varGfxWorld; - } - varGfxWorldDpvsStatic = &v29->dpvs; - Load_GfxWorldDpvsStatic(0); - varGfxWorldDpvsDynamic = &varGfxWorld->dpvsDyn; - Load_GfxWorldDpvsDynamic(0); - DB_PopStreamPos(); -} - - -// ?Load_menuDef_t@@YAX_N@Z at 0x822adca0 -void Assets::Load_menuDef_t(QDataStream *aStream) -{ - menuDef_t *v1; // r11 - int itemCount; // r4 - - Load_Stream(1, varmenuDef_t, 0x134u); - DB_PushStreamPos(4u); - varWindow = &varmenuDef_t->window; - Load_Stream(0, varmenuDef_t, 0xA8u); - varwindowDef_t = varWindow; - Load_windowDef_t(0); - varXString = &varmenuDef_t->font; - Load_XString(0); - varXString = &varmenuDef_t->onOpen; - Load_XString(0); - varXString = &varmenuDef_t->onClose; - Load_XString(0); - varXString = &varmenuDef_t->onESC; - Load_XString(0); - v1 = varmenuDef_t; - if ( varmenuDef_t->onKey ) - { - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varItemKeyHandler = (XItemKeyHandler *)g_streamPos; - varmenuDef_t->onKey = (XItemKeyHandler *)g_streamPos; - Load_ItemKeyHandler(1); - v1 = varmenuDef_t; - } - varstatement = &v1->visibleExp; - Load_statement(0); - varXString = &varmenuDef_t->allowedBinding; - Load_XString(0); - varXString = &varmenuDef_t->soundName; - Load_XString(0); - varstatement = &varmenuDef_t->rectXExp; - Load_statement(0); - varstatement = &varmenuDef_t->rectYExp; - Load_statement(0); - if ( varmenuDef_t->items ) - { - itemCount = varmenuDef_t->itemCount; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varitemDef_ptr = (ItemDef **)g_streamPos; - varmenuDef_t->items = (ItemDef **)g_streamPos; - Load_itemDef_ptrArray(1, itemCount); - } - DB_PopStreamPos(); -} - - -// ?Load_FxElemDef@@YAX_N@Z at 0x822ade30 -void Assets::Load_FxElemDef(QDataStream *aStream) -{ - FxElemDef *v1; // r11 - int v2; // r10 - FxElemVelStateSample *v3; // r4 - int v4; // r10 - FxElemVisStateSample *v5; // r4 - - Load_Stream(0, (void *)varFxElemDef, 0xFCu); - v1 = varFxElemDef; - if ( varFxElemDef->velSamples ) - { - v2 = varFxElemDef->velIntervalCount + 1; - v3 = (FxElemVelStateSample *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varFxElemDef->velSamples = v3; - g_streamPos = (unsigned __int8 *)v3; - varFxElemVelStateSample = v3; - Load_Stream(1, (void *)v3, 96 * v2); - v1 = varFxElemDef; - } - if ( v1->visSamples ) - { - v4 = v1->visStateIntervalCount + 1; - v5 = (FxElemVisStateSample *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - v1->visSamples = v5; - g_streamPos = (unsigned __int8 *)v5; - varFxElemVisStateSample = v5; - Load_Stream(1, (void *)v5, 48 * v4); - v1 = varFxElemDef; - } - varFxElemDefVisuals = &v1->visuals; - Load_FxElemDefVisuals(0); - varFxEffectDefRef = &varFxElemDef->effectOnImpact; - Load_FxEffectDefRef(0); - varFxEffectDefRef = &varFxElemDef->effectOnDeath; - Load_FxEffectDefRef(0); - varFxEffectDefRef = &varFxElemDef->effectEmitted; - Load_FxEffectDefRef(0); - if ( varFxElemDef->trailDef ) - { - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varFxTrailDef = (FxTrailDef *)g_streamPos; - varFxElemDef->trailDef = (FxTrailDef *)g_streamPos; - Load_FxTrailDef(1); - } -} - - -// ?Load_GfxWorldPtr@@YAX_N@Z at 0x822adfd8 -void Assets::Load_GfxWorldPtr(QDataStream *aStream) -{ - int v1; // r11 - bool v2; // cr58 - unsigned __int8 *v3; // r11 - const void **inserted; // r30 - GfxWorld **v5; // r31 - XAssetHeader *v6; // r5 - - Load_Stream(0, varGfxWorldPtr, 4u); - DB_PushStreamPos(0); - v1 = (int)*varGfxWorldPtr; - if ( *varGfxWorldPtr ) - { - if ( v1 != -1 && v1 != -2 ) - { - *varGfxWorldPtr = *(GfxWorld **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - DB_PopStreamPos(); - return; - } - v2 = v1 == -2; - v3 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v3; - *varGfxWorldPtr = (GfxWorld *)v3; - varGfxWorld = (GfxWorld *)v3; - if ( v2 ) - inserted = DB_InsertPointer(); - else - inserted = 0; - Load_GfxWorld(1); - v5 = varGfxWorldPtr; - *v5 = (GfxWorld *)DB_AddXAsset((XAssetHeader *)0x11, (XAssetHeader *)*varGfxWorldPtr, v6); - if ( inserted ) - *inserted = *varGfxWorldPtr; - } - DB_PopStreamPos(); -} - - -// ?Load_menuDef_ptr@@YAX_N@Z at 0x822ae0c0 -void Assets::Load_menuDef_ptr(QDataStream *aStream) -{ - int v1; // r11 - bool v2; // cr58 - unsigned __int8 *v3; // r11 - const void **inserted; // r31 - XAssetHeader *v5; // r5 - int v6; // r4 - - Load_Stream(0, varmenuDef_ptr, 4u); - DB_PushStreamPos(0); - v1 = (int)*varmenuDef_ptr; - if ( *varmenuDef_ptr ) - { - if ( v1 == -1 || v1 == -2 ) - { - v2 = v1 == -2; - v3 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v3; - *varmenuDef_ptr = (menuDef_t *)v3; - varmenuDef_t = (menuDef_t *)v3; - if ( v2 ) - inserted = DB_InsertPointer(); - else - inserted = 0; - Load_menuDef_t(1); - Load_MenuAsset(varmenuDef_ptr, v6, v5); - if ( inserted ) - *inserted = *varmenuDef_ptr; - } - else - { - *varmenuDef_ptr = *(menuDef_t **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - } - } - DB_PopStreamPos(); -} - - -// ?Load_FxElemDefArray@@YAX_NH@Z at 0x822ae1b0 -void Assets::Load_FxElemDefArray(QDataStream *aStream, int count) -{ - int v2; // r31 - FxElemDef *v3; // r30 - - v2 = count; - Load_Stream(1, (void *)varFxElemDef, 252 * count); - v3 = varFxElemDef; - if ( v2 > 0 ) - { - do - { - varFxElemDef = v3; - Load_FxElemDef(0); - --v2; - ++v3; - } - while ( v2 ); - } -} - - -// ?Load_menuDef_ptrArray@@YAX_NH@Z at 0x822ae208 -QVector Assets::Load_menuDef_ptrArray(QDataStream *aStream, int count) -{ - QVector result; - QVector menuDefPtr; - - for (int i = 0; i < count; i++) { - menuDef_t menuDef; - - *aStream - >> menuDef. - - result << menuDef; - } - - v2 = count; - Load_Stream(1, varmenuDef_ptr, 4 * count); - v3 = varmenuDef_ptr; - if ( v2 > 0 ) - { - do - { - varmenuDef_ptr = v3; - Load_menuDef_ptr(0); - --v2; - ++v3; - } - while ( v2 ); - } - - return result; -} - - -// ?Load_FxEffectDef@@YAX_N@Z at 0x822ae260 -FxEffectDef Assets::Load_FxEffectDef(QDataStream *aStream) -{ - FxEffectDef result; - - *aStream - >> result.namePtr - >> result.flags - >> result.totalSize - >> result.msecLoopingLife - >> result.elemDefCountLooping - >> result.elemDefCountOneShot - >> result.elemDefCountEmission - >> result.elemDefsPtr; - - if (result.namePtr) - { - result.name = Load_XStringCustom(aStream); - } - - if (result.elemDefsPtr) - { - result.elemDefs = Load_FxElemDefArray(aStream, result.elemDefCountEmission + result.elemDefCountOneShot + result.elemDefCountLooping); - } - - return result; -} - - -// ?Load_FxEffectDefHandle@@YAX_N@Z at 0x822ae308 -FxEffectDef Assets::Load_FxEffectDefHandle(QDataStream *aStream) -{ - FxEffectDef result; - - qint32 fxEffectDefPtr; - *aStream >> fxEffectDefPtr; - - if (fxEffectDefPtr) - { - if (fxEffectDefPtr == -1 || fxEffectDefPtr == -2) - { - result = Load_FxEffectDef(aStream); - } - else { - *varFxEffectDefHandle = *(const FxEffectDef **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - DB_PopStreamPos(); - } - } - - return result -} - - -// ?Load_WeaponDef@@YAX_N@Z at 0x822ae3f0 -WeaponDef Assets::Load_WeaponDef(QDataStream *aStream) -{ - WeaponDef result; - - *aStream - >> result.szInternalNamePtr - >> result.szDisplayNamePtr - >> result.szOverlayNamePtr - >> result.gunXModelPtr - >> result.handXModelPtr; - - for (int i = 0; i < 33; i++) { - *aStream >> result.szXAnimsPtr[i]; - } - - *aStream - >> result.szModeNamePtr - >> result.hideTags[8]; - - for (int i = 0; i < 8; i++) - { - *aStream >> result.hideTags[i]; - } - for (int i = 0; i < 16; i++) - { - *aStream >> result.notetrackSoundMapKeys[i]; - } - for (int i = 0; i < 16; i++) - { - *aStream >> result.notetrackSoundMapValues[i]; - } - - *aStream - >> result.playerAnimType - >> result.weapType - >> result.weapClass - >> result.penetrateType - >> result.impactType - >> result.inventoryType - >> result.fireType - >> result.offhandClass - >> result.stance - >> result.viewFlashEffectPtr - >> result.worldFlashEffectPtr - >> result.pickupSoundPtr - >> result.pickupSoundPlayerPtr - >> result.ammoPickupSoundPtr - >> result.ammoPickupSoundPlayerPtr - >> result.projectileSoundPtr - >> result.pullbackSoundPtr - >> result.pullbackSoundPlayerPtr - >> result.fireSoundPtr - >> result.fireSoundPlayerPtr - >> result.fireLoopSoundPtr - >> result.fireLoopSoundPlayerPtr - >> result.fireStopSoundPtr - >> result.fireStopSoundPlayerPtr - >> result.fireLastSoundPtr - >> result.fireLastSoundPlayerPtr - >> result.emptyFireSoundPtr - >> result.emptyFireSoundPlayerPtr - >> result.meleeSwipeSoundPtr - >> result.meleeSwipeSoundPlayerPtr - >> result.meleeHitSoundPtr - >> result.meleeMissSoundPtr - >> result.rechamberSoundPtr - >> result.rechamberSoundPlayerPtr - >> result.reloadSoundPtr - >> result.reloadSoundPlayerPtr - >> result.reloadEmptySoundPtr - >> result.reloadEmptySoundPlayerPtr - >> result.reloadStartSoundPtr - >> result.reloadStartSoundPlayerPtr - >> result.reloadEndSoundPtr - >> result.reloadEndSoundPlayerPtr - >> result.detonateSoundPtr - >> result.detonateSoundPlayerPtr - >> result.nightVisionWearSoundPtr - >> result.nightVisionWearSoundPlayerPtr - >> result.nightVisionRemoveSoundPtr - >> result.nightVisionRemoveSoundPlayerPtr - >> result.altSwitchSoundPtr - >> result.altSwitchSoundPlayerPtr - >> result.raiseSoundPtr - >> result.raiseSoundPlayerPtr - >> result.firstRaiseSoundPtr - >> result.firstRaiseSoundPlayerPtr - >> result.putawaySoundPtr - >> result.putawaySoundPlayerPtr - >> result.bounceSoundPtr - >> result.viewShellEjectEffectPtr - >> result.worldShellEjectEffectPtr - >> result.viewLastShotEjectEffectPtr - >> result.worldLastShotEjectEffectPtr - >> result.reticleCenterPtr - >> result.reticleSidePtr - >> result.iReticleCenterSize - >> result.iReticleSideSize - >> result.iReticleMinOfs - >> result.activeReticleType - >> result.vStandMove[0] - >> result.vStandMove[1] - >> result.vStandMove[2] - >> result.vStandRot[0] - >> result.vStandRot[1] - >> result.vStandRot[2] - >> result.vDuckedOfs[0] - >> result.vDuckedOfs[1] - >> result.vDuckedOfs[2] - >> result.vDuckedMove[0] - >> result.vDuckedMove[1] - >> result.vDuckedMove[2] - >> result.vDuckedRot[0] - >> result.vDuckedRot[1] - >> result.vDuckedRot[2] - >> result.vProneOfs[0] - >> result.vProneOfs[1] - >> result.vProneOfs[2] - >> result.vProneMove[0] - >> result.vProneMove[1] - >> result.vProneMove[2] - >> result.vProneRot[0] - >> result.vProneRot[1] - >> result.vProneRot[2] - >> result.fPosMoveRate - >> result.fPosProneMoveRate - >> result.fStandMoveMinSpeed - >> result.fDuckedMoveMinSpeed - >> result.fProneMoveMinSpeed - >> result.fPosRotRate - >> result.fPosProneRotRate - >> result.fStandRotMinSpeed - >> result.fDuckedRotMinSpeed - >> result.fProneRotMinSpeed - >> result.worldModelPtr - >> result.worldClipModelPtr - >> result.rocketModelPtr - >> result.knifeModelPtr - >> result.worldKnifeModelPtr - >> result.hudIconPtr - >> result.hudIconRatio - >> result.ammoCounterIconPtr - >> result.ammoCounterIconRatio - >> result.iStartAmmo - >> result.szAmmoNamePtr - >> result.iAmmoIndex - >> result.szClipNamePtr - >> result.iClipIndex - >> result.iMaxAmmo - >> result.iClipSize - >> result.shotCount - >> result.szSharedAmmoCapNamePtr - >> result.iSharedAmmoCapIndex - >> result.iSharedAmmoCap - >> result.damage - >> result.playerDamage - >> result.iMeleeDamage - >> result.iDamageType - >> result.iFireDelay - >> result.iMeleeDelay - >> result.meleeChargeDelay - >> result.iDetonateDelay - >> result.iFireTime - >> result.iRechamberTime - >> result.iRechamberBoltTime - >> result.iHoldFireTime - >> result.iDetonateTime - >> result.iMeleeTime - >> result.meleeChargeTime - >> result.iReloadTime - >> result.reloadShowRocketTime - >> result.iReloadEmptyTime - >> result.iReloadAddTime - >> result.iReloadStartTime - >> result.iReloadStartAddTime - >> result.iReloadEndTime - >> result.iDropTime - >> result.iRaiseTime - >> result.iAltDropTime - >> result.iAltRaiseTime - >> result.quickDropTime - >> result.quickRaiseTime - >> result.iFirstRaiseTime - >> result.iEmptyRaiseTime - >> result.iEmptyDropTime - >> result.sprintInTime - >> result.sprintLoopTime - >> result.sprintOutTime - >> result.nightVisionWearTime - >> result.nightVisionWearTimeFadeOutEnd - >> result.nightVisionWearTimePowerUp - >> result.nightVisionRemoveTime - >> result.nightVisionRemoveTimePowerDown - >> result.nightVisionRemoveTimeFadeInStart - >> result.fuseTime - >> result.aiFuseTime - >> result.requireLockonToFire - >> result.noAdsWhenMagEmpty - >> result.avoidDropCleanup - >> result.autoAimRange - >> result.aimAssistRange - >> result.aimAssistRangeAds - >> result.aimPadding - >> result.enemyCrosshairRange - >> result.crosshairColorChange - >> result.moveSpeedScale - >> result.adsMoveSpeedScale - >> result.sprintDurationScale - >> result.fAdsZoomFov - >> result.fAdsZoomInFrac - >> result.fAdsZoomOutFrac - >> result.overlayMaterialPtr - >> result.overlayMaterialLowResPtr - >> result.overlayReticle - >> result.overlayInterface - >> result.overlayWidth - >> result.overlayHeight - >> result.fAdsBobFactor - >> result.fAdsViewBobMult - >> result.fHipSpreadStandMin - >> result.fHipSpreadDuckedMin - >> result.fHipSpreadProneMin - >> result.hipSpreadStandMax - >> result.hipSpreadDuckedMax - >> result.hipSpreadProneMax - >> result.fHipSpreadDecayRate - >> result.fHipSpreadFireAdd - >> result.fHipSpreadTurnAdd - >> result.fHipSpreadMoveAdd - >> result.fHipSpreadDuckedDecay - >> result.fHipSpreadProneDecay - >> result.fHipReticleSidePos - >> result.iAdsTransInTime - >> result.iAdsTransOutTime - >> result.fAdsIdleAmount - >> result.fHipIdleAmount - >> result.adsIdleSpeed - >> result.hipIdleSpeed - >> result.fIdleCrouchFactor - >> result.fIdleProneFactor - >> result.fGunMaxPitch - >> result.fGunMaxYaw - >> result.swayMaxAngle - >> result.swayLerpSpeed - >> result.swayPitchScale - >> result.swayYawScale - >> result.swayHorizScale - >> result.swayVertScale - >> result.swayShellShockScale - >> result.adsSwayMaxAngle - >> result.adsSwayLerpSpeed - >> result.adsSwayPitchScale - >> result.adsSwayYawScale - >> result.adsSwayHorizScale - >> result.adsSwayVertScale - >> result.bRifleBullet - >> result.armorPiercing - >> result.bBoltAction - >> result.aimDownSight - >> result.bRechamberWhileAds - >> result.adsViewErrorMin - >> result.adsViewErrorMax - >> result.bCookOffHold - >> result.bClipOnly - >> result.adsFireOnly - >> result.cancelAutoHolsterWhenEmpty - >> result.suppressAmmoReserveDisplay - >> result.enhanced - >> result.laserSightDuringNightvision - >> result.killIconPtr - >> result.killIconRatio - >> result.flipKillIcon - >> result.dpadIconPtr - >> result.dpadIconRatio - >> result.bNoPartialReload - >> result.bSegmentedReload - >> result.iReloadAmmoAdd - >> result.iReloadStartAdd - >> result.szAltWeaponNamePtr - >> result.dpadIconRatio - >> result.dpadIconRatio - >> result.dpadIconRatio - >> result.altWeaponIndex - >> result.iDropAmmoMin - >> result.iDropAmmoMax - >> result.blocksProne - >> result.silenced - >> result.iExplosionRadius - >> result.iExplosionRadiusMin - >> result.iExplosionInnerDamage - >> result.iExplosionOuterDamage - >> result.damageConeAngle - >> result.iProjectileSpeed - >> result.iProjectileSpeedUp - >> result.iProjectileSpeedForward - >> result.iProjectileActivateDist - >> result.projLifetime - >> result.timeToAccelerate - >> result.projectileCurvature - >> result.projectileModelPtr - >> result.projExplosion - >> result.projExplosionEffectPtr - >> result.projExplosionEffectForceNormalUp - >> result.projDudEffectPtr - >> result.projExplosionSoundPtr - >> result.projDudSoundPtr - >> result.bProjImpactExplode - >> result.stickiness - >> result.bProjImpactExplode - >> result.hasDetonator - >> result.bProjImpactExplode - >> result.timedDetonation - >> result.rotate - >> result.holdButtonToThrow - >> result.freezeMovementWhenFiring - >> result.lowAmmoWarningThreshold - >> result.bProjImpactExplode; - - for (int i = 0; i < 29; i++) { - *aStream >> result.parallelBounce[i]; - } - for (int i = 0; i < 29; i++) { - *aStream >> result.perpendicularBounce[i]; - } - - *aStream - >> result.projTrailEffectPtr - >> result.vProjectileColor[0] - >> result.vProjectileColor[1] - >> result.vProjectileColor[2] - >> result.guidedMissileType - >> result.maxSteeringAccel - >> result.projIgnitionDelay - >> result.projIgnitionEffect - >> result.projIgnitionSoundPtr - >> result.fAdsAimPitch - >> result.fAdsCrosshairInFrac - >> result.fAdsCrosshairOutFrac - >> result.adsGunKickReducedKickBullets - >> result.adsGunKickReducedKickPercent - >> result.fAdsGunKickPitchMin - >> result.fAdsGunKickPitchMax - >> result.fAdsGunKickYawMin - >> result.fAdsGunKickYawMax - >> result.fAdsGunKickAccel - >> result.fAdsGunKickSpeedMax - >> result.fAdsGunKickSpeedDecay - >> result.fAdsGunKickStaticDecay - >> result.fAdsViewKickPitchMin - >> result.fAdsViewKickPitchMax - >> result.fAdsViewKickYawMin - >> result.fAdsViewKickYawMax - >> result.fAdsViewKickCenterSpeed - >> result.fAdsViewScatterMin - >> result.fAdsViewScatterMax - >> result.fAdsSpread - >> result.hipGunKickReducedKickBullets - >> result.hipGunKickReducedKickPercent - >> result.fHipGunKickPitchMin - >> result.fHipGunKickPitchMax - >> result.fHipGunKickYawMin - >> result.fHipGunKickYawMax - >> result.fHipGunKickAccel - >> result.fHipGunKickSpeedMax - >> result.fHipGunKickSpeedDecay - >> result.fHipGunKickStaticDecay - >> result.fHipViewKickPitchMin - >> result.fHipViewKickPitchMax - >> result.fHipViewKickYawMin - >> result.fHipViewKickYawMax - >> result.fHipViewKickCenterSpeed - >> result.fHipViewScatterMin - >> result.fHipViewScatterMax - >> result.fightDist - >> result.maxDist - >> result.accuracyGraphNamePtr[0] - >> result.accuracyGraphNamePtr[1] - >> result.accuracyGraphKnotsPtr[0] - >> result.accuracyGraphKnotsPtr[1] - >> result.originalAccuracyGraphKnotsPtr[0] - >> result.originalAccuracyGraphKnotsPtr[1] - >> result.accuracyGraphKnotCount[0] - >> result.accuracyGraphKnotCount[1] - >> result.originalAccuracyGraphKnotCount[0] - >> result.originalAccuracyGraphKnotCount[1] - >> result.iPositionReloadTransTime - >> result.leftArc - >> result.rightArc - >> result.topArc - >> result.bottomArc - >> result.accuracy - >> result.aiSpread - >> result.playerSpread - >> result.minTurnSpeed[0] - >> result.minTurnSpeed[1] - >> result.maxTurnSpeed[0] - >> result.maxTurnSpeed[1] - >> result.pitchConvergenceTime - >> result.yawConvergenceTime - >> result.suppressTime - >> result.maxRange - >> result.fAnimHorRotateInc - >> result.fPlayerPositionDist - >> result.szUseHintStringPtr - >> result.dropHintStringPtr - >> result.iUseHintStringIndex - >> result.dropHintStringIndex - >> result.horizViewJitter - >> result.vertViewJitter - >> result.szScriptPtr - >> result.fOOPosAnimLength[0] - >> result.fOOPosAnimLength[1] - >> result.minDamage - >> result.minPlayerDamage - >> result.fMaxDamageRange - >> result.fMinDamageRange - >> result.destabilizationRateTime - >> result.destabilizationCurvatureMax - >> result.destabilizeDistance; - - for (int i = 0; i < 29; i++) { - *aStream >> result.locationDamageMultipliers[i]; - } - - *aStream - >> result.fireRumblePtr - >> result.meleeImpactRumblePtr - >> result.adsDofStart - >> result.adsDofEnd; - - if (result.szInternalNamePtr == -1) { - result.szInternalName = Load_XStringCustom(aStream); - } - if (result.szDisplayNamePtr == -1) { - result.szDisplayName = Load_XStringCustom(aStream); - } - if (result.szOverlayNamePtr == -1) { - result.szOverlayName = Load_XStringCustom(aStream); - } - if (result.gunXModelPtr) { - result.gunXModel = Load_XModelPtrArray(aStream, 16); - } - if (result.handXModelPtr) { - result.handXModel = Load_XModelPtr(aStream); - } - - for (int i = 0; i < 33; i++) { - if (result.szXAnimsPtr[i]) { - result.szXAnims[i] = Load_XStringCustom(aStream); - } - } - - if (result.szModeNamePtr) { - result.szModeName = Load_XStringCustom(aStream); - } - - if (result.hideTagsPtr) { - result.hideTags = Load_ScriptStringArray(aStream, 8); - } - if (result.notetrackSoundMapKeysPtr) { - result.notetrackSoundMapKeys = Load_ScriptStringArray(aStream, 16); - } - if (result.notetrackSoundMapValuesPtr) { - result.notetrackSoundMapValues = Load_ScriptStringArray(aStream, 16); - } - - if (result.viewFlashEffectPtr) { - result.viewFlashEffect = Load_FxEffectDefHandle(aStream); - } - if (result.worldFlashEffectPtr) { - result.worldFlashEffect = Load_FxEffectDefHandle(aStream); - } - - if (result.pickupSoundPtr) { - result.pickupSound = Load_SndAliasCustom(aStream); - } - if (result.pickupSoundPlayerPtr) { - result.pickupSoundPlayer = Load_SndAliasCustom(aStream); - } - if (result.ammoPickupSoundPtr) { - result.ammoPickupSound = Load_SndAliasCustom(aStream); - } - if (result.ammoPickupSoundPlayerPtr) { - result.ammoPickupSoundPlayer = Load_SndAliasCustom(aStream); - } - if (result.projectileSoundPtr) { - result.projectileSound = Load_SndAliasCustom(aStream); - } - if (result.pullbackSoundPtr) { - result.pullbackSound = Load_SndAliasCustom(aStream); - } - if (result.pullbackSoundPlayerPtr) { - result.pullbackSoundPlayer = Load_SndAliasCustom(aStream); - } - if (result.fireSoundPtr) { - result.fireSound = Load_SndAliasCustom(aStream); - } - if (result.fireSoundPlayerPtr) { - result.fireSoundPlayer = Load_SndAliasCustom(aStream); - } - if (result.fireLoopSoundPtr) { - result.fireLoopSound = Load_SndAliasCustom(aStream); - } - if (result.fireLoopSoundPlayerPtr) { - result.fireLoopSoundPlayer = Load_SndAliasCustom(aStream); - } - if (result.fireStopSoundPtr) { - result.fireStopSound = Load_SndAliasCustom(aStream); - } - if (result.fireStopSoundPlayerPtr) { - result.fireStopSoundPlayer = Load_SndAliasCustom(aStream); - } - if (result.fireLastSoundPtr) { - result.fireLastSound = Load_SndAliasCustom(aStream); - } - if (result.fireLastSoundPlayerPtr) { - result.fireLastSoundPlayer = Load_SndAliasCustom(aStream); - } - if (result.emptyFireSoundPtr) { - result.emptyFireSound = Load_SndAliasCustom(aStream); - } - if (result.emptyFireSoundPlayerPtr) { - result.emptyFireSoundPlayer = Load_SndAliasCustom(aStream); - } - if (result.meleeSwipeSoundPtr) { - result.meleeSwipeSound = Load_SndAliasCustom(aStream); - } - if (result.meleeSwipeSoundPlayerPtr) { - result.meleeSwipeSoundPlayer = Load_SndAliasCustom(aStream); - } - if (result.meleeHitSoundPtr) { - result.meleeHitSound = Load_SndAliasCustom(aStream); - } - if (result.meleeMissSoundPtr) { - result.meleeMissSound = Load_SndAliasCustom(aStream); - } - if (result.rechamberSoundPtr) { - result.rechamberSound = Load_SndAliasCustom(aStream); - } - if (result.rechamberSoundPlayerPtr) { - result.rechamberSoundPlayer = Load_SndAliasCustom(aStream); - } - if (result.reloadSoundPtr) { - result.reloadSound = Load_SndAliasCustom(aStream); - } - if (result.reloadSoundPlayerPtr) { - result.reloadSoundPlayer = Load_SndAliasCustom(aStream); - } - if (result.reloadEmptySoundPtr) { - result.reloadEmptySound = Load_SndAliasCustom(aStream); - } - if (result.reloadEmptySoundPlayerPtr) { - result.reloadEmptySoundPlayer = Load_SndAliasCustom(aStream); - } - if (result.reloadStartSoundPtr) { - result.reloadStartSound = Load_SndAliasCustom(aStream); - } - if (result.reloadStartSoundPlayerPtr) { - result.reloadStartSoundPlayer = Load_SndAliasCustom(aStream); - } - if (result.reloadEndSoundPtr) { - result.reloadEndSound = Load_SndAliasCustom(aStream); - } - if (result.reloadEndSoundPlayerPtr) { - result.reloadEndSoundPlayer = Load_SndAliasCustom(aStream); - } - if (result.nightVisionWearSoundPtr) { - result.nightVisionWearSound = Load_SndAliasCustom(aStream); - } - if (result.detonateSoundPlayerPtr) { - result.detonateSoundPlayer = Load_SndAliasCustom(aStream); - } - if (result.nightVisionWearSoundPtr) { - result.nightVisionWearSound = Load_SndAliasCustom(aStream); - } - if (result.nightVisionRemoveSoundPtr) { - result.nightVisionRemoveSound = Load_SndAliasCustom(aStream); - } - if (result.nightVisionRemoveSoundPlayerPtr) { - result.nightVisionRemoveSoundPlayer = Load_SndAliasCustom(aStream); - } - if (result.altSwitchSoundPtr) { - result.altSwitchSound = Load_SndAliasCustom(aStream); - } - if (result.altSwitchSoundPlayerPtr) { - result.altSwitchSoundPlayer = Load_SndAliasCustom(aStream); - } - if (result.raiseSoundPtr) { - result.raiseSound = Load_SndAliasCustom(aStream); - } - if (result.raiseSoundPlayerPtr) { - result.raiseSoundPlayer = Load_SndAliasCustom(aStream); - } - if (result.firstRaiseSoundPtr) { - result.firstRaiseSound = Load_SndAliasCustom(aStream); - } - if (result.firstRaiseSoundPlayerPtr) { - result.firstRaiseSoundPlayer = Load_SndAliasCustom(aStream); - } - if (result.putawaySoundPtr) { - result.putawaySound = Load_SndAliasCustom(aStream); - } - if (result.putawaySoundPlayerPtr) { - result.putawaySoundPlayer = Load_SndAliasCustom(aStream); - } - - if (result.bounceSoundPtr) - { - if (result.bounceSoundPtr == -1) - { - result.bounceSound = Load_snd_alias_list_nameArray(aStream, 29); - } - else - { - // Resolve contents from g_streamBlocks - //varWeaponDef->bounceSound = (snd_alias_list_t **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + ((((unsigned int)varWeaponDef->bounceSound - // - 1) >> 26) & 0x38)))[((int)varWeaponDef->bounceSound - 1) & 0x1FFFFFFF]; - } - } - - if (result.viewShellEjectEffectPtr) { - result.viewShellEjectEffect = Load_FxEffectDefHandle(aStream); - } - if (result.worldShellEjectEffectPtr) { - result.worldShellEjectEffect = Load_FxEffectDefHandle(aStream); - } - if (result.viewLastShotEjectEffectPtr) { - result.viewLastShotEjectEffect = Load_FxEffectDefHandle(aStream); - } - if (result.worldLastShotEjectEffectPtr) { - result.worldLastShotEjectEffect = Load_FxEffectDefHandle(aStream); - } - - if (result.reticleCenterPtr) { - result.reticleCenter = Load_MaterialHandle(aStream); - } - if (result.reticleSidePtr) { - result.reticleSide = Load_MaterialHandle(aStream); - } - - if (result.worldModelPtr) { - result.worldModel = Load_XModelPtrArray(aStream, 16); - } - - if (result.worldClipModelPtr) { - result.worldClipModel = Load_XModelPtr(aStream); - } - if (result.rocketModelPtr) { - result.rocketModel = Load_XModelPtr(aStream); - } - if (result.knifeModelPtr) { - result.knifeModel = Load_XModelPtr(aStream); - } - if (result.worldKnifeModelPtr) { - result.worldKnifeModel = Load_XModelPtr(aStream); - } - - if (result.hudIconPtr) { - result.hudIcon = Load_MaterialHandle(aStream); - } - if (result.ammoCounterIconPtr) { - result.ammoCounterIcon = Load_MaterialHandle(aStream); - } - - if (result.szAmmoNamePtr == -1) { - result.szAmmoName = Load_XStringCustom(aStream); - } - if (result.szAmmoNamePtr == -1) { - result.szAmmoName = Load_XStringCustom(aStream); - } - if (result.szSharedAmmoCapNamePtr == -1) { - result.szSharedAmmoCapName = Load_XStringCustom(aStream); - } - - if (result.overlayMaterialPtr) { - result.overlayMaterial = Load_MaterialHandle(aStream); - } - if (result.overlayMaterialLowResPtr) { - result.overlayMaterialLowRes = Load_MaterialHandle(aStream); - } - if (result.killIconPtr) { - result.killIcon = Load_MaterialHandle(aStream); - } - if (result.dpadIconPtr) { - result.dpadIcon = Load_MaterialHandle(aStream); - } - - if (result.szAltWeaponNamePtr == -1) { - result.szAltWeaponName = Load_XStringCustom(aStream); - } - - if (result.projectileModelPtr) { - result.projectileModel = Load_XModelPtr(aStream); - } - - if (result.projExplosionEffectPtr) { - result.projExplosionEffect = Load_FxEffectDefHandle(aStream); - } - if (result.projDudEffectPtr) { - result.projDudEffect = Load_FxEffectDefHandle(aStream); - } - - if (result.projExplosionSoundPtr) { - result.projExplosionSound = Load_SndAliasCustom(aStream); - } - if (result.projDudSoundPtr) { - result.projDudSound = Load_SndAliasCustom(aStream); - } - - if (result.projTrailEffectPtr) { - result.projTrailEffect = Load_FxEffectDefHandle(aStream); - } - if (result.projIgnitionEffectPtr) { - result.projIgnitionEffect = Load_FxEffectDefHandle(aStream); - } - - if (result.projIgnitionSoundPtr) { - result.projIgnitionSound = Load_SndAliasCustom(aStream); - } - - if (result.accuracyGraphNamePtr[0] == -1) { - result.accuracyGraphName[0] = Load_XStringCustom(aStream); - } - - if (result.accuracyGraphKnotsPtr[0]) - { - if (result.accuracyGraphKnotsPtr[0] == -1) - { - for (int i = 0; i < varWeaponDef->accuracyGraphKnotCount[0]; i++) { - *aStream >> result.accaccuracyGraphKnots[i]; - } - } - else - { - // Resolve contents from g_streamBlocks - //varWeaponDef->accuracyGraphKnots[0] = (float (*)[2])&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + ((((unsigned int)&(*varWeaponDef->accuracyGraphKnots[0])[0] - // - 1) >> 26) & 0x38)))[((int)&(*varWeaponDef->accuracyGraphKnots[0])[0] - 1) & 0x1FFFFFFF]; - } - } - if (result.originalAccuracyGraphKnotsPtr[0]) - { - if (result.originalAccuracyGraphKnotsPtr[0] == -1) - { - for (int i = 0; i < varWeaponDef->accuracyGraphKnotCount[0]; i++) { - *aStream >> result.originalAccuracyGraphKnots[i]; - } - } - else - { - // Resolve contents from g_streamBlocks - //v5->originalAccuracyGraphKnots[0] = (float (*)[2])&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + ((((unsigned int)&(*v5->originalAccuracyGraphKnots[0])[0] - // - 1) >> 26) & 0x38)))[((int)&(*v5->originalAccuracyGraphKnots[0])[0] - 1) & 0x1FFFFFFF]; - } - } - if (result.accuracyGraphNamePtr[1] == -1) { - result.accuracyGraphName[1] = Load_XStringCustom(aStream); - } - - if (result.accuracyGraphKnotsPtr[1]) - { - if (result.accuracyGraphKnotsPtr[1] == -1) - { - for (int i = 0; i < varWeaponDef->accuracyGraphKnotCount[1]; i++) { - *aStream >> result.accuracyGraphKnots[i]; - } - } - else - { - // Resolve contents from g_streamBlocks - //varWeaponDef->accuracyGraphKnots[1] = (float (*)[2])&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + ((((unsigned int)&(*varWeaponDef->accuracyGraphKnots[1])[0] - // - 1) >> 26) & 0x38)))[((int)&(*varWeaponDef->accuracyGraphKnots[1])[0] - 1) & 0x1FFFFFFF]; - } - } - if (result.originalAccuracyGraphKnotsPtr[1]) - { - if (result.originalAccuracyGraphKnotsPtr[1] == -1) - { - for (int i = 0; i < varWeaponDef->accuracyGraphKnotCount[1]; i++) { - *aStream >> result.originalAccuracyGraphKnots[i]; - } - } - else - { - // Resolve contents from g_streamBlocks - //v12->originalAccuracyGraphKnots[1] = (float (*)[2])&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + ((((unsigned int)&(*v12->originalAccuracyGraphKnots[1])[0] - // - 1) >> 26) & 0x38)))[((int)&(*v12->originalAccuracyGraphKnots[1])[0] - 1) & 0x1FFFFFFF]; - } - } - - if (result.szUseHintStringPtr == -1) { - result.szUseHintString = Load_XStringCustom(aStream); - } - if (result.dropHintStringPtr == -1) { - result.dropHintString = Load_XStringCustom(aStream); - } - if (result.szScriptPtr == -1) { - result.szScript = Load_XStringCustom(aStream); - } - if (result.fireRumblePtr == -1) { - result.fireRumble = Load_XStringCustom(aStream); - } - if (result.meleeImpactRumblePtr == -1) { - result.meleeImpactRumble = Load_XStringCustom(aStream); - } - - return result; -} - - -// ?Load_MenuList@@YAX_N@Z at 0x822aeff8 -MenuList Assets::Load_MenuList(QDataStream *aStream) -{ - MenuList result; - - *aStream >> - result.namePtr - result.menuCount - result.menusPtr; - - if (result.namePtr) { - result.name = Load_XStringCustom(aStream); - } - - if (result.menusPtr) - { - result.menus << Load_menuDef_ptrArray(aStream, result.menuCount); - } - - return result; -} - - -// ?Load_DynEntityDef@@YAX_N@Z at 0x822af090 -DynEntityDef Assets::Load_DynEntityDef(QDataStream *aStream) -{ - DynEntityDef result; - - *aStream - >> result.type - >> result.pose - >> result.xModelPtr - >> result.brushModel - >> result.physicsBrushModel - >> result.destroyFxPtr - >> result.destroyPiecesPtr - >> result.physPresetPtr - >> result.health - >> result.mass - >> result.contents; - - if (result.xModelPtr) { - result.xModel = Load_XModelPtr(aStream); - } - if (result.destroyFxPtr) { - result.destroyFx = Load_FxEffectDefHandle(aStream); - } - if (result.destroyPiecesPtr) { - result.destroyPieces = Load_XModelPiecesPtr(aStream); - } - if (result.physPresetPtr) { - result.physPreset = Load_PhysPresetPtr(aStream); - } - - return result; -} - - -// ?Load_FxEffectDefHandleArray@@YAX_NH@Z at 0x822af148 -QVector Assets::Load_FxEffectDefHandleArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - - } - - v2 = count; - Load_Stream(0, varFxEffectDefHandle, 4 * count); - v3 = varFxEffectDefHandle; - if ( v2 > 0 ) - { - do - { - varFxEffectDefHandle = v3; - Load_FxEffectDefHandle(0); - --v2; - ++v3; - } - while ( v2 ); - } - - return result; -} - - -// ?Load_WeaponDefPtr@@YAX_N@Z at 0x822af1a0 -WeaponDef Assets::Load_WeaponDefPtr(QDataStream *aStream) -{ - WeaponDef result; - qint32 weaponDefPtr; - - *aStream >> weaponDefPtr; - - if (weaponDefPtr) - { - if (weaponDefPtr == -1 || weaponDefPtr == -2) - { - result = Load_WeaponDef(aStream); - } - else - { - // Resolve contents from g_streamBlocks - //*varWeaponDefPtr = *(WeaponDef **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - - } - } - return result; -} - - -// ?Load_FxImpactEntry@@YAX_N@Z at 0x822af288 -FxImpactEntry Assets::Load_FxImpactEntry(QDataStream *aStream) -{ - FxImpactEntry result; - - for (int i = 0; i < 29; i++) { - qint32 nonFleshPtr; - - *aStream >> nonFleshPtr; - - result.nonFleshPtrs[i] = nonFleshPtr - } - for (int i = 0; i < 4; i++) { - qint32 fleshPtr; - - *aStream >> fleshPtr; - - result.fleshPtrs[i] = fleshPtr - } - - - for (int i = 0; i < 29; i++) { - qint32 nonFleshPtr; - - *aStream >> nonFleshPtr; - - result.nonFleshPtrs[i] = nonFleshPtr - } - for (int i = 0; i < 4; i++) { - qint32 fleshPtr; - - *aStream >> fleshPtr; - - result.fleshPtrs[i] = fleshPtr - } - - v2 = 29; - do - { - varFxEffectDefHandle = v1; - Load_FxEffectDefHandle(0); - --v2; - ++v1; - } - while ( v2 ); - varFxEffectDefHandle = varFxImpactEntry->flesh; - Load_Stream(0, varFxImpactEntry->flesh, 0x10u); - v3 = varFxEffectDefHandle; - v4 = 4; - do - { - varFxEffectDefHandle = v3; - Load_FxEffectDefHandle(0); - --v4; - ++v3; - } - while ( v4 ); - - return result; -} - - -// ?Load_MenuListPtr@@YAX_N@Z at 0x822af328 -MenuList Assets::Load_MenuListPtr(QDataStream *aStream) -{ - MenuList result; - qint32 menuListPtr; - - *aStream >> menuListPtr; - - if (menuListPtr) - { - if (menuListPtr == -1 || menuListPtr == -2) - { - result = Load_MenuList(aStream); - } - else { - // Resolve contents from g_streamBlocks - //*varMenuListPtr = *(MenuList **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - } - } - return result; -} - - -// ?Load_DynEntityDefArray@@YAX_NH@Z at 0x822af410 -QVector Assets::Load_DynEntityDefArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - result << Load_DynEntityDef(aStream); - } - - return result; -} - - -// ?Load_FxImpactEntryArray@@YAX_NH@Z at 0x822af470 -QVector Assets::Load_FxImpactEntryArray(QDataStream *aStream, int count) -{ - QVector result; - - for (int i = 0; i < count; i++) { - result << Assets::Load_FxImpactEntry(aStream); - } - - return result; -} - - -// ?Load_clipMap_t@@YAX_N@Z at 0x822af4c0 -clipMap_t Assets::Load_clipMap_t(QDataStream *aStream) -{ - clipMap_t result; - - *aStream - >> result.namePtr - >> result.isInUse - >> result.planeCount - >> result.planesPtr - >> result.numStaticModels - >> result.staticModelListPtr - >> result.numMaterials - >> result.materialsPtr - >> result.numBrushSides - >> result.brushsidesPtr - >> result.numBrushEdges - >> result.brushEdgesPtr - >> result.numNodes - >> result.nodesPtr - >> result.leafsPtr - >> result.leafbrushNodesCount - >> result.leafbrushNodesPtr - >> result.numLeafBrushes - >> result.leafbrushesPtr - >> result.numLeafSurfaces - >> result.leafsurfacesPtr - >> result.vertCount - >> result.verts[0] - >> result.verts[1] - >> result.verts[2] - >> result.triCount - >> result.triIndicesPtr - >> result.triEdgeIsWalkablePtr - >> result.borderCount - >> result.bordersPtr - >> result.partitionCount - >> result.partitionsPtr - >> result.aabbTreeCount - >> result.aabbTreesPtr - >> result.numSubModels - >> result.cmodelsPtr - >> result.numBrushes - >> result.brushesPtr - >> result.numClusters - >> result.clusterBytes - >> result.visibilityPtr - >> result.vised - >> result.visibilityPtr - >> result.visibilityPtr - >> result.visibilityPtr - >> result.visibilityPtr; - - if (result.namePtr == -1) { - result.name = Assets::Load_XStringCustom(aStream); - } - if (result.planesPtr) - { - if (result.planesPtr == -1) - { - for (int i = 0; i < result.planeCount; i++) { - result.planes << XAsset::Load_cplane_s(aStream); - } - } - else - { - - //varclipMap_t->planes = (cplane_s *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + (((unsigned int)&varclipMap_t->planes[-1].pad[1] >> 26) & 0x38)))[(int)&varclipMap_t->planes[-1].pad[1] & 0x1FFFFFFF]; - } - } - if (result.staticModelListPtr) - { - result.staticModelList = Load_cStaticModel_tArray(aStream, result.numStaticModels); - } - if (result.materialsPtr) - { - result.materials = Load_dmaterial_tArray(aStream, result.numMaterials); - } - if (result.brushsidesPtr) - { - result.brushsides = Load_cbrushside_tArray(aStream, result.numBrushSides); - } - if (result.brushEdgesPtr) - { - result.brushEdges = Load_cbrushedge_tArray(aStream, result.numBrushEdges); - } - if (result.nodesPtr) - { - result.nodes = Load_cNode_tArray(aStream, result.numNodes); - } - if (result.leafsPtr) - { - result.leafs = Load_cLeaf_tArray(aStream, result.numLeafs); - } - if (result.leafbrushesPtr) - { - result.leafbrushes = Load_LeafBrushArray(aStream, result.numLeafBrushes); - } - if ( v1->leafbrushNodes ) - { - leafbrushNodesCount = v1->leafbrushNodesCount; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varcLeafBrushNode_t = (CLeafBrushNode *)g_streamPos; - v1->leafbrushNodes = (CLeafBrushNode *)g_streamPos; - Load_cLeafBrushNode_tArray(1, leafbrushNodesCount); - v1 = varclipMap_t; - } - if ( v1->leafsurfaces ) - { - v17 = 4 * v1->numLeafSurfaces; - v18 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v18; - varuint = (unsigned int *)v18; - v1->leafsurfaces = (unsigned int *)v18; - Load_Stream(1, v18, v17); - v1 = varclipMap_t; - } - if ( v1->verts ) - { - vertCount = v1->vertCount; - v20 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - v1->verts = (float (*)[3])v20; - g_streamPos = v20; - varvec3_t = (float (*)[3])v20; - Load_Stream(1, v20, 12 * vertCount); - v1 = varclipMap_t; - } - if ( v1->triIndices ) - { - triCount = v1->triCount; - v22 = (unsigned __int8 *)((unsigned int)(g_streamPos + 1) & 0xFFFFFFFE); - v1->triIndices = (unsigned __int16 *)v22; - g_streamPos = v22; - varUnsignedShort = (unsigned __int16 *)v22; - Load_Stream(1, v22, 6 * triCount); - v1 = varclipMap_t; - } - if ( v1->triEdgeIsWalkable ) - { - v23 = g_streamPos; - v24 = v1->triCount; - v1->triEdgeIsWalkable = g_streamPos; - g_streamPos = v23; - varbyte = v23; - Load_Stream(1, v23, ((3 * v24 + 31) >> 3) & 0xFFFFFFFC); - v1 = varclipMap_t; - } - if ( v1->borders ) - { - v25 = 28 * v1->borderCount; - v26 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - v1->borders = (CollisionBorder *)v26; - g_streamPos = v26; - varCollisionBorder = (CollisionBorder *)v26; - Load_Stream(1, v26, v25); - v1 = varclipMap_t; - } - if ( v1->partitions ) - { - partitionCount = v1->partitionCount; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varCollisionPartition = (CollisionPartition *)g_streamPos; - v1->partitions = (CollisionPartition *)g_streamPos; - Load_CollisionPartitionArray(1, partitionCount); - v1 = varclipMap_t; - } - if ( v1->aabbTrees ) - { - v28 = 32 * v1->aabbTreeCount; - v29 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v29; - varCollisionAabbTree = (CollisionAabbTree *)v29; - v1->aabbTrees = (CollisionAabbTree *)v29; - Load_Stream(1, v29, v28); - v1 = varclipMap_t; - } - if ( v1->cmodels ) - { - numSubModels = v1->numSubModels; - v31 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - v1->cmodels = (cmodel_t *)v31; - g_streamPos = v31; - varcmodel_t = (cmodel_t *)v31; - Load_Stream(1, v31, 72 * numSubModels); - v1 = varclipMap_t; - } - if ( v1->brushes ) - { - numBrushes = v1->numBrushes; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 15) & 0xFFFFFFF0); - varcbrush_t = (cbrush_t *)g_streamPos; - v1->brushes = (cbrush_t *)g_streamPos; - Load_cbrush_tArray(1, numBrushes); - v1 = varclipMap_t; - } - if ( v1->visibility ) - { - v33 = g_streamPos; - v34 = v1->clusterBytes * v1->numClusters; - v1->visibility = g_streamPos; - varbyte = v33; - Load_Stream(1, v33, v34); - v1 = varclipMap_t; - } - varMapEntsPtr = &v1->mapEnts; - Load_MapEntsPtr(0); - v35 = varclipMap_t; - box_brush = varclipMap_t->box_brush; - if ( box_brush ) - { - if ( box_brush == (cbrush_t *)-1 ) - { - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 15) & 0xFFFFFFF0); - varcbrush_t = (cbrush_t *)g_streamPos; - varclipMap_t->box_brush = (cbrush_t *)g_streamPos; - Load_CBrush(1); - v35 = varclipMap_t; - } - else - { - varclipMap_t->box_brush = (cbrush_t *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)varclipMap_t->box_brush[-1].edgeCount[5] >> 26) & 0x38)))[(int)varclipMap_t->box_brush[-1].edgeCount[5] & 0x1FFFFFFF]; - } - } - if ( v35->dynEntDefList[0] ) - { - v37 = v35->dynEntCount[0]; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varDynEntityDef = (DynEntityDef *)g_streamPos; - v35->dynEntDefList[0] = (DynEntityDef *)g_streamPos; - Load_DynEntityDefArray(1, v37); - v35 = varclipMap_t; - } - if ( v35->dynEntDefList[1] ) - { - v38 = v35->dynEntCount[1]; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varDynEntityDef = (DynEntityDef *)g_streamPos; - v35->dynEntDefList[1] = (DynEntityDef *)g_streamPos; - Load_DynEntityDefArray(1, v38); - v35 = varclipMap_t; - } - DB_PushStreamPos(1u); - if ( v35->dynEntPoseList[0] ) - { - v40 = __ROL4__(v35->dynEntCount[0], 5); - v41 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v41; - varDynEntityPose = (DynEntityPose *)v41; - v35->dynEntPoseList[0] = (DynEntityPose *)v41; - Load_Stream(v39, v41, v40); - v35 = varclipMap_t; - } - DB_PopStreamPos(); - DB_PushStreamPos(1u); - if ( v35->dynEntPoseList[1] ) - { - v43 = __ROL4__(v35->dynEntCount[1], 5); - v44 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v44; - varDynEntityPose = (DynEntityPose *)v44; - v35->dynEntPoseList[1] = (DynEntityPose *)v44; - Load_Stream(v42, v44, v43); - v35 = varclipMap_t; - } - DB_PopStreamPos(); - DB_PushStreamPos(1u); - if ( v35->dynEntClientList[0] ) - { - v46 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - v47 = 4 * (v35->dynEntCount[0] + __ROL4__(v35->dynEntCount[0], 1)); - g_streamPos = v46; - varDynEntityClient = (DynEntityClient *)v46; - v35->dynEntClientList[0] = (DynEntityClient *)v46; - Load_Stream(v45, v46, v47); - v35 = varclipMap_t; - } - DB_PopStreamPos(); - DB_PushStreamPos(1u); - if ( v35->dynEntClientList[1] ) - { - v49 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - v50 = 4 * (v35->dynEntCount[1] + __ROL4__(v35->dynEntCount[1], 1)); - g_streamPos = v49; - varDynEntityClient = (DynEntityClient *)v49; - v35->dynEntClientList[1] = (DynEntityClient *)v49; - Load_Stream(v48, v49, v50); - v35 = varclipMap_t; - } - DB_PopStreamPos(); - DB_PushStreamPos(1u); - if ( v35->dynEntCollList[0] ) - { - v52 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - v53 = 4 * (v35->dynEntCount[0] + __ROL4__(v35->dynEntCount[0], 2)); - g_streamPos = v52; - varDynEntityColl = (DynEntityColl *)v52; - v35->dynEntCollList[0] = (DynEntityColl *)v52; - Load_Stream(v51, v52, v53); - v35 = varclipMap_t; - } - DB_PopStreamPos(); - DB_PushStreamPos(1u); - if ( v35->dynEntCollList[1] ) - { - v55 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - v56 = 4 * (v35->dynEntCount[1] + __ROL4__(v35->dynEntCount[1], 2)); - g_streamPos = v55; - varDynEntityColl = (DynEntityColl *)v55; - v35->dynEntCollList[1] = (DynEntityColl *)v55; - Load_Stream(v54, v55, v56); - } - DB_PopStreamPos(); - DB_PopStreamPos(); -} - - -// ?Load_FxImpactTable@@YAX_N@Z at 0x822afc40 -FxImpactTable Assets::Load_FxImpactTable(QDataStream *aStream) -{ - FxImpactTable result; - - *aStream - >> result.namePtr - >> result.tablePtr; - - if (result.namePtr == -1) { - result.name = Assets::Load_XStringCustom(aStream); - } - - if (result.tablePtr) - { - result.table = Assets::Load_FxImpactEntryArray(1, 12); - } - DB_PopStreamPos(); -} - - -// ?Load_clipMap_ptr@@YAX_N@Z at 0x822afcd8 -clipMap_t Assets::Load_clipMap_ptr(QDataStream *aStream) -{ - clipMap_t result; - qint32 clipMapPtr; - - *aStream >> clipMapPtr; - - if (clipMapPtr) - { - if (clipMapPtr != -1 || clipMapPtr != -2) - { - result = Assets::Load_clipMap_t(aStream); - } - else - { - // Resolve contents to g_streamBlocks - //*varclipMap_ptr = *(clipMap_t **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - } - } -} - - -// ?Load_FxImpactTablePtr@@YAX_N@Z at 0x822afdc0 -FxImpactTable Assets::Load_FxImpactTablePtr(QDataStream *aStream) -{ - FxImpactTable result; - qint32 fxImpactTablePtr; - - *aStream >> fxImpactTablePtr; - - if (fxImpactTablePtr) - { - if (fxImpactTablePtr == -1 || fxImpactTablePtr != -2) - { - result = Assets::Load_FxImpactTable(aStream); - } - else - { - // Resolve contents to g_streamBlocks - //*varFxImpactTablePtr = *(FxImpactTable **)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - // + (((unsigned int)(v1 - 1) >> 26) & 0x38)))[(v1 - 1) & 0x1FFFFFFF]; - } - } - - return result; -} - - -struct XAsset -{ - XAssetType type; - XAssetHeader header; -}; - -// ?Load_XAssetHeader@@YAX_N@Z at 0x822afea8 -XAssetHeader Assets::Load_XAssetHeader(QDataStream *aStream, XAsset aAsset) -{ - XAssetHeader result; - - switch (aAsset.type) - { - case ASSET_TYPE_PHYSPRESET: - result = Assets::Load_PhysPresetPtr(aStream); - break; - case ASSET_TYPE_XANIMPARTS: - result = Assets::Load_XAnimPartsPtr(aStream); - break; - case ASSET_TYPE_XMODEL: - result = Assets::Load_XModelPtr(aStream); - break; - case ASSET_TYPE_MATERIAL: - result = Assets::Load_MaterialHandle(aStream); - break; - case ASSET_TYPE_PIXELSHADER: - result = Assets::Load_MaterialPixelShaderPtr(aStream); - break; - case ASSET_TYPE_TECHNIQUE_SET: - result = Assets::Load_MaterialTechniqueSetPtr(aStream); - break; - case ASSET_TYPE_IMAGE: - varGfxImagePtr = (GfxImage **)varXAssetHeader; - result = Assets::Load_GfxImagePtr(aStream); - break; - case ASSET_TYPE_SOUND: - result = Assets::Load_snd_alias_list_ptr(aStream); - break; - case ASSET_TYPE_SOUND_CURVE: - result = Assets::Load_SndCurvePtr(aStream); - break; - case ASSET_TYPE_LOADED_SOUND: - result = Assets::Load_LoadedSoundPtr(aStream); - break; - case ASSET_TYPE_CLIPMAP: - case ASSET_TYPE_CLIPMAP_PVS: - varclipMap_ptr = (clipMap_t **)varXAssetHeader; - result = Assets::Load_clipMap_ptr(aStream); - break; - case ASSET_TYPE_COMWORLD: - result = Assets::Load_ComWorldPtr(aStream); - break; - case ASSET_TYPE_GAMEWORLD_SP: - result = Assets::Load_GameWorldSpPtr(aStream); - break; - case ASSET_TYPE_GAMEWORLD_MP: - result = Assets::Load_GameWorldMpPtr(aStream); - break; - case ASSET_TYPE_MAP_ENTS: - result = Assets::Load_MapEntsPtr(aStream); - break; - case ASSET_TYPE_GFXWORLD: - result = Assets::Load_GfxWorldPtr(aStream); - break; - case ASSET_TYPE_LIGHT_DEF: - result = Assets::Load_GfxLightDefPtr(aStream); - break; - case ASSET_TYPE_FONT: - result = Assets::Load_FontHandle(aStream); - break; - case ASSET_TYPE_MENULIST: - result = Assets::Load_MenuListPtr(aStream); - break; - case ASSET_TYPE_MENU: - result = Assets::Load_menuDef_ptr(aStream); - break; - case ASSET_TYPE_LOCALIZE_ENTRY: - result = Assets::Load_LocalizeEntryPtr(aStream); - break; - case ASSET_TYPE_WEAPON: - result = Assets::Load_WeaponDefPtr(aStream); - break; - case ASSET_TYPE_SNDDRIVER_GLOBALS: - result = Assets::Load_SndDriverGlobalsPtr(aStream); - break; - case ASSET_TYPE_FX: - result = Assets::Load_FxEffectDefHandle(aStream); - break; - case ASSET_TYPE_IMPACT_FX: - result = Assets::Load_FxImpactTablePtr(aStream); - break; - case ASSET_TYPE_RAWFILE: - result = Assets::Load_RawFilePtr(aStream); - break; - case ASSET_TYPE_STRINGTABLE: - result = Assets::Load_StringTablePtr(aStream); - break; - } - - return result; -} - -// ?Load_XAsset@@YAX_N@Z at 0x822b0220 -XAsset Assets::Load_XAsset(QDataStream *aStream) -{ - XAsset result; - - *aStream - >> result.type - >> result.header - - result.header = Load_XAssetHeader(aStream, result); - - return result; -} - - diff --git a/libs/xassets/assets.h b/libs/xassets/assets.h deleted file mode 100644 index d494c9c..0000000 --- a/libs/xassets/assets.h +++ /dev/null @@ -1,2822 +0,0 @@ -#ifndef ASSETS_H -#define ASSETS_H - -#include "xgfxpixelshaderloaddef.h" -#include "xmodel.h" -#include -#include - -typedef quint32 _DWORD; - - -enum _D3DRESOURCETYPE : __int32 -{ - D3DRTYPE_NONE = 0x0, - D3DRTYPE_VERTEXBUFFER = 0x1, - D3DRTYPE_INDEXBUFFER = 0x2, - D3DRTYPE_TEXTURE = 0x3, - D3DRTYPE_SURFACE = 0x4, - D3DRTYPE_VERTEXDECLARATION = 0x5, - D3DRTYPE_VERTEXSHADER = 0x6, - D3DRTYPE_PIXELSHADER = 0x7, - D3DRTYPE_CONSTANTBUFFER = 0x8, - D3DRTYPE_COMMANDBUFFER = 0x9, - D3DRTYPE_VOLUME = 0x10, - D3DRTYPE_VOLUMETEXTURE = 0x11, - D3DRTYPE_CUBETEXTURE = 0x12, - D3DRTYPE_ARRAYTEXTURE = 0x13, - D3DRTYPE_LINETEXTURE = 0x14, - D3DRTYPE_FORCE_DWORD = 0x7FFFFFFF, -}; - -enum _D3DFORMAT : __int32 -{ - D3DFMT_DXT1 = 0x1A200152, - D3DFMT_LIN_DXT1 = 0x1A200052, - D3DFMT_DXT2 = 0x1A200153, - D3DFMT_LIN_DXT2 = 0x1A200053, - D3DFMT_DXT3 = 0x1A200153, - D3DFMT_LIN_DXT3 = 0x1A200053, - D3DFMT_DXT3A = 0x1A20017A, - D3DFMT_LIN_DXT3A = 0x1A20007A, - D3DFMT_DXT3A_1111 = 0x1A20017D, - D3DFMT_LIN_DXT3A_1111 = 0x1A20007D, - D3DFMT_DXT4 = 0x1A200154, - D3DFMT_LIN_DXT4 = 0x1A200054, - D3DFMT_DXT5 = 0x1A200154, - D3DFMT_LIN_DXT5 = 0x1A200054, - D3DFMT_DXT5A = 0x1A20017B, - D3DFMT_LIN_DXT5A = 0x1A20007B, - D3DFMT_DXN = 0x1A200171, - D3DFMT_LIN_DXN = 0x1A200071, - D3DFMT_CTX1 = 0x1A20017C, - D3DFMT_LIN_CTX1 = 0x1A20007C, - D3DFMT_A8 = 0x4900102, - D3DFMT_LIN_A8 = 0x4900002, - D3DFMT_L8 = 0x28000102, - D3DFMT_LIN_L8 = 0x28000002, - D3DFMT_R5G6B5 = 0x28280144, - D3DFMT_LIN_R5G6B5 = 0x28280044, - D3DFMT_R6G5B5 = 0x28280145, - D3DFMT_LIN_R6G5B5 = 0x28280045, - D3DFMT_L6V5U5 = 0x2A200B45, - D3DFMT_LIN_L6V5U5 = 0x2A200A45, - D3DFMT_X1R5G5B5 = 0x28280143, - D3DFMT_LIN_X1R5G5B5 = 0x28280043, - D3DFMT_A1R5G5B5 = 0x18280143, - D3DFMT_LIN_A1R5G5B5 = 0x18280043, - D3DFMT_A4R4G4B4 = 0x1828014F, - D3DFMT_LIN_A4R4G4B4 = 0x1828004F, - D3DFMT_X4R4G4B4 = 0x2828014F, - D3DFMT_LIN_X4R4G4B4 = 0x2828004F, - D3DFMT_Q4W4V4U4 = 0x1A20AB4F, - D3DFMT_LIN_Q4W4V4U4 = 0x1A20AA4F, - D3DFMT_A8L8 = 0x800014A, - D3DFMT_LIN_A8L8 = 0x800004A, - D3DFMT_G8R8 = 0x2D20014A, - D3DFMT_LIN_G8R8 = 0x2D20004A, - D3DFMT_V8U8 = 0x2D20AB4A, - D3DFMT_LIN_V8U8 = 0x2D20AA4A, - D3DFMT_D16 = 0x1A220158, - D3DFMT_LIN_D16 = 0x1A220058, - D3DFMT_L16 = 0x28000158, - D3DFMT_LIN_L16 = 0x28000058, - D3DFMT_R16F = 0x2DA2AB5E, - D3DFMT_LIN_R16F = 0x2DA2AA5E, - D3DFMT_R16F_EXPAND = 0x2DA2AB5B, - D3DFMT_LIN_R16F_EXPAND = 0x2DA2AA5B, - D3DFMT_UYVY = 0x1A20014C, - D3DFMT_LIN_UYVY = 0x1A20004C, - D3DFMT_LE_UYVY = 0x1A20010C, - D3DFMT_LE_LIN_UYVY = 0x1A20000C, - D3DFMT_G8R8_G8B8 = 0x1828014C, - D3DFMT_LIN_G8R8_G8B8 = 0x1828004C, - D3DFMT_R8G8_B8G8 = 0x1828014B, - D3DFMT_LIN_R8G8_B8G8 = 0x1828004B, - D3DFMT_YUY2 = 0x1A20014B, - D3DFMT_LIN_YUY2 = 0x1A20004B, - D3DFMT_LE_YUY2 = 0x1A20010B, - D3DFMT_LE_LIN_YUY2 = 0x1A20000B, - D3DFMT_A8R8G8B8 = 0x18280186, - D3DFMT_LIN_A8R8G8B8 = 0x18280086, - D3DFMT_X8R8G8B8 = 0x28280186, - D3DFMT_LIN_X8R8G8B8 = 0x28280086, - D3DFMT_A8B8G8R8 = 0x1A200186, - D3DFMT_LIN_A8B8G8R8 = 0x1A200086, - D3DFMT_X8B8G8R8 = 0x2A200186, - D3DFMT_LIN_X8B8G8R8 = 0x2A200086, - D3DFMT_X8L8V8U8 = 0x2A200B86, - D3DFMT_LIN_X8L8V8U8 = 0x2A200A86, - D3DFMT_Q8W8V8U8 = 0x1A20AB86, - D3DFMT_LIN_Q8W8V8U8 = 0x1A20AA86, - D3DFMT_A2R10G10B10 = 0x182801B6, - D3DFMT_LIN_A2R10G10B10 = 0x182800B6, - D3DFMT_X2R10G10B10 = 0x282801B6, - D3DFMT_LIN_X2R10G10B10 = 0x282800B6, - D3DFMT_A2B10G10R10 = 0x1A2001B6, - D3DFMT_LIN_A2B10G10R10 = 0x1A2000B6, - D3DFMT_A2W10V10U10 = 0x1A202BB6, - D3DFMT_LIN_A2W10V10U10 = 0x1A202AB6, - D3DFMT_A16L16 = 0x8000199, - D3DFMT_LIN_A16L16 = 0x8000099, - D3DFMT_G16R16 = 0x2D200199, - D3DFMT_LIN_G16R16 = 0x2D200099, - D3DFMT_V16U16 = 0x2D20AB99, - D3DFMT_LIN_V16U16 = 0x2D20AA99, - D3DFMT_R10G11B11 = 0x282801B7, - D3DFMT_LIN_R10G11B11 = 0x282800B7, - D3DFMT_R11G11B10 = 0x282801B8, - D3DFMT_LIN_R11G11B10 = 0x282800B8, - D3DFMT_W10V11U11 = 0x2A20ABB7, - D3DFMT_LIN_W10V11U11 = 0x2A20AAB7, - D3DFMT_W11V11U10 = 0x2A20ABB8, - D3DFMT_LIN_W11V11U10 = 0x2A20AAB8, - D3DFMT_G16R16F = 0x2D22AB9F, - D3DFMT_LIN_G16R16F = 0x2D22AA9F, - D3DFMT_G16R16F_EXPAND = 0x2D22AB9C, - D3DFMT_LIN_G16R16F_EXPAND = 0x2D22AA9C, - D3DFMT_L32 = 0x280001A1, - D3DFMT_LIN_L32 = 0x280000A1, - D3DFMT_R32F = 0x2DA2ABA4, - D3DFMT_LIN_R32F = 0x2DA2AAA4, - D3DFMT_D24S8 = 0x2D200196, - D3DFMT_LIN_D24S8 = 0x2D200096, - D3DFMT_D24X8 = 0x2DA00196, - D3DFMT_LIN_D24X8 = 0x2DA00096, - D3DFMT_D24FS8 = 0x1A220197, - D3DFMT_LIN_D24FS8 = 0x1A220097, - D3DFMT_D32 = 0x1A2201A1, - D3DFMT_LIN_D32 = 0x1A2200A1, - D3DFMT_A16B16G16R16 = 0x1A20015A, - D3DFMT_LIN_A16B16G16R16 = 0x1A20005A, - D3DFMT_Q16W16V16U16 = 0x1A20AB5A, - D3DFMT_LIN_Q16W16V16U16 = 0x1A20AA5A, - D3DFMT_A16B16G16R16F = 0x1A22AB60, - D3DFMT_LIN_A16B16G16R16F = 0x1A22AA60, - D3DFMT_A16B16G16R16F_EXPAND = 0x1A22AB5D, - D3DFMT_LIN_A16B16G16R16F_EXPAND = 0x1A22AA5D, - D3DFMT_A32L32 = 0x80001A2, - D3DFMT_LIN_A32L32 = 0x80000A2, - D3DFMT_G32R32 = 0x2D2001A2, - D3DFMT_LIN_G32R32 = 0x2D2000A2, - D3DFMT_V32U32 = 0x2D20ABA2, - D3DFMT_LIN_V32U32 = 0x2D20AAA2, - D3DFMT_G32R32F = 0x2D22ABA5, - D3DFMT_LIN_G32R32F = 0x2D22AAA5, - D3DFMT_A32B32G32R32 = 0x1A2001A3, - D3DFMT_LIN_A32B32G32R32 = 0x1A2000A3, - D3DFMT_Q32W32V32U32 = 0x1A20ABA3, - D3DFMT_LIN_Q32W32V32U32 = 0x1A20AAA3, - D3DFMT_A32B32G32R32F = 0x1A22ABA6, - D3DFMT_LIN_A32B32G32R32F = 0x1A22AAA6, - D3DFMT_A2B10G10R10F_EDRAM = 0x1A2201BF, - D3DFMT_G16R16_EDRAM = 0x2D20AB8D, - D3DFMT_A16B16G16R16_EDRAM = 0x1A20AB55, - D3DFMT_LE_X8R8G8B8 = 0x28280106, - D3DFMT_LE_A8R8G8B8 = 0x18280106, - D3DFMT_LE_X2R10G10B10 = 0x28280136, - D3DFMT_LE_A2R10G10B10 = 0x18280136, - D3DFMT_INDEX16 = 0x1, - D3DFMT_INDEX32 = 0x6, - D3DFMT_LE_INDEX16 = 0x0, - D3DFMT_LE_INDEX32 = 0x4, - D3DFMT_VERTEXDATA = 0x8, - //D3DFMT_UNKNOWN = 0xFFFFFFFF, - D3DFMT_FORCE_DWORD = 0x7FFFFFFF, -}; - -enum _D3DMULTISAMPLE_TYPE : __int32 -{ - D3DMULTISAMPLE_NONE = 0x0, - D3DMULTISAMPLE_2_SAMPLES = 0x1, - D3DMULTISAMPLE_4_SAMPLES = 0x2, - D3DMULTISAMPLE_FORCE_DWORD = 0x7FFFFFFF, -}; - -struct _XGTEXTURE_DESC -{ - _D3DRESOURCETYPE ResourceType; - uint Width; - uint Height; - uint Depth; - _D3DFORMAT Format; - uint RowPitch; - uint SlicePitch; - uint BitsPerPixel; - uint WidthInBlocks; - uint HeightInBlocks; - uint DepthInBlocks; - uint BytesPerBlock; - int ExpBias; - uint Flags; - _D3DMULTISAMPLE_TYPE MultiSampleType; -}; - - - -union MaterialPixelShaderProgram -{ - qint32 psPtr; - XD3DPixelShader ps; - XGfxPixelShaderLoadDef loadDef; -}; - -struct __declspec(align(4)) XMALOOPREGION -{ - uint LoopStart; - uint LoopEnd; - quint8 LoopSubframeEnd; - quint8 LoopSubframeSkip; -}; - -struct XAUDIOPACKET_ALIGNED -{ - qint32 pBufferPtr; - QVector pBuffer; - uint BufferSize; - uint LoopCount; - XMALOOPREGION XMALoop[6]; - qint32 pContextPtr; - char pContext; -}; - -struct __declspec(align(4)) XAUDIOXMAFORMAT -{ - uint SampleRate; - quint8 ChannelCount; - quint8 DecodeBufferSize; -}; - -union $A914CD29B804E77ACE08D070A31DB5AB -{ - quint8 NumStreams; - quint8 ChannelCount; -}; - -union $9C5A25260C9CC66355FE8A35CC8403E0 -{ - XAUDIOXMAFORMAT Stream[6]; - uint SampleRate; -}; - -struct XAUDIOSOURCEFORMAT -{ - quint8 SampleType; - __declspec(align(4)) $A914CD29B804E77ACE08D070A31DB5AB ___u1; - $9C5A25260C9CC66355FE8A35CC8403E0 ___u2; -}; - -struct XaIwXmaDataInfo -{ - int totalMsec; -}; - -struct XaSeekTable -{ - int size; - qint32 dataPtr; - QVector data; -}; - -struct XaSound -{ - XAUDIOPACKET_ALIGNED packet; - XAUDIOSOURCEFORMAT format; - XaIwXmaDataInfo xaIwXmaDataInfo; - XaSeekTable seekTable; -}; - -struct LoadedSound -{ - const char *name; - XaSound sound; -}; - -struct StreamFileNameRaw -{ - qint32 dirPtr; - QString dir; - qint32 namePtr; - QString name; -}; - -struct StreamFileNamePacked -{ - uint offset; - uint length; -}; - -union StreamFileInfo -{ - StreamFileNameRaw raw; - StreamFileNamePacked packed; -}; - -struct StreamFileName -{ - uint fileIndex; - StreamFileInfo info; -}; - -struct StreamedSound -{ - StreamFileName filename; -}; - -union SoundFileRef -{ - LoadedSound *loadSnd; - StreamedSound streamSnd; -}; - -struct SoundFile -{ - quint8 type; - quint8 exists; - SoundFileRef u; -}; - -struct SndCurve -{ - qint32 filenamePtr; - QString filename; - int knotCount; - float knots[8][2]; -}; - -struct XAUDIOCHANNELMAPENTRY -{ - quint8 InputChannel; - quint8 OutputChannel; - float Volume; -}; - -struct XAUDIOCHANNELMAP -{ - quint8 EntryCount; - qint32 paEntriesPtr; - QVector paEntries; -}; - -struct SpeakerMap -{ - bool isDefault; - const char *name; - XAUDIOCHANNELMAP channelMaps[2][2]; -}; - -struct snd_alias_t -{ - const char *aliasName; - const char *subtitle; - const char *secondaryAliasName; - const char *chainAliasName; - SoundFile *soundFile; - int sequence; - float volMin; - float volMax; - float pitchMin; - float pitchMax; - float distMin; - float distMax; - int flags; - float slavePercentage; - float probability; - float lfePercentage; - float centerPercentage; - int startDelay; - SndCurve *volumeFalloffCurve; - float envelopMin; - float envelopMax; - float envelopPercentage; - SpeakerMap *speakerMap; -}; - -struct SoundAliasList -{ - const char *aliasName; - snd_alias_t *head; - int count; -}; - -enum XAssetType : __int32 -{ - ASSET_TYPE_XMODELPIECES = 0x0, - ASSET_TYPE_PHYSPRESET = 0x1, - ASSET_TYPE_XANIMPARTS = 0x2, - ASSET_TYPE_XMODEL = 0x3, - ASSET_TYPE_MATERIAL = 0x4, - ASSET_TYPE_PIXELSHADER = 0x5, - ASSET_TYPE_TECHNIQUE_SET = 0x6, - ASSET_TYPE_IMAGE = 0x7, - ASSET_TYPE_SOUND = 0x8, - ASSET_TYPE_SOUND_CURVE = 0x9, - ASSET_TYPE_LOADED_SOUND = 0xA, - ASSET_TYPE_CLIPMAP = 0xB, - ASSET_TYPE_CLIPMAP_PVS = 0xC, - ASSET_TYPE_COMWORLD = 0xD, - ASSET_TYPE_GAMEWORLD_SP = 0xE, - ASSET_TYPE_GAMEWORLD_MP = 0xF, - ASSET_TYPE_MAP_ENTS = 0x10, - ASSET_TYPE_GFXWORLD = 0x11, - ASSET_TYPE_LIGHT_DEF = 0x12, - ASSET_TYPE_UI_MAP = 0x13, - ASSET_TYPE_FONT = 0x14, - ASSET_TYPE_MENULIST = 0x15, - ASSET_TYPE_MENU = 0x16, - ASSET_TYPE_LOCALIZE_ENTRY = 0x17, - ASSET_TYPE_WEAPON = 0x18, - ASSET_TYPE_SNDDRIVER_GLOBALS = 0x19, - ASSET_TYPE_FX = 0x1A, - ASSET_TYPE_IMPACT_FX = 0x1B, - ASSET_TYPE_AITYPE = 0x1C, - ASSET_TYPE_MPTYPE = 0x1D, - ASSET_TYPE_CHARACTER = 0x1E, - ASSET_TYPE_XMODELALIAS = 0x1F, - ASSET_TYPE_RAWFILE = 0x20, - ASSET_TYPE_STRINGTABLE = 0x21, - ASSET_TYPE_COUNT = 0x22, - ASSET_TYPE_STRING = 0x22, - ASSET_TYPE_ASSETLIST = 0x23, -}; - - -union GfxDrawSurf -{ - GfxDrawSurfFields fields; - unsigned __int64 packed; -}; - -struct MaterialTechniqueSet -{ - const char *name; - quint8 worldVertFormat; - quint8 unused[2]; - MaterialTechniqueSet *remappedTechniqueSet; - MaterialTechnique *techniques[26]; -}; - -struct XModelPiece -{ - XModel *model; - float offset[3]; -}; - -struct XModelPieces -{ - const char *name; - int numpieces; - XModelPiece *pieces; -}; - -union XAnimIndices -{ - quint8 *_1; - quint16 *_2; - void *data; -}; - -struct XAnimNotifyInfo -{ - quint16 name; - float time; -}; - -union XAnimDynamicFrames -{ - quint8 (*_1)[3]; - quint16 (*_2)[3]; -}; - -union XAnimDynamicIndices -{ - quint8 _1[1]; - quint16 _2[1]; -}; - -struct XAnimPartTransFrames -{ - float mins[3]; - float size[3]; - XAnimDynamicFrames frames; - XAnimDynamicIndices indices; -}; - -union XAnimPartTransData -{ - XAnimPartTransFrames frames; - float frame0[3]; -}; - -struct XAnimPartTrans -{ - quint16 size; - quint8 smallTrans; - XAnimPartTransData u; -}; - -struct __declspec(align(4)) XAnimDeltaPartQuatDataFrames -{ - qint16 (*frames)[2]; - XAnimDynamicIndices indices; -}; - -union XAnimDeltaPartQuatData -{ - XAnimDeltaPartQuatDataFrames frames; - qint16 frame0[2]; -}; - -struct XAnimDeltaPartQuat -{ - quint16 size; - XAnimDeltaPartQuatData u; -}; - -struct XAnimDeltaPart -{ - XAnimPartTrans *trans; - XAnimDeltaPartQuat *quat; -}; - -struct XAnimParts -{ - const char *name; - quint16 dataByteCount; - quint16 dataShortCount; - quint16 dataIntCount; - quint16 randomDataByteCount; - quint16 randomDataIntCount; - quint16 numframes; - bool bLoop; - bool bDelta; - quint8 boneCount[12]; - quint8 notifyCount; - quint8 assetType; - bool pad; - uint randomDataShortCount; - uint indexCount; - float framerate; - float frequency; - quint16 *names; - quint8 *dataByte; - qint16 *dataShort; - int *dataInt; - qint16 *randomDataShort; - quint8 *randomDataByte; - int *randomDataInt; - XAnimIndices indices; - XAnimNotifyInfo *notify; - XAnimDeltaPart *deltaPart; -}; - -struct cStaticModelWritable -{ - quint16 nextModelInWorldSector; -}; - -struct cStaticModel_s -{ - cStaticModelWritable writable; - XModel *xmodel; - float origin[3]; - float invScaledAxis[3][3]; - float absmin[3]; - float absmax[3]; -}; - -struct dmaterial_t -{ - char material[64]; - int surfaceFlags; - int contentFlags; -}; - -struct cNode_t -{ - qint32 planePtr; - CPlane plane; - qint16 children[2]; -}; - -struct __declspec(align(4)) CLeaf -{ - quint16 firstCollAabbIndex; - quint16 collAabbCount; - int brushContents; - int terrainContents; - float mins[3]; - float maxs[3]; - int leafBrushNode; - qint16 cluster; -}; - -struct CLeafBrushNodeLeaf; -struct CLeafBrushNodeChildren; - -struct CLeafBrushNodeData -{ - // Make these not ptrs - CLeafBrushNodeLeaf *leaf; - CLeafBrushNodeChildren *children; -}; - -struct CLeafBrushNodeLeaf : CLeafBrushNodeData -{ - qint32 brushesPtr; - QVector brushes; -}; - -struct CLeafBrushNodeChildren : CLeafBrushNodeData -{ - float dist; - float range; - quint16 childOffset[2]; -}; - -struct CLeafBrushNode -{ - quint8 axis; - qint16 leafBrushCount; - int contents; - CLeafBrushNodeData data; -}; - -struct CollisionBorder -{ - float distEq[3]; - float zBase; - float zSlope; - float start; - float length; -}; - -struct CollisionPartition -{ - quint8 triCount; - quint8 borderCount; - int firstTri; - qint32 bordersPtr; - CollisionBorder borders; -}; - -union CollisionAabbTreeIndex -{ - int firstChildIndex; - int partitionIndex; -}; - -struct CollisionAabbTree -{ - float origin[3]; - float halfSize[3]; - quint16 materialIndex; - quint16 childCount; - CollisionAabbTreeIndex u; -}; - -struct XCModel -{ - float mins[3]; - float maxs[3]; - float radius; - CLeaf leaf; -}; - -struct XCBrush -{ - float mins[3]; - int contents; - float maxs[3]; - uint numsides; - qint32 sidesPtr; - QVector sides; - qint16 axialMaterialNum[2][3]; - qint32 baseAdjacentSidePtr; - quint8 baseAdjacentSide; - qint16 firstAdjacentSideOffsets[2][3]; - quint8 edgeCount[2][3]; -}; - -struct MapEnts -{ - qint32 namePtr; - QString name; - qint32 entityStringPtr; - QString entityString; - int numEntityChars; -}; - -enum DynEntityType : __int32 -{ - DYNENT_TYPE_INVALID = 0x0, - DYNENT_TYPE_CLUTTER = 0x1, - DYNENT_TYPE_DESTRUCT = 0x2, - DYNENT_TYPE_COUNT = 0x3, -}; - -struct GfxPlacement -{ - float quat[4]; - float origin[3]; -}; - -struct FxSpawnDefLooping -{ - int intervalMsec; - int count; -}; - -struct FxIntRange -{ - int base; - int amplitude; -}; - -struct FxSpawnDefOneShot -{ - FxIntRange count; -}; - -union FxSpawnDef -{ - FxSpawnDefLooping looping; - FxSpawnDefOneShot oneShot; -}; - -struct FxFloatRange -{ - float base; - float amplitude; -}; - -struct FxElemAtlas -{ - quint8 behavior; - quint8 index; - quint8 fps; - quint8 loopCount; - quint8 colIndexBits; - quint8 rowIndexBits; - qint16 entryCount; -}; - -struct FxElemVec3Range -{ - float base[3]; - float amplitude[3]; -}; - -struct FxElemVelStateInFrame -{ - FxElemVec3Range velocity; - FxElemVec3Range totalDelta; -}; - -struct FxElemVelStateSample -{ - FxElemVelStateInFrame local; - FxElemVelStateInFrame world; -}; - -struct FxElemVisualState -{ - quint8 color[4]; - float rotationDelta; - float rotationTotal; - float size[2]; - float scale; -}; - -struct FxElemVisStateSample -{ - FxElemVisualState base; - FxElemVisualState amplitude; -}; - -struct FxElemMarkVisuals -{ - Material *materials[2]; -}; - -struct FxEffectDef; - -union FxEffectDefRef -{ - qint32 namePtr; -}; - -union FxElemVisuals -{ - const void *anonymous; - Material *material; - XModel *model; - FxEffectDefRef effectDef; - const char *soundName; -}; - -union FxElemDefVisuals -{ - FxElemMarkVisuals *markArray; - FxElemVisuals *array; - FxElemVisuals instance; -}; - -struct FxTrailVertex -{ - float pos[2]; - float normal[2]; - float texCoord; -}; - -struct FxTrailDef -{ - int scrollTimeMsec; - int repeatDist; - int splitDist; - - int vertCount; - qint32 vertsPtr; - QVector verts; - - int indCount; - qint32 indsPtr; - QVector inds; -}; - -struct FxElemDef -{ - int flags; - FxSpawnDef spawn; - FxFloatRange spawnRange; - FxFloatRange fadeInRange; - FxFloatRange fadeOutRange; - float spawnFrustumCullRadius; - FxIntRange spawnDelayMsec; - FxIntRange lifeSpanMsec; - FxFloatRange spawnOrigin[3]; - FxFloatRange spawnOffsetRadius; - FxFloatRange spawnOffsetHeight; - FxFloatRange spawnAngles[3]; - FxFloatRange angularVelocity[3]; - FxFloatRange initialRotation; - FxFloatRange gravity; - FxFloatRange reflectionFactor; - FxElemAtlas atlas; - quint8 elemType; - quint8 visualCount; - quint8 velIntervalCount; - quint8 visStateIntervalCount; - const FxElemVelStateSample *velSamples; - const FxElemVisStateSample *visSamples; - FxElemDefVisuals visuals; - float collMins[3]; - float collMaxs[3]; - FxEffectDefRef effectOnImpact; - FxEffectDefRef effectOnDeath; - FxEffectDefRef effectEmitted; - FxFloatRange emitDist; - FxFloatRange emitDistVariance; - FxTrailDef *trailDef; - quint8 sortOrder; - quint8 lightingFrac; - quint8 useItemClip; - quint8 unused[1]; -}; - -struct FxEffectDef -{ - qint32 namePtr; - QString name; - int flags; - int totalSize; - int msecLoopingLife; - int elemDefCountLooping; - int elemDefCountOneShot; - int elemDefCountEmission; - qint32 elemDefsPtr; - QVector elemDefs; -}; - -struct DynEntityDef -{ - DynEntityType type; - GfxPlacement pose; - qint32 xModelPtr; - XModel xModel; - quint16 brushModel; - quint16 physicsBrushModel; - qint32 destroyFxPtr; - FxEffectDef destroyFx; - qint32 destroyPiecesPtr; - XModelPieces destroyPieces; - qint32 physPresetPtr; - PhysPreset physPreset; - int health; - PhysMass mass; - int contents; -}; - -struct DynEntityPose -{ - GfxPlacement pose; - float radius; -}; - -struct DynEntityClient -{ - int physObjId; - quint16 flags; - quint16 lightingHandle; - int health; -}; - -struct DynEntityColl -{ - quint16 sector; - quint16 nextEntInSector; - float linkMins[2]; - float linkMaxs[2]; -}; - -struct clipMap_t -{ - qint32 namePtr; - QString name; - - int isInUse; - - int planeCount; - qint32 planesPtr; - QVector planes; - - uint numStaticModels; - qint32 staticModelListPtr; - QVector staticModelList; - - uint numMaterials; - qint32 materialsPtr; - QVector materials; - - uint numBrushSides; - qint32 brushsidesPtr; - QVector brushsides; - - uint numBrushEdges; - qint32 brushEdgesPtr; - QVector brushEdges; - - uint numNodes; - qint32 nodesPtr; - QVector nodes; - - uint numLeafs; - qint32 leafsPtr; - QVector leafs; - - uint leafbrushNodesCount; - qint32 leafbrushNodesPtr; - QVector leafbrushNodes; - - uint numLeafBrushes; - qint32 leafbrushesPtr; - QVector leafbrushes; - - uint numLeafSurfaces; - qint32 leafsurfacesPtr; - QVector leafsurfaces; - - uint vertCount; - float (*verts)[3]; - - int triCount; - qint32 triIndicesPtr; - QVector triIndices; - qint32 triEdgeIsWalkablePtr; - QVector triEdgeIsWalkable; - - int borderCount; - qint32 bordersPtr; - QVector borders; - - int partitionCount; - qint32 partitionsPtr; - QVector partitions; - - int aabbTreeCount; - qint32 aabbTreesPtr; - QVector aabbTrees; - - uint numSubModels; - qint32 cmodelsPtr; - QVector cmodels; - - quint16 numBrushes; - qint32 brushesPtr; - QVector brushes; - - int numClusters; - int clusterBytes; - - qint32 visibilityPtr; - QVector visibility; - int vised; - QVector mapEnts; - CBrush *box_brush; - CModel box_model; - quint16 dynEntCount[2]; - DynEntityDef *dynEntDefList[2]; - DynEntityPose *dynEntPoseList[2]; - DynEntityClient *dynEntClientList[2]; - DynEntityColl *dynEntCollList[2]; - uint checksum; -}; - -struct XComPrimaryLight -{ - quint8 type; - quint8 canUseShadowMap; - quint8 exponent; - quint8 unused; - float color[3]; - float dir[3]; - float origin[3]; - float radius; - float cosHalfFovOuter; - float cosHalfFovInner; - float cosHalfFovExpanded; - float rotationLimit; - float translationLimit; - qint32 defNamePtr; - QString defName; -}; - -struct ComWorld -{ - qint32 namePtr; - QString name; - int isInUse; - uint primaryLightCount; - qint32 primaryLightsPtr; - QVector primaryLights; -}; - -enum nodeType : qint32 -{ - NODE_BADNODE = 0x0, - NODE_PATHNODE = 0x1, - NODE_COVER_STAND = 0x2, - NODE_COVER_CROUCH = 0x3, - NODE_COVER_CROUCH_WINDOW = 0x4, - NODE_COVER_PRONE = 0x5, - NODE_COVER_RIGHT = 0x6, - NODE_COVER_LEFT = 0x7, - NODE_COVER_WIDE_RIGHT = 0x8, - NODE_COVER_WIDE_LEFT = 0x9, - NODE_CONCEALMENT_STAND = 0xA, - NODE_CONCEALMENT_CROUCH = 0xB, - NODE_CONCEALMENT_PRONE = 0xC, - NODE_REACQUIRE = 0xD, - NODE_BALCONY = 0xE, - NODE_SCRIPTED = 0xF, - NODE_NEGOTIATION_BEGIN = 0x10, - NODE_NEGOTIATION_END = 0x11, - NODE_TURRET = 0x12, - NODE_GUARD = 0x13, - NODE_NUMTYPES = 0x14, - NODE_DONTLINK = 0x14, -}; - -struct PathLink -{ - float fDist; - quint16 nodeNum; - quint8 disconnectCount; - quint8 negotiationLink; - quint8 ubBadPlaceCount[4]; -}; - -struct PathNodeConstant -{ - nodeType type; - quint16 spawnflags; - quint16 targetname; - quint16 script_linkName; - quint16 script_noteworthy; - quint16 target; - quint16 animscript; - int animscriptfunc; - float vOrigin[3]; - float fAngle; - float forward[2]; - float fRadius; - float minUseDistSq; - qint16 wOverlapNode[2]; - qint16 wChainId; - qint16 wChainDepth; - qint16 wChainParent; - quint16 totalLinkCount; - qint32 LinksPtr; - PathLink Links; -}; - -struct pathnode_dynamic_t -{ - void *pOwner; - int iFreeTime; - int iValidTime[3]; - int inPlayerLOSTime; - qint16 wLinkCount; - qint16 wOverlapCount; - qint16 turretEntNumber; - qint16 userCount; -}; - -struct pathnode_t; - -struct pathnode_transient_t -{ - int iSearchFrame; - pathnode_t *pNextOpen; - pathnode_t *pPrevOpen; - pathnode_t *pParent; - float fCost; - float fHeuristic; - float costFactor; -}; - -struct pathnode_t -{ - PathNodeConstant constant; - pathnode_dynamic_t dynamic; - pathnode_transient_t transient; -}; - -struct PathBaseNode -{ - float vOrigin[3]; - uint type; -}; - -struct PathNodeTree; - -struct PathNodeTreeNodes -{ - int nodeCount; - QVector nodes; -}; - -union PathNodeTreeInfo -{ - PathNodeTree *child[2]; - PathNodeTreeNodes s; -}; - -struct PathNodeTree -{ - int axis; - float dist; - qint32 infoPtr; - PathNodeTreeInfo info; -}; - -struct PathData -{ - uint nodeCount; - pathnode_t *nodes; - PathBaseNode *basenodes; - uint chainNodeCount; - quint16 *chainNodeForNode; - quint16 *nodeForChainNode; - int visBytes; - quint8 *pathVis; - int nodeTreeCount; - PathNodeTree *nodeTree; -}; - -struct GameWorldSp -{ - const char *name; - PathData path; -}; - -struct GameWorldMp -{ - qint32 namePtr; - QString name; -}; - -struct GfxStreamingAabbTree -{ - quint16 firstItem; - quint16 itemCount; - quint16 firstChild; - quint16 childCount; - float mins[3]; - float maxs[3]; -}; - -struct GfxWorldStreamInfo -{ - int aabbTreeCount; - qint32 aabbTreesPtr; - QVector aabbTrees; - - int leafRefCount; - qint32 leafRefsPtr; - QVector leafRefs; -}; - -struct GfxWorldVertex -{ - float xyz[3]; - float binormalSign; - GfxColor color; - float texCoord[2]; - float lmapCoord[2]; - PackedUnitVec normal; - PackedUnitVec tangent; -}; - -struct GfxWorldVertexData -{ - qint32 verticesPtr; - QVector vertices; - D3DVertexBuffer worldVb; -}; - -struct GfxWorldVertexLayerData -{ - qint32 dataPtr; - QVector data; - D3DVertexBuffer layerVb; -}; - -struct SunLightParseParams -{ - char name[64]; - float ambientScale; - float ambientColor[3]; - float diffuseFraction; - float sunLight; - float sunColor[3]; - float diffuseColor[3]; - bool diffuseColorHasBeenSet; - float angles[3]; -}; - -struct __declspec(align(4)) XGfxLightImage -{ - GfxImage *image; - quint8 samplerState; -}; - -struct XGfxLightDef -{ - const char *name; - XGfxLightImage attenuation; - int lmapLookupStart; -}; - -struct GfxLight -{ - quint8 type; - quint8 canUseShadowMap; - quint8 unused[2]; - float color[3]; - float dir[3]; - float origin[3]; - float radius; - float cosHalfFovOuter; - float cosHalfFovInner; - int exponent; - uint spotShadowIndex; - XGfxLightDef *def; -}; - -struct GfxReflectionProbe -{ - float origin[3]; - GfxImage *reflectionImage; -}; - -struct GfxWorldDpvsPlanes -{ - int cellCount; - qint32 planesPtr; - QVector planes; - qint32 nodesPtr; - QVector nodes; - qint32 sceneEntCellBitsPtr; - QVector sceneEntCellBits; -}; - -struct GfxAabbTree -{ - float mins[3]; - float maxs[3]; - quint16 childCount; - quint16 surfaceCount; - quint16 startSurfIndex; - - quint16 smodelIndexCount; - qint32 smodelIndexesPtr; - QVector smodelIndexes; - - int childrenOffset; -}; - -struct GfxPortal; - -struct GfxPortalWritable -{ - bool isQueued; - bool isAncestor; - quint8 recursionDepth; - quint8 hullPointCount; - quint32 hullPointPtrs[2]; - float hullPoints[2]; - qint32 queuedParentPtr; - GfxPortal *queuedParent; -}; - -struct DpvsPlane -{ - float coeffs[4]; - quint8 side[3]; - quint8 pad; -}; - -struct GfxCell; - -struct GfxPortal -{ - GfxPortalWritable writable; - DpvsPlane plane; - - qint32 cellPtr; - GfxCell *cell; - - qint32 verticesPtr; - float vertices[3]; - quint8 vertexCount; - - float hullAxis[2][3]; -}; - -struct GfxCell -{ - float mins[3]; - float maxs[3]; - - int aabbTreeCount; - qint32 aabbTreePtr; - QVector aabbTree; - - int portalCount; - qint32 portalsPtr; - QVector portals; - - int cullGroupCount; - qint32 cullGroupsPtr; - QVector cullGroups; - - quint8 reflectionProbeCount; - qint32 reflectionProbesPtr; - QVector reflectionProbes; -}; - -struct GfxLightmapArray -{ - GfxImage *primary; - GfxImage *secondary; -}; - -struct GfxLightGridEntry -{ - quint16 colorsIndex; - quint8 primaryLightIndex; - quint8 needsTrace; -}; - -struct GfxLightGridColors -{ - quint8 rgb[56][3]; -}; - -struct GfxLightGrid -{ - bool hasLightRegions; - uint sunPrimaryLightIndex; - quint16 mins[3]; - quint16 maxs[3]; - uint rowAxis; - uint colAxis; - qint32 rowDataStartPtr; - QVector rowDataStart; - uint rawRowDataSize; - qint32 rawRowDataPtr; - QVector rawRowData; - uint entryCount; - qint32 entriesPtr; - QVector entries; - uint colorCount; - qint32 colorsPtr; - QVector colors; -}; - -struct GfxBrushModelWritable -{ - float mins[3]; - float maxs[3]; -}; - -struct GfxBrushModel -{ - GfxBrushModelWritable writable; - float bounds[2][3]; - uint surfaceCount; - uint startSurfIndex; -}; - -struct MaterialMemory -{ - Material *material; - int memory; -}; - -struct sunflare_t -{ - bool hasValidData; - Material *spriteMaterial; - Material *flareMaterial; - float spriteSize; - float flareMinSize; - float flareMinDot; - float flareMaxSize; - float flareMaxDot; - float flareMaxAlpha; - int flareFadeInTime; - int flareFadeOutTime; - float blindMinDot; - float blindMaxDot; - float blindMaxDarken; - int blindFadeInTime; - int blindFadeOutTime; - float glareMinDot; - float glareMaxDot; - float glareMaxLighten; - int glareFadeInTime; - int glareFadeOutTime; - float sunFxPosition[3]; -}; - -struct XModelDrawInfo -{ - quint16 lod; - quint16 surfId; -}; - -struct GfxSceneDynModel -{ - XModelDrawInfo info; - quint16 dynEntId; -}; - -struct BModelDrawInfo -{ - quint16 surfId; -}; - -struct GfxSceneDynBrush -{ - BModelDrawInfo info; - quint16 dynEntId; -}; - -struct GfxShadowGeometry -{ - quint16 surfaceCount; - quint16 smodelCount; - qint32 sortedSurfIndexPtr; - QVector sortedSurfIndex; - qint32 smodelIndexPtr; - QVector smodelIndex; -}; - -struct GfxLightRegionAxis -{ - float dir[3]; - float midPoint; - float halfSize; -}; - -struct GfxLightRegionHull -{ - float kdopMidPoint[9]; - float kdopHalfSize[9]; - uint axisCount; - qint32 axisPtr; - QVector axis; -}; - -struct GfxLightRegion -{ - uint hullCount; - qint32 hullsPtr; - QVector hulls; -}; - -struct GfxStaticModelInst -{ - float mins[3]; - float maxs[3]; - GfxColor groundLighting; -}; - -struct srfTriangles_t -{ - int vertexLayerData; - int firstVertex; - quint16 vertexCount; - quint16 triCount; - int baseIndex; - float topMipMins[3]; - float topMipMaxs[3]; -}; - -struct GfxSurface -{ - srfTriangles_t tris; - Material *material; - quint8 lightmapIndex; - quint8 reflectionProbeIndex; - quint8 primaryLightIndex; - bool castsSunShadow; - float bounds[2][3]; -}; - -struct GfxCullGroup -{ - float mins[3]; - float maxs[3]; - int surfaceCount; - int startSurfIndex; -}; - -struct GfxPackedPlacement -{ - float origin[3]; - PackedUnitVec axis[3]; - float scale; -}; - -struct __declspec(align(4)) GfxStaticModelDrawInst -{ - float cullDist; - GfxPackedPlacement placement; - XModel *model; - quint8 reflectionProbeIndex; - quint8 primaryLightIndex; - quint16 lightingHandle; - quint8 flags; -}; - -struct GfxWorldDpvsStatic -{ - uint smodelCount; - uint staticSurfaceCount; - uint litSurfsBegin; - uint litSurfsEnd; - uint decalSurfsBegin; - uint decalSurfsEnd; - uint emissiveSurfsBegin; - uint emissiveSurfsEnd; - uint smodelVisDataCount; - uint surfaceVisDataCount; - quint8 *smodelVisData[3]; - quint8 *surfaceVisData[3]; - uint *lodData; - quint16 *sortedSurfIndex; - GfxStaticModelInst *smodelInsts; - GfxSurface *surfaces; - GfxCullGroup *cullGroups; - GfxStaticModelDrawInst *smodelDrawInsts; - GfxDrawSurfFields *surfaceMaterials; - uint *surfaceCastsSunShadow; - volatile int usageCount; -}; - -struct GfxWorldDpvsDynamic -{ - uint dynEntClientWordCount[2]; - uint dynEntClientCount[2]; - qint32 dynEntCellBitsPtrs[2]; - uint dynEntCellBits[2]; - qint32 dynEntVisDataPtrs[2][3]; - quint8 dynEntVisData[2][3]; -}; - -struct GfxWorld -{ - const char *name; - const char *baseName; - int planeCount; - int nodeCount; - int indexCount; - quint16 *indices; - D3DIndexBuffer indexBuffer; - int surfaceCount; - GfxWorldStreamInfo streamInfo; - int skySurfCount; - int *skyStartSurfs; - GfxImage *skyImage; - quint8 skySamplerState; - uint vertexCount; - GfxWorldVertexData vd; - uint vertexLayerDataSize; - GfxWorldVertexLayerData vld; - SunLightParseParams sunParse; - GfxLight *sunLight; - float sunColorFromBsp[3]; - uint sunPrimaryLightIndex; - uint primaryLightCount; - int cullGroupCount; - uint reflectionProbeCount; - GfxReflectionProbe *reflectionProbes; - GfxTexture *reflectionProbeTextures; - GfxWorldDpvsPlanes dpvsPlanes; - int cellBitsCount; - GfxCell *cells; - int lightmapCount; - GfxLightmapArray *lightmaps; - GfxLightGrid lightGrid; - GfxTexture *lightmapPrimaryTextures; - GfxTexture *lightmapSecondaryTextures; - int modelCount; - GfxBrushModel *models; - float mins[3]; - float maxs[3]; - uint checksum; - int materialMemoryCount; - MaterialMemory *materialMemory; - sunflare_t sun; - float outdoorLookupMatrix[4][4]; - GfxImage *outdoorImage; - uint *cellCasterBits; - GfxSceneDynModel *sceneDynModel; - GfxSceneDynBrush *sceneDynBrush; - uint *primaryLightEntityShadowVis; - uint *primaryLightDynEntShadowVis[2]; - quint8 *nonSunPrimaryLightForModelDynEnt; - GfxShadowGeometry *shadowGeom; - GfxLightRegion *lightRegion; - GfxWorldDpvsStatic dpvs; - GfxWorldDpvsDynamic dpvsDyn; -}; - -struct Glyph -{ - quint16 letter; - char x0; - char y0; - quint8 dx; - quint8 pixelWidth; - quint8 pixelHeight; - float s0; - float t0; - float s1; - float t1; -}; - -struct Font_s -{ - const char *fontName; - int pixelHeight; - int glyphCount; - Material *material; - Material *glowMaterial; - Glyph *glyphs; -}; - -struct XRectDef -{ - float x; - float y; - float w; - float h; - int horzAlign; - int vertAlign; -}; - -struct XWindowDef -{ - const char *name; - XRectDef rect; - XRectDef rectClient; - const char *group; - int style; - int border; - int ownerDraw; - int ownerDrawFlags; - float borderSize; - int staticFlags; - int dynamicFlags[4]; - int nextTime; - float foreColor[4]; - float backColor[4]; - float borderColor[4]; - float outlineColor[4]; - Material *background; -}; - -struct XItemKeyHandler -{ - int key; - qint32 actionPtr; - QString action; - qint32 nextPtr; - XItemKeyHandler *next; -}; - -enum OperationEnum : qint32 -{ - OP_NOOP = 0x0, - OP_RIGHTPAREN = 0x1, - OP_MULTIPLY = 0x2, - OP_DIVIDE = 0x3, - OP_MODULUS = 0x4, - OP_ADD = 0x5, - OP_SUBTRACT = 0x6, - OP_NOT = 0x7, - OP_LESSTHAN = 0x8, - OP_LESSTHANEQUALTO = 0x9, - OP_GREATERTHAN = 0xA, - OP_GREATERTHANEQUALTO = 0xB, - OP_EQUALS = 0xC, - OP_NOTEQUAL = 0xD, - OP_AND = 0xE, - OP_OR = 0xF, - OP_LEFTPAREN = 0x10, - OP_COMMA = 0x11, - OP_BITWISEAND = 0x12, - OP_BITWISEOR = 0x13, - OP_BITWISENOT = 0x14, - OP_BITSHIFTLEFT = 0x15, - OP_BITSHIFTRIGHT = 0x16, - OP_SIN = 0x17, - OP_FIRSTFUNCTIONCALL = 0x17, - OP_COS = 0x18, - OP_MIN = 0x19, - OP_MAX = 0x1A, - OP_MILLISECONDS = 0x1B, - OP_DVARINT = 0x1C, - OP_DVARBOOL = 0x1D, - OP_DVARFLOAT = 0x1E, - OP_DVARSTRING = 0x1F, - OP_STAT = 0x20, - OP_UIACTIVE = 0x21, - OP_FLASHBANGED = 0x22, - OP_SCOPED = 0x23, - OP_SCOREBOARDVISIBLE = 0x24, - OP_INKILLCAM = 0x25, - OP_PLAYERFIELD = 0x26, - OP_SELECTINGLOCATION = 0x27, - OP_TEAMFIELD = 0x28, - OP_OTHERTEAMFIELD = 0x29, - OP_MARINESFIELD = 0x2A, - OP_OPFORFIELD = 0x2B, - OP_MENUISOPEN = 0x2C, - OP_WRITINGDATA = 0x2D, - OP_INLOBBY = 0x2E, - OP_INPRIVATEPARTY = 0x2F, - OP_PRIVATEPARTYHOST = 0x30, - OP_PRIVATEPARTYHOSTINLOBBY = 0x31, - OP_ALONEINPARTY = 0x32, - OP_ADSJAVELIN = 0x33, - OP_WEAPLOCKBLINK = 0x34, - OP_WEAPATTACKTOP = 0x35, - OP_WEAPATTACKDIRECT = 0x36, - OP_SECONDSASTIME = 0x37, - OP_TABLELOOKUP = 0x38, - OP_LOCALIZESTRING = 0x39, - OP_LOCALVARINT = 0x3A, - OP_LOCALVARBOOL = 0x3B, - OP_LOCALVARFLOAT = 0x3C, - OP_LOCALVARSTRING = 0x3D, - OP_TIMELEFT = 0x3E, - OP_SECONDSASCOUNTDOWN = 0x3F, - OP_GAMEMSGWNDACTIVE = 0x40, - OP_TOINT = 0x41, - OP_TOSTRING = 0x42, - OP_TOFLOAT = 0x43, - OP_GAMETYPENAME = 0x44, - OP_GAMETYPE = 0x45, - OP_GAMETYPEDESCRIPTION = 0x46, - OP_SCORE = 0x47, - OP_FRIENDSONLINE = 0x48, - OP_FOLLOWING = 0x49, - OP_STATRANGEBITSSET = 0x4A, - OP_KEYBINDING = 0x4B, - OP_ACTIONSLOTUSABLE = 0x4C, - OP_HUDFADE = 0x4D, - OP_MAXPLAYERS = 0x4E, - OP_ACCEPTINGINVITE = 0x4F, - NUM_OPERATORS = 0x50, -}; - -enum XExpDataType : __int32 -{ - VAL_INT = 0x0, - VAL_FLOAT = 0x1, - VAL_STRING = 0x2, -}; - -struct XOperand -{ - XExpDataType dataType; - int intVal; - float floatVal; - QString stringVal; -}; - -union entryInternalData -{ - OperationEnum op; - XOperand operand; -}; - -struct XExpressionEntry -{ - int type; - entryInternalData data; -}; - -struct XStatement -{ - int numEntries; - XExpressionEntry **entries; -}; - -struct ItemDef; - -struct menuDef_t -{ - XWindowDef window; - const char *font; - int fullScreen; - int itemCount; - int fontIndex; - int cursorItem[4]; - int fadeCycle; - float fadeClamp; - float fadeAmount; - float fadeInAmount; - float blurRadius; - const char *onOpen; - const char *onClose; - const char *onESC; - XItemKeyHandler *onKey; - XStatement visibleExp; - const char *allowedBinding; - const char *soundName; - int imageTrack; - float focusColor[4]; - float disableColor[4]; - XStatement rectXExp; - XStatement rectYExp; - ItemDef **items; -}; - -struct XColumnInfo -{ - int pos; - int width; - int maxChars; - int alignment; -}; - -struct XListBoxDef -{ - int startPos[4]; - int endPos[4]; - int drawPadding; - float elementWidth; - float elementHeight; - int elementStyle; - int numColumns; - XColumnInfo columnInfo[16]; - const char *doubleClick; - int notselectable; - int noScrollBars; - int usePaging; - float selectBorder[4]; - float disableColor[4]; - Material *selectIcon; -}; - -struct XEditFieldDef -{ - float minVal; - float maxVal; - float defVal; - float range; - int maxChars; - int maxCharsGotoNext; - int maxPaintChars; - int paintOffset; -}; - -struct XMultiDef -{ - QVector dvarListPtrs; - QStringList dvarList; - QVector dvarStrPtrs; - QStringList dvarStr; - QVector dvarValue[32]; - int count; - int strDef; -}; - -union XItemDefData -{ - XListBoxDef *listBox; - XEditFieldDef *editField; - XMultiDef *multi; - const char *enumDvarName; - void *data; -}; - -struct ItemDef -{ - XWindowDef window; - XRectDef textRect[4]; - int type; - int dataType; - int alignment; - int fontEnum; - int textAlignMode; - float textalignx; - float textaligny; - float textscale; - int textStyle; - int gameMsgWindowIndex; - int gameMsgWindowMode; - const char *text; - int itemFlags; - menuDef_t *parent; - const char *mouseEnterText; - const char *mouseExitText; - const char *mouseEnter; - const char *mouseExit; - const char *action; - const char *onAccept; - const char *onFocus; - const char *leaveFocus; - const char *dvar; - const char *dvarTest; - XItemKeyHandler *onKey; - const char *enableDvar; - int dvarFlags; - SoundAliasList *focusSound; - float special; - int cursorPos[4]; - XItemDefData typeData; - int imageTrack; - XStatement visibleExp; - XStatement textExp; - XStatement materialExp; - XStatement rectXExp; - XStatement rectYExp; - XStatement rectWExp; - XStatement rectHExp; - XStatement forecolorAExp; -}; - -struct MenuList -{ - qint32 namePtr; - QString name; - int menuCount; - qint32 menusPtr; - QVector menus; -}; - -struct XLocalizeEntry -{ - qint32 valuePtr; - QString value; - - qint32 namePtr; - QString name; -}; - -enum WeaponType : __int32 -{ - WEAPTYPE_BULLET = 0x0, - WEAPTYPE_GRENADE = 0x1, - WEAPTYPE_PROJECTILE = 0x2, - WEAPTYPE_BINOCULARS = 0x3, - WEAPTYPE_NUM = 0x4, -}; - -enum WeaponClass : __int32 -{ - WEAPCLASS_RIFLE = 0x0, - WEAPCLASS_MG = 0x1, - WEAPCLASS_SMG = 0x2, - WEAPCLASS_SPREAD = 0x3, - WEAPCLASS_PISTOL = 0x4, - WEAPCLASS_GRENADE = 0x5, - WEAPCLASS_ROCKETLAUNCHER = 0x6, - WEAPCLASS_TURRET = 0x7, - WEAPCLASS_NON_PLAYER = 0x8, - WEAPCLASS_ITEM = 0x9, - WEAPCLASS_NUM = 0xA, -}; - -enum PenetrateType : __int32 -{ - PENETRATE_TYPE_NONE = 0x0, - PENETRATE_TYPE_SMALL = 0x1, - PENETRATE_TYPE_MEDIUM = 0x2, - PENETRATE_TYPE_LARGE = 0x3, - PENETRATE_TYPE_COUNT = 0x4, -}; - -enum ImpactType : __int32 -{ - IMPACT_TYPE_NONE = 0x0, - IMPACT_TYPE_BULLET_SMALL = 0x1, - IMPACT_TYPE_BULLET_LARGE = 0x2, - IMPACT_TYPE_BULLET_AP = 0x3, - IMPACT_TYPE_SHOTGUN = 0x4, - IMPACT_TYPE_GRENADE_BOUNCE = 0x5, - IMPACT_TYPE_GRENADE_EXPLODE = 0x6, - IMPACT_TYPE_ROCKET_EXPLODE = 0x7, - IMPACT_TYPE_PROJECTILE_DUD = 0x8, - IMPACT_TYPE_COUNT = 0x9, -}; - -enum WeaponInventoryType : __int32 -{ - WEAPINVENTORY_PRIMARY = 0x0, - WEAPINVENTORY_OFFHAND = 0x1, - WEAPINVENTORY_ITEM = 0x2, - WEAPINVENTORY_ALTMODE = 0x3, - WEAPINVENTORYCOUNT = 0x4, -}; - -enum WeaponFireType : __int32 -{ - WEAPON_FIRETYPE_FULLAUTO = 0x0, - WEAPON_FIRETYPE_SINGLESHOT = 0x1, - WEAPON_FIRETYPE_BURSTFIRE2 = 0x2, - WEAPON_FIRETYPE_BURSTFIRE3 = 0x3, - WEAPON_FIRETYPE_BURSTFIRE4 = 0x4, - WEAPON_FIRETYPECOUNT = 0x5, -}; - -enum OffhandClass : __int32 -{ - OFFHAND_CLASS_NONE = 0x0, - OFFHAND_CLASS_FRAG_GRENADE = 0x1, - OFFHAND_CLASS_SMOKE_GRENADE = 0x2, - OFFHAND_CLASS_FLASH_GRENADE = 0x3, - OFFHAND_CLASS_COUNT = 0x4, -}; - -enum WeaponStance : __int32 -{ - WEAPSTANCE_STAND = 0x0, - WEAPSTANCE_DUCK = 0x1, - WEAPSTANCE_PRONE = 0x2, - WEAPSTANCE_NUM = 0x3, -}; - -enum ActiveReticleType : __int32 -{ - VEH_ACTIVE_RETICLE_NONE = 0x0, - VEH_ACTIVE_RETICLE_PIP_ON_A_STICK = 0x1, - VEH_ACTIVE_RETICLE_BOUNCING_DIAMOND = 0x2, - VEH_ACTIVE_RETICLE_COUNT = 0x3, -}; - -enum WeaponIconRatioType : __int32 -{ - WEAPON_ICON_RATIO_1TO1 = 0x0, - WEAPON_ICON_RATIO_2TO1 = 0x1, - WEAPON_ICON_RATIO_4TO1 = 0x2, - WEAPON_ICON_RATIO_COUNT = 0x3, -}; - -enum AmmoCounterClipType : __int32 -{ - AMMO_COUNTER_CLIP_NONE = 0x0, - AMMO_COUNTER_CLIP_MAGAZINE = 0x1, - AMMO_COUNTER_CLIP_SHORTMAGAZINE = 0x2, - AMMO_COUNTER_CLIP_SHOTGUN = 0x3, - AMMO_COUNTER_CLIP_ROCKET = 0x4, - AMMO_COUNTER_CLIP_BELTFED = 0x5, - AMMO_COUNTER_CLIP_ALTWEAPON = 0x6, - AMMO_COUNTER_CLIP_COUNT = 0x7, -}; - -enum WeaponOverlayReticle : __int32 -{ - WEAPOVERLAYRETICLE_NONE = 0x0, - WEAPOVERLAYRETICLE_CROSSHAIR = 0x1, - WEAPOVERLAYRETICLE_NUM = 0x2, -}; - -enum WeapOverlayInteface_t : __int32 -{ - WEAPOVERLAYINTERFACE_NONE = 0x0, - WEAPOVERLAYINTERFACE_JAVELIN = 0x1, - WEAPOVERLAYINTERFACE_TURRETSCOPE = 0x2, - WEAPOVERLAYINTERFACECOUNT = 0x3, -}; - -enum WeaponProjExposion : __int32 -{ - WEAPPROJEXP_GRENADE = 0x0, - WEAPPROJEXP_ROCKET = 0x1, - WEAPPROJEXP_FLASHBANG = 0x2, - WEAPPROJEXP_NONE = 0x3, - WEAPPROJEXP_DUD = 0x4, - WEAPPROJEXP_SMOKE = 0x5, - WEAPPROJEXP_HEAVY = 0x6, - WEAPPROJEXP_NUM = 0x7, -}; - -enum WeapStickinessType : __int32 -{ - WEAPSTICKINESS_NONE = 0x0, - WEAPSTICKINESS_ALL = 0x1, - WEAPSTICKINESS_GROUND = 0x2, - WEAPSTICKINESS_GROUND_WITH_YAW = 0x3, - WEAPSTICKINESS_COUNT = 0x4, -}; - -enum GuidedMissileType : __int32 -{ - MISSILE_GUIDANCE_NONE = 0x0, - MISSILE_GUIDANCE_SIDEWINDER = 0x1, - MISSILE_GUIDANCE_HELLFIRE = 0x2, - MISSILE_GUIDANCE_JAVELIN = 0x3, - MISSILE_GUIDANCE_COUNT = 0x4, -}; - -struct WeaponDef -{ - qint32 szInternalNamePtr; - QString szInternalName; - - qint32 szDisplayNamePtr; - QString szDisplayName; - - qint32 szOverlayNamePtr; - QString szOverlayName; - - qint32 gunXModelPtr; - QVector gunXModel; - - qint32 handXModelPtr; - XModel handXModel; - - qint32 szXAnimsPtr[33]; - QStringList szXAnims; - - qint32 szModeNamePtr; - QString szModeName; - - quint16 hideTags[8]; - quint16 notetrackSoundMapKeys[16]; - quint16 notetrackSoundMapValues[16]; - int playerAnimType; - WeaponType weapType; - WeaponClass weapClass; - PenetrateType penetrateType; - ImpactType impactType; - WeaponInventoryType inventoryType; - WeaponFireType fireType; - OffhandClass offhandClass; - WeaponStance stance; - - qint32 viewFlashEffectPtr; - FxEffectDef viewFlashEffect; - - qint32 worldFlashEffectPtr; - FxEffectDef worldFlashEffect; - - qint32 pickupSoundPtr; - SoundAliasList pickupSound; - - qint32 pickupSoundPlayerPtr; - SoundAliasList pickupSoundPlayer; - - qint32 ammoPickupSoundPtr; - SoundAliasList ammoPickupSound; - - qint32 ammoPickupSoundPlayerPtr; - SoundAliasList ammoPickupSoundPlayer; - - qint32 projectileSoundPtr; - SoundAliasList projectileSound; - - qint32 pullbackSoundPtr; - SoundAliasList pullbackSound; - - qint32 pullbackSoundPlayerPtr; - SoundAliasList pullbackSoundPlayer; - - qint32 fireSoundPtr; - SoundAliasList fireSound; - - qint32 fireSoundPlayerPtr; - SoundAliasList fireSoundPlayer; - - qint32 fireLoopSoundPtr; - SoundAliasList fireLoopSound; - - qint32 fireLoopSoundPlayerPtr; - SoundAliasList fireLoopSoundPlayer; - - qint32 fireStopSoundPtr; - SoundAliasList fireStopSound; - - qint32 fireStopSoundPlayerPtr; - SoundAliasList fireStopSoundPlayer; - - qint32 fireLastSoundPtr; - SoundAliasList fireLastSound; - - qint32 fireLastSoundPlayerPtr; - SoundAliasList fireLastSoundPlayer; - - qint32 emptyFireSoundPtr; - SoundAliasList emptyFireSound; - - qint32 emptyFireSoundPlayerPtr; - SoundAliasList emptyFireSoundPlayer; - - qint32 meleeSwipeSoundPtr; - SoundAliasList meleeSwipeSound; - - qint32 meleeSwipeSoundPlayerPtr; - SoundAliasList meleeSwipeSoundPlayer; - - qint32 meleeHitSoundPtr; - SoundAliasList meleeHitSound; - - qint32 meleeMissSoundPtr; - SoundAliasList meleeMissSound; - - qint32 rechamberSoundPtr; - SoundAliasList rechamberSound; - - qint32 rechamberSoundPlayerPtr; - SoundAliasList rechamberSoundPlayer; - - qint32 reloadSoundPtr; - SoundAliasList reloadSound; - - qint32 reloadSoundPlayerPtr; - SoundAliasList reloadSoundPlayer; - - qint32 reloadEmptySoundPtr; - SoundAliasList reloadEmptySound; - - qint32 reloadEmptySoundPlayerPtr; - SoundAliasList reloadEmptySoundPlayer; - - qint32 reloadStartSoundPtr; - SoundAliasList reloadStartSound; - - qint32 reloadStartSoundPlayerPtr; - SoundAliasList reloadStartSoundPlayer; - - qint32 reloadEndSoundPtr; - SoundAliasList reloadEndSound; - - qint32 reloadEndSoundPlayerPtr; - SoundAliasList reloadEndSoundPlayer; - - qint32 detonateSoundPtr; - SoundAliasList detonateSound; - - qint32 detonateSoundPlayerPtr; - SoundAliasList detonateSoundPlayer; - - qint32 nightVisionWearSoundPtr; - SoundAliasList nightVisionWearSound; - - qint32 nightVisionWearSoundPlayerPtr; - SoundAliasList nightVisionWearSoundPlayer; - - qint32 nightVisionRemoveSoundPtr; - SoundAliasList nightVisionRemoveSound; - - qint32 nightVisionRemoveSoundPlayerPtr; - SoundAliasList nightVisionRemoveSoundPlayer; - - qint32 altSwitchSoundPtr; - SoundAliasList altSwitchSound; - - qint32 altSwitchSoundPlayerPtr; - SoundAliasList altSwitchSoundPlayer; - - qint32 raiseSoundPtr; - SoundAliasList raiseSound; - - qint32 raiseSoundPlayerPtr; - SoundAliasList raiseSoundPlayer; - - qint32 firstRaiseSoundPtr; - SoundAliasList firstRaiseSound; - - qint32 firstRaiseSoundPlayerPtr; - SoundAliasList firstRaiseSoundPlayer; - - qint32 putawaySoundPtr; - SoundAliasList putawaySound; - - qint32 putawaySoundPlayerPtr; - SoundAliasList putawaySoundPlayer; - - qint32 bounceSoundPtr; - SoundAliasList *bounceSound; - - qint32 viewShellEjectEffectPtr; - FxEffectDef viewShellEjectEffect; - - qint32 worldShellEjectEffectPtr; - FxEffectDef worldShellEjectEffect; - - qint32 viewLastShotEjectEffectPtr; - FxEffectDef viewLastShotEjectEffect; - - qint32 worldLastShotEjectEffectPtr; - FxEffectDef worldLastShotEjectEffect; - - qint32 reticleCenterPtr; - Material reticleCenter; - - qint32 reticleSidePtr; - Material reticleSide; - - int iReticleCenterSize; - int iReticleSideSize; - int iReticleMinOfs; - ActiveReticleType activeReticleType; - float vStandMove[3]; - float vStandRot[3]; - float vDuckedOfs[3]; - float vDuckedMove[3]; - float vDuckedRot[3]; - float vProneOfs[3]; - float vProneMove[3]; - float vProneRot[3]; - float fPosMoveRate; - float fPosProneMoveRate; - float fStandMoveMinSpeed; - float fDuckedMoveMinSpeed; - float fProneMoveMinSpeed; - float fPosRotRate; - float fPosProneRotRate; - float fStandRotMinSpeed; - float fDuckedRotMinSpeed; - float fProneRotMinSpeed; - - qint32 worldModelPtr; - QVector worldModel; - - qint32 worldClipModelPtr; - XModel worldClipModel; - - qint32 rocketModelPtr; - XModel rocketModel; - - qint32 knifeModelPtr; - XModel knifeModel; - - qint32 worldKnifeModelPtr; - XModel worldKnifeModel; - - qint32 hudIconPtr; - Material hudIcon; - WeaponIconRatioType hudIconRatio; - - qint32 ammoCounterIconPtr; - Material ammoCounterIcon; - - WeaponIconRatioType ammoCounterIconRatio; - AmmoCounterClipType ammoCounterClip; - int iStartAmmo; - - qint32 szAmmoNamePtr; - QString szAmmoName; - int iAmmoIndex; - - qint32 szClipNamePtr; - QString szClipName; - - int iClipIndex; - int iMaxAmmo; - int iClipSize; - int shotCount; - - qint32 szSharedAmmoCapNamePtr; - QString szSharedAmmoCapName; - - int iSharedAmmoCapIndex; - int iSharedAmmoCap; - int damage; - int playerDamage; - int iMeleeDamage; - int iDamageType; - int iFireDelay; - int iMeleeDelay; - int meleeChargeDelay; - int iDetonateDelay; - int iFireTime; - int iRechamberTime; - int iRechamberBoltTime; - int iHoldFireTime; - int iDetonateTime; - int iMeleeTime; - int meleeChargeTime; - int iReloadTime; - int reloadShowRocketTime; - int iReloadEmptyTime; - int iReloadAddTime; - int iReloadStartTime; - int iReloadStartAddTime; - int iReloadEndTime; - int iDropTime; - int iRaiseTime; - int iAltDropTime; - int iAltRaiseTime; - int quickDropTime; - int quickRaiseTime; - int iFirstRaiseTime; - int iEmptyRaiseTime; - int iEmptyDropTime; - int sprintInTime; - int sprintLoopTime; - int sprintOutTime; - int nightVisionWearTime; - int nightVisionWearTimeFadeOutEnd; - int nightVisionWearTimePowerUp; - int nightVisionRemoveTime; - int nightVisionRemoveTimePowerDown; - int nightVisionRemoveTimeFadeInStart; - int fuseTime; - int aiFuseTime; - int requireLockonToFire; - int noAdsWhenMagEmpty; - int avoidDropCleanup; - float autoAimRange; - float aimAssistRange; - float aimAssistRangeAds; - float aimPadding; - float enemyCrosshairRange; - int crosshairColorChange; - float moveSpeedScale; - float adsMoveSpeedScale; - float sprintDurationScale; - float fAdsZoomFov; - float fAdsZoomInFrac; - float fAdsZoomOutFrac; - - qint32 overlayMaterialPtr; - Material overlayMaterial; - - qint32 overlayMaterialLowResPtr; - Material overlayMaterialLowRes; - - WeaponOverlayReticle overlayReticle; - WeapOverlayInteface_t overlayInterface; - float overlayWidth; - float overlayHeight; - float fAdsBobFactor; - float fAdsViewBobMult; - float fHipSpreadStandMin; - float fHipSpreadDuckedMin; - float fHipSpreadProneMin; - float hipSpreadStandMax; - float hipSpreadDuckedMax; - float hipSpreadProneMax; - float fHipSpreadDecayRate; - float fHipSpreadFireAdd; - float fHipSpreadTurnAdd; - float fHipSpreadMoveAdd; - float fHipSpreadDuckedDecay; - float fHipSpreadProneDecay; - float fHipReticleSidePos; - int iAdsTransInTime; - int iAdsTransOutTime; - float fAdsIdleAmount; - float fHipIdleAmount; - float adsIdleSpeed; - float hipIdleSpeed; - float fIdleCrouchFactor; - float fIdleProneFactor; - float fGunMaxPitch; - float fGunMaxYaw; - float swayMaxAngle; - float swayLerpSpeed; - float swayPitchScale; - float swayYawScale; - float swayHorizScale; - float swayVertScale; - float swayShellShockScale; - float adsSwayMaxAngle; - float adsSwayLerpSpeed; - float adsSwayPitchScale; - float adsSwayYawScale; - float adsSwayHorizScale; - float adsSwayVertScale; - int bRifleBullet; - int armorPiercing; - int bBoltAction; - int aimDownSight; - int bRechamberWhileAds; - float adsViewErrorMin; - float adsViewErrorMax; - int bCookOffHold; - int bClipOnly; - int adsFireOnly; - int cancelAutoHolsterWhenEmpty; - int suppressAmmoReserveDisplay; - int enhanced; - int laserSightDuringNightvision; - - qint32 killIconPtr; - Material killIcon; - WeaponIconRatioType killIconRatio; - int flipKillIcon; - - qint32 dpadIconPtr; - Material dpadIcon; - - WeaponIconRatioType dpadIconRatio; - int bNoPartialReload; - int bSegmentedReload; - int iReloadAmmoAdd; - int iReloadStartAdd; - - qint32 szAltWeaponNamePtr; - QString szAltWeaponName; - - uint altWeaponIndex; - int iDropAmmoMin; - int iDropAmmoMax; - int blocksProne; - int silenced; - int iExplosionRadius; - int iExplosionRadiusMin; - int iExplosionInnerDamage; - int iExplosionOuterDamage; - float damageConeAngle; - int iProjectileSpeed; - int iProjectileSpeedUp; - int iProjectileSpeedForward; - int iProjectileActivateDist; - float projLifetime; - float timeToAccelerate; - float projectileCurvature; - - qint32 projectileModelPtr; - XModel projectileModel; - WeaponProjExposion projExplosion; - - qint32 projExplosionEffectPtr; - FxEffectDef projExplosionEffect; - int projExplosionEffectForceNormalUp; - - qint32 projDudEffectPtr; - FxEffectDef projDudEffect; - - qint32 projExplosionSoundPtr; - SoundAliasList projExplosionSound; - - qint32 projDudSoundPtr; - SoundAliasList projDudSound; - - int bProjImpactExplode; - WeapStickinessType stickiness; - int hasDetonator; - int timedDetonation; - int rotate; - int holdButtonToThrow; - int freezeMovementWhenFiring; - float lowAmmoWarningThreshold; - float parallelBounce[29]; - float perpendicularBounce[29]; - - qint32 projTrailEffectPtr; - FxEffectDef projTrailEffect; - - float vProjectileColor[3]; - GuidedMissileType guidedMissileType; - float maxSteeringAccel; - int projIgnitionDelay; - FxEffectDef projIgnitionEffect; - - qint32 projIgnitionSoundPtr; - SoundAliasList projIgnitionSound; - - float fAdsAimPitch; - float fAdsCrosshairInFrac; - float fAdsCrosshairOutFrac; - int adsGunKickReducedKickBullets; - float adsGunKickReducedKickPercent; - float fAdsGunKickPitchMin; - float fAdsGunKickPitchMax; - float fAdsGunKickYawMin; - float fAdsGunKickYawMax; - float fAdsGunKickAccel; - float fAdsGunKickSpeedMax; - float fAdsGunKickSpeedDecay; - float fAdsGunKickStaticDecay; - float fAdsViewKickPitchMin; - float fAdsViewKickPitchMax; - float fAdsViewKickYawMin; - float fAdsViewKickYawMax; - float fAdsViewKickCenterSpeed; - float fAdsViewScatterMin; - float fAdsViewScatterMax; - float fAdsSpread; - int hipGunKickReducedKickBullets; - float hipGunKickReducedKickPercent; - float fHipGunKickPitchMin; - float fHipGunKickPitchMax; - float fHipGunKickYawMin; - float fHipGunKickYawMax; - float fHipGunKickAccel; - float fHipGunKickSpeedMax; - float fHipGunKickSpeedDecay; - float fHipGunKickStaticDecay; - float fHipViewKickPitchMin; - float fHipViewKickPitchMax; - float fHipViewKickYawMin; - float fHipViewKickYawMax; - float fHipViewKickCenterSpeed; - float fHipViewScatterMin; - float fHipViewScatterMax; - float fightDist; - float maxDist; - - qint32 accuracyGraphNamePtr[2]; - QString accuracyGraphName[2]; - - qint32 accuracyGraphKnotsPtr[2]; - float accuracyGraphKnots[2]; - - qint32 originalAccuracyGraphKnotsPtr[2]; - float originalAccuracyGraphKnots[2]; - - int accuracyGraphKnotCount[2]; - int originalAccuracyGraphKnotCount[2]; - int iPositionReloadTransTime; - float leftArc; - float rightArc; - float topArc; - float bottomArc; - float accuracy; - float aiSpread; - float playerSpread; - float minTurnSpeed[2]; - float maxTurnSpeed[2]; - float pitchConvergenceTime; - float yawConvergenceTime; - float suppressTime; - float maxRange; - float fAnimHorRotateInc; - float fPlayerPositionDist; - - qint32 szUseHintStringPtr; - QString szUseHintString; - - qint32 dropHintStringPtr; - QString dropHintString; - - int iUseHintStringIndex; - int dropHintStringIndex; - float horizViewJitter; - float vertViewJitter; - - qint32 szScriptPtr; - const char *szScript; - - float fOOPosAnimLength[2]; - int minDamage; - int minPlayerDamage; - float fMaxDamageRange; - float fMinDamageRange; - float destabilizationRateTime; - float destabilizationCurvatureMax; - int destabilizeDistance; - float locationDamageMultipliers[19]; - - qint32 fireRumblePtr; - QString fireRumble; - - qint32 meleeImpactRumblePtr; - QString meleeImpactRumble; - - float adsDofStart; - float adsDofEnd; -}; - -struct XReverbSettings -{ - uint ReflectionsDelay; - quint8 ReverbDelay; - quint8 RearDelay; - quint8 PositionLeft; - quint8 PositionRight; - quint8 PositionMatrixLeft; - quint8 PositionMatrixRight; - quint8 EarlyDiffusion; - quint8 LateDiffusion; - quint8 LowEQGain; - quint8 LowEQCutoff; - quint8 HighEQGain; - quint8 HighEQCutoff; - float RoomFilterFreq; - float RoomFilterMain; - float RoomFilterHF; - float ReflectionsGain; - float ReverbGain; - float DecayTime; - float Density; - float RoomSize; -}; - -struct XAudioReverbSettings -{ - int presetOverridden; - XReverbSettings reverbSettings; -}; - -struct XSoundDriverGlobals -{ - qint32 reverbSettingsPtr; - XAudioReverbSettings reverbSettings; - qint32 namePtr; - QString name; -}; - -struct FxImpactEntry -{ - qint32 nonFleshPtrs[29]; - QVector nonflesh; - qint32 fleshPtrs[4]; - QVector flesh; -}; - -struct FxImpactTable -{ - qint32 namePtr; - QString name; - qint32 tablePtr; - QVector table; -}; - -union XAssetHeader -{ - XModelPieces *xmodelPieces; - XPhysPreset *physPreset; - XAnimParts *parts; - XModel *model; - XMaterial *material; - XMaterialPixelShader *pixelShader; - XMaterialVertexShader *vertexShader; - MaterialTechniqueSet *techniqueSet; - XGfxImage *image; - SoundAliasList *sound; - SndCurve *sndCurve; - LoadedSound *loadSnd; - clipMap_t *clipMap; - ComWorld *comWorld; - GameWorldSp *gameWorldSp; - GameWorldMp *gameWorldMp; - MapEnts *mapEnts; - GfxWorld *gfxWorld; - XGfxLightDef *lightDef; - Font_s *font; - MenuList *menuList; - menuDef_t *menu; - XLocalizeEntry *localize; - WeaponDef *weapon; - XSoundDriverGlobals *sndDriverGlobals; - const FxEffectDef *fx; - FxImpactTable *impactFx; - XRawFile *rawfile; - XStringTable *stringTable; - void *data; -}; - -#endif // ASSETS_H diff --git a/libs/xassets/font.cpp b/libs/xassets/font.cpp deleted file mode 100644 index 4d5fdc3..0000000 --- a/libs/xassets/font.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "font.h" diff --git a/libs/xassets/font.h b/libs/xassets/font.h deleted file mode 100644 index 8dd5ec5..0000000 --- a/libs/xassets/font.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef FONT_H -#define FONT_H - -#include "xmaterial.h" - -struct Glyph -{ - unsigned __int16 letter; - char x0; - char y0; - unsigned __int8 dx; - unsigned __int8 pixelWidth; - unsigned __int8 pixelHeight; - float s0; - float t0; - float s1; - float t1; -}; - -struct GameFont -{ - const char *fontName; - int pixelHeight; - int glyphCount; - XMaterial *material; - XMaterial *glowMaterial; - XGlyph *glyphs; -}; - -#endif // FONT_H diff --git a/libs/xassets/gfxworld.cpp b/libs/xassets/gfxworld.cpp deleted file mode 100644 index 621d727..0000000 --- a/libs/xassets/gfxworld.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "gfxworld.h" diff --git a/libs/xassets/gfxworld.h b/libs/xassets/gfxworld.h deleted file mode 100644 index 37419fb..0000000 --- a/libs/xassets/gfxworld.h +++ /dev/null @@ -1,357 +0,0 @@ -#ifndef GFXWORLD_H -#define GFXWORLD_H - -#include "xgfximage.h" -#include "gfxlightdef.h" -#include "xmodel.h" - -struct GfxWorldVertexLayerData -{ - unsigned __int8 *data; - D3DVertexBuffer layerVb; -}; - - -struct GfxWorldDpvsPlanes -{ - int cellCount; - CPlane *planes; - unsigned __int16 *nodes; - unsigned int *sceneEntCellBits; -}; - -struct GfxAabbTree -{ - float mins[3]; - float maxs[3]; - unsigned __int16 childCount; - unsigned __int16 surfaceCount; - unsigned __int16 startSurfIndex; - unsigned __int16 smodelIndexCount; - unsigned __int16 *smodelIndexes; - int childrenOffset; -}; - -struct GfxPortal; -struct GfxPortalWritable -{ - bool isQueued; - bool isAncestor; - unsigned __int8 recursionDepth; - unsigned __int8 hullPointCount; - float (*hullPoints)[2]; - GfxPortal *queuedParent; -}; - -struct DpvsPlane -{ - float coeffs[4]; - unsigned __int8 side[3]; - unsigned __int8 pad; -}; - -struct GfxCell; -struct GfxPortal -{ - GfxPortalWritable writable; - DpvsPlane plane; - GfxCell *cell; - float (*vertices)[3]; - unsigned __int8 vertexCount; - float hullAxis[2][3]; -}; - -struct GfxCell -{ - float mins[3]; - float maxs[3]; - int aabbTreeCount; - GfxAabbTree *aabbTree; - int portalCount; - GfxPortal *portals; - int cullGroupCount; - int *cullGroups; - unsigned __int8 reflectionProbeCount; - unsigned __int8 *reflectionProbes; -}; - -struct GfxLightmapArray -{ - GfxImage *primary; - GfxImage *secondary; -}; - -struct GfxLightGridEntry -{ - unsigned __int16 colorsIndex; - unsigned __int8 primaryLightIndex; - unsigned __int8 needsTrace; -}; - -struct GfxLightGridColors -{ - unsigned __int8 rgb[56][3]; -}; - -struct GfxLightGrid -{ - bool hasLightRegions; - unsigned int sunPrimaryLightIndex; - unsigned __int16 mins[3]; - unsigned __int16 maxs[3]; - unsigned int rowAxis; - unsigned int colAxis; - unsigned __int16 *rowDataStart; - unsigned int rawRowDataSize; - unsigned __int8 *rawRowData; - unsigned int entryCount; - GfxLightGridEntry *entries; - unsigned int colorCount; - GfxLightGridColors *colors; -}; - -struct GfxBrushModelWritable -{ - float mins[3]; - float maxs[3]; -}; - -struct GfxBrushModel -{ - GfxBrushModelWritable writable; - float bounds[2][3]; - unsigned int surfaceCount; - unsigned int startSurfIndex; -}; - -struct MaterialMemory -{ - Material *material; - int memory; -}; - -struct sunflare_t -{ - bool hasValidData; - Material *spriteMaterial; - Material *flareMaterial; - float spriteSize; - float flareMinSize; - float flareMinDot; - float flareMaxSize; - float flareMaxDot; - float flareMaxAlpha; - int flareFadeInTime; - int flareFadeOutTime; - float blindMinDot; - float blindMaxDot; - float blindMaxDarken; - int blindFadeInTime; - int blindFadeOutTime; - float glareMinDot; - float glareMaxDot; - float glareMaxLighten; - int glareFadeInTime; - int glareFadeOutTime; - float sunFxPosition[3]; -}; - -struct XModelDrawInfo -{ - unsigned __int16 lod; - unsigned __int16 surfId; -}; - -struct GfxSceneDynModel -{ - XModelDrawInfo info; - unsigned __int16 dynEntId; -}; - -struct BModelDrawInfo -{ - unsigned __int16 surfId; -}; - -struct GfxSceneDynBrush -{ - BModelDrawInfo info; - unsigned __int16 dynEntId; -}; - -struct GfxShadowGeometry -{ - unsigned __int16 surfaceCount; - unsigned __int16 smodelCount; - unsigned __int16 *sortedSurfIndex; - unsigned __int16 *smodelIndex; -}; - -struct GfxLightRegionAxis -{ - float dir[3]; - float midPoint; - float halfSize; -}; - -struct GfxLightRegionHull -{ - float kdopMidPoint[9]; - float kdopHalfSize[9]; - unsigned int axisCount; - GfxLightRegionAxis *axis; -}; - -struct GfxLightRegion -{ - unsigned int hullCount; - GfxLightRegionHull *hulls; -}; - -struct GfxStaticModelInst -{ - float mins[3]; - float maxs[3]; - GfxColor groundLighting; -}; - -struct srfTriangles_t -{ - int vertexLayerData; - int firstVertex; - unsigned __int16 vertexCount; - unsigned __int16 triCount; - int baseIndex; - float topMipMins[3]; - float topMipMaxs[3]; -}; - -struct GfxSurface -{ - srfTriangles_t tris; - Material *material; - unsigned __int8 lightmapIndex; - unsigned __int8 reflectionProbeIndex; - unsigned __int8 primaryLightIndex; - bool castsSunShadow; - float bounds[2][3]; -}; - -struct GfxCullGroup -{ - float mins[3]; - float maxs[3]; - int surfaceCount; - int startSurfIndex; -}; - -struct GfxPackedPlacement -{ - float origin[3]; - PackedUnitVec axis[3]; - float scale; -}; - -struct GfxStaticModelDrawInst -{ - float cullDist; - GfxPackedPlacement placement; - Model *model; - unsigned __int8 reflectionProbeIndex; - unsigned __int8 primaryLightIndex; - unsigned __int16 lightingHandle; - unsigned __int8 flags; -}; - -struct GfxWorldDpvsStatic -{ - unsigned int smodelCount; - unsigned int staticSurfaceCount; - unsigned int litSurfsBegin; - unsigned int litSurfsEnd; - unsigned int decalSurfsBegin; - unsigned int decalSurfsEnd; - unsigned int emissiveSurfsBegin; - unsigned int emissiveSurfsEnd; - unsigned int smodelVisDataCount; - unsigned int surfaceVisDataCount; - unsigned __int8 *smodelVisData[3]; - unsigned __int8 *surfaceVisData[3]; - unsigned int *lodData; - unsigned __int16 *sortedSurfIndex; - GfxStaticModelInst *smodelInsts; - GfxSurface *surfaces; - GfxCullGroup *cullGroups; - GfxStaticModelDrawInst *smodelDrawInsts; - GfxDrawSurfFields *surfaceMaterials; - unsigned int *surfaceCastsSunShadow; - volatile int usageCount; -}; - -struct GfxWorldDpvsDynamic -{ - unsigned int dynEntClientWordCount[2]; - unsigned int dynEntClientCount[2]; - unsigned int *dynEntCellBits[2]; - unsigned __int8 *dynEntVisData[2][3]; -}; - -struct GfxWorld -{ - const char *name; - const char *baseName; - int planeCount; - int nodeCount; - int indexCount; - unsigned __int16 *indices; - D3DIndexBuffer indexBuffer; - int surfaceCount; - GfxWorldStreamInfo streamInfo; - int skySurfCount; - int *skyStartSurfs; - GfxImage *skyImage; - unsigned __int8 skySamplerState; - unsigned int vertexCount; - GfxWorldVertexData vd; - unsigned int vertexLayerDataSize; - GfxWorldVertexLayerData vld; - SunLightParseParams sunParse; - GfxLight *sunLight; - float sunColorFromBsp[3]; - unsigned int sunPrimaryLightIndex; - unsigned int primaryLightCount; - int cullGroupCount; - unsigned int reflectionProbeCount; - GfxReflectionProbe *reflectionProbes; - GfxTexture *reflectionProbeTextures; - GfxWorldDpvsPlanes dpvsPlanes; - int cellBitsCount; - GfxCell *cells; - int lightmapCount; - GfxLightmapArray *lightmaps; - GfxLightGrid lightGrid; - GfxTexture *lightmapPrimaryTextures; - GfxTexture *lightmapSecondaryTextures; - int modelCount; - GfxBrushModel *models; - float mins[3]; - float maxs[3]; - unsigned int checksum; - int materialMemoryCount; - MaterialMemory *materialMemory; - sunflare_t sun; - float outdoorLookupMatrix[4][4]; - GfxImage *outdoorImage; - unsigned int *cellCasterBits; - GfxSceneDynModel *sceneDynModel; - GfxSceneDynBrush *sceneDynBrush; - unsigned int *primaryLightEntityShadowVis; - unsigned int *primaryLightDynEntShadowVis[2]; - unsigned __int8 *nonSunPrimaryLightForModelDynEnt; - GfxShadowGeometry *shadowGeom; - GfxLightRegion *lightRegion; - GfxWorldDpvsStatic dpvs; - GfxWorldDpvsDynamic dpvsDyn; -}; - -#endif // GFXWORLD_H diff --git a/libs/xassets/materialtechset.cpp b/libs/xassets/materialtechset.cpp deleted file mode 100644 index fadfbe0..0000000 --- a/libs/xassets/materialtechset.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "materialtechset.h" diff --git a/libs/xassets/materialtechset.h b/libs/xassets/materialtechset.h deleted file mode 100644 index af66f27..0000000 --- a/libs/xassets/materialtechset.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef MATERIALTECHSET_H -#define MATERIALTECHSET_H - -#include "xasset.h" - -#include - -class XMaterialTechnique; - -class XMaterialTechSet : public XAsset -{ -public: - explicit XMaterialTechSet(); - - virtual void ParseData(QDataStream* aStream) override; - virtual void Clear() override; - -private: - QString mName; - int mWorldVertFormat; - - qint32 mRemappedPtr; - XMaterialTechSet* mRemappedTechniqueSet; - - QVector mTechPtrs; - QVector mTechniques; -}; - -#endif // MATERIALTECHSET_H diff --git a/libs/xassets/weapondef.cpp b/libs/xassets/weapondef.cpp deleted file mode 100644 index a292c6f..0000000 --- a/libs/xassets/weapondef.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "weapondef.h" diff --git a/libs/xassets/weapondef.h b/libs/xassets/weapondef.h deleted file mode 100644 index 7dbeea4..0000000 --- a/libs/xassets/weapondef.h +++ /dev/null @@ -1,531 +0,0 @@ -#ifndef WEAPONDEF_H -#define WEAPONDEF_H - -#include "clipmap.h" -#include "soundalias.h" -#include "xmodel.h" - -enum WeaponType : __int32 -{ - WEAPTYPE_BULLET = 0x0, - WEAPTYPE_GRENADE = 0x1, - WEAPTYPE_PROJECTILE = 0x2, - WEAPTYPE_BINOCULARS = 0x3, - WEAPTYPE_NUM = 0x4, -}; - -enum WeaponClass : __int32 -{ - WEAPCLASS_RIFLE = 0x0, - WEAPCLASS_MG = 0x1, - WEAPCLASS_SMG = 0x2, - WEAPCLASS_SPREAD = 0x3, - WEAPCLASS_PISTOL = 0x4, - WEAPCLASS_GRENADE = 0x5, - WEAPCLASS_ROCKETLAUNCHER = 0x6, - WEAPCLASS_TURRET = 0x7, - WEAPCLASS_NON_PLAYER = 0x8, - WEAPCLASS_ITEM = 0x9, - WEAPCLASS_NUM = 0xA, -}; - -enum PenetrateType : __int32 -{ - PENETRATE_TYPE_NONE = 0x0, - PENETRATE_TYPE_SMALL = 0x1, - PENETRATE_TYPE_MEDIUM = 0x2, - PENETRATE_TYPE_LARGE = 0x3, - PENETRATE_TYPE_COUNT = 0x4, -}; - -enum ImpactType : __int32 -{ - IMPACT_TYPE_NONE = 0x0, - IMPACT_TYPE_BULLET_SMALL = 0x1, - IMPACT_TYPE_BULLET_LARGE = 0x2, - IMPACT_TYPE_BULLET_AP = 0x3, - IMPACT_TYPE_SHOTGUN = 0x4, - IMPACT_TYPE_GRENADE_BOUNCE = 0x5, - IMPACT_TYPE_GRENADE_EXPLODE = 0x6, - IMPACT_TYPE_ROCKET_EXPLODE = 0x7, - IMPACT_TYPE_PROJECTILE_DUD = 0x8, - IMPACT_TYPE_COUNT = 0x9, -}; - -enum WeaponInventoryType : __int32 -{ - WEAPINVENTORY_PRIMARY = 0x0, - WEAPINVENTORY_OFFHAND = 0x1, - WEAPINVENTORY_ITEM = 0x2, - WEAPINVENTORY_ALTMODE = 0x3, - WEAPINVENTORYCOUNT = 0x4, -}; - -enum WeaponFireType : __int32 -{ - WEAPON_FIRETYPE_FULLAUTO = 0x0, - WEAPON_FIRETYPE_SINGLESHOT = 0x1, - WEAPON_FIRETYPE_BURSTFIRE2 = 0x2, - WEAPON_FIRETYPE_BURSTFIRE3 = 0x3, - WEAPON_FIRETYPE_BURSTFIRE4 = 0x4, - WEAPON_FIRETYPECOUNT = 0x5, -}; - -enum OffhandClass : __int32 -{ - OFFHAND_CLASS_NONE = 0x0, - OFFHAND_CLASS_FRAG_GRENADE = 0x1, - OFFHAND_CLASS_SMOKE_GRENADE = 0x2, - OFFHAND_CLASS_FLASH_GRENADE = 0x3, - OFFHAND_CLASS_COUNT = 0x4, -}; - -enum WeaponStance : __int32 -{ - WEAPSTANCE_STAND = 0x0, - WEAPSTANCE_DUCK = 0x1, - WEAPSTANCE_PRONE = 0x2, - WEAPSTANCE_NUM = 0x3, -}; - -enum ActiveReticleType : __int32 -{ - VEH_ACTIVE_RETICLE_NONE = 0x0, - VEH_ACTIVE_RETICLE_PIP_ON_A_STICK = 0x1, - VEH_ACTIVE_RETICLE_BOUNCING_DIAMOND = 0x2, - VEH_ACTIVE_RETICLE_COUNT = 0x3, -}; - -enum WeaponIconRatioType : __int32 -{ - WEAPON_ICON_RATIO_1TO1 = 0x0, - WEAPON_ICON_RATIO_2TO1 = 0x1, - WEAPON_ICON_RATIO_4TO1 = 0x2, - WEAPON_ICON_RATIO_COUNT = 0x3, -}; - -enum AmmoCounterClipType : __int32 -{ - AMMO_COUNTER_CLIP_NONE = 0x0, - AMMO_COUNTER_CLIP_MAGAZINE = 0x1, - AMMO_COUNTER_CLIP_SHORTMAGAZINE = 0x2, - AMMO_COUNTER_CLIP_SHOTGUN = 0x3, - AMMO_COUNTER_CLIP_ROCKET = 0x4, - AMMO_COUNTER_CLIP_BELTFED = 0x5, - AMMO_COUNTER_CLIP_ALTWEAPON = 0x6, - AMMO_COUNTER_CLIP_COUNT = 0x7, -}; - -enum WeaponOverlayReticle : __int32 -{ - WEAPOVERLAYRETICLE_NONE = 0x0, - WEAPOVERLAYRETICLE_CROSSHAIR = 0x1, - WEAPOVERLAYRETICLE_NUM = 0x2, -}; - -enum WeapOverlayInteface_t : __int32 -{ - WEAPOVERLAYINTERFACE_NONE = 0x0, - WEAPOVERLAYINTERFACE_JAVELIN = 0x1, - WEAPOVERLAYINTERFACE_TURRETSCOPE = 0x2, - WEAPOVERLAYINTERFACECOUNT = 0x3, -}; - -enum WeaponProjExposion : __int32 -{ - WEAPPROJEXP_GRENADE = 0x0, - WEAPPROJEXP_ROCKET = 0x1, - WEAPPROJEXP_FLASHBANG = 0x2, - WEAPPROJEXP_NONE = 0x3, - WEAPPROJEXP_DUD = 0x4, - WEAPPROJEXP_SMOKE = 0x5, - WEAPPROJEXP_HEAVY = 0x6, - WEAPPROJEXP_NUM = 0x7, -}; - -enum WeapStickinessType : __int32 -{ - WEAPSTICKINESS_NONE = 0x0, - WEAPSTICKINESS_ALL = 0x1, - WEAPSTICKINESS_GROUND = 0x2, - WEAPSTICKINESS_GROUND_WITH_YAW = 0x3, - WEAPSTICKINESS_COUNT = 0x4, -}; - -enum GuidedMissileType : __int32 -{ - MISSILE_GUIDANCE_NONE = 0x0, - MISSILE_GUIDANCE_SIDEWINDER = 0x1, - MISSILE_GUIDANCE_HELLFIRE = 0x2, - MISSILE_GUIDANCE_JAVELIN = 0x3, - MISSILE_GUIDANCE_COUNT = 0x4, -}; - -struct WeaponDef -{ - const char *szInternalName; - const char *szDisplayName; - const char *szOverlayName; - Model *gunXModel[16]; - Model *handXModel; - const char *szXAnims[33]; - const char *szModeName; - unsigned __int16 hideTags[8]; - unsigned __int16 notetrackSoundMapKeys[16]; - unsigned __int16 notetrackSoundMapValues[16]; - int playerAnimType; - WeaponType weapType; - WeaponClass weapClass; - PenetrateType penetrateType; - ImpactType impactType; - WeaponInventoryType inventoryType; - WeaponFireType fireType; - OffhandClass offhandClass; - WeaponStance stance; - const EffectDef *viewFlashEffect; - const EffectDef *worldFlashEffect; - SoundAliasList *pickupSound; - SoundAliasList *pickupSoundPlayer; - SoundAliasList *ammoPickupSound; - SoundAliasList *ammoPickupSoundPlayer; - SoundAliasList *projectileSound; - SoundAliasList *pullbackSound; - SoundAliasList *pullbackSoundPlayer; - SoundAliasList *fireSound; - SoundAliasList *fireSoundPlayer; - SoundAliasList *fireLoopSound; - SoundAliasList *fireLoopSoundPlayer; - SoundAliasList *fireStopSound; - SoundAliasList *fireStopSoundPlayer; - SoundAliasList *fireLastSound; - SoundAliasList *fireLastSoundPlayer; - SoundAliasList *emptyFireSound; - SoundAliasList *emptyFireSoundPlayer; - SoundAliasList *meleeSwipeSound; - SoundAliasList *meleeSwipeSoundPlayer; - SoundAliasList *meleeHitSound; - SoundAliasList *meleeMissSound; - SoundAliasList *rechamberSound; - SoundAliasList *rechamberSoundPlayer; - SoundAliasList *reloadSound; - SoundAliasList *reloadSoundPlayer; - SoundAliasList *reloadEmptySound; - SoundAliasList *reloadEmptySoundPlayer; - SoundAliasList *reloadStartSound; - SoundAliasList *reloadStartSoundPlayer; - SoundAliasList *reloadEndSound; - SoundAliasList *reloadEndSoundPlayer; - SoundAliasList *detonateSound; - SoundAliasList *detonateSoundPlayer; - SoundAliasList *nightVisionWearSound; - SoundAliasList *nightVisionWearSoundPlayer; - SoundAliasList *nightVisionRemoveSound; - SoundAliasList *nightVisionRemoveSoundPlayer; - SoundAliasList *altSwitchSound; - SoundAliasList *altSwitchSoundPlayer; - SoundAliasList *raiseSound; - SoundAliasList *raiseSoundPlayer; - SoundAliasList *firstRaiseSound; - SoundAliasList *firstRaiseSoundPlayer; - SoundAliasList *putawaySound; - SoundAliasList *putawaySoundPlayer; - SoundAliasList **bounceSound; - const EffectDef *viewShellEjectEffect; - const EffectDef *worldShellEjectEffect; - const EffectDef *viewLastShotEjectEffect; - const EffectDef *worldLastShotEjectEffect; - Material *reticleCenter; - Material *reticleSide; - int iReticleCenterSize; - int iReticleSideSize; - int iReticleMinOfs; - ActiveReticleType activeReticleType; - float vStandMove[3]; - float vStandRot[3]; - float vDuckedOfs[3]; - float vDuckedMove[3]; - float vDuckedRot[3]; - float vProneOfs[3]; - float vProneMove[3]; - float vProneRot[3]; - float fPosMoveRate; - float fPosProneMoveRate; - float fStandMoveMinSpeed; - float fDuckedMoveMinSpeed; - float fProneMoveMinSpeed; - float fPosRotRate; - float fPosProneRotRate; - float fStandRotMinSpeed; - float fDuckedRotMinSpeed; - float fProneRotMinSpeed; - Model *worldModel[16]; - Model *worldClipModel; - Model *rocketModel; - Model *knifeModel; - Model *worldKnifeModel; - Material *hudIcon; - WeaponIconRatioType hudIconRatio; - Material *ammoCounterIcon; - WeaponIconRatioType ammoCounterIconRatio; - AmmoCounterClipType ammoCounterClip; - int iStartAmmo; - const char *szAmmoName; - int iAmmoIndex; - const char *szClipName; - int iClipIndex; - int iMaxAmmo; - int iClipSize; - int shotCount; - const char *szSharedAmmoCapName; - int iSharedAmmoCapIndex; - int iSharedAmmoCap; - int damage; - int playerDamage; - int iMeleeDamage; - int iDamageType; - int iFireDelay; - int iMeleeDelay; - int meleeChargeDelay; - int iDetonateDelay; - int iFireTime; - int iRechamberTime; - int iRechamberBoltTime; - int iHoldFireTime; - int iDetonateTime; - int iMeleeTime; - int meleeChargeTime; - int iReloadTime; - int reloadShowRocketTime; - int iReloadEmptyTime; - int iReloadAddTime; - int iReloadStartTime; - int iReloadStartAddTime; - int iReloadEndTime; - int iDropTime; - int iRaiseTime; - int iAltDropTime; - int iAltRaiseTime; - int quickDropTime; - int quickRaiseTime; - int iFirstRaiseTime; - int iEmptyRaiseTime; - int iEmptyDropTime; - int sprintInTime; - int sprintLoopTime; - int sprintOutTime; - int nightVisionWearTime; - int nightVisionWearTimeFadeOutEnd; - int nightVisionWearTimePowerUp; - int nightVisionRemoveTime; - int nightVisionRemoveTimePowerDown; - int nightVisionRemoveTimeFadeInStart; - int fuseTime; - int aiFuseTime; - int requireLockonToFire; - int noAdsWhenMagEmpty; - int avoidDropCleanup; - float autoAimRange; - float aimAssistRange; - float aimAssistRangeAds; - float aimPadding; - float enemyCrosshairRange; - int crosshairColorChange; - float moveSpeedScale; - float adsMoveSpeedScale; - float sprintDurationScale; - float fAdsZoomFov; - float fAdsZoomInFrac; - float fAdsZoomOutFrac; - Material *overlayMaterial; - Material *overlayMaterialLowRes; - WeaponOverlayReticle overlayReticle; - WeapOverlayInteface_t overlayInterface; - float overlayWidth; - float overlayHeight; - float fAdsBobFactor; - float fAdsViewBobMult; - float fHipSpreadStandMin; - float fHipSpreadDuckedMin; - float fHipSpreadProneMin; - float hipSpreadStandMax; - float hipSpreadDuckedMax; - float hipSpreadProneMax; - float fHipSpreadDecayRate; - float fHipSpreadFireAdd; - float fHipSpreadTurnAdd; - float fHipSpreadMoveAdd; - float fHipSpreadDuckedDecay; - float fHipSpreadProneDecay; - float fHipReticleSidePos; - int iAdsTransInTime; - int iAdsTransOutTime; - float fAdsIdleAmount; - float fHipIdleAmount; - float adsIdleSpeed; - float hipIdleSpeed; - float fIdleCrouchFactor; - float fIdleProneFactor; - float fGunMaxPitch; - float fGunMaxYaw; - float swayMaxAngle; - float swayLerpSpeed; - float swayPitchScale; - float swayYawScale; - float swayHorizScale; - float swayVertScale; - float swayShellShockScale; - float adsSwayMaxAngle; - float adsSwayLerpSpeed; - float adsSwayPitchScale; - float adsSwayYawScale; - float adsSwayHorizScale; - float adsSwayVertScale; - int bRifleBullet; - int armorPiercing; - int bBoltAction; - int aimDownSight; - int bRechamberWhileAds; - float adsViewErrorMin; - float adsViewErrorMax; - int bCookOffHold; - int bClipOnly; - int adsFireOnly; - int cancelAutoHolsterWhenEmpty; - int suppressAmmoReserveDisplay; - int enhanced; - int laserSightDuringNightvision; - Material *killIcon; - WeaponIconRatioType killIconRatio; - int flipKillIcon; - Material *dpadIcon; - WeaponIconRatioType dpadIconRatio; - int bNoPartialReload; - int bSegmentedReload; - int iReloadAmmoAdd; - int iReloadStartAdd; - const char *szAltWeaponName; - unsigned int altWeaponIndex; - int iDropAmmoMin; - int iDropAmmoMax; - int blocksProne; - int silenced; - int iExplosionRadius; - int iExplosionRadiusMin; - int iExplosionInnerDamage; - int iExplosionOuterDamage; - float damageConeAngle; - int iProjectileSpeed; - int iProjectileSpeedUp; - int iProjectileSpeedForward; - int iProjectileActivateDist; - float projLifetime; - float timeToAccelerate; - float projectileCurvature; - Model *projectileModel; - WeaponProjExposion projExplosion; - const EffectDef *projExplosionEffect; - int projExplosionEffectForceNormalUp; - const EffectDef *projDudEffect; - SoundAliasList *projExplosionSound; - SoundAliasList *projDudSound; - int bProjImpactExplode; - WeapStickinessType stickiness; - int hasDetonator; - int timedDetonation; - int rotate; - int holdButtonToThrow; - int freezeMovementWhenFiring; - float lowAmmoWarningThreshold; - float parallelBounce[29]; - float perpendicularBounce[29]; - const EffectDef *projTrailEffect; - float vProjectileColor[3]; - GuidedMissileType guidedMissileType; - float maxSteeringAccel; - int projIgnitionDelay; - const EffectDef *projIgnitionEffect; - SoundAliasList *projIgnitionSound; - float fAdsAimPitch; - float fAdsCrosshairInFrac; - float fAdsCrosshairOutFrac; - int adsGunKickReducedKickBullets; - float adsGunKickReducedKickPercent; - float fAdsGunKickPitchMin; - float fAdsGunKickPitchMax; - float fAdsGunKickYawMin; - float fAdsGunKickYawMax; - float fAdsGunKickAccel; - float fAdsGunKickSpeedMax; - float fAdsGunKickSpeedDecay; - float fAdsGunKickStaticDecay; - float fAdsViewKickPitchMin; - float fAdsViewKickPitchMax; - float fAdsViewKickYawMin; - float fAdsViewKickYawMax; - float fAdsViewKickCenterSpeed; - float fAdsViewScatterMin; - float fAdsViewScatterMax; - float fAdsSpread; - int hipGunKickReducedKickBullets; - float hipGunKickReducedKickPercent; - float fHipGunKickPitchMin; - float fHipGunKickPitchMax; - float fHipGunKickYawMin; - float fHipGunKickYawMax; - float fHipGunKickAccel; - float fHipGunKickSpeedMax; - float fHipGunKickSpeedDecay; - float fHipGunKickStaticDecay; - float fHipViewKickPitchMin; - float fHipViewKickPitchMax; - float fHipViewKickYawMin; - float fHipViewKickYawMax; - float fHipViewKickCenterSpeed; - float fHipViewScatterMin; - float fHipViewScatterMax; - float fightDist; - float maxDist; - const char *accuracyGraphName[2]; - float (*accuracyGraphKnots[2])[2]; - float (*originalAccuracyGraphKnots[2])[2]; - int accuracyGraphKnotCount[2]; - int originalAccuracyGraphKnotCount[2]; - int iPositionReloadTransTime; - float leftArc; - float rightArc; - float topArc; - float bottomArc; - float accuracy; - float aiSpread; - float playerSpread; - float minTurnSpeed[2]; - float maxTurnSpeed[2]; - float pitchConvergenceTime; - float yawConvergenceTime; - float suppressTime; - float maxRange; - float fAnimHorRotateInc; - float fPlayerPositionDist; - const char *szUseHintString; - const char *dropHintString; - int iUseHintStringIndex; - int dropHintStringIndex; - float horizViewJitter; - float vertViewJitter; - const char *szScript; - float fOOPosAnimLength[2]; - int minDamage; - int minPlayerDamage; - float fMaxDamageRange; - float fMinDamageRange; - float destabilizationRateTime; - float destabilizationCurvatureMax; - int destabilizeDistance; - float locationDamageMultipliers[19]; - const char *fireRumble; - const char *meleeImpactRumble; - float adsDofStart; - float adsDofEnd; -}; - -#endif // WEAPONDEF_H diff --git a/libs/xassets/xanimdeltapart.cpp b/libs/xassets/xanimdeltapart.cpp index 7696d55..756daf6 100644 --- a/libs/xassets/xanimdeltapart.cpp +++ b/libs/xassets/xanimdeltapart.cpp @@ -1,25 +1,28 @@ #include "xanimdeltapart.h" XAnimDeltaPart::XAnimDeltaPart() - : XAsset() { + : XAsset() + , mTrans() + , mQuat() +{ +} + +XAnimDeltaPart::~XAnimDeltaPart() +{ + } void XAnimDeltaPart::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read((char*)&mTransPtr, sizeof(quint32)); - mTrans.ParseData(aStream); - - aStream->read((char*)&mQuatPtr, sizeof(quint32)); - mQuat.ParseData(aStream); + mTrans.ParsePtr(aStream); + mQuat.ParsePtr(aStream); } } -quint32 XAnimDeltaPart::GetTransPtr() const { - return mTransPtr; -} - -void XAnimDeltaPart::SetTransPtr(quint32 ptr) { - mTransPtr = ptr; +void XAnimDeltaPart::Clear() +{ + mTrans.Clear(); + mQuat.Clear(); } const XAnimPartTrans& XAnimDeltaPart::GetTrans() const { @@ -30,14 +33,6 @@ void XAnimDeltaPart::SetTrans(const XAnimPartTrans& trans) { mTrans = trans; } -quint32 XAnimDeltaPart::GetQuatPtr() const { - return mQuatPtr; -} - -void XAnimDeltaPart::SetQuatPtr(quint32 ptr) { - mQuatPtr = ptr; -} - const XAnimDeltaPartQuat& XAnimDeltaPart::GetQuat() const { return mQuat; } diff --git a/libs/xassets/xanimdeltapart.h b/libs/xassets/xanimdeltapart.h index 1aa1186..3ec3a3f 100644 --- a/libs/xassets/xanimdeltapart.h +++ b/libs/xassets/xanimdeltapart.h @@ -9,26 +9,19 @@ class XAnimDeltaPart : public XAsset { public: explicit XAnimDeltaPart(); + ~XAnimDeltaPart(); void ParseData(QDataStream *aStream) override; - - quint32 GetTransPtr() const; - void SetTransPtr(quint32 ptr); + void Clear() override; const XAnimPartTrans& GetTrans() const; void SetTrans(const XAnimPartTrans& trans); - quint32 GetQuatPtr() const; - void SetQuatPtr(quint32 ptr); - const XAnimDeltaPartQuat& GetQuat() const; void SetQuat(const XAnimDeltaPartQuat& quat); private: - quint32 mTransPtr = 0; XAnimPartTrans mTrans; - - quint32 mQuatPtr = 0; XAnimDeltaPartQuat mQuat; }; diff --git a/libs/xassets/xanimdeltapartquat.cpp b/libs/xassets/xanimdeltapartquat.cpp index 20f67c9..d99dbef 100644 --- a/libs/xassets/xanimdeltapartquat.cpp +++ b/libs/xassets/xanimdeltapartquat.cpp @@ -1,8 +1,3 @@ - - - - - #include "xanimdeltapartquat.h" XAnimDeltaPartQuat::XAnimDeltaPartQuat() @@ -11,7 +6,7 @@ XAnimDeltaPartQuat::XAnimDeltaPartQuat() void XAnimDeltaPartQuat::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read((char*)&mSize, sizeof(quint16)); + *aStream >> mSize; // Parse data mData.ParseData(aStream); @@ -33,7 +28,3 @@ const XAnimDeltaPartQuatData& XAnimDeltaPartQuat::GetData() const { void XAnimDeltaPartQuat::SetData(const XAnimDeltaPartQuatData& data) { mData = data; } - - - - diff --git a/libs/xassets/xanimdeltapartquatdata.cpp b/libs/xassets/xanimdeltapartquatdata.cpp index 66b137f..a008791 100644 --- a/libs/xassets/xanimdeltapartquatdata.cpp +++ b/libs/xassets/xanimdeltapartquatdata.cpp @@ -1,9 +1,3 @@ - - - - - - #include "xanimdeltapartquatdata.h" XAnimDeltaPartQuatData::XAnimDeltaPartQuatData() @@ -14,9 +8,6 @@ void XAnimDeltaPartQuatData::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { // Parse frames mFrames.ParseData(aStream); - - // Parse frame0 - aStream->read((char*)mFrame0, 2 * sizeof(qint16)); } } @@ -37,7 +28,3 @@ void XAnimDeltaPartQuatData::SetFrame0(const qint16* frame0, size_t count) { memcpy(mFrame0, frame0, count * sizeof(qint16)); } } - - - - diff --git a/libs/xassets/xanimdeltapartquatdataframes.cpp b/libs/xassets/xanimdeltapartquatdataframes.cpp index cc9e6cc..750251b 100644 --- a/libs/xassets/xanimdeltapartquatdataframes.cpp +++ b/libs/xassets/xanimdeltapartquatdataframes.cpp @@ -36,8 +36,10 @@ void XAnimDeltaPartQuatDataFrames::SetIndices(const XAnimDynamicIndices& indices void XAnimDeltaPartQuatDataFrames::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read((char*)&mFramesPtr, sizeof(quint32)); - aStream->read((char*)mFrames, 2 * sizeof(qint16)); + *aStream + >> mFramesPtr + >> mFrames[0] + >> mFrames[1]; // Parse indices mIndices.ParseData(aStream); diff --git a/libs/xassets/xanimdynamicframes.cpp b/libs/xassets/xanimdynamicframes.cpp index c269297..17c587e 100644 --- a/libs/xassets/xanimdynamicframes.cpp +++ b/libs/xassets/xanimdynamicframes.cpp @@ -1,33 +1,40 @@ - - #include "xanimdynamicframes.h" XAnimDynamicFrames::XAnimDynamicFrames() - : XAsset() { + : XAsset() + , mFrames(3) +{ +} + +XAnimDynamicFrames::~XAnimDynamicFrames() +{ + } void XAnimDynamicFrames::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read((char*)&mFramesPtr, sizeof(quint32)); - aStream->read((char*)mFrames, 3 * sizeof(quint8)); + qint32 framePtr; + *aStream >> framePtr; + + if (framePtr == -1) + { + *aStream + >> mFrames[0] + >> mFrames[1] + >> mFrames[2]; + } } } -quint32 XAnimDynamicFrames::GetFramesPtr() const { - return mFramesPtr; +void XAnimDynamicFrames::Clear() +{ + mFrames.clear(); } -void XAnimDynamicFrames::SetFramesPtr(quint32 ptr) { - mFramesPtr = ptr; -} - -const quint8* XAnimDynamicFrames::GetFrames() const { +QVector XAnimDynamicFrames::GetFrames() const { return mFrames; } -void XAnimDynamicFrames::SetFrames(const quint8* frames, size_t count) { - if (count <= 3) { - memcpy(mFrames, frames, count * sizeof(quint8)); - } +void XAnimDynamicFrames::SetFrames(QVector aFrames) { + mFrames = aFrames; } - diff --git a/libs/xassets/xanimdynamicframes.h b/libs/xassets/xanimdynamicframes.h index d132cc9..9b1e07e 100644 --- a/libs/xassets/xanimdynamicframes.h +++ b/libs/xassets/xanimdynamicframes.h @@ -1,27 +1,25 @@ - #ifndef XANIMDYNAMICFRAMES_H #define XANIMDYNAMICFRAMES_H #include "xasset.h" +#include + class XAnimDynamicFrames : public XAsset { public: explicit XAnimDynamicFrames(); + ~XAnimDynamicFrames(); void ParseData(QDataStream *aStream) override; + void Clear() override; - quint32 GetFramesPtr() const; - void SetFramesPtr(quint32 ptr); - - const quint8* GetFrames() const; - void SetFrames(const quint8* frames, size_t count = 3); + QVector GetFrames() const; + void SetFrames(QVector aFrames); private: - quint32 mFramesPtr = 0; - quint8 mFrames[3] = {0}; + QVector mFrames; }; #endif // XANIMDYNAMICFRAMES_H - diff --git a/libs/xassets/xanimdynamicindices.cpp b/libs/xassets/xanimdynamicindices.cpp index de56d82..65bc44b 100644 --- a/libs/xassets/xanimdynamicindices.cpp +++ b/libs/xassets/xanimdynamicindices.cpp @@ -1,28 +1,31 @@ - - - - #include "xanimdynamicindices.h" XAnimDynamicIndices::XAnimDynamicIndices() - : XAsset() { + : XAsset() + , mIndices(1) +{ +} + +XAnimDynamicIndices::~XAnimDynamicIndices() +{ + } void XAnimDynamicIndices::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read((char*)mIndices, sizeof(quint8)); + *aStream >> mIndices[0]; } } -const quint8* XAnimDynamicIndices::GetIndices() const { +void XAnimDynamicIndices::Clear() +{ + mIndices.clear(); +} + +QVector XAnimDynamicIndices::GetIndices() const { return mIndices; } -void XAnimDynamicIndices::SetIndices(const quint8* indices, size_t count) { - if (count <= 1) { - memcpy(mIndices, indices, count * sizeof(quint8)); - } +void XAnimDynamicIndices::SetIndices(QVector aIndices) { + mIndices = aIndices; } - - - diff --git a/libs/xassets/xanimdynamicindices.h b/libs/xassets/xanimdynamicindices.h index 9b87d2f..3f7d0b6 100644 --- a/libs/xassets/xanimdynamicindices.h +++ b/libs/xassets/xanimdynamicindices.h @@ -1,25 +1,24 @@ - - - #ifndef XANIMDYNAMICINDICES_H #define XANIMDYNAMICINDICES_H #include "xasset.h" +#include + class XAnimDynamicIndices : public XAsset { public: explicit XAnimDynamicIndices(); + ~XAnimDynamicIndices(); void ParseData(QDataStream *aStream) override; + void Clear() override; - const quint8* GetIndices() const; - void SetIndices(const quint8* indices, size_t count = 1); + QVector GetIndices() const; + void SetIndices(QVector aIndices); private: - quint8 mIndices[1] = {0}; + QVector mIndices; }; #endif // XANIMDYNAMICINDICES_H - - diff --git a/libs/xassets/xanimindices.cpp b/libs/xassets/xanimindices.cpp index 4b44863..f13e9f9 100644 --- a/libs/xassets/xanimindices.cpp +++ b/libs/xassets/xanimindices.cpp @@ -1,28 +1,31 @@ - - - - - - #include "xanimindices.h" XAnimIndices::XAnimIndices() - : XAsset() { + : XAsset() + , mIndex(0) +{ + +} + +XAnimIndices::~XAnimIndices() +{ + } void XAnimIndices::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read((char*)&mIndexPtr, sizeof(quint32)); - aStream->read((char*)&mIndex, sizeof(quint16)); + qint32 indexPtr; + *aStream >> indexPtr; + if (indexPtr == -1) + { + *aStream >> mIndex; + } } } -quint32 XAnimIndices::GetIndexPtr() const { - return mIndexPtr; -} - -void XAnimIndices::SetIndexPtr(quint32 ptr) { - mIndexPtr = ptr; +void XAnimIndices::Clear() +{ + mIndex = 0; } quint16 XAnimIndices::GetIndex() const { @@ -32,7 +35,3 @@ quint16 XAnimIndices::GetIndex() const { void XAnimIndices::SetIndex(quint16 index) { mIndex = index; } - - - - diff --git a/libs/xassets/xanimindices.h b/libs/xassets/xanimindices.h index fd8a1a0..66dd25c 100644 --- a/libs/xassets/xanimindices.h +++ b/libs/xassets/xanimindices.h @@ -1,10 +1,3 @@ - - - - - - - #ifndef XANIMINDICES_H #define XANIMINDICES_H @@ -14,24 +7,16 @@ class XAnimIndices : public XAsset { public: explicit XAnimIndices(); + ~XAnimIndices(); void ParseData(QDataStream *aStream) override; - - quint32 GetIndexPtr() const; - void SetIndexPtr(quint32 ptr); + void Clear() override; quint16 GetIndex() const; void SetIndex(quint16 index); private: - quint32 mIndexPtr = 0; quint16 mIndex = 0; }; #endif // XANIMINDICES_H - - - - - - diff --git a/libs/xassets/xanimnotifyinfo.cpp b/libs/xassets/xanimnotifyinfo.cpp index 6acf60b..3e0241f 100644 --- a/libs/xassets/xanimnotifyinfo.cpp +++ b/libs/xassets/xanimnotifyinfo.cpp @@ -1,22 +1,32 @@ - - - - - - #include "xanimnotifyinfo.h" XAnimNotifyInfo::XAnimNotifyInfo() - : XAsset() { + : XAsset() + , mName(0) + , mTime(0.0f) +{ + +} + +XAnimNotifyInfo::~XAnimNotifyInfo() +{ + } void XAnimNotifyInfo::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read((char*)&mName, sizeof(quint16)); - aStream->read((char*)&mTime, sizeof(float)); + *aStream + >> mName + >> mTime; } } +void XAnimNotifyInfo::Clear() +{ + mName = 0; + mTime = 0.0f; +} + quint16 XAnimNotifyInfo::GetName() const { return mName; } @@ -32,7 +42,3 @@ float XAnimNotifyInfo::GetTime() const { void XAnimNotifyInfo::SetTime(float time) { mTime = time; } - - - - diff --git a/libs/xassets/xanimnotifyinfo.h b/libs/xassets/xanimnotifyinfo.h index e243cf7..115dbe0 100644 --- a/libs/xassets/xanimnotifyinfo.h +++ b/libs/xassets/xanimnotifyinfo.h @@ -1,9 +1,3 @@ - - - - - - #ifndef XANIMNOTIFYINFO_H #define XANIMNOTIFYINFO_H @@ -13,8 +7,10 @@ class XAnimNotifyInfo : public XAsset { public: explicit XAnimNotifyInfo(); + ~XAnimNotifyInfo(); void ParseData(QDataStream *aStream) override; + void Clear() override; quint16 GetName() const; void SetName(quint16 name); @@ -23,13 +19,8 @@ public: void SetTime(float time); private: - quint16 mName = 0; - float mTime = 0.0f; + quint16 mName; + float mTime; }; #endif // XANIMNOTIFYINFO_H - - - - - diff --git a/libs/xassets/xanimparts.cpp b/libs/xassets/xanimparts.cpp index aa55d5e..3daeb69 100644 --- a/libs/xassets/xanimparts.cpp +++ b/libs/xassets/xanimparts.cpp @@ -1,380 +1,140 @@ #include "xanimparts.h" XAnimParts::XAnimParts() - : XAsset() { + : XAsset() + , mName() + , mDataByteCount(0) + , mDataShortCount(0) + , mDataIntCount(0) + , mRandomDataByteCount(0) + , mRandomDataIntCount(0) + , mNumFrames(0) + , mIsLoop(false) + , mIsDelta(false) + , mBoneCount(12) + , mNotifyCount(0) + , mAssetType(0) + , mPad(false) + , mRandomDataShortCount(0) + , mIndexCount(0) + , mFramerate(0.0f) + , mFrequency(0.0f) + , mNames(0) + , mDataByte(0) + , mDataShort(0) + , mDataInt(0) + , mRandomDataShort(0) + , mRandomDataByte(0) + , mRandomDataInt(0) + , mIndices() + , mNotify() + , mDeltaPart() +{ + SetType(ASSET_TYPE_XANIMPARTS); + SetName("XAnimParts"); +} + +XAnimParts::~XAnimParts() +{ + } void XAnimParts::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - // Parse all fields - aStream->read((char*)&mNamePtr, sizeof(quint32)); - mName = ""; // We'll need to resolve this pointer later - aStream->read((char*)&mDataByteCount, sizeof(quint16)); - aStream->read((char*)&mDataShortCount, sizeof(quint16)); - aStream->read((char*)&mDataIntCount, sizeof(quint16)); - aStream->read((char*)&mRandomDataByteCount, sizeof(quint16)); - aStream->read((char*)&mRandomDataIntCount, sizeof(quint16)); - aStream->read((char*)&mNumFrames, sizeof(quint16)); + mName.ParsePtr(aStream, false); + + // Parse all fields + *aStream + >> mDataByteCount + >> mDataShortCount + >> mDataIntCount + >> mRandomDataByteCount + >> mRandomDataIntCount + >> mNumFrames; quint8 loopDelta; - aStream->read((char*)&loopDelta, sizeof(quint8)); + *aStream >> loopDelta; mIsLoop = (loopDelta & 0x1) != 0; mIsDelta = (loopDelta & 0x2) != 0; - aStream->read((char*)mBoneCount, sizeof(mBoneCount)); - aStream->read((char*)&mNotifyCount, sizeof(quint8)); - aStream->read((char*)&mAssetType, sizeof(quint8)); + for (int i = 0; i < 12; i++) + { + *aStream >> mBoneCount[i]; + } - quint8 pad; - aStream->read((char*)&pad, sizeof(quint8)); + *aStream + >> mNotifyCount + >> mAssetType; + + quint16 pad; + *aStream >> pad; mPad = (pad != 0); - aStream->read((char*)&mRandomDataShortCount, sizeof(quint16)); - aStream->read((char*)&mIndexCount, sizeof(quint16)); + qint32 namesPtr, dataBytePtr, dataShortPtr, dataIntPtr, + randomDataShortPtr, randomDataBytePtr, randomDataIntPtr; - aStream->read((char*)&mFramerate, sizeof(float)); - aStream->read((char*)&mFrequency, sizeof(float)); - - aStream->read((char*)&mNamesPtr, sizeof(quint32)); - aStream->read((char*)&mNames, sizeof(quint16)); - - aStream->read((char*)&mDataBytePtr, sizeof(quint32)); - aStream->read((char*)&mDataByte, sizeof(quint8)); - - aStream->read((char*)&mDataShortPtr, sizeof(quint32)); - aStream->read((char*)&mDataShort, sizeof(qint16)); - - aStream->read((char*)&mDataIntPtr, sizeof(quint32)); - aStream->read((char*)&mDataInt, sizeof(int)); - - aStream->read((char*)&mRandomDataShortPtr, sizeof(quint32)); - aStream->read((char*)&mRandomDataShort, sizeof(qint16)); - - aStream->read((char*)&mRandomDataBytePtr, sizeof(quint32)); - aStream->read((char*)&mRandomDataByte, sizeof(quint8)); - - aStream->read((char*)&mRandomDataIntPtr, sizeof(quint32)); - aStream->read((char*)&mRandomDataInt, sizeof(int)); + *aStream + >> mRandomDataShortCount + >> mIndexCount + >> mFramerate + >> mFrequency + >> namesPtr + >> mNames + >> dataBytePtr + >> mDataByte + >> dataShortPtr + >> mDataShort + >> dataIntPtr + >> mDataInt + >> randomDataShortPtr + >> mRandomDataShort + >> randomDataBytePtr + >> mRandomDataByte + >> randomDataIntPtr + >> mRandomDataInt; // Parse indices mIndices.ParseData(aStream); + mNotify.ParsePtr(aStream, false); + mDeltaPart.ParsePtr(aStream, false); - aStream->read((char*)&mNotifyPtr, sizeof(qint32)); + mName.ParseData(aStream); + if (namesPtr) + { + + } mNotify.ParseData(aStream); - - aStream->read((char*)&mDeltaPartPtr, sizeof(qint32)); mDeltaPart.ParseData(aStream); + if (dataBytePtr) + { + *aStream >> mDataByte; + } + if (dataShortPtr) + { + *aStream >> mDataShort; + } + if (dataIntPtr) + { + *aStream >> mDataInt; + } + if (randomDataShortPtr) + { + *aStream >> mDataInt; + } + if (randomDataBytePtr) + { + *aStream >> mRandomDataByte; + } + if (randomDataIntPtr) + { + *aStream >> mRandomDataInt; + } + mIndices.ParseData(aStream); } } -const QString& XAnimParts::GetName() const { - return mName; -} - -void XAnimParts::SetName(const QString& name) { - mName = name; -} - -quint32 XAnimParts::GetNamePtr() const { - return mNamePtr; -} - -void XAnimParts::SetNamePtr(quint32 ptr) { - mNamePtr = ptr; -} - -quint16 XAnimParts::GetDataByteCount() const { - return mDataByteCount; -} - -void XAnimParts::SetDataByteCount(quint16 count) { - mDataByteCount = count; -} - -quint16 XAnimParts::GetDataShortCount() const { - return mDataShortCount; -} - -void XAnimParts::SetDataShortCount(quint16 count) { - mDataShortCount = count; -} - -quint16 XAnimParts::GetDataIntCount() const { - return mDataIntCount; -} - -void XAnimParts::SetDataIntCount(quint16 count) { - mDataIntCount = count; -} - -quint16 XAnimParts::GetRandomDataByteCount() const { - return mRandomDataByteCount; -} - -void XAnimParts::SetRandomDataByteCount(quint16 count) { - mRandomDataByteCount = count; -} - -quint16 XAnimParts::GetRandomDataIntCount() const { - return mRandomDataIntCount; -} - -void XAnimParts::SetRandomDataIntCount(quint16 count) { - mRandomDataIntCount = count; -} - -quint16 XAnimParts::GetNumFrames() const { - return mNumFrames; -} - -void XAnimParts::SetNumFrames(quint16 frames) { - mNumFrames = frames; -} - -bool XAnimParts::IsLoop() const { - return mIsLoop; -} - -void XAnimParts::SetIsLoop(bool loop) { - mIsLoop = loop; -} - -bool XAnimParts::IsDelta() const { - return mIsDelta; -} - -void XAnimParts::SetIsDelta(bool delta) { - mIsDelta = delta; -} - -const quint8* XAnimParts::GetBoneCount() const { - return mBoneCount; -} - -void XAnimParts::SetBoneCount(const quint8* count, size_t boneCount) { - if (boneCount <= 12) { - memcpy(mBoneCount, count, boneCount * sizeof(quint8)); - } -} - -quint8 XAnimParts::GetNotifyCount() const { - return mNotifyCount; -} - -void XAnimParts::SetNotifyCount(quint8 count) { - mNotifyCount = count; -} - -quint8 XAnimParts::GetAssetType() const { - return mAssetType; -} - -void XAnimParts::SetAssetType(quint8 type) { - mAssetType = type; -} - -bool XAnimParts::IsPad() const { - return mPad; -} - -void XAnimParts::SetIsPad(bool pad) { - mPad = pad; -} - -quint16 XAnimParts::GetRandomDataShortCount() const { - return mRandomDataShortCount; -} - -void XAnimParts::SetRandomDataShortCount(quint16 count) { - mRandomDataShortCount = count; -} - -quint16 XAnimParts::GetIndexCount() const { - return mIndexCount; -} - -void XAnimParts::SetIndexCount(quint16 count) { - mIndexCount = count; -} - -float XAnimParts::GetFramerate() const { - return mFramerate; -} - -void XAnimParts::SetFramerate(float rate) { - mFramerate = rate; -} - -float XAnimParts::GetFrequency() const { - return mFrequency; -} - -void XAnimParts::SetFrequency(float frequency) { - mFrequency = frequency; -} - -quint32 XAnimParts::GetNamesPtr() const { - return mNamesPtr; -} - -void XAnimParts::SetNamesPtr(quint32 ptr) { - mNamesPtr = ptr; -} - -quint16 XAnimParts::GetNames() const { - return mNames; -} - -void XAnimParts::SetNames(quint16 names) { - mNames = names; -} - -quint32 XAnimParts::GetDataBytePtr() const { - return mDataBytePtr; -} - -void XAnimParts::SetDataBytePtr(quint32 ptr) { - mDataBytePtr = ptr; -} - -quint8 XAnimParts::GetDataByte() const { - return mDataByte; -} - -void XAnimParts::SetDataByte(quint8 byte) { - mDataByte = byte; -} - -quint32 XAnimParts::GetDataShortPtr() const { - return mDataShortPtr; -} - -void XAnimParts::SetDataShortPtr(quint32 ptr) { - mDataShortPtr = ptr; -} - -qint16 XAnimParts::GetDataShort() const { - return mDataShort; -} - -void XAnimParts::SetDataShort(qint16 shortValue) { - mDataShort = shortValue; -} - -quint32 XAnimParts::GetDataIntPtr() const { - return mDataIntPtr; -} - -void XAnimParts::SetDataIntPtr(quint32 ptr) { - mDataIntPtr = ptr; -} - -int XAnimParts::GetDataInt() const { - return mDataInt; -} - -void XAnimParts::SetDataInt(int value) { - mDataInt = value; -} - -quint32 XAnimParts::GetRandomDataShortPtr() const { - return mRandomDataShortPtr; -} - -void XAnimParts::SetRandomDataShortPtr(quint32 ptr) { - mRandomDataShortPtr = ptr; -} - -qint16 XAnimParts::GetRandomDataShort() const { - return mRandomDataShort; -} - -void XAnimParts::SetRandomDataShort(qint16 shortValue) { - mRandomDataShort = shortValue; -} - -quint32 XAnimParts::GetRandomDataBytePtr() const { - return mRandomDataBytePtr; -} - -void XAnimParts::SetRandomDataBytePtr(quint32 ptr) { - mRandomDataBytePtr = ptr; -} - -quint8 XAnimParts::GetRandomDataByte() const { - return mRandomDataByte; -} - -void XAnimParts::SetRandomDataByte(quint8 byte) { - mRandomDataByte = byte; -} - -quint32 XAnimParts::GetRandomDataIntPtr() const { - return mRandomDataIntPtr; -} - -void XAnimParts::SetRandomDataIntPtr(quint32 ptr) { - mRandomDataIntPtr = ptr; -} - -int XAnimParts::GetRandomDataInt() const { - return mRandomDataInt; -} - -void XAnimParts::SetRandomDataInt(int value) { - mRandomDataInt = value; -} - -XAnimIndices& XAnimParts::GetIndices() { - return mIndices; -} - -const XAnimIndices& XAnimParts::GetIndices() const { - return mIndices; -} - -void XAnimParts::SetIndices(const XAnimIndices& indices) { - mIndices = indices; -} +void XAnimParts::Clear() +{ -qint32 XAnimParts::GetNotifyPtr() const { - return mNotifyPtr; } - -void XAnimParts::SetNotifyPtr(qint32 ptr) { - mNotifyPtr = ptr; -} - -XAnimNotifyInfo& XAnimParts::GetNotify() { - return mNotify; -} - -const XAnimNotifyInfo& XAnimParts::GetNotify() const { - return mNotify; -} - -void XAnimParts::SetNotify(const XAnimNotifyInfo& notify) { - mNotify = notify; -} - -qint32 XAnimParts::GetDeltaPartPtr() const { - return mDeltaPartPtr; -} - -void XAnimParts::SetDeltaPartPtr(qint32 ptr) { - mDeltaPartPtr = ptr; -} - -XAnimDeltaPart& XAnimParts::GetDeltaPart() { - return mDeltaPart; -} - -const XAnimDeltaPart& XAnimParts::GetDeltaPart() const { - return mDeltaPart; -} - -void XAnimParts::SetDeltaPart(const XAnimDeltaPart& deltaPart) { - mDeltaPart = deltaPart; -} - diff --git a/libs/xassets/xanimparts.h b/libs/xassets/xanimparts.h index cf27beb..7b36901 100644 --- a/libs/xassets/xanimparts.h +++ b/libs/xassets/xanimparts.h @@ -2,135 +2,24 @@ #define XANIMPARTS_H #include "xasset.h" -#include +#include "xstring.h" #include "xanimindices.h" #include "xanimnotifyinfo.h" #include "xanimdeltapart.h" +#include + class XAnimParts : public XAsset { public: explicit XAnimParts(); + ~XAnimParts(); void ParseData(QDataStream *aStream) override; - - const QString& GetName() const; - void SetName(const QString& name); - - quint32 GetNamePtr() const; - void SetNamePtr(quint32 ptr); - - quint16 GetDataByteCount() const; - void SetDataByteCount(quint16 count); - - quint16 GetDataShortCount() const; - void SetDataShortCount(quint16 count); - - quint16 GetDataIntCount() const; - void SetDataIntCount(quint16 count); - - quint16 GetRandomDataByteCount() const; - void SetRandomDataByteCount(quint16 count); - - quint16 GetRandomDataIntCount() const; - void SetRandomDataIntCount(quint16 count); - - quint16 GetNumFrames() const; - void SetNumFrames(quint16 frames); - - bool IsLoop() const; - void SetIsLoop(bool loop); - - bool IsDelta() const; - void SetIsDelta(bool delta); - - const quint8* GetBoneCount() const; - void SetBoneCount(const quint8* count, size_t boneCount = 12); - - quint8 GetNotifyCount() const; - void SetNotifyCount(quint8 count); - - quint8 GetAssetType() const; - void SetAssetType(quint8 type); - - bool IsPad() const; - void SetIsPad(bool pad); - - quint16 GetRandomDataShortCount() const; - void SetRandomDataShortCount(quint16 count); - - quint16 GetIndexCount() const; - void SetIndexCount(quint16 count); - - float GetFramerate() const; - void SetFramerate(float rate); - - float GetFrequency() const; - void SetFrequency(float frequency); - - quint32 GetNamesPtr() const; - void SetNamesPtr(quint32 ptr); - - quint16 GetNames() const; - void SetNames(quint16 names); - - quint32 GetDataBytePtr() const; - void SetDataBytePtr(quint32 ptr); - - quint8 GetDataByte() const; - void SetDataByte(quint8 byte); - - quint32 GetDataShortPtr() const; - void SetDataShortPtr(quint32 ptr); - - qint16 GetDataShort() const; - void SetDataShort(qint16 shortValue); - - quint32 GetDataIntPtr() const; - void SetDataIntPtr(quint32 ptr); - - int GetDataInt() const; - void SetDataInt(int value); - - quint32 GetRandomDataShortPtr() const; - void SetRandomDataShortPtr(quint32 ptr); - - qint16 GetRandomDataShort() const; - void SetRandomDataShort(qint16 shortValue); - - quint32 GetRandomDataBytePtr() const; - void SetRandomDataBytePtr(quint32 ptr); - - quint8 GetRandomDataByte() const; - void SetRandomDataByte(quint8 byte); - - quint32 GetRandomDataIntPtr() const; - void SetRandomDataIntPtr(quint32 ptr); - - int GetRandomDataInt() const; - void SetRandomDataInt(int value); - - XAnimIndices& GetIndices(); - const XAnimIndices& GetIndices() const; - void SetIndices(const XAnimIndices& indices); - - qint32 GetNotifyPtr() const; - void SetNotifyPtr(qint32 ptr); - - XAnimNotifyInfo& GetNotify(); - const XAnimNotifyInfo& GetNotify() const; - void SetNotify(const XAnimNotifyInfo& notify); - - qint32 GetDeltaPartPtr() const; - void SetDeltaPartPtr(qint32 ptr); - - XAnimDeltaPart& GetDeltaPart(); - const XAnimDeltaPart& GetDeltaPart() const; - void SetDeltaPart(const XAnimDeltaPart& deltaPart); + void Clear() override; private: - QString mName; - quint32 mNamePtr = 0; + XString mName; quint16 mDataByteCount = 0; quint16 mDataShortCount = 0; @@ -142,7 +31,7 @@ private: bool mIsLoop = false; bool mIsDelta = false; - quint8 mBoneCount[12] = {0}; + QVector mBoneCount; quint8 mNotifyCount = 0; quint8 mAssetType = 0; @@ -154,33 +43,15 @@ private: float mFramerate = 0.0f; float mFrequency = 0.0f; - quint32 mNamesPtr = 0; quint16 mNames = 0; - - quint32 mDataBytePtr = 0; quint8 mDataByte = 0; - - quint32 mDataShortPtr = 0; qint16 mDataShort = 0; - - quint32 mDataIntPtr = 0; int mDataInt = 0; - - quint32 mRandomDataShortPtr = 0; qint16 mRandomDataShort = 0; - - quint32 mRandomDataBytePtr = 0; quint8 mRandomDataByte = 0; - - quint32 mRandomDataIntPtr = 0; int mRandomDataInt = 0; - XAnimIndices mIndices; - - qint32 mNotifyPtr = 0; XAnimNotifyInfo mNotify; - - qint32 mDeltaPartPtr = 0; XAnimDeltaPart mDeltaPart; }; diff --git a/libs/xassets/xanimparttrans.cpp b/libs/xassets/xanimparttrans.cpp index 2e97c9e..2e88cee 100644 --- a/libs/xassets/xanimparttrans.cpp +++ b/libs/xassets/xanimparttrans.cpp @@ -1,19 +1,33 @@ - - - - - #include "xanimparttrans.h" XAnimPartTrans::XAnimPartTrans() - : XAsset() { + : XAsset() + , mSize(0) + , mIsSmallTrans(false) + , mData() +{ +} + +XAnimPartTrans::XAnimPartTrans(const XAnimPartTrans &aSrc) + : XAsset() + , mSize(aSrc.mSize) + , mIsSmallTrans(aSrc.mIsSmallTrans) + , mData(aSrc.mData) +{ + +} + +XAnimPartTrans::~XAnimPartTrans() +{ + } void XAnimPartTrans::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read((char*)&mSize, sizeof(quint16)); quint8 smallTransByte; - aStream->read((char*)&smallTransByte, sizeof(quint8)); + *aStream + >> mSize + >> smallTransByte; mIsSmallTrans = (smallTransByte != 0); // Parse data @@ -21,32 +35,11 @@ void XAnimPartTrans::ParseData(QDataStream *aStream) { } } -quint16 XAnimPartTrans::GetSize() const { - return mSize; -} - -void XAnimPartTrans::SetSize(quint16 size) { - mSize = size; -} - -bool XAnimPartTrans::IsSmallTrans() const { - return mIsSmallTrans; -} - -void XAnimPartTrans::SetIsSmallTrans(bool isSmall) { - mIsSmallTrans = isSmall; -} - -XAnimPartTransData& XAnimPartTrans::GetData() { - return mData; -} - -const XAnimPartTransData& XAnimPartTrans::GetData() const { - return mData; -} - -void XAnimPartTrans::SetData(const XAnimPartTransData& data) { - mData = data; +void XAnimPartTrans::Clear() +{ + mSize = 0; + mIsSmallTrans = false; + mData.Clear(); } diff --git a/libs/xassets/xanimparttrans.h b/libs/xassets/xanimparttrans.h index 433f47f..3c9a2c2 100644 --- a/libs/xassets/xanimparttrans.h +++ b/libs/xassets/xanimparttrans.h @@ -8,23 +8,15 @@ class XAnimPartTrans : public XAsset { public: explicit XAnimPartTrans(); + XAnimPartTrans(const XAnimPartTrans& aSrc); ~XAnimPartTrans(); - void ParseData(QDataStream *aStream) override; - - quint16 GetSize() const; - void SetSize(quint16 size); - - bool IsSmallTrans() const; - void SetIsSmallTrans(bool isSmall); - - XAnimPartTransData& GetData(); - const XAnimPartTransData& GetData() const; - void SetData(const XAnimPartTransData& data); + void ParseData(QDataStream* aStream) override; + void Clear() override; private: - quint16 mSize = 0; - bool mIsSmallTrans = false; + quint16 mSize; + bool mIsSmallTrans; XAnimPartTransData mData; }; diff --git a/libs/xassets/xanimparttransdata.cpp b/libs/xassets/xanimparttransdata.cpp index 5fa2559..0a686d6 100644 --- a/libs/xassets/xanimparttransdata.cpp +++ b/libs/xassets/xanimparttransdata.cpp @@ -1,12 +1,23 @@ - - - - - #include "xanimparttransdata.h" XAnimPartTransData::XAnimPartTransData() - : XAsset() { + : XAsset() + , mFrames() + , mFrame() +{ +} + +XAnimPartTransData::XAnimPartTransData(const XAnimPartTransData &aSrc) + : XAsset() + , mFrames(aSrc.mFrames) + , mFrame(aSrc.mFrame) +{ + +} + +XAnimPartTransData::~XAnimPartTransData() +{ + } void XAnimPartTransData::ParseData(QDataStream *aStream) { @@ -17,24 +28,7 @@ void XAnimPartTransData::ParseData(QDataStream *aStream) { } } -const XAnimPartTransFrames& XAnimPartTransData::GetFrames() const { - return mFrames; +void XAnimPartTransData::Clear() +{ + } - -void XAnimPartTransData::SetFrames(const XAnimPartTransFrames& frames) { - mFrames = frames; -} - -const float* XAnimPartTransData::GetFrame0() const { - return mFrame0; -} - -void XAnimPartTransData::SetFrame0(const float* frame0, size_t count) { - if (count <= 3) { - memcpy(mFrame0, frame0, count * sizeof(float)); - } -} - - - - diff --git a/libs/xassets/xanimparttransdata.h b/libs/xassets/xanimparttransdata.h index 9d70d16..e6736c0 100644 --- a/libs/xassets/xanimparttransdata.h +++ b/libs/xassets/xanimparttransdata.h @@ -8,23 +8,15 @@ class XAnimPartTransData : public XAsset { public: explicit XAnimPartTransData(); + XAnimPartTransData(const XAnimPartTransData &aSrc); ~XAnimPartTransData(); void ParseData(QDataStream *aStream) override; - - // Option 1: Frames data - const XAnimPartTransFrames& GetFrames() const; - void SetFrames(const XAnimPartTransFrames& frames); - - // Option 2: Frame0 data - const float* GetFrame0() const; - void SetFrame0(const float* frame0, size_t count = 3); + void Clear() override; private: - union { - XAnimPartTransFrames mFrames; - float mFrame0[3] = {0.0f, 0.0f, 0.0f}; - }; + XAnimPartTransFrames mFrames; + QVector3D mFrame; }; #endif // XANIMPARTTRANSDATA_H diff --git a/libs/xassets/xanimparttransframes.cpp b/libs/xassets/xanimparttransframes.cpp index e38af94..8549fee 100644 --- a/libs/xassets/xanimparttransframes.cpp +++ b/libs/xassets/xanimparttransframes.cpp @@ -1,18 +1,28 @@ - - - - - #include "xanimparttransframes.h" XAnimPartTransFrames::XAnimPartTransFrames() - : XAsset() { + : XAsset() + , mMins() + , mMaxs() + , mFrames() + , mIndices() +{ +} + +XAnimPartTransFrames::~XAnimPartTransFrames() +{ + } void XAnimPartTransFrames::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read((char*)mMins, 3 * sizeof(float)); - aStream->read((char*)mSize, 3 * sizeof(float)); + *aStream + >> mMins[0] + >> mMins[1] + >> mMins[2] + >> mMaxs[0] + >> mMaxs[1] + >> mMaxs[2]; // Parse frames mFrames.ParseData(aStream); @@ -22,50 +32,11 @@ void XAnimPartTransFrames::ParseData(QDataStream *aStream) { } } -const float* XAnimPartTransFrames::GetMins() const { - return mMins; +void XAnimPartTransFrames::Clear() +{ + mMins = QVector3D(); + mMaxs = QVector3D(); + + mFrames.Clear(); + mIndices.Clear(); } - -void XAnimPartTransFrames::SetMins(const float* mins, size_t count) { - if (count <= 3) { - memcpy(mMins, mins, count * sizeof(float)); - } -} - -const float* XAnimPartTransFrames::GetSize() const { - return mSize; -} - -void XAnimPartTransFrames::SetSize(const float* size, size_t count) { - if (count <= 3) { - memcpy(mSize, size, count * sizeof(float)); - } -} - -XAnimDynamicFrames& XAnimPartTransFrames::GetFrames() { - return mFrames; -} - -const XAnimDynamicFrames& XAnimPartTransFrames::GetFrames() const { - return mFrames; -} - -void XAnimPartTransFrames::SetFrames(const XAnimDynamicFrames& frames) { - mFrames = frames; -} - -XAnimDynamicIndices& XAnimPartTransFrames::GetIndices() { - return mIndices; -} - -const XAnimDynamicIndices& XAnimPartTransFrames::GetIndices() const { - return mIndices; -} - -void XAnimPartTransFrames::SetIndices(const XAnimDynamicIndices& indices) { - mIndices = indices; -} - - - - diff --git a/libs/xassets/xanimparttransframes.h b/libs/xassets/xanimparttransframes.h index 3bb35c4..68b2932 100644 --- a/libs/xassets/xanimparttransframes.h +++ b/libs/xassets/xanimparttransframes.h @@ -1,7 +1,3 @@ - - - - #ifndef XANIMPARTTRANSFRAMES_H #define XANIMPARTTRANSFRAMES_H @@ -9,35 +5,22 @@ #include "xanimdynamicframes.h" #include "xanimdynamicindices.h" +#include + class XAnimPartTransFrames : public XAsset { public: explicit XAnimPartTransFrames(); + ~XAnimPartTransFrames(); void ParseData(QDataStream *aStream) override; - - const float* GetMins() const; - void SetMins(const float* mins, size_t count = 3); - - const float* GetSize() const; - void SetSize(const float* size, size_t count = 3); - - XAnimDynamicFrames& GetFrames(); - const XAnimDynamicFrames& GetFrames() const; - void SetFrames(const XAnimDynamicFrames& frames); - - XAnimDynamicIndices& GetIndices(); - const XAnimDynamicIndices& GetIndices() const; - void SetIndices(const XAnimDynamicIndices& indices); + void Clear() override; private: - float mMins[3] = {0.0f, 0.0f, 0.0f}; - float mSize[3] = {0.0f, 0.0f, 0.0f}; + QVector3D mMins; + QVector3D mMaxs; XAnimDynamicFrames mFrames; XAnimDynamicIndices mIndices; }; #endif // XANIMPARTTRANSFRAMES_H - - - diff --git a/libs/xassets/xasset.cpp b/libs/xassets/xasset.cpp index fe92e39..ea494d0 100644 --- a/libs/xassets/xasset.cpp +++ b/libs/xassets/xasset.cpp @@ -1,7 +1,29 @@ #include "xasset.h" +#include "xanimparts.h" +#include "xclipmap.h" +#include "xcomworld.h" +#include "xfont.h" +#include "xfximpacttable.h" +#include "xgameworldmp.h" +#include "xgameworldsp.h" +#include "xgfxlightdef.h" +#include "xgfxworld.h" +#include "xloadedsound.h" +#include "xlocalizeentry.h" +#include "xmaterialpixelshader.h" +#include "xmenulist.h" +#include "xmodelpieces.h" +#include "xrawfile.h" +#include "xsoundaliaslist.h" +#include "xsounddriverglobals.h" +#include "xstringtable.h" +#include "xweapondef.h" XAsset::XAsset() - : mPtr(0) { + : mPtr(0) + , mType(ASSET_TYPE_NONE) + , mName("Unknown Asset") +{ } @@ -14,10 +36,37 @@ void XAsset::SetPtr(qint32 aPtr) { mPtr = aPtr; } -qint32 XAsset::GetPtr() { +qint32 XAsset::GetPtr() const +{ return mPtr; } +void XAsset::SetType(XAssetType aType) +{ + mType = aType; +} + +XAssetType XAsset::GetType() const +{ + return mType; +} + +void XAsset::SetName(QString aName) +{ + mName = aName; +} + +QString XAsset::GetName() const +{ + return mName; +} + +void XAsset::Clear() +{ + mPtr = 0; + mType = ASSET_TYPE_NONE; +} + void XAsset::ParsePtr(QDataStream *aStream, bool aDataFlag) { *aStream >> mPtr; @@ -26,3 +75,348 @@ void XAsset::ParsePtr(QDataStream *aStream, bool aDataFlag) { ParseData(aStream); } } + +XAsset* XAsset::Create(XAssetType aAssetType) +{ + switch (aAssetType) + { + case ASSET_TYPE_XANIMPARTS: + return new XAnimParts(); + case ASSET_TYPE_XMODEL: + return new XModel(); + case ASSET_TYPE_MATERIAL: + return new XMaterial(); + case ASSET_TYPE_PIXELSHADER: + return new XMaterialPixelShader(); + case ASSET_TYPE_TECHNIQUE_SET: + return new XMaterialTechniqueSet(); + case ASSET_TYPE_IMAGE: + return new XGfxImage(); + case ASSET_TYPE_SOUND: + return new XSoundAliasList(); + case ASSET_TYPE_SOUND_CURVE: + return new XSoundCurve(); + case ASSET_TYPE_LOADED_SOUND: + return new XLoadedSound(); + case ASSET_TYPE_CLIPMAP: + case ASSET_TYPE_CLIPMAP_PVS: + return new XClipMap(); + case ASSET_TYPE_COMWORLD: + return new XComWorld(); + case ASSET_TYPE_GAMEWORLD_SP: + return new XGameWorldSp(); + case ASSET_TYPE_GAMEWORLD_MP: + return new XGameWorldMp(); + case ASSET_TYPE_MAP_ENTS: + return new XMapEnts(); + case ASSET_TYPE_GFXWORLD: + return new XGfxWorld(); + case ASSET_TYPE_LIGHT_DEF: + return new XGfxLightDef(); + case ASSET_TYPE_FONT: + return new XFont(); + case ASSET_TYPE_MENULIST: + return new XMenuList(); + case ASSET_TYPE_MENU: + return new XMenuDef(); + case ASSET_TYPE_LOCALIZE_ENTRY: + return new XLocalizeEntry(); + case ASSET_TYPE_WEAPON: + return new XWeaponDef(); + case ASSET_TYPE_SNDDRIVER_GLOBALS: + return new XSoundDriverGlobals(); + case ASSET_TYPE_FX: + return new XFxEffectDef(); + case ASSET_TYPE_IMPACT_FX: + return new XFxImpactTable(); + case ASSET_TYPE_RAWFILE: + return new XRawFile(); + case ASSET_TYPE_STRINGTABLE: + return new XStringTable(); + case ASSET_TYPE_XMODELPIECES: + return new XModelPieces(); + case ASSET_TYPE_PHYSPRESET: + return new XPhysPreset(); + // case ASSET_TYPE_UI_MAP: + // case ASSET_TYPE_AITYPE: + // case ASSET_TYPE_MPTYPE: + // case ASSET_TYPE_CHARACTER: + // case ASSET_TYPE_XMODELALIAS: + // case ASSET_TYPE_COUNT: + // case ASSET_TYPE_STRING: + // case ASSET_TYPE_ASSETLIST: + default: + break; + } + + return nullptr; +} + +QString XAsset::XAssetTypeToString(XAssetType type) { + switch (type) { + case ASSET_TYPE_XMODELPIECES: + return "ModelPieces"; + case ASSET_TYPE_PHYSPRESET: + return "PhysPreset"; + case ASSET_TYPE_XANIMPARTS: + return "AnimParts"; + case ASSET_TYPE_XMODEL: + return "Model"; + case ASSET_TYPE_MATERIAL: + return "Material"; + case ASSET_TYPE_PIXELSHADER: + return "PixelShader"; + case ASSET_TYPE_TECHNIQUE_SET: + return "TechniqueSet"; + case ASSET_TYPE_IMAGE: + return "Image"; + case ASSET_TYPE_SOUND: + return "Sound"; + case ASSET_TYPE_SOUND_CURVE: + return "SoundCurve"; + case ASSET_TYPE_LOADED_SOUND: + return "LoadedSound"; + case ASSET_TYPE_CLIPMAP: + return "ClipMap"; + case ASSET_TYPE_CLIPMAP_PVS: + return "ClipMapPvs"; + case ASSET_TYPE_COMWORLD: + return "ComWorld"; + case ASSET_TYPE_GAMEWORLD_SP: + return "GameWorldSp"; + case ASSET_TYPE_GAMEWORLD_MP: + return "GameWorldMp"; + case ASSET_TYPE_MAP_ENTS: + return "MapEnts"; + case ASSET_TYPE_GFXWORLD: + return "GfxWorld"; + case ASSET_TYPE_LIGHT_DEF: + return "LightDef"; + case ASSET_TYPE_UI_MAP: + return "UiMap"; + case ASSET_TYPE_FONT: + return "Font"; + case ASSET_TYPE_MENULIST: + return "MenuList"; + case ASSET_TYPE_MENU: + return "Menu"; + case ASSET_TYPE_LOCALIZE_ENTRY: + return "LocalizeEntry"; + case ASSET_TYPE_WEAPON: + return "Weapon"; + case ASSET_TYPE_SNDDRIVER_GLOBALS: + return "SndDriverGlobals"; + case ASSET_TYPE_FX: + return "Fx"; + case ASSET_TYPE_IMPACT_FX: + return "ImpactFx"; + case ASSET_TYPE_AITYPE: + return "AiType"; + case ASSET_TYPE_MPTYPE: + return "MpType"; + case ASSET_TYPE_CHARACTER: + return "Character"; + case ASSET_TYPE_XMODELALIAS: + return "ModelAlias"; + case ASSET_TYPE_RAWFILE: + return "RawFile"; + case ASSET_TYPE_STRINGTABLE: + return "StringTable"; + case ASSET_TYPE_COUNT: + return "Count"; + case ASSET_TYPE_STRING: + return "String"; + case ASSET_TYPE_ASSETLIST: + return "AssetList"; + case ASSET_TYPE_COLLISION_MAP: + return "CollisionMap"; + case ASSET_TYPE_GFX_MAP: + return "GfxMap"; + case ASSET_TYPE_D3DBSP: + return "D3dBsp"; + case ASSET_TYPE_GAME_MAP_SP: + return "GameMapSp"; + case ASSET_TYPE_COL_MAP_SP: + return "ColMapSp"; + case ASSET_TYPE_DESTRUCTIBLE: + return "Destructible"; + case ASSET_TYPE_SHOCK_FILE: + return "ShockFile"; + case ASSET_TYPE_PHYSCOLLMAP: + return "PhysCollMap"; + case ASSET_TYPE_XMODEL_SURFS: + return "XModelSurfs"; + case ASSET_TYPE_CLIPMAP_SP: + return "ClipmapSp"; + case ASSET_TYPE_CLIPMAP_MP: + return "ClipmapMp"; + case ASSET_TYPE_FXWORLD: + return "FxWorld"; + case ASSET_TYPE_LEADERBOARD: + return "Leaderboard"; + case ASSET_TYPE_STRUCTURED_DATA_DEF: + return "StructuredDataDef"; + case ASSET_TYPE_TRACER: + return "Tracer"; + case ASSET_TYPE_VEHICLE: + return "Vehicle"; + case ASSET_TYPE_ADDON_MAP_ENTS: + return "AddonMapEnts"; + case ASSET_TYPE_PHYSCONSTRAINTS: + return "PhysConstraints"; + case ASSET_TYPE_DESTRUCTIBLEDEF: + return "DestructibleDef"; + case ASSET_TYPE_SOUND_PATCH: + return "SoundPatch"; + case ASSET_TYPE_WEAPONDEF: + return "WeaponDef"; + case ASSET_TYPE_WEAPON_VARIANT: + return "WeaponVariant"; + case ASSET_TYPE_MPBODY: + return "MpBody"; + case ASSET_TYPE_MPHEAD: + return "MpHead"; + case ASSET_TYPE_PACK_INDEX: + return "PackIndex"; + case ASSET_TYPE_XGLOBALS: + return "Globals"; + case ASSET_TYPE_DDL: + return "Ddl"; + case ASSET_TYPE_GLASSES: + return "Glasses"; + case ASSET_TYPE_EMBLEMSET: + return "EmblemSet"; + case ASSET_TYPE_GLASSWORLD: + return "GlassWorld"; + case ASSET_TYPE_PATHDATA: + return "PathData"; + case ASSET_TYPE_VEHICLE_TRACK: + return "VehicleTrack"; + case ASSET_TYPE_ATTACHMENT: + return "Attachment"; + case ASSET_TYPE_SURFACE_FX: + return "SurfaceFx"; + case ASSET_TYPE_SCRIPTFILE: + return "ScriptFile"; + case ASSET_TYPE_SOUND_SUBMIX: + return "SoundSubmix"; + case ASSET_TYPE_SOUND_EVENT: + return "SoundEvent"; + case ASSET_TYPE_LPF_CURVE: + return "LpfCurve"; + case ASSET_TYPE_REVERB_CURVE: + return "ReverbCurve"; + case ASSET_TYPE_GFXWORLD_TRANSIENT_ZONE: + return "GfxWorldTransientZone"; + case ASSET_TYPE_ANIMCLASS: + return "AnimClass"; + case ASSET_TYPE_NET_CONST_STRINGS: + return "NetConstStrings"; + case ASSET_TYPE_REVERB_PRESET: + return "ReverbPreset"; + case ASSET_TYPE_LUA_FILE: + return "LuaFile"; + case ASSET_TYPE_SCRIPTABLE: + return "Scriptable"; + case ASSET_TYPE_EQUIPMENT_SND_TABLE: + return "EquipmentSndTable"; + case ASSET_TYPE_DOPPLER_PRESET: + return "DopplerPreset"; + case ASSET_TYPE_LASER: + return "Laser"; + case ASSET_TYPE_SKELETON_SCRIPT: + return "SkeletonScript"; + case ASSET_TYPE_PHYS_CONSTRAINTS: + return "PhysConstraints"; + case ASSET_TYPE_DESTRUCTIBLE_DEF: + return "DestructibleDef"; + case ASSET_TYPE_XMODEL_MESH: + return "ModelMesh"; + case ASSET_TYPE_COMPUTE_SHADER_SET: + return "ComputeShaderSet"; + case ASSET_TYPE_FONT_ICON: + return "FontIcon"; + case ASSET_TYPE_PLAYER_SOUNDS_TABLE: + return "PlayerSoundsTable"; + case ASSET_TYPE_PLAYER_FX_TABLE: + return "PlayerFxTable"; + case ASSET_TYPE_SHARED_WEAPON_SOUNDS: + return "SharedWeaponSounds"; + case ASSET_TYPE_ATTACHMENT_UNIQUE: + return "AttachmentUnique"; + case ASSET_TYPE_WEAPON_CAMO: + return "WeaponCamo"; + case ASSET_TYPE_CUSTOMIZATION_TABLE: + return "CustomizationTable"; + case ASSET_TYPE_CUSTOMIZATION_TABLE_FEIMAGES: + return "CustomizationTableFeimages"; + case ASSET_TYPE_CUSTOMIZATION_TABLE_COLOR: + return "CustomizationTableColor"; + case ASSET_TYPE_STRUCTURED_TABLE: + return "StructuredTable"; + case ASSET_TYPE_LEADERBOARD_DEF: + return "LeaderboardDef"; + case ASSET_TYPE_SCRIPT_PARSE_TREE: + return "ScriptParseTree"; + case ASSET_TYPE_KEY_VALUE_PAIRS: + return "KeyValuePairs"; + case ASSET_TYPE_VEHICLE_TRACER: + return "VehicleTracer"; + case ASSET_TYPE_SURFACE_FX_TABLE: + return "SurfaceFxTable"; + case ASSET_TYPE_SURFACE_SOUND_DEF: + return "SurfaceSoundDef"; + case ASSET_TYPE_FOOTSTEP_TABLE: + return "FootstepTable"; + case ASSET_TYPE_ENTITY_FX_IMPACTS: + return "EntityFxImpacts"; + case ASSET_TYPE_ENTITY_SOUND_IMPACTS: + return "EntitySoundImpacts"; + case ASSET_TYPE_VEHICLE_FX_DEF: + return "VehicleFxDef"; + case ASSET_TYPE_VEHICLE_SOUND_DEF: + return "VehicleSoundDef"; + case ASSET_TYPE_SCRIPT_BUNDLE: + return "ScriptBundle"; + case ASSET_TYPE_SCRIPT_BUNDLE_LIST: + return "ScriptBundleList"; + case ASSET_TYPE_RUMBLE: + return "Rumble"; + case ASSET_TYPE_AIM_TABLE: + return "AimTable"; + case ASSET_TYPE_ANIM_SELECTOR_TABLE: + return "AnimSelectorTable"; + case ASSET_TYPE_ANIM_MAPPING_TABLE: + return "AnimMappingTable"; + case ASSET_TYPE_ANIM_STATE_MACHINE: + return "AnimStateMachine"; + case ASSET_TYPE_BEHAVIOR_TREE: + return "BehaviorTree"; + case ASSET_TYPE_BEHAVIOR_STATE_MACHINE: + return "BehaviorStateMachine"; + case ASSET_TYPE_S_ANIM: + return "SAnim"; + case ASSET_TYPE_BIT_FIELD: + return "BitField"; + case ASSET_TYPE_MAP_TABLE: + return "MapTable"; + case ASSET_TYPE_MAP_TABLE_LOADING_IMAGES: + return "MapTableLoadingImages"; + case ASSET_TYPE_MEDAL: + return "Medal"; + case ASSET_TYPE_MEDAL_TABLE: + return "MedalTable"; + case ASSET_TYPE_OBJECTIVE: + return "Objective"; + case ASSET_TYPE_OBJECTIVE_LIST: + return "ObjectiveList"; + case ASSET_TYPE_BEAM: + return "Beam"; + case ASSET_TYPE_STREAMER_HINT: + return "StreamerHint"; + case ASSET_TYPE_CG_MEDIA_TABLE: + return "CgMediaTable"; + default: + return ""; + } +} diff --git a/libs/xassets/xasset.h b/libs/xassets/xasset.h index e3ada07..b4e0602 100644 --- a/libs/xassets/xasset.h +++ b/libs/xassets/xasset.h @@ -1,7 +1,10 @@ #ifndef XASSET_H #define XASSET_H +#include "xassettype.h" + #include +#include class XAsset { @@ -10,14 +13,25 @@ public: virtual ~XAsset(); void SetPtr(qint32 aPtr); - qint32 GetPtr(); + qint32 GetPtr() const; + + void SetType(XAssetType aType); + XAssetType GetType() const; + + void SetName(QString aName); + QString GetName() const; virtual void Clear(); virtual void ParsePtr(QDataStream *aStream, bool aDataFlag = true); virtual void ParseData(QDataStream *aStream) = 0; + static XAsset* Create(XAssetType aAssetType); + static QString XAssetTypeToString(XAssetType type); + private: qint32 mPtr; + XAssetType mType; + QString mName; }; #endif // XASSET_H diff --git a/libs/xassets/xassetlist.cpp b/libs/xassets/xassetlist.cpp index 9d1d8a6..d95d6a9 100644 --- a/libs/xassets/xassetlist.cpp +++ b/libs/xassets/xassetlist.cpp @@ -1,32 +1,71 @@ #include "xassetlist.h" +#include "qdebug.h" +#include "qfiledevice.h" XAssetList::XAssetList() : XAsset() , mStringList() - , mAssetCount(0) + , mAssetCount() , mAssets() + , mAssetHeaders() + , mZoneFile(nullptr) { } +XAssetList::XAssetList(ZoneFile* aZoneFile) + : XAsset() + , mStringList() + , mAssetCount() + , mAssets() + , mAssetHeaders() + , mZoneFile(aZoneFile) +{ +} + +XAssetList::~XAssetList() +{ + +} + void XAssetList::ParseData(QDataStream *aStream) { - if (GetPtr() == -1) { - // Parse string list - mStringList.ParsePtr(aStream); + // Parse string list + qDebug() << aStream->device()->pos(); + mStringList.ParsePtr(aStream); - // Parse asset count and assets - *aStream >> mAssetCount; - aStream->skipRawData(2 * 4); + // Parse asset count and assets + qint32 assetsPtr; + *aStream + >> mAssetCount + >> assetsPtr; - mStringList.ParseData(aStream); + mStringList.ParseData(aStream); - for (int i = 0; i < mAssetCount; i++) { - //XAsset asset; - //asset.ParseData(aStream); - //mAssets.append(asset); + if (assetsPtr) + { + for (int i = 0; i < mAssetCount; i++) + { + XAssetHeader assetHeader(mZoneFile); + assetHeader.ParseData(aStream); + + mAssetHeaders.append(assetHeader); + } + + for (int i = 0; i < mAssetHeaders.size(); i++) + { + XAssetHeader assetHeader = mAssetHeaders[i]; + XAsset* asset = XAsset::Create(assetHeader.GetAssetType()); + asset->ParseData(aStream); + + mAssets.append(asset); } } } +void XAssetList::Clear() +{ + +} + XScriptStringList XAssetList::GetStringList() const { return mStringList; } @@ -35,20 +74,39 @@ void XAssetList::SetStringList(const XScriptStringList& stringList) { mStringList = stringList; } -int XAssetList::GetAssetCount() const { - return mAssetCount; -} - -void XAssetList::SetAssetCount(int count) { - mAssetCount = count; -} - -QVector XAssetList::GetAssets() { +QVector XAssetList::GetAssets() const { return mAssets; } +XAsset *XAssetList::GetAsset(size_t aIndex) const +{ + return mAssets[aIndex]; +} + +QVector XAssetList::GetAssetsByType(XAssetType aAssetType) const +{ + QVector foundAssets; + for (int i = 0; i < mAssets.size(); i++) + { + XAsset* asset = mAssets[i]; + if (asset->GetType() == aAssetType) + { + foundAssets.append(asset); + } + } + return foundAssets; +} + void XAssetList::SetAssets(QVector assets) { mAssets = assets; } +void XAssetList::AddAsset(XAsset *aAsset) +{ + mAssets.append(aAsset); +} +size_t XAssetList::Size() const +{ + return mAssets.size(); +} diff --git a/libs/xassets/xassetlist.h b/libs/xassets/xassetlist.h index 9f3caa1..fa7c0c3 100644 --- a/libs/xassets/xassetlist.h +++ b/libs/xassets/xassetlist.h @@ -1,31 +1,41 @@ #ifndef XASSETLIST_H #define XASSETLIST_H +#include "xassetheader.h" #include "xscriptstringlist.h" #include "xasset.h" #include +class ZoneFile; + class XAssetList : public XAsset { public: explicit XAssetList(); + XAssetList(ZoneFile* aZoneFile); + ~XAssetList(); void ParseData(QDataStream *aStream) override; + void Clear() override; XScriptStringList GetStringList() const; void SetStringList(const XScriptStringList& stringList); - int GetAssetCount() const; - void SetAssetCount(int count); - - QVector GetAssets(); + QVector GetAssets() const; + XAsset* GetAsset(size_t aIndex) const; + QVector GetAssetsByType(XAssetType aAssetType) const; void SetAssets(QVector assets); + void AddAsset(XAsset* aAsset); + + size_t Size() const; private: XScriptStringList mStringList; - int mAssetCount = 0; + quint32 mAssetCount; QVector mAssets; + QVector mAssetHeaders; + ZoneFile* mZoneFile; }; #endif // XASSETLIST_H diff --git a/libs/xassets/xassets.pro b/libs/xassets/xassets.pro index ee21e14..54bfa74 100644 --- a/libs/xassets/xassets.pro +++ b/libs/xassets/xassets.pro @@ -6,12 +6,15 @@ SOURCES += $$files($$PWD/*.cpp, true) HEADERS += $$files($$PWD/*.h, true) LIBS += \ - -L$$OUT_PWD/../libs/core -lcore + -L$$OUT_PWD/../libs/core -lcore \ + -L$$OUT_PWD/../libs/zonefile -lzonefile INCLUDEPATH += \ - $$PWD/../core + $$PWD/../core \ + $$PWD/../zonefile DEPENDPATH += \ - $$PWD/../core + $$PWD/../core \ + $$PWD/../zonefile DESTDIR = $$OUT_PWD/../ diff --git a/libs/xassets/xaudiochannelmap.h b/libs/xassets/xaudiochannelmap.h index 7734d30..9387ff0 100644 --- a/libs/xassets/xaudiochannelmap.h +++ b/libs/xassets/xaudiochannelmap.h @@ -4,6 +4,8 @@ #include "xasset.h" #include "xaudiochannelmapentry.h" +#include + class XAudioChannelMap : public XAsset { public: diff --git a/libs/xassets/xaudioformatinfo.h b/libs/xassets/xaudioformatinfo.h index c5ba96e..cf5c665 100644 --- a/libs/xassets/xaudioformatinfo.h +++ b/libs/xassets/xaudioformatinfo.h @@ -3,6 +3,8 @@ #include "xasset.h" +#include + class XAudioXmaFormat; class XAudioFormatInfo : public XAsset diff --git a/libs/xassets/xaudiopacketaligned.h b/libs/xassets/xaudiopacketaligned.h index b401d97..fe0ce47 100644 --- a/libs/xassets/xaudiopacketaligned.h +++ b/libs/xassets/xaudiopacketaligned.h @@ -2,8 +2,9 @@ #define XAUDIOPACKETALIGNED_H #include "xasset.h" +#include "xaudioxmaloopregion.h" -class XAudioXmaLoopRegion; +#include class XAudioPacketAligned : public XAsset { diff --git a/libs/xassets/xaudioseektable.h b/libs/xassets/xaudioseektable.h index 16e2b3d..fc349fd 100644 --- a/libs/xassets/xaudioseektable.h +++ b/libs/xassets/xaudioseektable.h @@ -3,7 +3,7 @@ #include "xasset.h" -class XSoundFileRef; +#include class XAudioSeekTable : public XAsset { diff --git a/libs/xassets/xaudiosound.h b/libs/xassets/xaudiosound.h index 230e1b5..94c799d 100644 --- a/libs/xassets/xaudiosound.h +++ b/libs/xassets/xaudiosound.h @@ -4,9 +4,8 @@ #include "xasset.h" #include "xaudiopacketaligned.h" #include "xaudioseektable.h" - -class XAudioSourceFormat; -class XAudioXmaDataInfo; +#include "xaudiosourceformat.h" +#include "xaudioxmadatainfo.h" class XAudioSound : public XAsset { diff --git a/libs/xassets/xcleafbrushnodechildren.cpp b/libs/xassets/xcleafbrushnodechildren.cpp index dd3fbf1..57c0311 100644 --- a/libs/xassets/xcleafbrushnodechildren.cpp +++ b/libs/xassets/xcleafbrushnodechildren.cpp @@ -1,52 +1,31 @@ - - - - - - #include "xcleafbrushnodechildren.h" XCLeafBrushNodeChildren::XCLeafBrushNodeChildren() - : XAsset() { + : XAsset() + , mDist(0.0f) + , mRange(0.0f) + , mChildOffset() +{ +} + +XCLeafBrushNodeChildren::~XCLeafBrushNodeChildren() +{ + } void XCLeafBrushNodeChildren::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read((char*)&mDist, sizeof(float)); - aStream->read((char*)&mRange, sizeof(float)); - aStream->read((char*)mChildOffset, 2 * sizeof(quint16)); + *aStream + >> mDist + >> mRange + >> mChildOffset[0] + >> mChildOffset[1]; } } -float XCLeafBrushNodeChildren::GetDist() const { - return mDist; +void XCLeafBrushNodeChildren::Clear() +{ + mDist = 0.0f; + mRange = 0.0f; + mChildOffset = QVector(); } - -void XCLeafBrushNodeChildren::SetDist(float dist) { - mDist = dist; -} - -float XCLeafBrushNodeChildren::GetRange() const { - return mRange; -} - -void XCLeafBrushNodeChildren::SetRange(float range) { - mRange = range; -} - -quint16 XCLeafBrushNodeChildren::GetChildOffset(int index) const { - if (index >= 0 && index < 2) { - return mChildOffset[index]; - } - return 0; -} - -void XCLeafBrushNodeChildren::SetChildOffset(int index, quint16 offset) { - if (index >= 0 && index < 2) { - mChildOffset[index] = offset; - } -} - - - - diff --git a/libs/xassets/xcleafbrushnodechildren.h b/libs/xassets/xcleafbrushnodechildren.h index f0d5a39..75e9623 100644 --- a/libs/xassets/xcleafbrushnodechildren.h +++ b/libs/xassets/xcleafbrushnodechildren.h @@ -1,39 +1,23 @@ - - - - - - #ifndef XCLEAFBRUSHNODECHILDREN_H #define XCLEAFBRUSHNODECHILDREN_H #include "xasset.h" +#include + class XCLeafBrushNodeChildren : public XAsset { public: explicit XCLeafBrushNodeChildren(); + ~XCLeafBrushNodeChildren(); void ParseData(QDataStream *aStream) override; - - float GetDist() const; - void SetDist(float dist); - - float GetRange() const; - void SetRange(float range); - - quint16 GetChildOffset(int index) const; - void SetChildOffset(int index, quint16 offset); + void Clear() override; private: - float mDist = 0.0f; - float mRange = 0.0f; - quint16 mChildOffset[2] = {0}; + float mDist; + float mRange; + QVector mChildOffset; }; #endif // XCLEAFBRUSHNODECHILDREN_H - - - - - diff --git a/libs/xassets/xcleafbrushnodedata.cpp b/libs/xassets/xcleafbrushnodedata.cpp index 1e11748..92fc1eb 100644 --- a/libs/xassets/xcleafbrushnodedata.cpp +++ b/libs/xassets/xcleafbrushnodedata.cpp @@ -1,9 +1,10 @@ #include "xcleafbrushnodedata.h" +#include "xcleafbrushnodeleaf.h" XCLeafBrushNodeData::XCLeafBrushNodeData() : XAsset() - , mLeaf() - , mChildren() + , mLeaf(new XCLeafBrushNodeLeaf()) + , mChildren(new XCLeafBrushNodeChildren()) { } @@ -16,28 +17,28 @@ void XCLeafBrushNodeData::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { // We need to determine which part of the union to parse // For simplicity, we'll assume it's always leaf for now - mLeaf.ParseData(aStream); + mLeaf->ParseData(aStream); } } void XCLeafBrushNodeData::Clear() { - mLeaf.Clear(); - mChildren.Clear(); + mLeaf->Clear(); + mChildren->Clear(); } -const XCLeafBrushNodeLeaf& XCLeafBrushNodeData::GetLeaf() const { +XCLeafBrushNodeLeaf *XCLeafBrushNodeData::GetLeaf() const { return mLeaf; } -void XCLeafBrushNodeData::SetLeaf(const XCLeafBrushNodeLeaf& leaf) { - mLeaf = leaf; +void XCLeafBrushNodeData::SetLeaf(XCLeafBrushNodeLeaf& leaf) { + mLeaf = &leaf; } -const XCLeafBrushNodeChildren& XCLeafBrushNodeData::GetChildren() const { +XCLeafBrushNodeChildren* XCLeafBrushNodeData::GetChildren() const { return mChildren; } -void XCLeafBrushNodeData::SetChildren(const XCLeafBrushNodeChildren& children) { - mChildren = children; +void XCLeafBrushNodeData::SetChildren(XCLeafBrushNodeChildren& children) { + mChildren = &children; } diff --git a/libs/xassets/xcleafbrushnodedata.h b/libs/xassets/xcleafbrushnodedata.h index d224479..c5cdca5 100644 --- a/libs/xassets/xcleafbrushnodedata.h +++ b/libs/xassets/xcleafbrushnodedata.h @@ -2,9 +2,10 @@ #define XCLEAFBRUSHNODEDATA_H #include "xasset.h" -#include "xcleafbrushnodeleaf.h" #include "xcleafbrushnodechildren.h" +class XCLeafBrushNodeLeaf; + class XCLeafBrushNodeData : public XAsset { public: @@ -12,19 +13,19 @@ public: virtual ~XCLeafBrushNodeData() override; void ParseData(QDataStream *aStream) override; - void Clear() override; + virtual void Clear() override; // Option 1: Leaf data - const XCLeafBrushNodeLeaf& GetLeaf() const; - void SetLeaf(const XCLeafBrushNodeLeaf& leaf); + XCLeafBrushNodeLeaf* GetLeaf() const; + void SetLeaf(XCLeafBrushNodeLeaf& leaf); // Option 2: Children data - const XCLeafBrushNodeChildren& GetChildren() const; - void SetChildren(const XCLeafBrushNodeChildren& children); + XCLeafBrushNodeChildren *GetChildren() const; + void SetChildren(XCLeafBrushNodeChildren& children); private: - XCLeafBrushNodeLeaf mLeaf; - XCLeafBrushNodeChildren mChildren; + XCLeafBrushNodeLeaf *mLeaf; + XCLeafBrushNodeChildren *mChildren; }; #endif // XCLEAFBRUSHNODEDATA_H diff --git a/libs/xassets/xcleafbrushnodeleaf.cpp b/libs/xassets/xcleafbrushnodeleaf.cpp index 0c4d2f2..d796332 100644 --- a/libs/xassets/xcleafbrushnodeleaf.cpp +++ b/libs/xassets/xcleafbrushnodeleaf.cpp @@ -1,13 +1,13 @@ - - - - - - #include "xcleafbrushnodeleaf.h" XCLeafBrushNodeLeaf::XCLeafBrushNodeLeaf() - : XAsset() { + : XCLeafBrushNodeData() + , mBrushes() { +} + +XCLeafBrushNodeLeaf::~XCLeafBrushNodeLeaf() +{ + } void XCLeafBrushNodeLeaf::ParseData(QDataStream *aStream) { @@ -15,14 +15,3 @@ void XCLeafBrushNodeLeaf::ParseData(QDataStream *aStream) { // We would parse brushes here, but we're using a placeholder } } - -void* XCLeafBrushNodeLeaf::GetBrushes() const { - return mBrushes; -} - -void XCLeafBrushNodeLeaf::SetBrushes(void* brushes) { - mBrushes = brushes; -} - - - diff --git a/libs/xassets/xcleafbrushnodeleaf.h b/libs/xassets/xcleafbrushnodeleaf.h index 04bf0f8..cca5b4b 100644 --- a/libs/xassets/xcleafbrushnodeleaf.h +++ b/libs/xassets/xcleafbrushnodeleaf.h @@ -1,33 +1,19 @@ - - - - - - #ifndef XCLEAFBRUSHNODELEAF_H #define XCLEAFBRUSHNODELEAF_H -#include "xasset.h" +#include "xcleafbrushnodedata.h" -class XCLeafBrushNodeLeaf : public XAsset +class XCLeafBrushNodeLeaf : public XCLeafBrushNodeData { public: explicit XCLeafBrushNodeLeaf(); + ~XCLeafBrushNodeLeaf(); void ParseData(QDataStream *aStream) override; - - // Note: In a real implementation, we would have proper handling for brushes pointer - // For now, we'll just use a placeholder - void* GetBrushes() const; - void SetBrushes(void* brushes); + void Clear() override; private: - void* mBrushes = nullptr; // Placeholder for unsigned __int16* + QVector mBrushes; }; #endif // XCLEAFBRUSHNODELEAF_H - - - - - diff --git a/libs/xassets/xclipmap.cpp b/libs/xassets/xclipmap.cpp index f7e2c25..464e1f4 100644 --- a/libs/xassets/xclipmap.cpp +++ b/libs/xassets/xclipmap.cpp @@ -1,104 +1,25 @@ - - - - - - #include "xclipmap.h" XClipMap::XClipMap() : XAsset() { + SetType(ASSET_TYPE_CLIPMAP); + SetName("ClipMap"); +} + +XClipMap::~XClipMap() +{ + } void XClipMap::ParseData(QDataStream *aStream) { - if (GetPtr() == -1) { - char name[64]; - aStream->read(name, 64); - mName = QString::fromUtf8(name); + mName = XString::ParseCustom(aStream); - aStream->read((char*)&mChecksum, sizeof(int)); + *aStream >> mChecksum; - // We would parse arrays here, but we're using placeholders - } + // We would parse arrays here, but we're using placeholders } -const QString& XClipMap::GetName() const { - return mName; -} +void XClipMap::Clear() +{ -void XClipMap::SetName(const QString& name) { - mName = name; } - -int XClipMap::GetChecksum() const { - return mChecksum; -} - -void XClipMap::SetChecksum(int checksum) { - mChecksum = checksum; -} - -void* XClipMap::GetStaticModels() const { - return mStaticModels; -} - -void XClipMap::SetStaticModels(void* staticModels) { - mStaticModels = staticModels; -} - -int XClipMap::GetNumStaticModels() const { - return mNumStaticModels; -} - -void XClipMap::SetNumStaticModels(int count) { - mNumStaticModels = count; -} - -void* XClipMap::GetCollisionAabbTrees() const { - return mCollisionAabbTrees; -} - -void XClipMap::SetCollisionAabbTrees(void* trees) { - mCollisionAabbTrees = trees; -} - -int XClipMap::GetNumCollisionAabbTrees() const { - return mNumCollisionAabbTrees; -} - -void XClipMap::SetNumCollisionAabbTrees(int count) { - mNumCollisionAabbTrees = count; -} - -void* XClipMap::GetMaterials() const { - return mMaterials; -} - -void XClipMap::SetMaterials(void* materials) { - mMaterials = materials; -} - -int XClipMap::GetNumMaterials() const { - return mNumMaterials; -} - -void XClipMap::SetNumMaterials(int count) { - mNumMaterials = count; -} - -void* XClipMap::GetLeafBrushNodes() const { - return mLeafBrushNodes; -} - -void XClipMap::SetLeafBrushNodes(void* nodes) { - mLeafBrushNodes = nodes; -} - -int XClipMap::GetNumLeafBrushNodes() const { - return mNumLeafBrushNodes; -} - -void XClipMap::SetNumLeafBrushNodes(int count) { - mNumLeafBrushNodes = count; -} - diff --git a/libs/xassets/xclipmap.h b/libs/xassets/xclipmap.h index c2054bb..33dac01 100644 --- a/libs/xassets/xclipmap.h +++ b/libs/xassets/xclipmap.h @@ -1,76 +1,105 @@ - - - - - - - #ifndef XCLIPMAP_H #define XCLIPMAP_H #include "xasset.h" -#include - -class XCStaticModel_s; // Forward declaration -class XCollisionAabbTree; // Forward declaration -class XDmaterial_t; // Forward declaration -class XCLeafBrushNode; // Forward declaration +#include "xcleaf.h" +#include "xcleafbrushnode.h" +#include "xcnode.h" +#include "xcbrush.h" +#include "xcmodel.h" +#include "xcollisionaabbtree.h" +#include "xcollisionborder.h" +#include "xcollisionpartition.h" +#include "xcplane.h" +#include "xcstaticmodel.h" +#include "xdmaterial.h" +#include "xdynentityclient.h" +#include "xdynentitydef.h" +#include "xdynentitypose.h" +#include "xdynentitycoll.h" +#include "xmapents.h" class XClipMap : public XAsset { public: explicit XClipMap(); + ~XClipMap(); void ParseData(QDataStream *aStream) override; - - const QString& GetName() const; - void SetName(const QString& name); - - int GetChecksum() const; - void SetChecksum(int checksum); - - // Note: In a real implementation, we would have proper handling for these arrays - // For now, we'll just use placeholders - void* GetStaticModels() const; - void SetStaticModels(void* staticModels); - - int GetNumStaticModels() const; - void SetNumStaticModels(int count); - - void* GetCollisionAabbTrees() const; - void SetCollisionAabbTrees(void* trees); - - int GetNumCollisionAabbTrees() const; - void SetNumCollisionAabbTrees(int count); - - void* GetMaterials() const; - void SetMaterials(void* materials); - - int GetNumMaterials() const; - void SetNumMaterials(int count); - - void* GetLeafBrushNodes() const; - void SetLeafBrushNodes(void* nodes); - - int GetNumLeafBrushNodes() const; - void SetNumLeafBrushNodes(int count); + void Clear() override; private: - QString mName = ""; - int mChecksum = 0; + QString mName; - // Placeholders for arrays - void* mStaticModels = nullptr; // Placeholder for XCStaticModel_s* - int mNumStaticModels = 0; + bool mIsInUse; - void* mCollisionAabbTrees = nullptr; // Placeholder for XCollisionAabbTree* - int mNumCollisionAabbTrees = 0; + int mPlaneCount; + QVector mPlanes; - void* mMaterials = nullptr; // Placeholder for XDmaterial_t* - int mNumMaterials = 0; + uint mNumStaticModels; + QVector mStaticModelList; - void* mLeafBrushNodes = nullptr; // Placeholder for XCLeafBrushNode* - int mNumLeafBrushNodes = 0; + uint mNumMaterials; + QVector mMaterials; + + uint mNumBrushSides; + QVector mBrushsides; + + uint mNumBrushEdges; + QVector mBrushEdges; + + uint mNumNodes; + QVector mNodes; + + uint mNumLeafs; + QVector mLeafs; + + uint mLeafbrushNodesCount; + QVector mLeafbrushNodes; + + uint mNumLeafBrushes; + QVector mLeafbrushes; + + uint mNumLeafSurfaces; + QVector mLeafsurfaces; + + uint mVertCount; + QVector mVerts; + + int mTriCount; + QVector mTriIndices; + QVector mTriEdgeIsWalkable; + + int mBorderCount; + QVector mBorders; + + int mPartitionCount; + QVector mPartitions; + + int mAabbTreeCount; + QVector mAabbTrees; + + uint mNumSubModels; + QVector mCodels; + + quint16 mNumBrushes; + QVector mBrushes; + + int mNumClusters; + int mClusterBytes; + + qint32 mVisibilityPtr; + QVector mVisibility; + int mVised; + QVector mMapEnts; + XCBrush *mBoxBrush; + XCModel mBoxModel; + quint16 mDynEntCount[2]; + XDynEntityDef *mDynEntDefList[2]; + XDynEntityPose *mDynEntPoseList[2]; + XDynEntityClient *mDynEntClientList[2]; + XDynEntityColl *mDynEntCollList[2]; + uint mChecksum; }; #endif // XCLIPMAP_H diff --git a/libs/xassets/xcnode.cpp b/libs/xassets/xcnode.cpp index 8f8d7d6..b65ccf3 100644 --- a/libs/xassets/xcnode.cpp +++ b/libs/xassets/xcnode.cpp @@ -1,43 +1,33 @@ - - - - - - #include "xcnode.h" -XCNode_t::XCNode_t() - : XAsset() { +XCNode::XCNode() + : XAsset() + , mPlane(new XCPlane()) + , mChildren() +{ } -void XCNode_t::ParseData(QDataStream *aStream) { +XCNode::~XCNode() +{ + delete mPlane; +} + +void XCNode::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { // We would parse plane here, but we're using a placeholder + mPlane->ParseData(aStream); // Parse children - aStream->read((char*)mChildren, 2 * sizeof(qint16)); + *aStream + >> mChildren[0] + >> mChildren[1]; } } -void* XCNode_t::GetPlane() const { - return mPlane; -} - -void XCNode_t::SetPlane(void* plane) { - mPlane = plane; -} - -qint16 XCNode_t::GetChild(int index) const { - if (index >= 0 && index < 2) { - return mChildren[index]; - } - return 0; -} - -void XCNode_t::SetChild(int index, qint16 child) { - if (index >= 0 && index < 2) { - mChildren[index] = child; - } +void XCNode::Clear() +{ + mPlane->Clear(); + mChildren.clear(); } diff --git a/libs/xassets/xcnode.h b/libs/xassets/xcnode.h index ebb9cc9..481eb17 100644 --- a/libs/xassets/xcnode.h +++ b/libs/xassets/xcnode.h @@ -1,39 +1,21 @@ - - - - - - #ifndef XCNODE_H #define XCNODE_H #include "xasset.h" +#include "xcplane.h" -class CPlane; // Forward declaration - -class XCNode_t : public XAsset +class XCNode : public XAsset { public: - explicit XCNode_t(); + explicit XCNode(); + ~XCNode(); void ParseData(QDataStream *aStream) override; - - // Note: In a real implementation, we would have an XCPlane class - // For now, we'll just use a pointer to CPlane as a placeholder - void* GetPlane() const; - void SetPlane(void* plane); - - qint16 GetChild(int index) const; - void SetChild(int index, qint16 child); + void Clear() override; private: - void* mPlane = nullptr; // Placeholder for CPlane* - qint16 mChildren[2] = {0}; + XCPlane* mPlane; + QVector mChildren; }; #endif // XCNODE_H - - - - - diff --git a/libs/xassets/xcollisionaabbtree.cpp b/libs/xassets/xcollisionaabbtree.cpp index a140b0c..3e42d7d 100644 --- a/libs/xassets/xcollisionaabbtree.cpp +++ b/libs/xassets/xcollisionaabbtree.cpp @@ -1,53 +1,59 @@ - - - - - - #include "xcollisionaabbtree.h" XCollisionAabbTree::XCollisionAabbTree() - : XAsset() { + : XAsset() + , mOrigin() + , mHalfSize() + , mMaterialIndex(0) + , mChildCount(0) + , mTreeIndex() +{ +} + +XCollisionAabbTree::~XCollisionAabbTree() +{ + } void XCollisionAabbTree::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read((char*)mOrigin, 3 * sizeof(float)); - aStream->read((char*)mHalfSize, 3 * sizeof(float)); - aStream->read((char*)&mMaterialIndex, sizeof(quint16)); - aStream->read((char*)&mChildCount, sizeof(quint16)); + *aStream + >> mOrigin[0] + >> mOrigin[1] + >> mOrigin[2] + >> mHalfSize[0] + >> mHalfSize[1] + >> mHalfSize[2] + >> mMaterialIndex + >> mChildCount; // Parse union - mU.ParseData(aStream); + mTreeIndex.ParseData(aStream); } } -const float* XCollisionAabbTree::GetOrigin() const { +QVector3D XCollisionAabbTree::GetOrigin() const { return mOrigin; } -void XCollisionAabbTree::SetOrigin(const float* origin, size_t count) { - if (count <= 3) { - memcpy(mOrigin, origin, count * sizeof(float)); - } +void XCollisionAabbTree::SetOrigin(QVector3D aOrigin) { + mOrigin = aOrigin; } -const float* XCollisionAabbTree::GetHalfSize() const { +QVector3D XCollisionAabbTree::GetHalfSize() const { return mHalfSize; } -void XCollisionAabbTree::SetHalfSize(const float* halfSize, size_t count) { - if (count <= 3) { - memcpy(mHalfSize, halfSize, count * sizeof(float)); - } +void XCollisionAabbTree::SetHalfSize(QVector3D aHalfSize) { + mHalfSize = aHalfSize; } quint16 XCollisionAabbTree::GetMaterialIndex() const { return mMaterialIndex; } -void XCollisionAabbTree::SetMaterialIndex(quint16 index) { - mMaterialIndex = index; +void XCollisionAabbTree::SetMaterialIndex(quint16 aIndex) { + mMaterialIndex = aIndex; } quint16 XCollisionAabbTree::GetChildCount() const { @@ -58,16 +64,12 @@ void XCollisionAabbTree::SetChildCount(quint16 count) { mChildCount = count; } -XCollisionAabbTreeIndex& XCollisionAabbTree::GetU() { - return mU; +XCollisionAabbTreeIndex& XCollisionAabbTree::GetTreeIndex() { + return mTreeIndex; } -const XCollisionAabbTreeIndex& XCollisionAabbTree::GetU() const { - return mU; -} - -void XCollisionAabbTree::SetU(const XCollisionAabbTreeIndex& u) { - mU = u; +void XCollisionAabbTree::SetTreeIndex(const XCollisionAabbTreeIndex& aTreeIndex) { + mTreeIndex = aTreeIndex; } diff --git a/libs/xassets/xcollisionaabbtree.h b/libs/xassets/xcollisionaabbtree.h index 2e8288b..a6c5b58 100644 --- a/libs/xassets/xcollisionaabbtree.h +++ b/libs/xassets/xcollisionaabbtree.h @@ -1,49 +1,40 @@ - - - - - - #ifndef XCOLLISIONAABBTREE_H #define XCOLLISIONAABBTREE_H #include "xasset.h" #include "xcollisionaabbtreeindex.h" +#include + class XCollisionAabbTree : public XAsset { public: explicit XCollisionAabbTree(); + ~XCollisionAabbTree(); void ParseData(QDataStream *aStream) override; - const float* GetOrigin() const; - void SetOrigin(const float* origin, size_t count = 3); + QVector3D GetOrigin() const; + void SetOrigin(QVector3D aOrigin); - const float* GetHalfSize() const; - void SetHalfSize(const float* halfSize, size_t count = 3); + QVector3D GetHalfSize() const; + void SetHalfSize(QVector3D aHalfSize); quint16 GetMaterialIndex() const; - void SetMaterialIndex(quint16 index); + void SetMaterialIndex(quint16 aIndex); quint16 GetChildCount() const; - void SetChildCount(quint16 count); + void SetChildCount(quint16 aCount); - XCollisionAabbTreeIndex& GetU(); - const XCollisionAabbTreeIndex& GetU() const; - void SetU(const XCollisionAabbTreeIndex& u); + XCollisionAabbTreeIndex& GetTreeIndex(); + void SetTreeIndex(const XCollisionAabbTreeIndex& aTreeIndex); private: - float mOrigin[3] = {0.0f, 0.0f, 0.0f}; - float mHalfSize[3] = {0.0f, 0.0f, 0.0f}; + QVector3D mOrigin; + QVector3D mHalfSize; quint16 mMaterialIndex = 0; quint16 mChildCount = 0; - XCollisionAabbTreeIndex mU; + XCollisionAabbTreeIndex mTreeIndex; }; #endif // XCOLLISIONAABBTREE_H - - - - - diff --git a/libs/xassets/xcollisionaabbtreeindex.cpp b/libs/xassets/xcollisionaabbtreeindex.cpp index 42c2700..727eaf5 100644 --- a/libs/xassets/xcollisionaabbtreeindex.cpp +++ b/libs/xassets/xcollisionaabbtreeindex.cpp @@ -1,21 +1,21 @@ - - - - - - - #include "xcollisionaabbtreeindex.h" XCollisionAabbTreeIndex::XCollisionAabbTreeIndex() - : XAsset() { + : XAsset() + , mFirstChildIndex(0) + , mPartitionIndex(0) +{ + +} + +XCollisionAabbTreeIndex::~XCollisionAabbTreeIndex() +{ + } void XCollisionAabbTreeIndex::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - // We need to determine which part of the union to parse - // For simplicity, we'll assume it's always firstChildIndex for now - aStream->read((char*)&mFirstChildIndex, sizeof(int)); + *aStream >> mFirstChildIndex; } } diff --git a/libs/xassets/xcollisionaabbtreeindex.h b/libs/xassets/xcollisionaabbtreeindex.h index ac28346..6afada4 100644 --- a/libs/xassets/xcollisionaabbtreeindex.h +++ b/libs/xassets/xcollisionaabbtreeindex.h @@ -1,9 +1,3 @@ - - - - - - #ifndef XCOLLISIONAABBTREEINDEX_H #define XCOLLISIONAABBTREEINDEX_H @@ -13,6 +7,7 @@ class XCollisionAabbTreeIndex : public XAsset { public: explicit XCollisionAabbTreeIndex(); + ~XCollisionAabbTreeIndex(); void ParseData(QDataStream *aStream) override; @@ -25,15 +20,8 @@ public: void SetPartitionIndex(int index); private: - union { - int mFirstChildIndex = 0; - int mPartitionIndex = 0; - }; + int mFirstChildIndex; + int mPartitionIndex; }; #endif // XCOLLISIONAABBTREEINDEX_H - - - - - diff --git a/libs/xassets/xcollisionborder.cpp b/libs/xassets/xcollisionborder.cpp index a917522..85827a0 100644 --- a/libs/xassets/xcollisionborder.cpp +++ b/libs/xassets/xcollisionborder.cpp @@ -1,60 +1,36 @@ - - #include "xcollisionborder.h" XCollisionBorder::XCollisionBorder() - : XAsset() { + : XAsset() + , mDistEq() + , mZBase(0.0f) + , mZSlope(0.0f) + , mStart(0.0f) + , mLength(0.0f) +{ +} + +XCollisionBorder::~XCollisionBorder() +{ + } void XCollisionBorder::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read((char*)mDistEq, 3 * sizeof(float)); - aStream->read((char*)&mZBase, sizeof(float)); - aStream->read((char*)&mZSlope, sizeof(float)); - aStream->read((char*)&mStart, sizeof(float)); - aStream->read((char*)&mLength, sizeof(float)); + *aStream + >> mDistEq + >> mZBase + >> mZSlope + >> mStart + >> mLength; } } -const float* XCollisionBorder::GetDistEq() const { - return mDistEq; +void XCollisionBorder::Clear() +{ + mDistEq = QVector3D(); + mZBase = 0.0f; + mZSlope = 0.0f; + mStart = 0.0f; + mLength = 0.0f; } - -void XCollisionBorder::SetDistEq(const float* distEq, size_t count) { - if (count <= 3) { - memcpy(mDistEq, distEq, count * sizeof(float)); - } -} - -float XCollisionBorder::GetZBase() const { - return mZBase; -} - -void XCollisionBorder::SetZBase(float zBase) { - mZBase = zBase; -} - -float XCollisionBorder::GetZSlope() const { - return mZSlope; -} - -void XCollisionBorder::SetZSlope(float zSlope) { - mZSlope = zSlope; -} - -float XCollisionBorder::GetStart() const { - return mStart; -} - -void XCollisionBorder::SetStart(float start) { - mStart = start; -} - -float XCollisionBorder::GetLength() const { - return mLength; -} - -void XCollisionBorder::SetLength(float length) { - mLength = length; -} - diff --git a/libs/xassets/xcollisionborder.h b/libs/xassets/xcollisionborder.h index d01af88..d874711 100644 --- a/libs/xassets/xcollisionborder.h +++ b/libs/xassets/xcollisionborder.h @@ -1,47 +1,25 @@ - - - - - - #ifndef XCOLLISIONBORDER_H #define XCOLLISIONBORDER_H #include "xasset.h" +#include + class XCollisionBorder : public XAsset { public: explicit XCollisionBorder(); + ~XCollisionBorder(); void ParseData(QDataStream *aStream) override; - - const float* GetDistEq() const; - void SetDistEq(const float* distEq, size_t count = 3); - - float GetZBase() const; - void SetZBase(float zBase); - - float GetZSlope() const; - void SetZSlope(float zSlope); - - float GetStart() const; - void SetStart(float start); - - float GetLength() const; - void SetLength(float length); + void Clear() override; private: - float mDistEq[3] = {0.0f, 0.0f, 0.0f}; - float mZBase = 0.0f; - float mZSlope = 0.0f; - float mStart = 0.0f; - float mLength = 0.0f; + QVector3D mDistEq; + float mZBase; + float mZSlope; + float mStart; + float mLength; }; #endif // XCOLLISIONBORDER_H - - - - - diff --git a/libs/xassets/xcollisionpartition.cpp b/libs/xassets/xcollisionpartition.cpp index 707a25a..229a178 100644 --- a/libs/xassets/xcollisionpartition.cpp +++ b/libs/xassets/xcollisionpartition.cpp @@ -1,58 +1,32 @@ - - - - - - - #include "xcollisionpartition.h" XCollisionPartition::XCollisionPartition() - : XAsset() { + : XAsset() + , mTriCount(0) + , mBorderCount(0) + , mFirstTri(0) + , mBorders() +{ +} + +XCollisionPartition::~XCollisionPartition() +{ + } void XCollisionPartition::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read((char*)&mTriCount, sizeof(quint8)); - aStream->read((char*)&mBorderCount, sizeof(quint8)); - aStream->read((char*)&mFirstTri, sizeof(int)); - - // We would parse borders here, but we're using a placeholder + *aStream + >>mTriCount + >>mBorderCount + >>mFirstTri; } } -quint8 XCollisionPartition::GetTriCount() const { - return mTriCount; +void XCollisionPartition::Clear() +{ + mTriCount = 0; + mBorderCount = 0; + mFirstTri = 0; + mBorders = QVector(); } - -void XCollisionPartition::SetTriCount(quint8 count) { - mTriCount = count; -} - -quint8 XCollisionPartition::GetBorderCount() const { - return mBorderCount; -} - -void XCollisionPartition::SetBorderCount(quint8 count) { - mBorderCount = count; -} - -int XCollisionPartition::GetFirstTri() const { - return mFirstTri; -} - -void XCollisionPartition::SetFirstTri(int firstTri) { - mFirstTri = firstTri; -} - -void* XCollisionPartition::GetBorders() const { - return mBorders; -} - -void XCollisionPartition::SetBorders(void* borders) { - mBorders = borders; -} - - - - diff --git a/libs/xassets/xcollisionpartition.h b/libs/xassets/xcollisionpartition.h index 8ac0761..be322eb 100644 --- a/libs/xassets/xcollisionpartition.h +++ b/libs/xassets/xcollisionpartition.h @@ -1,47 +1,25 @@ - - - - - - #ifndef XCOLLISIONPARTITION_H #define XCOLLISIONPARTITION_H #include "xasset.h" +#include "xcollisionborder.h" -class CollisionBorder; // Forward declaration +#include class XCollisionPartition : public XAsset { public: explicit XCollisionPartition(); + ~XCollisionPartition(); void ParseData(QDataStream *aStream) override; - - quint8 GetTriCount() const; - void SetTriCount(quint8 count); - - quint8 GetBorderCount() const; - void SetBorderCount(quint8 count); - - int GetFirstTri() const; - void SetFirstTri(int firstTri); - - // Note: In a real implementation, we would have proper handling for borders pointer - // For now, we'll just use a placeholder - void* GetBorders() const; - void SetBorders(void* borders); + void Clear() override; private: - quint8 mTriCount = 0; - quint8 mBorderCount = 0; - int mFirstTri = 0; - void* mBorders = nullptr; // Placeholder for CollisionBorder* + quint8 mTriCount; + quint8 mBorderCount; + int mFirstTri; + QVector mBorders; }; #endif // XCOLLISIONPARTITION_H - - - - - diff --git a/libs/xassets/xcomworld.cpp b/libs/xassets/xcomworld.cpp index 7081051..03f9b3c 100644 --- a/libs/xassets/xcomworld.cpp +++ b/libs/xassets/xcomworld.cpp @@ -1,16 +1,22 @@ #include "xcomworld.h" -ComWorld::ComWorld() +XComWorld::XComWorld() : XAsset() , mName(new XString()) , mInUse(false) , mPrimaryLightCount(-1) , mPrimaryLights(new XComPrimaryLightArray()) +{ + SetType(ASSET_TYPE_COMWORLD); + SetName("ComWorld"); +} + +XComWorld::~XComWorld() { } -void ComWorld::Clear() +void XComWorld::Clear() { for (int i = 0; i < mPrimaryLights->size(); i++) { @@ -21,7 +27,7 @@ void ComWorld::Clear() delete mName; } -void ComWorld::ParseData(QDataStream *aStream) +void XComWorld::ParseData(QDataStream *aStream) { mName->ParsePtr(aStream, false); @@ -43,32 +49,32 @@ void ComWorld::ParseData(QDataStream *aStream) } } -QString ComWorld::GetName() const +QString XComWorld::GetName() const { return mName->GetString(); } -bool ComWorld::IsInUse() const +bool XComWorld::IsInUse() const { return mInUse; } -quint32 ComWorld::GetPrimaryLightCount() const +quint32 XComWorld::GetPrimaryLightCount() const { return mPrimaryLightCount; } -XComPrimaryLight *ComWorld::GetPrimaryLight(quint32 aIndex) const +XComPrimaryLight *XComWorld::GetPrimaryLight(quint32 aIndex) const { return mPrimaryLights->at(aIndex); } -XComPrimaryLightArray *ComWorld::GetPrimaryLights() const +XComPrimaryLightArray *XComWorld::GetPrimaryLights() const { return mPrimaryLights; } -void ComWorld::SetName(const QString &aName) +void XComWorld::SetName(const QString &aName) { if (aName != nullptr) { @@ -76,7 +82,7 @@ void ComWorld::SetName(const QString &aName) } } -void ComWorld::SetName(XString* aName) +void XComWorld::SetName(XString* aName) { if (aName != nullptr) { @@ -84,7 +90,7 @@ void ComWorld::SetName(XString* aName) } } -void ComWorld::SetInUse(bool aInUse) +void XComWorld::SetInUse(bool aInUse) { mInUse = aInUse; } diff --git a/libs/xassets/xcomworld.h b/libs/xassets/xcomworld.h index 5a1a537..5df8014 100644 --- a/libs/xassets/xcomworld.h +++ b/libs/xassets/xcomworld.h @@ -8,10 +8,11 @@ #include #include -class ComWorld : public XAsset +class XComWorld : public XAsset { public: - explicit ComWorld(); + explicit XComWorld(); + ~XComWorld(); virtual void Clear() override; virtual void ParseData(QDataStream *aStream) override; diff --git a/libs/xassets/xcstaticmodels.cpp b/libs/xassets/xcstaticmodels.cpp deleted file mode 100644 index 19b3b81..0000000 --- a/libs/xassets/xcstaticmodels.cpp +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - -#include "xcstaticmodels.h" - -XCStaticModel_s::XCStaticModel_s() - : XAsset() { -} - -void XCStaticModel_s::ParseData(QDataStream *aStream) { - if (GetPtr() == -1) { - // Parse writable - mWritable.ParseData(aStream); - - // We would parse xmodel here, but we're using a placeholder - - // Parse origin - aStream->read((char*)mOrigin, 3 * sizeof(float)); - - // Parse invScaledAxis - for (int i = 0; i < 3; ++i) { - aStream->read((char*)mInvScaledAxis[i], 3 * sizeof(float)); - } - - // Parse absmin and absmax - aStream->read((char*)mAbsmin, 3 * sizeof(float)); - aStream->read((char*)mAbsmax, 3 * sizeof(float)); - } -} - -const XCStaticModelWritable& XCStaticModel_s::GetWritable() const { - return mWritable; -} - -void XCStaticModel_s::SetWritable(const XCStaticModelWritable& writable) { - mWritable = writable; -} - -void* XCStaticModel_s::GetXModel() const { - return mXModel; -} - -void XCStaticModel_s::SetXModel(void* model) { - mXModel = model; -} - -const float* XCStaticModel_s::GetOrigin() const { - return mOrigin; -} - -void XCStaticModel_s::SetOrigin(const float* origin, size_t count) { - if (count <= 3) { - memcpy(mOrigin, origin, count * sizeof(float)); - } -} - -const float* XCStaticModel_s::GetInvScaledAxis() const { - return &mInvScaledAxis[0][0]; -} - -void XCStaticModel_s::SetInvScaledAxis(const float* axis, size_t rows, size_t cols) { - if (rows <= 3 && cols <= 3) { - for (size_t i = 0; i < rows; ++i) { - memcpy(mInvScaledAxis[i], &axis[i * cols], cols * sizeof(float)); - } - } -} - -const float* XCStaticModel_s::GetAbsmin() const { - return mAbsmin; -} - -void XCStaticModel_s::SetAbsmin(const float* absmin, size_t count) { - if (count <= 3) { - memcpy(mAbsmin, absmin, count * sizeof(float)); - } -} - -const float* XCStaticModel_s::GetAbsmax() const { - return mAbsmax; -} - -void XCStaticModel_s::SetAbsmax(const float* absmax, size_t count) { - if (count <= 3) { - memcpy(mAbsmax, absmax, count * sizeof(float)); - } -} - - - diff --git a/libs/xassets/xcstaticmodels.h b/libs/xassets/xcstaticmodels.h deleted file mode 100644 index 28e6d96..0000000 --- a/libs/xassets/xcstaticmodels.h +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - -#ifndef XCSTATICMODELS_H -#define XCSTATICMODELS_H - -#include "xasset.h" -#include "xcstaticmodelwritable.h" - -class XModel; // Forward declaration - -class XCStaticModel_s : public XAsset -{ -public: - explicit XCStaticModel_s(); - - void ParseData(QDataStream *aStream) override; - - const XCStaticModelWritable& GetWritable() const; - void SetWritable(const XCStaticModelWritable& writable); - - // Note: In a real implementation, we would have an XModel class - // For now, we'll just use a pointer to Model as a placeholder - void* GetXModel() const; - void SetXModel(void* model); - - const float* GetOrigin() const; - void SetOrigin(const float* origin, size_t count = 3); - - const float* GetInvScaledAxis() const; - void SetInvScaledAxis(const float* axis, size_t rows = 3, size_t cols = 3); - - const float* GetAbsmin() const; - void SetAbsmin(const float* absmin, size_t count = 3); - - const float* GetAbsmax() const; - void SetAbsmax(const float* absmax, size_t count = 3); - -private: - XCStaticModelWritable mWritable; - void* mXModel = nullptr; // Placeholder for Model* - float mOrigin[3] = {0.0f, 0.0f, 0.0f}; - float mInvScaledAxis[3][3] = {{0.0f}}; - float mAbsmin[3] = {0.0f, 0.0f, 0.0f}; - float mAbsmax[3] = {0.0f, 0.0f, 0.0f}; -}; - -#endif // XCSTATICMODELS_H - - - - - diff --git a/libs/xassets/xcstaticmodelwritable.cpp b/libs/xassets/xcstaticmodelwritable.cpp index 58a282a..3348cc9 100644 --- a/libs/xassets/xcstaticmodelwritable.cpp +++ b/libs/xassets/xcstaticmodelwritable.cpp @@ -1,18 +1,19 @@ - - - - - - #include "xcstaticmodelwritable.h" XCStaticModelWritable::XCStaticModelWritable() - : XAsset() { + : XAsset() + , mNextModelInWorldSector(0) +{ +} + +XCStaticModelWritable::~XCStaticModelWritable() +{ + } void XCStaticModelWritable::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read((char*)&mNextModelInWorldSector, sizeof(quint16)); + *aStream >> mNextModelInWorldSector; } } diff --git a/libs/xassets/xcstaticmodelwritable.h b/libs/xassets/xcstaticmodelwritable.h index a70fad4..e6c0ca8 100644 --- a/libs/xassets/xcstaticmodelwritable.h +++ b/libs/xassets/xcstaticmodelwritable.h @@ -1,8 +1,3 @@ - - - - - #ifndef XCSTATICMODELWRITABLE_H #define XCSTATICMODELWRITABLE_H @@ -12,6 +7,7 @@ class XCStaticModelWritable : public XAsset { public: explicit XCStaticModelWritable(); + ~XCStaticModelWritable(); void ParseData(QDataStream *aStream) override; @@ -19,11 +15,7 @@ public: void SetNextModelInWorldSector(quint16 nextModel); private: - quint16 mNextModelInWorldSector = 0; + quint16 mNextModelInWorldSector; }; #endif // XCSTATICMODELWRITABLE_H - - - - diff --git a/libs/xassets/xd3dbasetexture.cpp b/libs/xassets/xd3dbasetexture.cpp index 5eef2c4..ef838e7 100644 --- a/libs/xassets/xd3dbasetexture.cpp +++ b/libs/xassets/xd3dbasetexture.cpp @@ -3,14 +3,15 @@ XD3DBaseTexture::XD3DBaseTexture() : XAsset() , mMipFlush(0) - , mFormat(new XGpuTextureFetchConstant()) + , mFormat() + , mResource() { } XD3DBaseTexture::~XD3DBaseTexture() { - delete mFormat; + } void XD3DBaseTexture::ParseData(QDataStream *aStream) @@ -21,5 +22,6 @@ void XD3DBaseTexture::ParseData(QDataStream *aStream) void XD3DBaseTexture::Clear() { mMipFlush = 0; - mFormat->Clear(); + mFormat.Clear(); + mResource.Clear(); } diff --git a/libs/xassets/xd3dbasetexture.h b/libs/xassets/xd3dbasetexture.h index b0d8599..cfced0a 100644 --- a/libs/xassets/xd3dbasetexture.h +++ b/libs/xassets/xd3dbasetexture.h @@ -2,9 +2,8 @@ #define XD3DBASETEXTURE_H #include "xasset.h" - -class XGpuTextureFetchConstant; -class XD3DResource; +#include "xd3dresource.h" +#include "xgputexturefetchconstant.h" class XD3DBaseTexture : public XAsset { @@ -17,8 +16,8 @@ public: private: unsigned int mMipFlush; - XGpuTextureFetchConstant* mFormat; - XD3DResource* mResource; + XGpuTextureFetchConstant mFormat; + XD3DResource mResource; }; #endif // XD3DBASETEXTURE_H diff --git a/libs/xassets/xdmaterial.cpp b/libs/xassets/xdmaterial.cpp index f8f44a2..98916b4 100644 --- a/libs/xassets/xdmaterial.cpp +++ b/libs/xassets/xdmaterial.cpp @@ -1,50 +1,40 @@ - - - - - - #include "xdmaterial.h" +#include "xstring.h" -XDmaterial_t::XDmaterial_t() +XDMaterial::XDMaterial() : XAsset() { } -void XDmaterial_t::ParseData(QDataStream *aStream) { +void XDMaterial::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - char material[64]; - aStream->read(material, 64); - mMaterial = QString::fromUtf8(material); + mMaterial = XString::ParseCustom(aStream); - aStream->read((char*)&mSurfaceFlags, sizeof(int)); - aStream->read((char*)&mContentFlags, sizeof(int)); + *aStream + >> mSurfaceFlags + >> mContentFlags; } } -const QString& XDmaterial_t::GetMaterial() const { +const QString& XDMaterial::GetMaterial() const { return mMaterial; } -void XDmaterial_t::SetMaterial(const QString& material) { +void XDMaterial::SetMaterial(const QString& material) { mMaterial = material; } -int XDmaterial_t::GetSurfaceFlags() const { +int XDMaterial::GetSurfaceFlags() const { return mSurfaceFlags; } -void XDmaterial_t::SetSurfaceFlags(int flags) { +void XDMaterial::SetSurfaceFlags(int flags) { mSurfaceFlags = flags; } -int XDmaterial_t::GetContentFlags() const { +int XDMaterial::GetContentFlags() const { return mContentFlags; } -void XDmaterial_t::SetContentFlags(int flags) { +void XDMaterial::SetContentFlags(int flags) { mContentFlags = flags; } - - - - diff --git a/libs/xassets/xdmaterial.h b/libs/xassets/xdmaterial.h index 24ca21d..6ae905b 100644 --- a/libs/xassets/xdmaterial.h +++ b/libs/xassets/xdmaterial.h @@ -4,10 +4,11 @@ #include "xasset.h" #include -class XDmaterial_t : public XAsset +class XDMaterial : public XAsset { public: - explicit XDmaterial_t(); + explicit XDMaterial(); + ~XDMaterial(); void ParseData(QDataStream *aStream) override; diff --git a/libs/xassets/xeffectdef.cpp b/libs/xassets/xeffectdef.cpp index 889b4a8..d2bed3c 100644 --- a/libs/xassets/xeffectdef.cpp +++ b/libs/xassets/xeffectdef.cpp @@ -1 +1,37 @@ -#include "effectdef.h" +#include "xeffectdef.h" + +XEffectDef::XEffectDef() + : XAsset() + , mName("") + , mFlags(0) + , mTotalSize(0) + , mMsecLoopingLife(0) + , mElemDefCountLooping(0) + , mElemDefCountOneShot(0) + , mElemDefCountEmission(0) + , mElemDefs() +{ + +} + +XEffectDef::~XEffectDef() +{ + +} + +void XEffectDef::Clear() +{ + mName.clear(); + mFlags = 0; + mTotalSize = 0; + mMsecLoopingLife = 0; + mElemDefCountLooping = 0; + mElemDefCountOneShot = 0; + mElemDefCountEmission = 0; + mElemDefs.clear(); +} + +void XEffectDef::ParseData(QDataStream *aStream) +{ + +} diff --git a/libs/xassets/xeffectdef.h b/libs/xassets/xeffectdef.h index ea50d37..56fa283 100644 --- a/libs/xassets/xeffectdef.h +++ b/libs/xassets/xeffectdef.h @@ -1,206 +1,10 @@ #ifndef EFFECTDEF_H #define EFFECTDEF_H -#include "xmaterial.h" -#include "xmodel.h" - -class XFxSpawnDefLooping : public XAsset -{ -public: - explicit XFxSpawnDefLooping(); - ~XFxSpawnDefLooping(); - - void Clear() override; - void ParseData(QDataStream *aStream) override; - -private: - int mIntervalMsec; - int mCount; -}; - -class XFxIntRange : public XAsset -{ -public: - explicit XFxIntRange(); - ~XFxIntRange(); - - void Clear() override; - void ParseData(QDataStream *aStream) override; - -private: - int mBase; - int mAmplitude; -}; - -class XFxSpawnDefOneShot : public XAsset -{ -public: - explicit XFxSpawnDefOneShot(); - ~XFxSpawnDefOneShot(); - - void Clear() override; - void ParseData(QDataStream *aStream) override; - -private: - XFxIntRange mCount; -}; - -class XFxSpawnDef : public XAsset -{ -public: - explicit XFxSpawnDef(); - ~XFxSpawnDef(); - - void Clear() override; - void ParseData(QDataStream *aStream) override; - -private: - XFxSpawnDefLooping mLooping; - XFxSpawnDefOneShot omOneShot; -}; - -class XFxFloatRange : public XAsset -{ -public: - explicit XFxFloatRange(); - ~XFxFloatRange(); - - void Clear() override; - void ParseData(QDataStream *aStream) override; - -private: - float base; - float amplitude; -}; - -class XFxElemAtlas : public XAsset -{ -public: - explicit XFxElemAtlas(); - ~XFxElemAtlas(); - - void Clear() override; - void ParseData(QDataStream *aStream) override; - -private: - quint8 mBehavior; - quint8 mIndex; - quint8 mFps; - quint8 mLoopCount; - quint8 mColIndexBits; - quint8 mRowIndexBits; - qint16 mEntryCount; -}; - -class XFxElemVec3Range : public XAsset -{ -public: - explicit XFxElemVec3Range(); - ~XFxElemVec3Range(); - - void Clear() override; - void ParseData(QDataStream *aStream) override; - -private: - QVector3D mBase; - QVector3D mAmplitude; -}; - -class XFxElemVelStateInFrame : public XAsset -{ -public: - explicit XFxElemVelStateInFrame(); - ~XFxElemVelStateInFrame(); - - void Clear() override; - void ParseData(QDataStream *aStream) override; - -private: - XFxElemVec3Range mVelocity; - XFxElemVec3Range mTotalDelta; -}; - -class XFxElemVelStateSample : public XAsset -{ -public: - explicit XFxElemVelStateSample(); - ~XFxElemVelStateSample(); - - void Clear() override; - void ParseData(QDataStream *aStream) override; - -private: - XFxElemVelStateInFrame mLocal; - XFxElemVelStateInFrame mWorld; -}; - -class XFxElemVisualState : public XAsset -{ -public: - explicit XFxElemVisualState(); - ~XFxElemVisualState(); - - void Clear() override; - void ParseData(QDataStream *aStream) override; - -private: - quint8 mColor[4]; - float mRotationDelta; - float mRotationTotal; - float mSize[2]; - float mScale; -}; - -class XFxElemVisStateSample : public XAsset -{ -public: - explicit XFxElemVisStateSample(); - ~XFxElemVisStateSample(); - - void Clear() override; - void ParseData(QDataStream *aStream) override; - -private: - XFxElemVisualState mBase; - XFxElemVisualState mAmplitude; -}; - -class XFxElemMarkVisuals : public XAsset -{ -public: - explicit XFxElemMarkVisuals(); - ~XFxElemMarkVisuals(); - - void Clear() override; - void ParseData(QDataStream *aStream) override; - -private: - qint32 mMaterialPtrs[2]; - QVector mMaterials; -}; - -class XEffectDefRef : public XAsset -{ -public: - explicit XEffectDefRef(); - ~XEffectDefRef(); - - void Clear() override; - void ParseData(QDataStream *aStream) override; - -private: - qint32 mHandlePtr; - const XEffectDef *mHandle; - - qint32 mNamePtr; - QString mName; -}; - - - - - +#include "xasset.h" +#include "xfxelemdef.h" +#include class XEffectDef : public XAsset { @@ -212,7 +16,6 @@ public: void ParseData(QDataStream *aStream) override; private: - qint32 mNamePtr; QString mName; int mFlags; @@ -222,7 +25,6 @@ private: int mElemDefCountOneShot; int mElemDefCountEmission; - qint32 mElemDefsPtr; QVector mElemDefs; }; diff --git a/libs/xassets/xeffectdefref.cpp b/libs/xassets/xeffectdefref.cpp index 4a4b3e7..f719f94 100644 --- a/libs/xassets/xeffectdefref.cpp +++ b/libs/xassets/xeffectdefref.cpp @@ -1,4 +1,5 @@ #include "xeffectdefref.h" +#include "xeffectdef.h" XEffectDefRef::XEffectDefRef() : XAsset() diff --git a/libs/xassets/xeffectdefref.h b/libs/xassets/xeffectdefref.h index f24d35a..9ecc2f3 100644 --- a/libs/xassets/xeffectdefref.h +++ b/libs/xassets/xeffectdefref.h @@ -2,7 +2,10 @@ #define XEFFECTDEFREF_H #include "xasset.h" -#include "xeffectdef.h" + +#include + +class XEffectDef; class XEffectDefRef : public XAsset { diff --git a/libs/xassets/xfile.cpp b/libs/xassets/xfile.cpp index 3caca69..64435e0 100644 --- a/libs/xassets/xfile.cpp +++ b/libs/xassets/xfile.cpp @@ -1,5 +1,7 @@ #include "xfile.h" +#include + XFile::XFile() : XAsset() { @@ -8,7 +10,13 @@ XFile::XFile() void XFile::ParseData(QDataStream *aStream) { + quint32 contentLength; + *aStream + >> contentLength; + contentLength += 44; + qDebug() << "Content size: " << contentLength; + aStream->skipRawData(8 * 4); } void XFile::Clear() diff --git a/libs/xassets/xfxelemdef.cpp b/libs/xassets/xfxelemdef.cpp index cc47d8b..f2b0e10 100644 --- a/libs/xassets/xfxelemdef.cpp +++ b/libs/xassets/xfxelemdef.cpp @@ -1,4 +1,5 @@ #include "xfxelemdef.h" +#include "xfxtraildef.h" XFxElemDef::XFxElemDef() : XAsset() @@ -53,39 +54,39 @@ void XFxElemDef::Clear() { mFlags = 0; mSpawn.Clear(); - mSpawnRange = FxFloatRange(); - mFadeInRange = FxFloatRange(); - mFadeOutRange = FxFloatRange(); + mSpawnRange.Clear(); + mFadeInRange.Clear(); + mFadeOutRange.Clear(); mSpawnFrustumCullRadius = 0; - mSpawnDelayMsec = FxIntRange(); - mLifeSpanMsec = FxIntRange(); - mSpawnOrigin = QVector(); - mSpawnOffsetRadius = FxFloatRange(); - mSpawnOffsetHeight = FxFloatRange(); - mSpawnAngles = QVector(); - mAngularVelocity = QVector(); - mInitialRotation = FxFloatRange(); - mGravity = FxFloatRange(); - mReflectionFactor = FxFloatRange(); - mAtlas = FxElemAtlas(); + mSpawnDelayMsec.Clear(); + mLifeSpanMsec.Clear(); + mSpawnOrigin.clear(); + mSpawnOffsetRadius.Clear(); + mSpawnOffsetHeight.Clear(); + mSpawnAngles.clear(); + mAngularVelocity.clear(); + mInitialRotation.Clear(); + mGravity.Clear(); + mReflectionFactor.Clear(); + mAtlas.Clear(); mElemType = 0; mVisualCount = 0; mVelIntervalCount = 0; mVisStateIntervalCount = 0; mVelSamplesPtr = 0; - mVelSamples = QVector(); + mVelSamples.clear(); mVisSamplesPtr = 0; - mVisSamples = QVector(); - mVisuals = FxElemDefVisuals(); + mVisSamples.clear(); + mVisuals.Clear(); mCollMins = QVector3D(); mCollMaxs = QVector3D(); - mEffectOnImpact = ; - mEffectOnDeath = ; - mEffectEmitted = ; - mEmitDist = ; - mEmitDistVariance = ; + mEffectOnImpact.Clear(); + mEffectOnDeath.Clear(); + mEffectEmitted.Clear(); + mEmitDist.Clear(); + mEmitDistVariance.Clear(); mTrailDefPtr = 0; - mTrailDef = new XFxTrailDef = ;; + mTrailDef->Clear(); mSortOrder = 0; mLightingFrac = 0; mUseItemClip = 0; diff --git a/libs/xassets/xfxelemdef.h b/libs/xassets/xfxelemdef.h index 1dc194f..56c1cab 100644 --- a/libs/xassets/xfxelemdef.h +++ b/libs/xassets/xfxelemdef.h @@ -2,8 +2,16 @@ #define XFXELEMDEF_H #include "xasset.h" -#include "xeffectdef.h" -#include "xfxtraildef.h" +#include "xfxspawndef.h" +#include "xfxfloatrange.h" +#include "xfxintrange.h" +#include "xfxelematlas.h" +#include "xfxelemvelstatesample.h" +#include "xfxelemvisstatesample.h" +#include "xeffectdefref.h" +#include "xfxelemdefvisuals.h" + +class XFxTrailDef; class XFxElemDef : public XAsset { @@ -16,41 +24,41 @@ public: private: int mFlags; - FxSpawnDef mSpawn; - FxFloatRange mSpawnRange; - FxFloatRange mFadeInRange; - FxFloatRange mFadeOutRange; + XFxSpawnDef mSpawn; + XFxFloatRange mSpawnRange; + XFxFloatRange mFadeInRange; + XFxFloatRange mFadeOutRange; float mSpawnFrustumCullRadius; - FxIntRange mSpawnDelayMsec; - FxIntRange mLifeSpanMsec; - QVector mSpawnOrigin; - FxFloatRange mSpawnOffsetRadius; - FxFloatRange mSpawnOffsetHeight; - QVector mSpawnAngles; - QVector mAngularVelocity; - FxFloatRange mInitialRotation; - FxFloatRange mGravity; - FxFloatRange mReflectionFactor; - FxElemAtlas mAtlas; + XFxIntRange mSpawnDelayMsec; + XFxIntRange mLifeSpanMsec; + QVector mSpawnOrigin; + XFxFloatRange mSpawnOffsetRadius; + XFxFloatRange mSpawnOffsetHeight; + QVector mSpawnAngles; + QVector mAngularVelocity; + XFxFloatRange mInitialRotation; + XFxFloatRange mGravity; + XFxFloatRange mReflectionFactor; + XFxElemAtlas mAtlas; quint8 mElemType; quint8 mVisualCount; quint8 mVelIntervalCount; quint8 mVisStateIntervalCount; qint32 mVelSamplesPtr; - QVector mVelSamples; + QVector mVelSamples; qint32 mVisSamplesPtr; - QVector mVisSamples; - FxElemDefVisuals mVisuals; + QVector mVisSamples; + XFxElemDefVisuals mVisuals; QVector3D mCollMins; QVector3D mCollMaxs; - EffectDefRef mEffectOnImpact; - EffectDefRef mEffectOnDeath; - EffectDefRef mEffectEmitted; - FxFloatRange mEmitDist; - FxFloatRange mEmitDistVariance; + XEffectDefRef mEffectOnImpact; + XEffectDefRef mEffectOnDeath; + XEffectDefRef mEffectEmitted; + XFxFloatRange mEmitDist; + XFxFloatRange mEmitDistVariance; qint32 mTrailDefPtr; - XFxTrailDef *mTrailDef; + XFxTrailDef* mTrailDef; quint8 mSortOrder; quint8 mLightingFrac; diff --git a/libs/xassets/xfxelemdefvisuals.h b/libs/xassets/xfxelemdefvisuals.h index 8db309c..9a46b29 100644 --- a/libs/xassets/xfxelemdefvisuals.h +++ b/libs/xassets/xfxelemdefvisuals.h @@ -2,7 +2,8 @@ #define XFXELEMDEFVISUALS_H #include "xasset.h" -#include "xeffectdef.h" +#include "xfxelemmarkvisuals.h" +#include "xfxelemvisuals.h" class XFxElemDefVisuals : public XAsset { diff --git a/libs/xassets/xfxelemvisstatesample.cpp b/libs/xassets/xfxelemvisstatesample.cpp index ba0c3df..12f58bd 100644 --- a/libs/xassets/xfxelemvisstatesample.cpp +++ b/libs/xassets/xfxelemvisstatesample.cpp @@ -1,32 +1,9 @@ -#include "xfxtrailvertex.h" - -XFxTrailVertex::XFxTrailVertex() - : XAsset() - , mPos() - , mNormal() - , mTexCoord(0) -{ - -} - -XFxTrailVertex::~XFxTrailVertex() -{ - -} - -void XFxTrailVertex::Clear() -{ - mPos = QVector2D(); - mNormal = QVector2D(); - mTexCoord = 0; -} - -void XFxTrailVertex::ParseData(QDataStream *aStream) -{ - -} +#include "xfxelemvisstatesample.h" XFxElemVisStateSample::XFxElemVisStateSample() + : XAsset() + , mBase() + , mAmplitude() { } @@ -38,7 +15,8 @@ XFxElemVisStateSample::~XFxElemVisStateSample() void XFxElemVisStateSample::Clear() { - + mBase.Clear(); + mAmplitude.Clear(); } void XFxElemVisStateSample::ParseData(QDataStream *aStream) diff --git a/libs/xassets/xfxelemvisstatesample.h b/libs/xassets/xfxelemvisstatesample.h index d6ffaed..bd3bcfe 100644 --- a/libs/xassets/xfxelemvisstatesample.h +++ b/libs/xassets/xfxelemvisstatesample.h @@ -2,7 +2,7 @@ #define XFXELEMVISSTATESAMPLE_H #include "xasset.h" -#include "xeffectdef.h" +#include "xfxelemvisualstate.h" class XFxElemVisStateSample : public XAsset { diff --git a/libs/xassets/xfxelemvisuals.h b/libs/xassets/xfxelemvisuals.h index d412141..8de7ac8 100644 --- a/libs/xassets/xfxelemvisuals.h +++ b/libs/xassets/xfxelemvisuals.h @@ -2,7 +2,7 @@ #define XFXELEMVISUALS_H #include "xasset.h" -#include "xeffectdef.h" +#include "xeffectdefref.h" #include "xmaterial.h" #include "xmodel.h" diff --git a/libs/xassets/xfxtraildef.h b/libs/xassets/xfxtraildef.h index ebe9823..51f543d 100644 --- a/libs/xassets/xfxtraildef.h +++ b/libs/xassets/xfxtraildef.h @@ -2,6 +2,7 @@ #define XFXTRAILDEF_H #include "xasset.h" +#include "xfxtrailvertex.h" #include diff --git a/libs/xassets/xgameworld.h b/libs/xassets/xgameworld.h index b6e49d7..b2ab666 100644 --- a/libs/xassets/xgameworld.h +++ b/libs/xassets/xgameworld.h @@ -1,11 +1,7 @@ - - - #ifndef XGAMEWORLD_H #define XGAMEWORLD_H #include "xasset.h" -#include "gameworld.h" #include "xgameworldmp.h" #include "xgameworldsp.h" diff --git a/libs/xassets/xgameworldmp.cpp b/libs/xassets/xgameworldmp.cpp index af432d0..c9ffa33 100644 --- a/libs/xassets/xgameworldmp.cpp +++ b/libs/xassets/xgameworldmp.cpp @@ -1,10 +1,17 @@ - - - #include "xgameworldmp.h" +#include "xstring.h" XGameWorldMp::XGameWorldMp() - : XAsset() { + : XAsset() + , mName("") +{ + SetType(ASSET_TYPE_GAMEWORLD_MP); + SetName("GameWorld MP"); +} + +XGameWorldMp::~XGameWorldMp() +{ + } void XGameWorldMp::ParseData(QDataStream *aStream) { @@ -14,6 +21,11 @@ void XGameWorldMp::ParseData(QDataStream *aStream) { } } +void XGameWorldMp::Clear() +{ + mName.clear(); +} + QString XGameWorldMp::GetName() const { return mName; } @@ -21,5 +33,3 @@ QString XGameWorldMp::GetName() const { void XGameWorldMp::SetName(const QString& name) { mName = name; } - - diff --git a/libs/xassets/xgameworldmp.h b/libs/xassets/xgameworldmp.h index a55c485..9fd4d61 100644 --- a/libs/xassets/xgameworldmp.h +++ b/libs/xassets/xgameworldmp.h @@ -3,12 +3,16 @@ #include "xasset.h" +#include + class XGameWorldMp : public XAsset { public: explicit XGameWorldMp(); + ~XGameWorldMp(); void ParseData(QDataStream *aStream) override; + void Clear() override; QString GetName() const; void SetName(const QString& name); diff --git a/libs/xassets/xgameworldsp.cpp b/libs/xassets/xgameworldsp.cpp index 746c385..6d297b8 100644 --- a/libs/xassets/xgameworldsp.cpp +++ b/libs/xassets/xgameworldsp.cpp @@ -1,9 +1,18 @@ - - #include "xgameworldsp.h" +#include "xstring.h" XGameWorldSp::XGameWorldSp() - : XAsset() { + : XAsset() + , mName("") + , mPath() +{ + SetType(ASSET_TYPE_GAMEWORLD_SP); + SetName("GameWorld SP"); +} + +XGameWorldSp::~XGameWorldSp() +{ + } void XGameWorldSp::ParseData(QDataStream *aStream) { @@ -12,10 +21,16 @@ void XGameWorldSp::ParseData(QDataStream *aStream) { mName = XString::ParseCustom(aStream); // Parse the path data using our new XPathData class - path.ParseData(aStream); + mPath.ParseData(aStream); } } +void XGameWorldSp::Clear() +{ + mName.clear(); + mPath.Clear(); +} + QString XGameWorldSp::GetName() const { return mName; } diff --git a/libs/xassets/xgameworldsp.h b/libs/xassets/xgameworldsp.h index c80ed5c..e8981c0 100644 --- a/libs/xassets/xgameworldsp.h +++ b/libs/xassets/xgameworldsp.h @@ -1,25 +1,26 @@ - - #ifndef XGAMEWORLDSP_H #define XGAMEWORLDSP_H #include "xasset.h" -#include "gameworld.h" #include "xpathdata.h" +#include + class XGameWorldSp : public XAsset { public: explicit XGameWorldSp(); + ~XGameWorldSp(); void ParseData(QDataStream *aStream) override; + void Clear() override; QString GetName() const; void SetName(const QString& name); private: QString mName; - XPathData path; // Using our new XPathData class instead of PathData struct + XPathData mPath; }; #endif // XGAMEWORLDSP_H diff --git a/libs/xassets/xgfxcolor.cpp b/libs/xassets/xgfxcolor.cpp index ad136da..ffc9a6a 100644 --- a/libs/xassets/xgfxcolor.cpp +++ b/libs/xassets/xgfxcolor.cpp @@ -15,5 +15,13 @@ void XGfxColor::ParseData(QDataStream *aStream) void XGfxColor::Clear() { - + +} + +void XGfxColor::SetColor(quint8 r, quint8 g, quint8 b, quint8 a) +{ + mArray[0] = r; + mArray[1] = g; + mArray[2] = b; + mArray[3] = a; } diff --git a/libs/xassets/xgfxcolor.h b/libs/xassets/xgfxcolor.h index e6622a8..e4ca60f 100644 --- a/libs/xassets/xgfxcolor.h +++ b/libs/xassets/xgfxcolor.h @@ -11,6 +11,8 @@ public: void ParseData(QDataStream *aStream) override; void Clear() override; + void SetColor(quint8 r, quint8 g, quint8 b, quint8 a); + private: unsigned int mPacked; quint8 mArray[4]; diff --git a/libs/xassets/xgfximage.cpp b/libs/xassets/xgfximage.cpp index fe39209..f893073 100644 --- a/libs/xassets/xgfximage.cpp +++ b/libs/xassets/xgfximage.cpp @@ -1 +1,37 @@ #include "xgfximage.h" + +XGfxImage::XGfxImage() + : XAsset() + , mMapType() + , mTexture() + , mSemantic(0) + , mCardMemory() + , mWidth(0) + , mHeight(0) + , mDepth(0) + , mCategory(0) + , mDelayLoadPixels(false) + , mPixels() + , mBaseSize(0) + , mStreamSlot(0) + , mStreaming(false) + , mName("") +{ + SetType(ASSET_TYPE_IMAGE); + SetName("Image"); +} + +XGfxImage::~XGfxImage() +{ + +} + +void XGfxImage::ParseData(QDataStream *aStream) +{ + +} + +void XGfxImage::Clear() +{ + +} diff --git a/libs/xassets/xgfximage.h b/libs/xassets/xgfximage.h index 2f04323..002ca78 100644 --- a/libs/xassets/xgfximage.h +++ b/libs/xassets/xgfximage.h @@ -7,11 +7,13 @@ #include "xmaptype.h" #include +#include class XGfxImage : public XAsset { public: explicit XGfxImage(); + ~XGfxImage(); virtual void ParseData(QDataStream* aStream) override; virtual void Clear() override; @@ -26,15 +28,10 @@ private: quint16 mDepth; quint8 mCategory; bool mDelayLoadPixels; - - qint32 mPixelsPtr; - quint8 *mPixels; - + QVector mPixels; unsigned int mBaseSize; quint16 mStreamSlot; bool mStreaming; - - qint32 mNamePtr; QString mName; }; diff --git a/libs/xassets/xgfximageloaddef.h b/libs/xassets/xgfximageloaddef.h index b7be951..8ccaf6a 100644 --- a/libs/xassets/xgfximageloaddef.h +++ b/libs/xassets/xgfximageloaddef.h @@ -2,11 +2,10 @@ #define XGFXIMAGELOADDEF_H #include "xasset.h" +#include "xgfxtexture.h" #include -class XGfxTexture; - class XGfxImageLoadDef : public XAsset { public: diff --git a/libs/xassets/xgfxlight.cpp b/libs/xassets/xgfxlight.cpp index 09aa74d..bbe5942 100644 --- a/libs/xassets/xgfxlight.cpp +++ b/libs/xassets/xgfxlight.cpp @@ -7,10 +7,9 @@ XGfxLight::XGfxLight() : XAsset() , mType(0) , mCanUseShadowMap(0) - , mUnused({0, 0}) - , mColor({0.0f, 0.0f, 0.0f}) - , mDir({0.0f, 0.0f, 0.0f}) - , mOrigin({0.0f, 0.0f, 0.0f}) + , mColor() + , mDir() + , mOrigin() , mRadius(0.0f) , mCosHalfFovOuter(0.0f) , mCosHalfFovInner(0.0f) @@ -62,92 +61,7 @@ void XGfxLight::ParseData(QDataStream *aStream) { } } -unsigned char XGfxLight::GetType() const { - return mType; +void XGfxLight::Clear() +{ + } - -void XGfxLight::SetType(unsigned char aType) { - mType = aType; -} - -unsigned char XGfxLight::CanUseShadowMap() const { - return mCanUseShadowMap; -} - -void XGfxLight::SetCanUseShadowMap(bool aCanUse) { - mCanUseShadowMap = aCanUse ? 1 : 0; -} - -QColor XGfxLight::GetColor() const { - return mColor; -} - -void XGfxLight::SetColor(const QColor &aColor) { - mColor = aColor; -} - -QVector XGfxLight::GetDir() const { - return mDir; -} - -void XGfxLight::SetDir(const QVector &aDir) { - mDir = aDir; -} - -QVector XGfxLight::GetOrigin() const { - return mOrigin; -} - -void XGfxLight::SetOrigin(const QVector &aOrigin) { - mOrigin = aOrigin; -} - -float XGfxLight::GetRadius() const { - return mRadius; -} - -void XGfxLight::SetRadius(float aRadius) { - mRadius = aRadius; -} - -float XGfxLight::GetCosHalfFovOuter() const { - return mCosHalfFovOuter; -} - -void XGfxLight::SetCosHalfFovOuter(float aCosHalfFov) { - mCosHalfFovOuter = aCosHalfFov; -} - -float XGfxLight::GetCosHalfFovInner() const { - return mCosHalfFovInner; -} - -void XGfxLight::SetCosHalfFovInner(float aCosHalfFov) { - mCosHalfFovInner = aCosHalfFov; -} - -int XGfxLight::GetExponent() const { - return mExponent; -} - -void XGfxLight::SetExponent(int aExponent) { - mExponent = aExponent; -} - -unsigned int XGfxLight::GetSpotShadowIndex() const { - return mSpotShadowIndex; -} - -void XGfxLight::SetSpotShadowIndex(unsigned int aIndex) { - mSpotShadowIndex = aIndex; -} - -int XGfxLight::GetDefPtr() const { - return mDefPtr; -} - -void XGfxLight::SetDefPtr(int ptr) { - mDefPtr = ptr; -} - - diff --git a/libs/xassets/xgfxlight.h b/libs/xassets/xgfxlight.h index f5136df..e1ac613 100644 --- a/libs/xassets/xgfxlight.h +++ b/libs/xassets/xgfxlight.h @@ -13,44 +13,10 @@ public: ~XGfxLight(); void ParseData(QDataStream *aStream) override; - - unsigned char GetType() const; - void SetType(unsigned char aType); - - unsigned char CanUseShadowMap() const; - void SetCanUseShadowMap(bool aCanUse); - - QColor GetColor() const; - void SetColor(const QColor& aColor); - - QVector GetDir() const; - void SetDir(const QVector &aDir); - - QVector GetOrigin() const; - void SetOrigin(const QVector &aOrigin); - - float GetRadius() const; - void SetRadius(float aRadius); - - float GetCosHalfFovOuter() const; - void SetCosHalfFovOuter(float aCosHalfFov); - - float GetCosHalfFovInner() const; - void SetCosHalfFovInner(float aCosHalfFov); - - int GetExponent() const; - void SetExponent(int aExponent); - - unsigned int GetSpotShadowIndex() const; - void SetSpotShadowIndex(unsigned int aIndex); - - int GetDefPtr() const; - void SetDefPtr(int ptr); - + void Clear() override; private: unsigned char mType; unsigned char mCanUseShadowMap; - QVector mUnused; QColor mColor; QVector mDir; QVector mOrigin; diff --git a/libs/xassets/xgfxlightdef.cpp b/libs/xassets/xgfxlightdef.cpp index 5379a2c..45c8a29 100644 --- a/libs/xassets/xgfxlightdef.cpp +++ b/libs/xassets/xgfxlightdef.cpp @@ -6,7 +6,8 @@ XGfxLightDef::XGfxLightDef() , mAttenuation(new XGfxLightImage()) , mLmapLookupStart(0) { - + SetType(ASSET_TYPE_LIGHT_DEF); + SetName("Light Def"); } XGfxLightDef::~XGfxLightDef() diff --git a/libs/xassets/xgfxreflectionprobe.cpp b/libs/xassets/xgfxreflectionprobe.cpp index 7a24305..3f4e5e5 100644 --- a/libs/xassets/xgfxreflectionprobe.cpp +++ b/libs/xassets/xgfxreflectionprobe.cpp @@ -1,48 +1,27 @@ - - - - - - #include "xgfxreflectionprobe.h" XGfxReflectionProbe::XGfxReflectionProbe() - : XAsset() { + : XAsset() + , mOrigin() + , mReflectionImage(new XGfxImage()) +{ +} + +XGfxReflectionProbe::~XGfxReflectionProbe() +{ + } void XGfxReflectionProbe::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read((char*)mOrigin, 3 * sizeof(float)); - aStream->read((char*)&mRadius, sizeof(float)); - aStream->read((char*)&mFlags, sizeof(int)); + *aStream + >> mOrigin; + + mReflectionImage->ParseData(aStream); } } -const float* XGfxReflectionProbe::GetOrigin() const { - return mOrigin; +void XGfxReflectionProbe::Clear() { + mOrigin = QVector3D(); + mReflectionImage->Clear(); } - -void XGfxReflectionProbe::SetOrigin(const float* origin, size_t count) { - if (count <= 3) { - memcpy(mOrigin, origin, count * sizeof(float)); - } -} - -float XGfxReflectionProbe::GetRadius() const { - return mRadius; -} - -void XGfxReflectionProbe::SetRadius(float radius) { - mRadius = radius; -} - -int XGfxReflectionProbe::GetFlags() const { - return mFlags; -} - -void XGfxReflectionProbe::SetFlags(int flags) { - mFlags = flags; -} - - - diff --git a/libs/xassets/xgfxreflectionprobe.h b/libs/xassets/xgfxreflectionprobe.h index d0107db..b257f8d 100644 --- a/libs/xassets/xgfxreflectionprobe.h +++ b/libs/xassets/xgfxreflectionprobe.h @@ -1,47 +1,23 @@ - - - - - - - - - - #ifndef XGFXREFLECTIONPROBE_H #define XGFXREFLECTIONPROBE_H #include "xasset.h" +#include "xgfximage.h" + +#include class XGfxReflectionProbe : public XAsset { public: explicit XGfxReflectionProbe(); + ~XGfxReflectionProbe(); void ParseData(QDataStream *aStream) override; - - const float* GetOrigin() const; - void SetOrigin(const float* origin, size_t count = 3); - - float GetRadius() const; - void SetRadius(float radius); - - int GetFlags() const; - void SetFlags(int flags); + void Clear() override; private: - float mOrigin[3] = {0.0f, 0.0f, 0.0f}; - float mRadius = 0.0f; - int mFlags = 0; + QVector3D mOrigin; + XGfxImage *mReflectionImage; }; #endif // XGFXREFLECTIONPROBE_H - - - - - - - - - diff --git a/libs/xassets/xgfxstreamingaabbtree.cpp b/libs/xassets/xgfxstreamingaabbtree.cpp index e53e12c..e301c71 100644 --- a/libs/xassets/xgfxstreamingaabbtree.cpp +++ b/libs/xassets/xgfxstreamingaabbtree.cpp @@ -12,12 +12,17 @@ XGfxStreamingAabbTree::XGfxStreamingAabbTree() void XGfxStreamingAabbTree::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read((char*)&mFirstItem, sizeof(unsigned short)); - aStream->read((char*)&mItemCount, sizeof(unsigned short)); - aStream->read((char*)&mFirstChild, sizeof(unsigned short)); - aStream->read((char*)&mChildCount, sizeof(unsigned short)); - aStream->read((char*)mMins, 3 * sizeof(float)); - aStream->read((char*)mMaxs, 3 * sizeof(float)); + *aStream + >> mFirstItem + >> mItemCount + >> mFirstChild + >> mChildCount + >> mMins[0] + >> mMins[1] + >> mMins[2] + >> mMaxs[0] + >> mMaxs[1] + >> mMaxs[2]; } } diff --git a/libs/xassets/xgfxtexture.cpp b/libs/xassets/xgfxtexture.cpp index d627d3b..d4c0f2c 100644 --- a/libs/xassets/xgfxtexture.cpp +++ b/libs/xassets/xgfxtexture.cpp @@ -1,15 +1,14 @@ #include "xgfxtexture.h" #include "xd3dbasetexture.h" -#include "xgfximageloaddef.h" XGfxTexture::XGfxTexture() : XAsset() - , mBaseMap(new XD3DBaseTexture()) - , mMap(new XD3DTexture()) - , mVolMap(new XD3DVolumeTexture()) - , mCubeMap(new XD3DCubeTexture()) - , mLoadDef(new XGfxImageLoadDef()) + , mBaseMap() + , mMap() + , mVolMap() + , mCubeMap() + , mLoadDef() { } diff --git a/libs/xassets/xgfxtexture.h b/libs/xassets/xgfxtexture.h index 0ac6ae1..49deda6 100644 --- a/libs/xassets/xgfxtexture.h +++ b/libs/xassets/xgfxtexture.h @@ -19,10 +19,10 @@ public: virtual void Clear() override; private: - XD3DBaseTexture* mBaseMap; - XD3DTexture* mMap; - XD3DVolumeTexture* mVolMap; - XD3DCubeTexture* mCubeMap; + XD3DBaseTexture mBaseMap; + XD3DTexture mMap; + XD3DVolumeTexture mVolMap; + XD3DCubeTexture mCubeMap; XGfxImageLoadDef* mLoadDef; }; diff --git a/libs/xassets/xgfxvertexshaderloaddef.cpp b/libs/xassets/xgfxvertexshaderloaddef.cpp index bd93b0b..c09efae 100644 --- a/libs/xassets/xgfxvertexshaderloaddef.cpp +++ b/libs/xassets/xgfxvertexshaderloaddef.cpp @@ -2,9 +2,7 @@ XGfxVertexShaderLoadDef::XGfxVertexShaderLoadDef() : XAsset() - , mCachedPartPtr(0) , mCachedPart() - , mPhysicalPartPtr(0) , mPhysicalPart() , mCachedPartSize(0) , mPhysicalPartSize(0) @@ -12,12 +10,34 @@ XGfxVertexShaderLoadDef::XGfxVertexShaderLoadDef() } -void XGfxVertexShaderLoadDef::Clear() +XGfxVertexShaderLoadDef::~XGfxVertexShaderLoadDef() { } +void XGfxVertexShaderLoadDef::Clear() +{ + mCachedPart = QByteArray(); + mPhysicalPart = QByteArray(); + mCachedPartSize = 0; + mPhysicalPartSize = 0; +} + void XGfxVertexShaderLoadDef::ParseData(QDataStream *aStream) { + qint32 cachedPartPtr, physicalPartPtr; + *aStream + >> cachedPartPtr + >> physicalPartPtr + >> mCachedPartSize + >> mPhysicalPartSize; + if (physicalPartPtr) + { + aStream->readRawData(mPhysicalPart.data(), mPhysicalPartSize); + } + if (cachedPartPtr) + { + aStream->readRawData(mCachedPart.data(), mCachedPartSize); + } } diff --git a/libs/xassets/xgfxvertexshaderloaddef.h b/libs/xassets/xgfxvertexshaderloaddef.h index ae94d03..fab47ca 100644 --- a/libs/xassets/xgfxvertexshaderloaddef.h +++ b/libs/xassets/xgfxvertexshaderloaddef.h @@ -8,16 +8,15 @@ class XGfxVertexShaderLoadDef : public XAsset { public: - XGfxVertexShaderLoadDef(); + explicit XGfxVertexShaderLoadDef(); + ~XGfxVertexShaderLoadDef(); virtual void Clear() override; virtual void ParseData(QDataStream *aStream) override; private: - qint32 mCachedPartPtr; - QVector mCachedPart; - qint32 mPhysicalPartPtr; - QVector mPhysicalPart; + QByteArray mCachedPart; + QByteArray mPhysicalPart; int mCachedPartSize; int mPhysicalPartSize; }; diff --git a/libs/xassets/xgfxworld.cpp b/libs/xassets/xgfxworld.cpp index 29c9344..23c54d3 100644 --- a/libs/xassets/xgfxworld.cpp +++ b/libs/xassets/xgfxworld.cpp @@ -1,19 +1,27 @@ - - - - - - - #include "xgfxworld.h" +#include "xstring.h" XGfxWorld::XGfxWorld() - : XAsset() { + : XAsset() + , mName("") + , mStreamingInfo() + , mVertexData() + , mSunLightParams() + , mLights() + , mReflectionProbes() +{ + SetType(ASSET_TYPE_GFXWORLD); + SetName("GFXWorld"); +} + +XGfxWorld::~XGfxWorld() +{ + } void XGfxWorld::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read(mName, 64 * sizeof(char)); + mName = XString::ParseCustom(aStream); // Parse streaming info mStreamingInfo.ParseData(aStream); @@ -26,7 +34,7 @@ void XGfxWorld::ParseData(QDataStream *aStream) { // Parse lights count and array int lightCount; - aStream->read((char*)&lightCount, sizeof(int)); + *aStream >> lightCount; for (int i = 0; i < lightCount; ++i) { XGfxLight light; light.ParseData(aStream); @@ -35,7 +43,7 @@ void XGfxWorld::ParseData(QDataStream *aStream) { // Parse reflection probes count and array int probeCount; - aStream->read((char*)&probeCount, sizeof(int)); + *aStream >> probeCount; for (int i = 0; i < probeCount; ++i) { XGfxReflectionProbe probe; probe.ParseData(aStream); @@ -44,74 +52,7 @@ void XGfxWorld::ParseData(QDataStream *aStream) { } } -const char* XGfxWorld::GetName() const { - return mName; +void XGfxWorld::Clear() +{ + } - -void XGfxWorld::SetName(const char* name) { - strncpy(mName, name, 64); -} - -XGfxWorldStreamInfo& XGfxWorld::GetStreamingInfo() { - return mStreamingInfo; -} - -const XGfxWorldStreamInfo& XGfxWorld::GetStreamingInfo() const { - return mStreamingInfo; -} - -void XGfxWorld::SetStreamingInfo(const XGfxWorldStreamInfo& info) { - mStreamingInfo = info; -} - -XGfxWorldVertexData& XGfxWorld::GetVertexData() { - return mVertexData; -} - -const XGfxWorldVertexData& XGfxWorld::GetVertexData() const { - return mVertexData; -} - -void XGfxWorld::SetVertexData(const XGfxWorldVertexData& data) { - mVertexData = data; -} - -XSunLightParseParams& XGfxWorld::GetSunLightParams() { - return mSunLightParams; -} - -const XSunLightParseParams& XGfxWorld::GetSunLightParams() const { - return mSunLightParams; -} - -void XGfxWorld::SetSunLightParams(const XSunLightParseParams& params) { - mSunLightParams = params; -} - -QVector& XGfxWorld::GetLights() { - return mLights; -} - -const QVector& XGfxWorld::GetLights() const { - return mLights; -} - -void XGfxWorld::SetLights(const QVector& lights) { - mLights = lights; -} - -QVector& XGfxWorld::GetReflectionProbes() { - return mReflectionProbes; -} - -const QVector& XGfxWorld::GetReflectionProbes() const { - return mReflectionProbes; -} - -void XGfxWorld::SetReflectionProbes(const QVector& probes) { - mReflectionProbes = probes; -} - - - - diff --git a/libs/xassets/xgfxworld.h b/libs/xassets/xgfxworld.h index 0b8c7ce..320392d 100644 --- a/libs/xassets/xgfxworld.h +++ b/libs/xassets/xgfxworld.h @@ -1,14 +1,3 @@ - - - - - - - - - - - #ifndef XGFXWORLD_H #define XGFXWORLD_H @@ -23,34 +12,13 @@ class XGfxWorld : public XAsset { public: explicit XGfxWorld(); + ~XGfxWorld(); void ParseData(QDataStream *aStream) override; - - const char* GetName() const; - void SetName(const char* name); - - XGfxWorldStreamInfo& GetStreamingInfo(); - const XGfxWorldStreamInfo& GetStreamingInfo() const; - void SetStreamingInfo(const XGfxWorldStreamInfo& info); - - XGfxWorldVertexData& GetVertexData(); - const XGfxWorldVertexData& GetVertexData() const; - void SetVertexData(const XGfxWorldVertexData& data); - - XSunLightParseParams& GetSunLightParams(); - const XSunLightParseParams& GetSunLightParams() const; - void SetSunLightParams(const XSunLightParseParams& params); - - QVector& GetLights(); - const QVector& GetLights() const; - void SetLights(const QVector& lights); - - QVector& GetReflectionProbes(); - const QVector& GetReflectionProbes() const; - void SetReflectionProbes(const QVector& probes); + void Clear() override; private: - char mName[64] = {0}; + QString mName; XGfxWorldStreamInfo mStreamingInfo; XGfxWorldVertexData mVertexData; XSunLightParseParams mSunLightParams; diff --git a/libs/xassets/xgfxworldstreaminfo.cpp b/libs/xassets/xgfxworldstreaminfo.cpp index 3387516..f64ce17 100644 --- a/libs/xassets/xgfxworldstreaminfo.cpp +++ b/libs/xassets/xgfxworldstreaminfo.cpp @@ -1,18 +1,22 @@ - - - - - - #include "xgfxworldstreaminfo.h" XGfxWorldStreamInfo::XGfxWorldStreamInfo() - : XAsset() { + : XAsset() + , mAabbTreeCount(0) + , mAabbTrees() + , mLeafRefCount(0) + , mLeafRefs() +{ +} + +XGfxWorldStreamInfo::~XGfxWorldStreamInfo() +{ + } void XGfxWorldStreamInfo::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read((char*)&mAabbTreeCount, sizeof(int)); + *aStream >> mAabbTreeCount; // Clear existing data before parsing new data mAabbTrees.clear(); @@ -25,53 +29,19 @@ void XGfxWorldStreamInfo::ParseData(QDataStream *aStream) { } // Parse leaf ref count and array - aStream->read((char*)&mLeafRefCount, sizeof(int)); + *aStream >> mLeafRefCount; if (mLeafRefCount > 0) { - mLeafRefs.resize(mLeafRefCount); - aStream->read((char*)mLeafRefs.data(), mLeafRefCount * sizeof(int)); + int leafRef; + *aStream >> leafRef; + mLeafRefs.append(leafRef); } } } -int XGfxWorldStreamInfo::GetAabbTreeCount() const { - return mAabbTreeCount; +void XGfxWorldStreamInfo::Clear() +{ + mAabbTreeCount = 0; + mAabbTrees = QVector(); + mLeafRefCount = 0; + mLeafRefs = QVector(); } - -void XGfxWorldStreamInfo::SetAabbTreeCount(int count) { - mAabbTreeCount = count; -} - -QVector& XGfxWorldStreamInfo::GetAabbTrees() { - return mAabbTrees; -} - -const QVector& XGfxWorldStreamInfo::GetAabbTrees() const { - return mAabbTrees; -} - -void XGfxWorldStreamInfo::SetAabbTrees(const QVector& trees) { - mAabbTrees = trees; -} - -int XGfxWorldStreamInfo::GetLeafRefCount() const { - return mLeafRefCount; -} - -void XGfxWorldStreamInfo::SetLeafRefCount(int count) { - mLeafRefCount = count; -} - -QVector& XGfxWorldStreamInfo::GetLeafRefs() { - return mLeafRefs; -} - -const QVector& XGfxWorldStreamInfo::GetLeafRefs() const { - return mLeafRefs; -} - -void XGfxWorldStreamInfo::SetLeafRefs(const QVector& refs) { - mLeafRefs = refs; -} - - - diff --git a/libs/xassets/xgfxworldstreaminfo.h b/libs/xassets/xgfxworldstreaminfo.h index be100a3..90f64ad 100644 --- a/libs/xassets/xgfxworldstreaminfo.h +++ b/libs/xassets/xgfxworldstreaminfo.h @@ -1,43 +1,25 @@ - - - - - - - - #ifndef XGFXWORLDSTREAMINFO_H #define XGFXWORLDSTREAMINFO_H #include "xasset.h" #include "xgfxstreamingaabbtree.h" +#include + class XGfxWorldStreamInfo : public XAsset { public: explicit XGfxWorldStreamInfo(); + ~XGfxWorldStreamInfo(); void ParseData(QDataStream *aStream) override; - - int GetAabbTreeCount() const; - void SetAabbTreeCount(int count); - - QVector& GetAabbTrees(); - const QVector& GetAabbTrees() const; - void SetAabbTrees(const QVector& trees); - - int GetLeafRefCount() const; - void SetLeafRefCount(int count); - - QVector& GetLeafRefs(); - const QVector& GetLeafRefs() const; - void SetLeafRefs(const QVector& refs); + void Clear() override; private: - int mAabbTreeCount = 0; + int mAabbTreeCount; QVector mAabbTrees; - int mLeafRefCount = 0; + int mLeafRefCount; QVector mLeafRefs; }; diff --git a/libs/xassets/xgfxworldvertex.cpp b/libs/xassets/xgfxworldvertex.cpp index 6e4777f..a4b71e4 100644 --- a/libs/xassets/xgfxworldvertex.cpp +++ b/libs/xassets/xgfxworldvertex.cpp @@ -1,35 +1,45 @@ - - - - - - - #include "xgfxworldvertex.h" XGfxWorldVertex::XGfxWorldVertex() - : XAsset() { + : XAsset() + , mXYZ() + , mBinormalSign(0.0f) + , mColor() + , mTexCoord() + , mLmapCoord() + , mNormal() + , mTangent() +{ +} + +XGfxWorldVertex::~XGfxWorldVertex() +{ + } void XGfxWorldVertex::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read((char*)mXYZ, 3 * sizeof(float)); - aStream->read((char*)&mBinormalSign, sizeof(float)); + *aStream + >> mXYZ[0] + >> mXYZ[1] + >> mXYZ[2] + >> mBinormalSign; // Read color components quint8 r, g, b, a; - aStream->read((char*)&r, sizeof(quint8)); - aStream->read((char*)&g, sizeof(quint8)); - aStream->read((char*)&b, sizeof(quint8)); - aStream->read((char*)&a, sizeof(quint8)); - mColor.r = r; - mColor.g = g; - mColor.b = b; - mColor.a = a; + *aStream + >> r + >> g + >> b + >> a; + mColor.SetColor(r, g, b, a); // Read texture coordinates - aStream->read((char*)mTexCoord, 2 * sizeof(float)); - aStream->read((char*)mLmapCoord, 2 * sizeof(float)); + *aStream + >> mTexCoord[0] + >> mTexCoord[1] + >> mLmapCoord[0] + >> mLmapCoord[1]; // Read normal and tangent (assuming they're PackedUnitVec) mNormal.ParseData(aStream); @@ -37,68 +47,7 @@ void XGfxWorldVertex::ParseData(QDataStream *aStream) { } } -const float* XGfxWorldVertex::GetXYZ() const { - return mXYZ; +void XGfxWorldVertex::Clear() +{ + } - -void XGfxWorldVertex::SetXYZ(const float* xyz, size_t count) { - if (count <= 3) { - memcpy(mXYZ, xyz, count * sizeof(float)); - } -} - -float XGfxWorldVertex::GetBinormalSign() const { - return mBinormalSign; -} - -void XGfxWorldVertex::SetBinormalSign(float sign) { - mBinormalSign = sign; -} - -const GfxColor& XGfxWorldVertex::GetColor() const { - return mColor; -} - -void XGfxWorldVertex::SetColor(const GfxColor& color) { - mColor = color; -} - -const float* XGfxWorldVertex::GetTexCoord() const { - return mTexCoord; -} - -void XGfxWorldVertex::SetTexCoord(const float* texCoord, size_t count) { - if (count <= 2) { - memcpy(mTexCoord, texCoord, count * sizeof(float)); - } -} - -const float* XGfxWorldVertex::GetLmapCoord() const { - return mLmapCoord; -} - -void XGfxWorldVertex::SetLmapCoord(const float* lmapCoord, size_t count) { - if (count <= 2) { - memcpy(mLmapCoord, lmapCoord, count * sizeof(float)); - } -} - -const PackedUnitVec& XGfxWorldVertex::GetNormal() const { - return mNormal; -} - -void XGfxWorldVertex::SetNormal(const PackedUnitVec& normal) { - mNormal = normal; -} - -const PackedUnitVec& XGfxWorldVertex::GetTangent() const { - return mTangent; -} - -void XGfxWorldVertex::SetTangent(const PackedUnitVec& tangent) { - mTangent = tangent; -} - - - - diff --git a/libs/xassets/xgfxworldvertex.h b/libs/xassets/xgfxworldvertex.h index 740d4c1..a14d10a 100644 --- a/libs/xassets/xgfxworldvertex.h +++ b/libs/xassets/xgfxworldvertex.h @@ -1,53 +1,29 @@ - - - - - - - - - #ifndef XGFXWORLDVERTEX_H #define XGFXWORLDVERTEX_H #include "xasset.h" +#include "xpackedunitvec.h" +#include "xgfxcolor.h" + +#include class XGfxWorldVertex : public XAsset { public: explicit XGfxWorldVertex(); + ~XGfxWorldVertex(); void ParseData(QDataStream *aStream) override; - - const float* GetXYZ() const; - void SetXYZ(const float* xyz, size_t count = 3); - - float GetBinormalSign() const; - void SetBinormalSign(float sign); - - const GfxColor& GetColor() const; - void SetColor(const GfxColor& color); - - const float* GetTexCoord() const; - void SetTexCoord(const float* texCoord, size_t count = 2); - - const float* GetLmapCoord() const; - void SetLmapCoord(const float* lmapCoord, size_t count = 2); - - const PackedUnitVec& GetNormal() const; - void SetNormal(const PackedUnitVec& normal); - - const PackedUnitVec& GetTangent() const; - void SetTangent(const PackedUnitVec& tangent); + void Clear() override; private: - float mXYZ[3] = {0.0f, 0.0f, 0.0f}; - float mBinormalSign = 0.0f; - GfxColor mColor = {0, 0, 0, 255}; // Default to black with full alpha - float mTexCoord[2] = {0.0f, 0.0f}; - float mLmapCoord[2] = {0.0f, 0.0f}; - PackedUnitVec mNormal; - PackedUnitVec mTangent; + QVector3D mXYZ; + float mBinormalSign; + XGfxColor mColor; + QVector2D mTexCoord; + QVector2D mLmapCoord; + XPackedUnitVec mNormal; + XPackedUnitVec mTangent; }; #endif // XGFXWORLDVERTEX_H diff --git a/libs/xassets/xgfxworldvertexdata.cpp b/libs/xassets/xgfxworldvertexdata.cpp index 602aa25..270e93c 100644 --- a/libs/xassets/xgfxworldvertexdata.cpp +++ b/libs/xassets/xgfxworldvertexdata.cpp @@ -1,9 +1,3 @@ - - - - - - #include "xgfxworldvertexdata.h" XGfxWorldVertexData::XGfxWorldVertexData() @@ -14,7 +8,7 @@ void XGfxWorldVertexData::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { // Parse vertex count int vertexCount; - aStream->read((char*)&vertexCount, sizeof(int)); + *aStream >> vertexCount; // Clear existing data before parsing new data mVertices.clear(); @@ -27,7 +21,12 @@ void XGfxWorldVertexData::ParseData(QDataStream *aStream) { } // Skip D3DVertexBuffer pointer - we'll handle this appropriately later - aStream->ignore(sizeof(int)); + qint32 bufferPtr; + *aStream >> bufferPtr; + if (bufferPtr == -1) + { + + } } } @@ -50,4 +49,3 @@ int XGfxWorldVertexData::GetVertexBufferPtr() const { void XGfxWorldVertexData::SetVertexBufferPtr(int ptr) { mVertexBufferPtr = ptr; } - diff --git a/libs/xassets/xgfxworldvertexdata.h b/libs/xassets/xgfxworldvertexdata.h index 79b8954..bd82635 100644 --- a/libs/xassets/xgfxworldvertexdata.h +++ b/libs/xassets/xgfxworldvertexdata.h @@ -1,18 +1,11 @@ - - - - - - - - - #ifndef XGFXWORLDVERTEXDATA_H #define XGFXWORLDVERTEXDATA_H #include "xasset.h" #include "xgfxworldvertex.h" +#include + class XGfxWorldVertexData : public XAsset { public: @@ -34,11 +27,3 @@ private: }; #endif // XGFXWORLDVERTEXDATA_H - - - - - - - - diff --git a/libs/xassets/xgputexturefetchconstant.cpp b/libs/xassets/xgputexturefetchconstant.cpp index ef1333f..5d767ec 100644 --- a/libs/xassets/xgputexturefetchconstant.cpp +++ b/libs/xassets/xgputexturefetchconstant.cpp @@ -1,23 +1,22 @@ -#include "xcardmemory.h" +#include "xgputexturefetchconstant.h" -XCardMemory::XCardMemory() +XGpuTextureFetchConstant::XGpuTextureFetchConstant() : XAsset() - , mPlatform(0) { } -XCardMemory::~XCardMemory() +XGpuTextureFetchConstant::~XGpuTextureFetchConstant() { } -void XCardMemory::ParseData(QDataStream *aStream) +void XGpuTextureFetchConstant::ParseData(QDataStream *aStream) { - *aStream >> mPlatform; + } -void XCardMemory::Clear() +void XGpuTextureFetchConstant::Clear() { - mPlatform = 0; + } diff --git a/libs/xassets/xgputexturefetchconstant.h b/libs/xassets/xgputexturefetchconstant.h index e687d1e..970e177 100644 --- a/libs/xassets/xgputexturefetchconstant.h +++ b/libs/xassets/xgputexturefetchconstant.h @@ -10,7 +10,7 @@ class XGpuTextureFetchConstant : public XAsset { public: - XGpuTextureFetchConstant(); + explicit XGpuTextureFetchConstant(); ~XGpuTextureFetchConstant(); virtual void ParseData(QDataStream* aStream) override; @@ -33,19 +33,16 @@ private: quint32 mStacked; quint32 mClampPolicy; quint32 mBaseAddress; - union - { - XGpuTextureSize1D mOneD; - XGpuTextureSize2D mTwoD; - XGpuTextureSize3D mThreeD; - XGpuTextureSizeStack mStack; - } mSize; quint32 mNumFormat; quint32 mSwizzleX; quint32 mSwizzleY; quint32 mSwizzleZ; quint32 mSwizzleW; qint32 mExpAdjust; + XGpuTextureSize1D mOneD; + XGpuTextureSize2D mTwoD; + XGpuTextureSize3D mThreeD; + XGpuTextureSizeStack mStack; quint32 mMagFilter; quint32 mMinFilter; quint32 mMipFilter; diff --git a/libs/xassets/xloadedsound.cpp b/libs/xassets/xloadedsound.cpp index a8426d1..ab72ae7 100644 --- a/libs/xassets/xloadedsound.cpp +++ b/libs/xassets/xloadedsound.cpp @@ -1,21 +1,24 @@ -#include "xsoundfile.h" +#include "xloadedsound.h" -XSoundFile::XSoundFile() +XLoadedSound::XLoadedSound() + : XAsset() + , mName() + , mSound() { } -XSoundFile::~XSoundFile() +XLoadedSound::~XLoadedSound() { } -void XSoundFile::ParseData(QDataStream *aStream) +void XLoadedSound::ParseData(QDataStream *aStream) { } -void XSoundFile::Clear() +void XLoadedSound::Clear() { } diff --git a/libs/xassets/xloadedsound.h b/libs/xassets/xloadedsound.h index f62c4db..500cc2d 100644 --- a/libs/xassets/xloadedsound.h +++ b/libs/xassets/xloadedsound.h @@ -5,12 +5,10 @@ #include "xaudiosound.h" #include "xstring.h" -class XSoundFileRef; - class XLoadedSound : public XAsset { public: - XLoadedSound(); + explicit XLoadedSound(); ~XLoadedSound(); virtual void ParseData(QDataStream* aStream) override; diff --git a/libs/xassets/xlocalizeentry.cpp b/libs/xassets/xlocalizeentry.cpp index 2cf6294..b91893c 100644 --- a/libs/xassets/xlocalizeentry.cpp +++ b/libs/xassets/xlocalizeentry.cpp @@ -5,7 +5,8 @@ XLocalizeEntry::XLocalizeEntry() , mValue(new XString()) , mName(new XString()) { - + SetType(ASSET_TYPE_LOCALIZE_ENTRY); + SetName("Localize Entry"); } XLocalizeEntry::~XLocalizeEntry() diff --git a/libs/xassets/xmapents.cpp b/libs/xassets/xmapents.cpp index 71aabd7..2f070b8 100644 --- a/libs/xassets/xmapents.cpp +++ b/libs/xassets/xmapents.cpp @@ -3,7 +3,8 @@ XMapEnts::XMapEnts() : XAsset() { - + SetType(ASSET_TYPE_MAP_ENTS); + SetName("Map Ents"); } XMapEnts::~XMapEnts() diff --git a/libs/xassets/xmaterial.cpp b/libs/xassets/xmaterial.cpp index 6f9b5f9..a7b3160 100644 --- a/libs/xassets/xmaterial.cpp +++ b/libs/xassets/xmaterial.cpp @@ -9,24 +9,18 @@ XMaterial::XMaterial() , mStateBitsCount(0) , mStateFlags(0) , mCameraRegion(0) - , mTechSetPtr(0) - , mTechniqueSet(new XMaterialTechSet) - , mTextureTablePtr(0) - , mTextureTable(new XMaterialTextureDef) - , mConstantTablePtr(0) - , mConstantTable(new XMaterialConstantDef) - , mStateBitsTablePtr(0) - , mStateBitsTable(new XGfxStateBits) + , mTechniqueSet() + , mTextureTable() + , mConstantTable() + , mStateBitsTable() { - + SetType(ASSET_TYPE_MATERIAL); + SetName("Material"); } XMaterial::~XMaterial() { - delete mTechniqueSet; - delete mTextureTable; - delete mConstantTable; - delete mStateBitsTable; + } void XMaterial::ParseData(QDataStream *aStream) @@ -43,12 +37,8 @@ void XMaterial::Clear() mStateBitsCount = 0; mStateFlags = 0; mCameraRegion = 0; - mTechSetPtr = 0; - mTechniqueSet = new XMaterialTechSet(); - mTextureTablePtr = 0; - mTextureTable = new XMaterialTextureDef(); - mConstantTablePtr = 0; - mConstantTable = new XMaterialConstantDef(); - mStateBitsTablePtr = 0; - mStateBitsTable = new XGfxStateBits(); + mTechniqueSet = XMaterialTechniqueSet(); + mTextureTable = XMaterialTextureDef(); + mConstantTable = XMaterialConstantDef(); + mStateBitsTable = XGfxStateBits(); } diff --git a/libs/xassets/xmaterial.h b/libs/xassets/xmaterial.h index 3f0baff..9192ae9 100644 --- a/libs/xassets/xmaterial.h +++ b/libs/xassets/xmaterial.h @@ -1,7 +1,7 @@ #ifndef XMATERIAL_H #define XMATERIAL_H -#include "materialtechset.h" +#include "xmaterialtechniqueset.h" #include "xgfxstatebits.h" #include "xmaterialinfo.h" #include "xmaterialtexturedef.h" @@ -18,25 +18,16 @@ public: private: XMaterialInfo mInfo; - QVector mStateBitsEntry; quint8 mTextureCount; quint8 mConstantCount; quint8 mStateBitsCount; quint8 mStateFlags; quint8 mCameraRegion; - - qint32 mTechSetPtr; - XMaterialTechSet *mTechniqueSet; - - qint32 mTextureTablePtr; - XMaterialTextureDef *mTextureTable; - - qint32 mConstantTablePtr; - XMaterialConstantDef *mConstantTable; - - qint32 mStateBitsTablePtr; - XGfxStateBits *mStateBitsTable; + XMaterialTechniqueSet mTechniqueSet; + XMaterialTextureDef mTextureTable; + XMaterialConstantDef mConstantTable; + XGfxStateBits mStateBitsTable; }; #endif // MATERIAL_H diff --git a/libs/xassets/xmaterialconstantdef.cpp b/libs/xassets/xmaterialconstantdef.cpp index 99bc215..f0cd298 100644 --- a/libs/xassets/xmaterialconstantdef.cpp +++ b/libs/xassets/xmaterialconstantdef.cpp @@ -23,5 +23,5 @@ void XMaterialConstantDef::Clear() { mNameHash = 0; mName = ""; - mLiteral = QList(); + mLiteral.clear(); } diff --git a/libs/xassets/xmaterialinfo.cpp b/libs/xassets/xmaterialinfo.cpp index 687ba1c..78a8e25 100644 --- a/libs/xassets/xmaterialinfo.cpp +++ b/libs/xassets/xmaterialinfo.cpp @@ -1,18 +1,29 @@ -#include "xgputexturesize3d.h" +#include "xmaterialinfo.h" -XGpuTextureSize3D::XGpuTextureSize3D() +XMaterialInfo::XMaterialInfo() : XAsset() - , mWidth(0) + , mName("") + , mGameFlags(0) + , mSortKey(0) + , mTextureAtlasRowCount(0) + , mTextureAtlasColumnCount(0) + , mDrawSurf() + , mSurfaceTypeBits(0) { - + } -void XGpuTextureSize3D::ParseData(QDataStream *aStream) +XMaterialInfo::~XMaterialInfo() { - + } -void XGpuTextureSize3D::Clear() +void XMaterialInfo::ParseData(QDataStream *aStream) { - + +} + +void XMaterialInfo::Clear() +{ + } diff --git a/libs/xassets/xmaterialinfo.h b/libs/xassets/xmaterialinfo.h index fc94557..5c3c526 100644 --- a/libs/xassets/xmaterialinfo.h +++ b/libs/xassets/xmaterialinfo.h @@ -10,6 +10,7 @@ class XMaterialInfo : public XAsset { public: explicit XMaterialInfo(); + ~XMaterialInfo(); void ParseData(QDataStream *aStream) override; void Clear() override; diff --git a/libs/xassets/xmaterialpass.cpp b/libs/xassets/xmaterialpass.cpp index ee21f4f..d2baddd 100644 --- a/libs/xassets/xmaterialpass.cpp +++ b/libs/xassets/xmaterialpass.cpp @@ -2,20 +2,19 @@ #include "xmaterialvertexdeclaration.h" #include "xmaterialvertexshader.h" #include "xmaterialpixelshader.h" -#include "xmaterialshaderargument.h" XMaterialPass::XMaterialPass() : XAsset() - , mVertexDecl(nullptr) + , mVertexDecl() , mVertexShaderArray() - , mVertexShader(nullptr) - , mPixelShader(nullptr) + , mVertexShader() + , mPixelShader() , mPerPrimArgCount(0) , mPerObjArgCount(0) , mStableArgCount(0) , mCustomSamplerFlags(0) , mPrecompiledIndex(0) - , mArgs(nullptr) + , mArgs() { } @@ -27,5 +26,28 @@ void XMaterialPass::Clear() void XMaterialPass::ParseData(QDataStream *aStream) { - + mVertexDecl.ParsePtr(aStream, false); + for (int i = 0; i < 15; i++) + { + mVertexShaderArray[i].ParsePtr(aStream, false); + } + mVertexShader.ParsePtr(aStream, false); + mPixelShader.ParsePtr(aStream, false); + + qint32 argPtr; + *aStream + >> mPerPrimArgCount + >> mPerObjArgCount + >> mStableArgCount + >> mCustomSamplerFlags + >> mPrecompiledIndex + >> argPtr; + + mVertexDecl.ParseData(aStream); + for (int i = 0; i < 15; i++) + { + mVertexShaderArray[i].ParseData(aStream); + } + mVertexShader.ParseData(aStream); + mPixelShader.ParseData(aStream); } diff --git a/libs/xassets/xmaterialpass.h b/libs/xassets/xmaterialpass.h index 3fd2ba7..c60cebe 100644 --- a/libs/xassets/xmaterialpass.h +++ b/libs/xassets/xmaterialpass.h @@ -2,14 +2,13 @@ #define XMATERIALPASS_H #include "xasset.h" +#include "xmaterialpixelshader.h" +#include "xmaterialshaderargument.h" +#include "xmaterialvertexdeclaration.h" +#include "xmaterialvertexshader.h" #include -class XMaterialVertexDeclaration; -class XMaterialVertexShader; -class XMaterialPixelShader; -class XMaterialShaderArgument; - class XMaterialPass : public XAsset { public: @@ -19,16 +18,16 @@ public: virtual void ParseData(QDataStream *aStream) override; private: - XMaterialVertexDeclaration* mVertexDecl; - QVector mVertexShaderArray; - XMaterialVertexShader* mVertexShader; - XMaterialPixelShader* mPixelShader; + XMaterialVertexDeclaration mVertexDecl; + QVector mVertexShaderArray; + XMaterialVertexShader mVertexShader; + XMaterialPixelShader mPixelShader; int mPerPrimArgCount; int mPerObjArgCount; int mStableArgCount; int mCustomSamplerFlags; int mPrecompiledIndex; - XMaterialShaderArgument* mArgs; + XMaterialShaderArgument mArgs; }; #endif // XMATERIALPASS_H diff --git a/libs/xassets/xmaterialpixelshader.cpp b/libs/xassets/xmaterialpixelshader.cpp index 2c33f89..f2ebdc2 100644 --- a/libs/xassets/xmaterialpixelshader.cpp +++ b/libs/xassets/xmaterialpixelshader.cpp @@ -5,7 +5,8 @@ XMaterialPixelShader::XMaterialPixelShader() , mName("") , mShaderProgram() { - + SetType(ASSET_TYPE_PIXELSHADER); + SetName("Pixel Shader"); } XMaterialPixelShader::~XMaterialPixelShader() diff --git a/libs/xassets/xmaterialstreamrouting.cpp b/libs/xassets/xmaterialstreamrouting.cpp index 71aabd7..f3c9092 100644 --- a/libs/xassets/xmaterialstreamrouting.cpp +++ b/libs/xassets/xmaterialstreamrouting.cpp @@ -1,22 +1,22 @@ -#include "xmapents.h" +#include "xmaterialstreamrouting.h" -XMapEnts::XMapEnts() +XMaterialStreamRouting::XMaterialStreamRouting() : XAsset() { } -XMapEnts::~XMapEnts() +XMaterialStreamRouting::~XMaterialStreamRouting() { } -void XMapEnts::Clear() +void XMaterialStreamRouting::Clear() { } -void XMapEnts::ParseData(QDataStream *aStream) +void XMaterialStreamRouting::ParseData(QDataStream *aStream) { } diff --git a/libs/xassets/xmaterialtechnique.cpp b/libs/xassets/xmaterialtechnique.cpp index 01242f8..f9db48b 100644 --- a/libs/xassets/xmaterialtechnique.cpp +++ b/libs/xassets/xmaterialtechnique.cpp @@ -1,17 +1,46 @@ #include "xmaterialtechnique.h" +#include "qdebug.h" +#include "qfiledevice.h" XMaterialTechnique::XMaterialTechnique() : XAsset() + , mName() + , mFlags(0) + , mPassCount(0) + , mPassArray() { } +XMaterialTechnique::~XMaterialTechnique() +{ + +} + void XMaterialTechnique::ParseData(QDataStream *aStream) { - + mName.ParsePtr(aStream); + + qDebug() << aStream->device()->pos(); + + *aStream + >> mFlags + >> mPassCount; + + mPassArray = QVector(mPassArray); + + for (int i = 0; i < mPassCount; i++) + { + mPassArray[i].ParseData(aStream); + } + + mName.ParseData(aStream); } void XMaterialTechnique::Clear() { - + mName.Clear(); + mFlags = 0; + mPassCount = 0; + mPassArray.clear(); } diff --git a/libs/xassets/xmaterialtechnique.h b/libs/xassets/xmaterialtechnique.h index 429ed0c..1266811 100644 --- a/libs/xassets/xmaterialtechnique.h +++ b/libs/xassets/xmaterialtechnique.h @@ -3,6 +3,7 @@ #include "xasset.h" #include "xmaterialpass.h" +#include "xstring.h" #include @@ -10,15 +11,16 @@ class XMaterialTechnique : public XAsset { public: explicit XMaterialTechnique(); + ~XMaterialTechnique(); virtual void ParseData(QDataStream* aStream) override; virtual void Clear() override; private: - QString mName; + XString mName; int mFlags; int mPassCount; - QVector mPassArray; + QVector mPassArray; }; #endif // XMATERIALTECHNIQUE_H diff --git a/libs/xassets/xmaterialtexturedef.cpp b/libs/xassets/xmaterialtexturedef.cpp index 00664d6..eca1109 100644 --- a/libs/xassets/xmaterialtexturedef.cpp +++ b/libs/xassets/xmaterialtexturedef.cpp @@ -29,5 +29,5 @@ void XMaterialTextureDef::Clear() mNameEnd = 0; mSamplerState = 0; mSemantic = 0; - mDefInfo = XMaterialTextureDefInfo(); + mDefInfo.Clear(); } diff --git a/libs/xassets/xmaterialtexturedefinfo.cpp b/libs/xassets/xmaterialtexturedefinfo.cpp index a0f7380..be91ab2 100644 --- a/libs/xassets/xmaterialtexturedefinfo.cpp +++ b/libs/xassets/xmaterialtexturedefinfo.cpp @@ -2,16 +2,15 @@ XMaterialTextureDefInfo::XMaterialTextureDefInfo() : XAsset() - , mImage(new XGfxImage()) - , mWater(new XWater()) + , mImage() + , mWater() { } XMaterialTextureDefInfo::~XMaterialTextureDefInfo() { - delete mImage; - delete mWater; + } void XMaterialTextureDefInfo::ParseData(QDataStream *aStream) @@ -21,9 +20,6 @@ void XMaterialTextureDefInfo::ParseData(QDataStream *aStream) void XMaterialTextureDefInfo::Clear() { - delete mImage; - delete mWater; - - mImage = new XGfxImage(); - mWater = new XWater(); + mImage.Clear(); + mWater.Clear(); } diff --git a/libs/xassets/xmaterialtexturedefinfo.h b/libs/xassets/xmaterialtexturedefinfo.h index 12517ee..c5e3f2c 100644 --- a/libs/xassets/xmaterialtexturedefinfo.h +++ b/libs/xassets/xmaterialtexturedefinfo.h @@ -15,8 +15,8 @@ public: virtual void Clear() override; private: - XGfxImage *mImage; - XWater *mWater; + XGfxImage mImage; + XWater mWater; }; #endif // XMATERIALTEXTUREDEFINFO_H diff --git a/libs/xassets/xmaterialvertexdeclaration.cpp b/libs/xassets/xmaterialvertexdeclaration.cpp index 45d221c..0402d50 100644 --- a/libs/xassets/xmaterialvertexdeclaration.cpp +++ b/libs/xassets/xmaterialvertexdeclaration.cpp @@ -16,5 +16,12 @@ void XMaterialVertexDeclaration::Clear() void XMaterialVertexDeclaration::ParseData(QDataStream *aStream) { + if (GetPtr() == -1) + { + *aStream + >> mStreamCount + >> mHasOptionalSource; + mRouting.ParseData(aStream); + } } diff --git a/libs/xassets/xmaterialvertexshader.cpp b/libs/xassets/xmaterialvertexshader.cpp index 4d29808..83668dc 100644 --- a/libs/xassets/xmaterialvertexshader.cpp +++ b/libs/xassets/xmaterialvertexshader.cpp @@ -4,7 +4,7 @@ XMaterialVertexShader::XMaterialVertexShader() : XAsset() , mName() - , mProgram(new XMaterialVertexShaderProgram()) + , mProgram() { } @@ -16,5 +16,12 @@ void XMaterialVertexShader::Clear() void XMaterialVertexShader::ParseData(QDataStream *aStream) { - + if (GetPtr() == -1) + { + mName.ParsePtr(aStream, false); + mProgram.ParseData(aStream); + + mName.ParseData(aStream); + mProgram.ParseData(aStream); + } } diff --git a/libs/xassets/xmaterialvertexshader.h b/libs/xassets/xmaterialvertexshader.h index fb55f63..61c2495 100644 --- a/libs/xassets/xmaterialvertexshader.h +++ b/libs/xassets/xmaterialvertexshader.h @@ -2,11 +2,11 @@ #define XMATERIALVERTEXSHADER_H #include "xasset.h" +#include "xstring.h" +#include "xmaterialvertexshaderprogram.h" #include -class XMaterialVertexShaderProgram; - class XMaterialVertexShader : public XAsset { public: @@ -16,8 +16,8 @@ public: virtual void ParseData(QDataStream *aStream) override; private: - QString mName; - XMaterialVertexShaderProgram* mProgram; + XString mName; + XMaterialVertexShaderProgram mProgram; }; #endif // XMATERIALVERTEXSHADER_H diff --git a/libs/xassets/xmaterialvertexshaderprogram.cpp b/libs/xassets/xmaterialvertexshaderprogram.cpp index 71aabd7..fa80781 100644 --- a/libs/xassets/xmaterialvertexshaderprogram.cpp +++ b/libs/xassets/xmaterialvertexshaderprogram.cpp @@ -1,22 +1,25 @@ -#include "xmapents.h" +#include "xmaterialvertexshaderprogram.h" -XMapEnts::XMapEnts() +XMaterialVertexShaderProgram::XMaterialVertexShaderProgram() : XAsset() -{ - -} - -XMapEnts::~XMapEnts() + //, mVertexShader() + , mLoadDef() { } -void XMapEnts::Clear() +XMaterialVertexShaderProgram::~XMaterialVertexShaderProgram() { } -void XMapEnts::ParseData(QDataStream *aStream) +void XMaterialVertexShaderProgram::Clear() { - + //mVertexShader.Clear(); + mLoadDef.Clear(); +} + +void XMaterialVertexShaderProgram::ParseData(QDataStream *aStream) +{ + mLoadDef.ParseData(aStream); } diff --git a/libs/xassets/xmaterialvertexshaderprogram.h b/libs/xassets/xmaterialvertexshaderprogram.h index fcad34f..ca9d935 100644 --- a/libs/xassets/xmaterialvertexshaderprogram.h +++ b/libs/xassets/xmaterialvertexshaderprogram.h @@ -2,19 +2,19 @@ #define XMATERIALVERTEXSHADERPROGRAM_H #include "xasset.h" -#include "xd3dvertexshader.h" #include "xgfxvertexshaderloaddef.h" class XMaterialVertexShaderProgram : public XAsset { public: XMaterialVertexShaderProgram(); + ~XMaterialVertexShaderProgram(); virtual void Clear() override; virtual void ParseData(QDataStream *aStream) override; private: - std::shared_ptr mVertexShader; + //XD3DVertexShader mVertexShader; XGfxVertexShaderLoadDef mLoadDef; }; diff --git a/libs/xassets/xmenudef.cpp b/libs/xassets/xmenudef.cpp index 393fb8d..4213163 100644 --- a/libs/xassets/xmenudef.cpp +++ b/libs/xassets/xmenudef.cpp @@ -1,4 +1,5 @@ #include "xmenudef.h" +#include "xitemdef.h" XMenuDef::XMenuDef() : XAsset() @@ -27,7 +28,8 @@ XMenuDef::XMenuDef() , mRectYExp() , mItems() { - + SetType(ASSET_TYPE_MENU); + SetName("Menu Def"); } XMenuDef::~XMenuDef() diff --git a/libs/xassets/xmenudef.h b/libs/xassets/xmenudef.h index a3428b2..7391e32 100644 --- a/libs/xassets/xmenudef.h +++ b/libs/xassets/xmenudef.h @@ -2,277 +2,13 @@ #define XMENUDEF_H #include "qcolor.h" -#include "xsoundalias.h" +#include "xitemkeyhandler.h" #include "xasset.h" -#include "xsoundaliaslist.h" +#include "xstatement.h" +#include "xstring.h" +#include "xwindowdef.h" -class XMaterial; - -struct XRectDef -{ - float x; - float y; - float w; - float h; - int horzAlign; - int vertAlign; -}; - -struct XWindowDef -{ - const char *name; - XRectDef rect; - XRectDef rectClient; - const char *group; - int style; - int border; - int ownerDraw; - int ownerDrawFlags; - float borderSize; - int staticFlags; - int dynamicFlags[4]; - int nextTime; - float foreColor[4]; - float backColor[4]; - float borderColor[4]; - float outlineColor[4]; - XMaterial *background; -}; - -struct XItemKeyHandler -{ - int key; - const char *action; - XItemKeyHandler *next; -}; - -enum XOperationEnum : __int32 -{ - OP_NOOP = 0x0, - OP_RIGHTPAREN = 0x1, - OP_MULTIPLY = 0x2, - OP_DIVIDE = 0x3, - OP_MODULUS = 0x4, - OP_ADD = 0x5, - OP_SUBTRACT = 0x6, - OP_NOT = 0x7, - OP_LESSTHAN = 0x8, - OP_LESSTHANEQUALTO = 0x9, - OP_GREATERTHAN = 0xA, - OP_GREATERTHANEQUALTO = 0xB, - OP_EQUALS = 0xC, - OP_NOTEQUAL = 0xD, - OP_AND = 0xE, - OP_OR = 0xF, - OP_LEFTPAREN = 0x10, - OP_COMMA = 0x11, - OP_BITWISEAND = 0x12, - OP_BITWISEOR = 0x13, - OP_BITWISENOT = 0x14, - OP_BITSHIFTLEFT = 0x15, - OP_BITSHIFTRIGHT = 0x16, - OP_SIN = 0x17, - OP_FIRSTFUNCTIONCALL = 0x17, - OP_COS = 0x18, - OP_MIN = 0x19, - OP_MAX = 0x1A, - OP_MILLISECONDS = 0x1B, - OP_DVARINT = 0x1C, - OP_DVARBOOL = 0x1D, - OP_DVARFLOAT = 0x1E, - OP_DVARSTRING = 0x1F, - OP_STAT = 0x20, - OP_UIACTIVE = 0x21, - OP_FLASHBANGED = 0x22, - OP_SCOPED = 0x23, - OP_SCOREBOARDVISIBLE = 0x24, - OP_INKILLCAM = 0x25, - OP_PLAYERFIELD = 0x26, - OP_SELECTINGLOCATION = 0x27, - OP_TEAMFIELD = 0x28, - OP_OTHERTEAMFIELD = 0x29, - OP_MARINESFIELD = 0x2A, - OP_OPFORFIELD = 0x2B, - OP_MENUISOPEN = 0x2C, - OP_WRITINGDATA = 0x2D, - OP_INLOBBY = 0x2E, - OP_INPRIVATEPARTY = 0x2F, - OP_PRIVATEPARTYHOST = 0x30, - OP_PRIVATEPARTYHOSTINLOBBY = 0x31, - OP_ALONEINPARTY = 0x32, - OP_ADSJAVELIN = 0x33, - OP_WEAPLOCKBLINK = 0x34, - OP_WEAPATTACKTOP = 0x35, - OP_WEAPATTACKDIRECT = 0x36, - OP_SECONDSASTIME = 0x37, - OP_TABLELOOKUP = 0x38, - OP_LOCALIZESTRING = 0x39, - OP_LOCALVARINT = 0x3A, - OP_LOCALVARBOOL = 0x3B, - OP_LOCALVARFLOAT = 0x3C, - OP_LOCALVARSTRING = 0x3D, - OP_TIMELEFT = 0x3E, - OP_SECONDSASCOUNTDOWN = 0x3F, - OP_GAMEMSGWNDACTIVE = 0x40, - OP_TOINT = 0x41, - OP_TOSTRING = 0x42, - OP_TOFLOAT = 0x43, - OP_GAMETYPENAME = 0x44, - OP_GAMETYPE = 0x45, - OP_GAMETYPEDESCRIPTION = 0x46, - OP_SCORE = 0x47, - OP_FRIENDSONLINE = 0x48, - OP_FOLLOWING = 0x49, - OP_STATRANGEBITSSET = 0x4A, - OP_KEYBINDING = 0x4B, - OP_ACTIONSLOTUSABLE = 0x4C, - OP_HUDFADE = 0x4D, - OP_MAXPLAYERS = 0x4E, - OP_ACCEPTINGINVITE = 0x4F, - NUM_OPERATORS = 0x50, -}; - -enum XExpDataType : __int32 -{ - VAL_INT = 0x0, - VAL_FLOAT = 0x1, - VAL_STRING = 0x2, -}; - -union XOperandInternalDataUnion -{ - int intVal; - float floatVal; - const char *string; -}; - -struct XOperand -{ - XExpDataType dataType; - XOperandInternalDataUnion internals; -}; - -union entryInternalData -{ - OperationEnum op; - XOperand operand; -}; - -struct XExpressionEntry -{ - int type; - entryInternalData data; -}; - -struct XStatement -{ - int numEntries; - XExpressionEntry **entries; -}; - -struct XColumnInfo -{ - int pos; - int width; - int maxChars; - int alignment; -}; - -struct XListBoxDef -{ - int startPos[4]; - int endPos[4]; - int drawPadding; - float elementWidth; - float elementHeight; - int elementStyle; - int numColumns; - XColumnInfo columnInfo[16]; - const char *doubleClick; - int notselectable; - int noScrollBars; - int usePaging; - float selectBorder[4]; - float disableColor[4]; - XMaterial *selectIcon; -}; - -struct XEditFieldDef -{ - float minVal; - float maxVal; - float defVal; - float range; - int maxChars; - int maxCharsGotoNext; - int maxPaintChars; - int paintOffset; -}; - -struct XMultiDef -{ - const char *dvarList[32]; - const char *dvarStr[32]; - float dvarValue[32]; - int count; - int strDef; -}; - -union XItemDefData -{ - XListBoxDef *listBox; - XEditFieldDef *editField; - XMultiDef *multi; - const char *enumDvarName; - void *data; -}; - -class XMenuDef; -struct XItemDef -{ - XWindowDef window; - XRectDef textRect[4]; - int type; - int dataType; - int alignment; - int fontEnum; - int textAlignMode; - float textalignx; - float textaligny; - float textscale; - int textStyle; - int gameMsgWindowIndex; - int gameMsgWindowMode; - const char *text; - int itemFlags; - XMenuDef *parent; - const char *mouseEnterText; - const char *mouseExitText; - const char *mouseEnter; - const char *mouseExit; - const char *action; - const char *onAccept; - const char *onFocus; - const char *leaveFocus; - const char *dvar; - const char *dvarTest; - XItemKeyHandler *onKey; - const char *enableDvar; - int dvarFlags; - XSoundAliasList *focusSound; - float special; - int cursorPos[4]; - XItemDefData typeData; - int imageTrack; - XStatement visibleExp; - XStatement textExp; - XStatement materialExp; - XStatement rectXExp; - XStatement rectYExp; - XStatement rectWExp; - XStatement rectHExp; - XStatement forecolorAExp; -}; +class XItemDef; class XMenuDef : public XAsset { diff --git a/libs/xassets/xmenulist.cpp b/libs/xassets/xmenulist.cpp index 36e564e..6295748 100644 --- a/libs/xassets/xmenulist.cpp +++ b/libs/xassets/xmenulist.cpp @@ -1,15 +1,16 @@ #include "xmenulist.h" -MenuList::MenuList() +XMenuList::XMenuList() : XAsset() , mName(new XString()) , mMenuCount(0) , mMenus(QVector()) { - + SetType(ASSET_TYPE_MENULIST); + XAsset::SetName("Menu List"); } -MenuList::~MenuList() +XMenuList::~XMenuList() { for (int i = 0; i < mMenus.size(); i++) { @@ -19,32 +20,32 @@ MenuList::~MenuList() delete mName; } -void MenuList::SetName(XString *aName) +void XMenuList::SetName(XString *aName) { mName = aName; } -XString *MenuList::GetName() const +XString *XMenuList::GetName() const { return mName; } -int MenuList::GetMenuCount() const +int XMenuList::GetMenuCount() const { return mMenuCount; } -void MenuList::SetMenuEntry(int aIndex, XMenuDef *aMenuDef) +void XMenuList::SetMenuEntry(int aIndex, XMenuDef *aMenuDef) { mMenus[aIndex] = aMenuDef; } -XMenuDef *MenuList::GetMenuEntry(int aIndex) const +XMenuDef *XMenuList::GetMenuEntry(int aIndex) const { return mMenus[aIndex]; } -void MenuList::Clear() +void XMenuList::Clear() { for (int i = 0; i < mMenus.size(); i++) { @@ -56,7 +57,7 @@ void MenuList::Clear() mMenus.clear(); } -void MenuList::ParseData(QDataStream *aStream) +void XMenuList::ParseData(QDataStream *aStream) { mName->ParsePtr(aStream, false); diff --git a/libs/xassets/xmenulist.h b/libs/xassets/xmenulist.h index e99ab6a..f5f4bfd 100644 --- a/libs/xassets/xmenulist.h +++ b/libs/xassets/xmenulist.h @@ -4,11 +4,11 @@ #include "xstring.h" #include "xmenudef.h" -class MenuList : public XAsset +class XMenuList : public XAsset { public: - MenuList(); - ~MenuList(); + XMenuList(); + ~XMenuList(); void SetName(XString* aName); XString* GetName() const; diff --git a/libs/xassets/xmodel.cpp b/libs/xassets/xmodel.cpp index d1a19ab..655d9a2 100644 --- a/libs/xassets/xmodel.cpp +++ b/libs/xassets/xmodel.cpp @@ -1,4 +1,5 @@ #include "xmodel.h" +#include "xstring.h" XModel::XModel() : XAsset() @@ -30,6 +31,11 @@ XModel::XModel() , mFlags(0) , mPhysPreset(new XPhysPreset) , mPhysGeoms(new XPhysGeomList) +{ + SetType(ASSET_TYPE_XMODEL); +} + +XModel::~XModel() { } @@ -40,168 +46,11 @@ void XModel::ParseData(QDataStream *aStream) { *aStream >> namePtr; - mName = Load_XString(aStream); - if (boneNamesPtr == -1) - { - Load_ScriptStringArray(1, numBones); - } - if ( parentList ) - { - if ( parentList == (unsigned __int8 *)-1 ) - { - v5 = g_streamPos; - v6 = v1->numBones - v1->numRootBones; - varbyte = g_streamPos; - v1->parentList = g_streamPos; - Load_Stream(1, v5, v6); - v1 = varXModel; - } - else - { - v1->parentList = &(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)(v1->parentList - 1) >> 26) & 0x38)))[(int)(v1->parentList - 1) & 0x1FFFFFFF]; - } - } - quats = v1->quats; - if ( quats ) - { - if ( quats == (__int16 *)-1 ) - { - v8 = (unsigned __int8 *)((unsigned int)(g_streamPos + 1) & 0xFFFFFFFE); - v9 = 8 * (v1->numBones - v1->numRootBones); - g_streamPos = v8; - v1->quats = (__int16 *)v8; - varshort = (__int16 *)v8; - Load_Stream(1, v8, v9); - v1 = varXModel; - } - else - { - v1->quats = (__int16 *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + ((((unsigned int)v1->quats - 1) >> 26) & 0x38)))[((int)v1->quats - 1) & 0x1FFFFFFF]; - } - } - trans = v1->trans; - if ( trans ) - { - if ( trans == (float *)-1 ) - { - v11 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - v12 = 16 * (v1->numBones - v1->numRootBones); - g_streamPos = v11; - v1->trans = (float *)v11; - varfloat = (float *)v11; - Load_Stream(1, v11, v12); - v1 = varXModel; - } - else - { - v1->trans = (float *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + ((((unsigned int)v1->trans - 1) >> 26) & 0x38)))[((int)v1->trans - 1) & 0x1FFFFFFF]; - } - } - partClassification = v1->partClassification; - if ( partClassification ) - { - if ( partClassification == (unsigned __int8 *)-1 ) - { - v14 = g_streamPos; - v15 = v1->numBones; - varbyte = g_streamPos; - v1->partClassification = g_streamPos; - Load_Stream(1, v14, v15); - v1 = varXModel; - } - else - { - v1->partClassification = &(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + (((unsigned int)(v1->partClassification - 1) >> 26) & 0x38)))[(int)(v1->partClassification - 1) & 0x1FFFFFFF]; - } - } - baseMat = v1->baseMat; - if ( baseMat ) - { - if ( baseMat == (DObjAnimMat *)-1 ) - { - v17 = __ROL4__(v1->numBones, 5); - v18 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - g_streamPos = v18; - varDObjAnimMat = (DObjAnimMat *)v18; - v1->baseMat = (DObjAnimMat *)v18; - Load_Stream(1, v18, v17); - v1 = varXModel; - } - else - { - v1->baseMat = (DObjAnimMat *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + ((((unsigned int)&v1->baseMat[-1].transWeight + 3) >> 26) & 0x38)))[((int)&v1->baseMat[-1].transWeight + 3) & 0x1FFFFFFF]; - } - } - if ( v1->surfs ) - { - numsurfs = v1->numsurfs; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varXSurface = (XSurface *)g_streamPos; - v1->surfs = (XSurface *)g_streamPos; - Load_XSurfaceArray(1, numsurfs); - v1 = varXModel; - } - if ( v1->materialHandles ) - { - v20 = v1->numsurfs; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varMaterialHandle = (Material **)g_streamPos; - v1->materialHandles = (Material **)g_streamPos; - Load_MaterialHandleArray(1, v20); - v1 = varXModel; - } - if ( v1->collSurfs ) - { - numCollSurfs = v1->numCollSurfs; - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varXModelCollSurf = (XModelCollSurf_s *)g_streamPos; - v1->collSurfs = (XModelCollSurf_s *)g_streamPos; - Load_XModelCollSurfArray(1, numCollSurfs); - v1 = varXModel; - } - if ( v1->boneInfo ) - { - v22 = v1->numBones; - v23 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - v1->boneInfo = (XBoneInfo *)v23; - g_streamPos = v23; - varXBoneInfo = (XBoneInfo *)v23; - Load_Stream(1, v23, 8 * (v22 + __ROL4__(v22, 2))); - v1 = varXModel; - } - varXModelStreamInfo = &v1->streamInfo; - Load_Stream(0, &v1->streamInfo, 4u); - if ( varXModelStreamInfo->highMipBounds ) - { - v24 = (XModelHighMipBounds *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varXModelStreamInfo->highMipBounds = v24; - varXModelHighMipBounds = v24; - g_streamPos = (unsigned __int8 *)v24; - Load_Stream(1, v24, 8 * (varXModel->lodInfo[0].numsurfs + __ROL4__(varXModel->lodInfo[0].numsurfs, 1))); - } - varPhysPresetPtr = &varXModel->physPreset; - Load_PhysPresetPtr(0); - physGeoms = varXModel->physGeoms; - if ( physGeoms ) - { - if ( physGeoms == (PhysGeomList *)-1 ) - { - g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC); - varPhysGeomList = (PhysGeomList *)g_streamPos; - varXModel->physGeoms = (PhysGeomList *)g_streamPos; - Load_PhysGeomList(1); - DB_PopStreamPos(); - return; - } - varXModel->physGeoms = (PhysGeomList *)&(*(unsigned __int8 **)((char *)&g_streamBlocks->data - + ((((unsigned int)&varXModel->physGeoms[-1].mass.productsOfInertia[2] - + 3) >> 26) & 0x38)))[((int)&varXModel->physGeoms[-1].mass.productsOfInertia[2] - + 3) & 0x1FFFFFFF]; - } - DB_PopStreamPos(); + mName = XString::ParseCustom(aStream); + +} + +void XModel::Clear() +{ + } diff --git a/libs/xassets/xmodel.h b/libs/xassets/xmodel.h index 409d4d9..550f9f5 100644 --- a/libs/xassets/xmodel.h +++ b/libs/xassets/xmodel.h @@ -17,6 +17,7 @@ class XModel : public XAsset { public: explicit XModel(); + ~XModel(); virtual void ParseData(QDataStream* aStream) override; virtual void Clear() override; diff --git a/libs/xassets/xnodetype.h b/libs/xassets/xnodetype.h index 64deaf8..4183a9d 100644 --- a/libs/xassets/xnodetype.h +++ b/libs/xassets/xnodetype.h @@ -1,9 +1,8 @@ #ifndef XNODETYPE_H #define XNODETYPE_H -#include - -enum class NodeType : int32_t { +enum class XNodeType +{ NODE_BADNODE = 0x0, NODE_PATHNODE = 0x1, NODE_COVER_STAND = 0x2, diff --git a/libs/xassets/xpathbasenode.cpp b/libs/xassets/xpathbasenode.cpp index 8723584..8634b2a 100644 --- a/libs/xassets/xpathbasenode.cpp +++ b/libs/xassets/xpathbasenode.cpp @@ -1,40 +1,31 @@ - - - - - - #include "xpathbasenode.h" +#include "qvectornd.h" XPathBaseNode::XPathBaseNode() - : XAsset() { + : XAsset() + , mOrigin() + , mType(0) +{ + +} + +XPathBaseNode::~XPathBaseNode() +{ + } void XPathBaseNode::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read((char*)mOrigin, 3 * sizeof(float)); - aStream->read((char*)&mType, sizeof(unsigned int)); + *aStream + >> mOrigin[0] + >> mOrigin[1] + >> mOrigin[2] + >> mType; } } -const float* XPathBaseNode::GetOrigin() const { - return mOrigin; +void XPathBaseNode::Clear() +{ + mOrigin = QVector3D(); + mType = 0; } - -void XPathBaseNode::SetOrigin(const float* origin, size_t count) { - if (count <= 3) { - memcpy(mOrigin, origin, count * sizeof(float)); - } -} - -unsigned int XPathBaseNode::GetType() const { - return mType; -} - -void XPathBaseNode::SetType(unsigned int type) { - mType = type; -} - - - - diff --git a/libs/xassets/xpathbasenode.h b/libs/xassets/xpathbasenode.h index 43f8f0b..bd32559 100644 --- a/libs/xassets/xpathbasenode.h +++ b/libs/xassets/xpathbasenode.h @@ -1,35 +1,22 @@ - - - - - - #ifndef XPATHBASENODE_H #define XPATHBASENODE_H #include "xasset.h" +#include + class XPathBaseNode : public XAsset { public: explicit XPathBaseNode(); + ~XPathBaseNode(); void ParseData(QDataStream *aStream) override; - - const float* GetOrigin() const; - void SetOrigin(const float* origin, size_t count = 3); - - unsigned int GetType() const; - void SetType(unsigned int type); + void Clear() override; private: - float mOrigin[3] = {0.0f, 0.0f, 0.0f}; - unsigned int mType = 0; + QVector3D mOrigin; + unsigned int mType; }; #endif // XPATHBASENODE_H - - - - - diff --git a/libs/xassets/xpathdata.cpp b/libs/xassets/xpathdata.cpp index ef8cb1e..834887e 100644 --- a/libs/xassets/xpathdata.cpp +++ b/libs/xassets/xpathdata.cpp @@ -13,7 +13,7 @@ XPathData::XPathData() void XPathData::ParseData(QDataStream *aStream) { // Parse the PathData structure if (GetPtr() == -1) { - aStream->read((char*)&mNodeCount, sizeof(unsigned int)); + *aStream >> mNodeCount; // Clear existing data before parsing new data mNodes.clear(); @@ -32,7 +32,7 @@ void XPathData::ParseData(QDataStream *aStream) { // Parse base nodes count and array unsigned int baseNodeCount; - aStream->read((char*)&baseNodeCount, sizeof(unsigned int)); + *aStream >> baseNodeCount; for (unsigned int i = 0; i < baseNodeCount; ++i) { XPathBaseNode baseNode; baseNode.ParseData(aStream); @@ -40,25 +40,27 @@ void XPathData::ParseData(QDataStream *aStream) { } // Parse chain node count and arrays - aStream->read((char*)&mChainNodeCount, sizeof(unsigned int)); + *aStream >> mChainNodeCount; + for (int i = 0; i < mChainNodeCount; i++) + { + unsigned short chainNode; + *aStream >> chainNode; + mChainNodeForNode << chainNode; - if (mChainNodeCount > 0) { - mChainNodeForNode.resize(mChainNodeCount); - mNodeForChainNode.resize(mChainNodeCount); - - aStream->read((char*)mChainNodeForNode.data(), mChainNodeCount * sizeof(unsigned short)); - aStream->read((char*)mNodeForChainNode.data(), mChainNodeCount * sizeof(unsigned short)); + unsigned short node; + *aStream >> node; + mNodeForChainNode << node; } // Parse visBytes and pathVis - aStream->read((char*)&mVisBytes, sizeof(int)); + *aStream >> mVisBytes; if (mVisBytes > 0) { mPathVis.resize(mVisBytes); - aStream->read(mPathVis.data(), mVisBytes); + aStream->readRawData(mPathVis.data(), mVisBytes); } // Parse nodeTreeCount and nodeTrees - aStream->read((char*)&mNodeTreeCount, sizeof(int)); + aStream->readRawData((char*)&mNodeTreeCount, sizeof(int)); for (int i = 0; i < mNodeTreeCount; ++i) { XPathNodeTree nodeTree; nodeTree.ParseData(aStream); diff --git a/libs/xassets/xpathdata.cpp.new b/libs/xassets/xpathdata.cpp.new deleted file mode 100644 index ef8cb1e..0000000 --- a/libs/xassets/xpathdata.cpp.new +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - -#include "xpathdata.h" - -XPathData::XPathData() - : XAsset() { -} - -void XPathData::ParseData(QDataStream *aStream) { - // Parse the PathData structure - if (GetPtr() == -1) { - aStream->read((char*)&mNodeCount, sizeof(unsigned int)); - - // Clear existing data before parsing new data - mNodes.clear(); - mBaseNodes.clear(); - mChainNodeForNode.clear(); - mNodeForChainNode.clear(); - mPathVis.clear(); - mNodeTrees.clear(); - - // Parse nodes - for (unsigned int i = 0; i < mNodeCount; ++i) { - XPathNode node; - node.ParseData(aStream); - mNodes.append(node); - } - - // Parse base nodes count and array - unsigned int baseNodeCount; - aStream->read((char*)&baseNodeCount, sizeof(unsigned int)); - for (unsigned int i = 0; i < baseNodeCount; ++i) { - XPathBaseNode baseNode; - baseNode.ParseData(aStream); - mBaseNodes.append(baseNode); - } - - // Parse chain node count and arrays - aStream->read((char*)&mChainNodeCount, sizeof(unsigned int)); - - if (mChainNodeCount > 0) { - mChainNodeForNode.resize(mChainNodeCount); - mNodeForChainNode.resize(mChainNodeCount); - - aStream->read((char*)mChainNodeForNode.data(), mChainNodeCount * sizeof(unsigned short)); - aStream->read((char*)mNodeForChainNode.data(), mChainNodeCount * sizeof(unsigned short)); - } - - // Parse visBytes and pathVis - aStream->read((char*)&mVisBytes, sizeof(int)); - if (mVisBytes > 0) { - mPathVis.resize(mVisBytes); - aStream->read(mPathVis.data(), mVisBytes); - } - - // Parse nodeTreeCount and nodeTrees - aStream->read((char*)&mNodeTreeCount, sizeof(int)); - for (int i = 0; i < mNodeTreeCount; ++i) { - XPathNodeTree nodeTree; - nodeTree.ParseData(aStream); - mNodeTrees.append(nodeTree); - } - } -} - -unsigned int XPathData::GetNodeCount() const { - return mNodeCount; -} - -void XPathData::SetNodeCount(unsigned int count) { - mNodeCount = count; -} - - - - diff --git a/libs/xassets/xpathdata.h b/libs/xassets/xpathdata.h index 74ac043..10831aa 100644 --- a/libs/xassets/xpathdata.h +++ b/libs/xassets/xpathdata.h @@ -1,14 +1,7 @@ - - - - - - #ifndef XPATHDATA_H #define XPATHDATA_H #include "xasset.h" -#include "gameworld.h" #include "xpathnode.h" #include "xpathbasenode.h" #include "xpathnodetree.h" @@ -38,8 +31,3 @@ private: }; #endif // XPATHDATA_H - - - - - diff --git a/libs/xassets/xpathdata.h.new b/libs/xassets/xpathdata.h.new deleted file mode 100644 index 74ac043..0000000 --- a/libs/xassets/xpathdata.h.new +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - -#ifndef XPATHDATA_H -#define XPATHDATA_H - -#include "xasset.h" -#include "gameworld.h" -#include "xpathnode.h" -#include "xpathbasenode.h" -#include "xpathnodetree.h" - -class XPathData : public XAsset -{ -public: - explicit XPathData(); - - void ParseData(QDataStream *aStream) override; - - unsigned int GetNodeCount() const; - void SetNodeCount(unsigned int count); - -private: - unsigned int mNodeCount = 0; - // Using our new classes instead of raw pointers to structures - QVector mNodes; // Vector for automatic memory management - QVector mBaseNodes; - unsigned int mChainNodeCount = 0; - QVector mChainNodeForNode; - QVector mNodeForChainNode; - int mVisBytes = 0; - QByteArray mPathVis; // Using QByteArray for automatic memory management - int mNodeTreeCount = 0; - QVector mNodeTrees; -}; - -#endif // XPATHDATA_H - - - - - diff --git a/libs/xassets/xpathlink.cpp b/libs/xassets/xpathlink.cpp index 406bba9..65b67e5 100644 --- a/libs/xassets/xpathlink.cpp +++ b/libs/xassets/xpathlink.cpp @@ -1,24 +1,43 @@ - - - - - #include "xpathlink.h" XPathLink::XPathLink() - : XAsset() { + : XAsset() + , mDist(0.0f) + , mNodeNum(0) + , mDisconnectCount(0) + , mNegotiationLink(0) + , mBadPlaceCount(4) +{ +} + +XPathLink::~XPathLink() +{ + } void XPathLink::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read((char*)&mDist, sizeof(float)); - aStream->read((char*)&mNodeNum, sizeof(unsigned short)); - aStream->read((char*)&mDisconnectCount, sizeof(unsigned char)); - aStream->read((char*)&mNegotiationLink, sizeof(unsigned char)); - aStream->read((char*)mBadPlaceCount, 4 * sizeof(unsigned char)); + *aStream + >> mDist + >> mNodeNum + >> mDisconnectCount + >> mNegotiationLink + >> mBadPlaceCount[0] + >> mBadPlaceCount[1] + >> mBadPlaceCount[2] + >> mBadPlaceCount[3]; } } +void XPathLink::Clear() +{ + mDist = 0.0f; + mNodeNum = 0; + mDisconnectCount = 0; + mNegotiationLink = 0; + mBadPlaceCount = QVector(4); +} + float XPathLink::GetDist() const { return mDist; } @@ -51,16 +70,10 @@ void XPathLink::SetNegotiationLink(unsigned char link) { mNegotiationLink = link; } -const unsigned char* XPathLink::GetBadPlaceCount() const { +QVector XPathLink::GetBadPlaceCount() const { return mBadPlaceCount; } -void XPathLink::SetBadPlaceCount(const unsigned char* counts, size_t size) { - if (size <= 4) { - memcpy(mBadPlaceCount, counts, size * sizeof(unsigned char)); - } +void XPathLink::SetBadPlaceCount(QVector aCounts) { + mBadPlaceCount = aCounts; } - - - - diff --git a/libs/xassets/xpathlink.h b/libs/xassets/xpathlink.h index 2785c9e..7bd0466 100644 --- a/libs/xassets/xpathlink.h +++ b/libs/xassets/xpathlink.h @@ -1,18 +1,18 @@ - - - - #ifndef XPATHLINK_H #define XPATHLINK_H #include "xasset.h" +#include + class XPathLink : public XAsset { public: explicit XPathLink(); + ~XPathLink(); void ParseData(QDataStream *aStream) override; + void Clear() override; float GetDist() const; void SetDist(float dist); @@ -26,18 +26,15 @@ public: unsigned char GetNegotiationLink() const; void SetNegotiationLink(unsigned char link); - const unsigned char* GetBadPlaceCount() const; - void SetBadPlaceCount(const unsigned char* counts, size_t size = 4); + QVector GetBadPlaceCount() const; + void SetBadPlaceCount(QVector aCounts); private: - float mDist = 0.0f; - unsigned short mNodeNum = 0; - unsigned char mDisconnectCount = 0; - unsigned char mNegotiationLink = 0; - unsigned char mBadPlaceCount[4] = {0, 0, 0, 0}; + float mDist; + unsigned short mNodeNum; + unsigned char mDisconnectCount; + unsigned char mNegotiationLink; + QVector mBadPlaceCount; }; #endif // XPATHLINK_H - - - diff --git a/libs/xassets/xpathnode.h b/libs/xassets/xpathnode.h index 03b646e..3c8c129 100644 --- a/libs/xassets/xpathnode.h +++ b/libs/xassets/xpathnode.h @@ -1,9 +1,3 @@ - - - - - - #ifndef XPATHNODE_H #define XPATHNODE_H @@ -35,8 +29,3 @@ private: }; #endif // XPATHNODE_H - - - - - diff --git a/libs/xassets/xpathnodeconstant.cpp b/libs/xassets/xpathnodeconstant.cpp index d80573e..ca387c8 100644 --- a/libs/xassets/xpathnodeconstant.cpp +++ b/libs/xassets/xpathnodeconstant.cpp @@ -1,220 +1,71 @@ - - - - - #include "xpathnodeconstant.h" XPathNodeConstant::XPathNodeConstant() - : XAsset() { + : XAsset() + , mType(XNodeType::NODE_BADNODE) + , mSpawnflags(0) + , mTargetname(0) + , mScriptLinkName(0) + , mScriptNoteworthy(0) + , mTarget(0) + , mAnimscript(0) + , mAnimscriptfunc(0) + , mOrigin() + , mAngle(0.0f) + , mForward() + , mRadius(0.0f) + , mMinUseDistSq(0.0f) + , mOverlapNode() + , mChainId(0) + , mChainDepth(0) + , mChainParent(0) + , mTotalLinkCount(0) + , mLinks() +{ +} + +XPathNodeConstant::~XPathNodeConstant() +{ + } void XPathNodeConstant::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { int typeInt; - aStream->read((char*)&typeInt, sizeof(int)); - mType = static_cast(typeInt); + *aStream >> typeInt; + mType = static_cast(typeInt); - aStream->read((char*)&mSpawnflags, sizeof(unsigned short)); - aStream->read((char*)&mTargetname, sizeof(unsigned short)); - aStream->read((char*)&mScriptLinkName, sizeof(unsigned short)); - aStream->read((char*)&mScriptNoteworthy, sizeof(unsigned short)); - aStream->read((char*)&mTarget, sizeof(unsigned short)); - aStream->read((char*)&mAnimscript, sizeof(unsigned short)); - aStream->read((char*)&mAnimscriptfunc, sizeof(int)); + *aStream + >> mSpawnflags + >> mTargetname + >> mScriptLinkName + >> mScriptNoteworthy + >> mTarget + >> mAnimscript + >> mAnimscriptfunc + >> mOrigin[0] + >> mOrigin[1] + >> mOrigin[2] + >> mAngle + >> mForward[0] + >> mForward[1] + >> mRadius + >> mMinUseDistSq + >> mOverlapNode + >> mChainId + >> mChainDepth + >> mChainParent + >> mTotalLinkCount; - aStream->read((char*)mOrigin, 3 * sizeof(float)); - aStream->read((char*)&mAngle, sizeof(float)); - aStream->read((char*)mForward, 2 * sizeof(float)); - aStream->read((char*)&mRadius, sizeof(float)); - aStream->read((char*)&mMinUseDistSq, sizeof(float)); - - aStream->read((char*)mOverlapNode, 2 * sizeof(short)); - aStream->read((char*)&mChainId, sizeof(short)); - aStream->read((char*)&mChainDepth, sizeof(short)); - aStream->read((char*)&mChainParent, sizeof(short)); - - aStream->read((char*)&mTotalLinkCount, sizeof(unsigned short)); - - // Allocate and parse links - if (mLinks != nullptr) { - delete[] mLinks; - mLinks = nullptr; - } - - if (mTotalLinkCount > 0) { - mLinks = new XPathLink[mTotalLinkCount]; - for (unsigned short i = 0; i < mTotalLinkCount; ++i) { - mLinks[i].ParseData(aStream); - } + for (unsigned short i = 0; i < mTotalLinkCount; ++i) { + XPathLink newLink; + newLink.ParseData(aStream); + mLinks.append(newLink); } } } -NodeType XPathNodeConstant::GetType() const { - return mType; +void XPathNodeConstant::Clear() +{ + } - -void XPathNodeConstant::SetType(NodeType type) { - mType = type; -} - -unsigned short XPathNodeConstant::GetSpawnflags() const { - return mSpawnflags; -} - -void XPathNodeConstant::SetSpawnflags(unsigned short flags) { - mSpawnflags = flags; -} - -unsigned short XPathNodeConstant::GetTargetname() const { - return mTargetname; -} - -void XPathNodeConstant::SetTargetname(unsigned short name) { - mTargetname = name; -} - -unsigned short XPathNodeConstant::GetScriptLinkName() const { - return mScriptLinkName; -} - -void XPathNodeConstant::SetScriptLinkName(unsigned short name) { - mScriptLinkName = name; -} - -unsigned short XPathNodeConstant::GetScriptNoteworthy() const { - return mScriptNoteworthy; -} - -void XPathNodeConstant::SetScriptNoteworthy(unsigned short noteworthy) { - mScriptNoteworthy = noteworthy; -} - -unsigned short XPathNodeConstant::GetTarget() const { - return mTarget; -} - -void XPathNodeConstant::SetTarget(unsigned short target) { - mTarget = target; -} - -unsigned short XPathNodeConstant::GetAnimscript() const { - return mAnimscript; -} - -void XPathNodeConstant::SetAnimscript(unsigned short script) { - mAnimscript = script; -} - -int XPathNodeConstant::GetAnimscriptfunc() const { - return mAnimscriptfunc; -} - -void XPathNodeConstant::SetAnimscriptfunc(int func) { - mAnimscriptfunc = func; -} - -const float* XPathNodeConstant::GetOrigin() const { - return mOrigin; -} - -void XPathNodeConstant::SetOrigin(const float* origin, size_t count) { - if (count <= 3) { - memcpy(mOrigin, origin, count * sizeof(float)); - } -} - -float XPathNodeConstant::GetAngle() const { - return mAngle; -} - -void XPathNodeConstant::SetAngle(float angle) { - mAngle = angle; -} - -const float* XPathNodeConstant::GetForward() const { - return mForward; -} - -void XPathNodeConstant::SetForward(const float* forward, size_t count) { - if (count <= 2) { - memcpy(mForward, forward, count * sizeof(float)); - } -} - -float XPathNodeConstant::GetRadius() const { - return mRadius; -} - -void XPathNodeConstant::SetRadius(float radius) { - mRadius = radius; -} - -float XPathNodeConstant::GetMinUseDistSq() const { - return mMinUseDistSq; -} - -void XPathNodeConstant::SetMinUseDistSq(float dist) { - mMinUseDistSq = dist; -} - -short XPathNodeConstant::GetOverlapNode(int index) const { - if (index >= 0 && index < 2) { - return mOverlapNode[index]; - } - return 0; -} - -void XPathNodeConstant::SetOverlapNode(int index, short node) { - if (index >= 0 && index < 2) { - mOverlapNode[index] = node; - } -} - -short XPathNodeConstant::GetChainId() const { - return mChainId; -} - -void XPathNodeConstant::SetChainId(short id) { - mChainId = id; -} - -short XPathNodeConstant::GetChainDepth() const { - return mChainDepth; -} - -void XPathNodeConstant::SetChainDepth(short depth) { - mChainDepth = depth; -} - -short XPathNodeConstant::GetChainParent() const { - return mChainParent; -} - -void XPathNodeConstant::SetChainParent(short parent) { - mChainParent = parent; -} - -unsigned short XPathNodeConstant::GetTotalLinkCount() const { - return mTotalLinkCount; -} - -void XPathNodeConstant::SetTotalLinkCount(unsigned short count) { - mTotalLinkCount = count; -} - -XPathLink* XPathNodeConstant::GetLinks() const { - return mLinks; -} - -void XPathNodeConstant::SetLinks(XPathLink* links, unsigned short count) { - if (mLinks != nullptr) { - delete[] mLinks; - } - - mLinks = new XPathLink[count]; - memcpy(mLinks, links, count * sizeof(XPathLink)); - mTotalLinkCount = count; -} - diff --git a/libs/xassets/xpathnodeconstant.h b/libs/xassets/xpathnodeconstant.h index 7b7cb53..6a44867 100644 --- a/libs/xassets/xpathnodeconstant.h +++ b/libs/xassets/xpathnodeconstant.h @@ -1,8 +1,3 @@ - - - - - #ifndef XPATHNODECONSTANT_H #define XPATHNODECONSTANT_H @@ -10,94 +5,38 @@ #include "xnodetype.h" #include "xpathlink.h" +#include +#include + class XPathNodeConstant : public XAsset { public: explicit XPathNodeConstant(); + ~XPathNodeConstant(); void ParseData(QDataStream *aStream) override; - - NodeType GetType() const; - void SetType(NodeType type); - - unsigned short GetSpawnflags() const; - void SetSpawnflags(unsigned short flags); - - unsigned short GetTargetname() const; - void SetTargetname(unsigned short name); - - unsigned short GetScriptLinkName() const; - void SetScriptLinkName(unsigned short name); - - unsigned short GetScriptNoteworthy() const; - void SetScriptNoteworthy(unsigned short noteworthy); - - unsigned short GetTarget() const; - void SetTarget(unsigned short target); - - unsigned short GetAnimscript() const; - void SetAnimscript(unsigned short script); - - int GetAnimscriptfunc() const; - void SetAnimscriptfunc(int func); - - const float* GetOrigin() const; - void SetOrigin(const float* origin, size_t count = 3); - - float GetAngle() const; - void SetAngle(float angle); - - const float* GetForward() const; - void SetForward(const float* forward, size_t count = 2); - - float GetRadius() const; - void SetRadius(float radius); - - float GetMinUseDistSq() const; - void SetMinUseDistSq(float dist); - - short GetOverlapNode(int index) const; - void SetOverlapNode(int index, short node); - - short GetChainId() const; - void SetChainId(short id); - - short GetChainDepth() const; - void SetChainDepth(short depth); - - short GetChainParent() const; - void SetChainParent(short parent); - - unsigned short GetTotalLinkCount() const; - void SetTotalLinkCount(unsigned short count); - - XPathLink* GetLinks() const; - void SetLinks(XPathLink* links, unsigned short count); + void Clear() override; private: - NodeType mType = NodeType::NODE_BADNODE; - unsigned short mSpawnflags = 0; - unsigned short mTargetname = 0; - unsigned short mScriptLinkName = 0; - unsigned short mScriptNoteworthy = 0; - unsigned short mTarget = 0; - unsigned short mAnimscript = 0; - int mAnimscriptfunc = 0; - float mOrigin[3] = {0.0f, 0.0f, 0.0f}; - float mAngle = 0.0f; - float mForward[2] = {0.0f, 0.0f}; - float mRadius = 0.0f; - float mMinUseDistSq = 0.0f; - short mOverlapNode[2] = {0, 0}; - short mChainId = 0; - short mChainDepth = 0; - short mChainParent = 0; - unsigned short mTotalLinkCount = 0; - XPathLink* mLinks = nullptr; // We'll need to manage memory for this array + XNodeType mType; + unsigned short mSpawnflags; + unsigned short mTargetname; + unsigned short mScriptLinkName; + unsigned short mScriptNoteworthy; + unsigned short mTarget; + unsigned short mAnimscript; + int mAnimscriptfunc; + QVector3D mOrigin; + float mAngle; + QVector2D mForward; + float mRadius; + float mMinUseDistSq; + QVector2D mOverlapNode; + short mChainId; + short mChainDepth; + short mChainParent; + unsigned short mTotalLinkCount; + QVector mLinks; }; #endif // XPATHNODECONSTANT_H - - - - diff --git a/libs/xassets/xpathnodedynamic.cpp b/libs/xassets/xpathnodedynamic.cpp index 7414f10..66b2a4f 100644 --- a/libs/xassets/xpathnodedynamic.cpp +++ b/libs/xassets/xpathnodedynamic.cpp @@ -1,36 +1,56 @@ - - - - - - #include "xpathnodedynamic.h" XPathNodeDynamic::XPathNodeDynamic() - : XAsset() { + : XAsset() + , mOwner(new XSentientHandle()) + , mFreeTime(0) + , mValidTime() + , mPlayerLostTime(0) + , mLinkCount(0) + , mOverlapCount(0) + , mTurretEntNumber(0) + , mUserCount(0) +{ +} + +XPathNodeDynamic::~XPathNodeDynamic() +{ + } void XPathNodeDynamic::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - // We can't directly read pointers from the stream, so we'll skip this - aStream->ignore(sizeof(void*)); - - aStream->read((char*)&mFreeTime, sizeof(int)); - aStream->read((char*)mValidTime, 3 * sizeof(int)); - aStream->read((char*)&mPlayerLostTime, sizeof(int)); - - aStream->read((char*)&mLinkCount, sizeof(short)); - aStream->read((char*)&mOverlapCount, sizeof(short)); - aStream->read((char*)&mTurretEntNumber, sizeof(short)); - aStream->read((char*)&mUserCount, sizeof(short)); + qint32 nodePtr; + *aStream + >> nodePtr + >> mFreeTime + >> mValidTime[0] + >> mValidTime[1] + >> mValidTime[2] + >> mPlayerLostTime + >> mLinkCount + >> mOverlapCount + >> mTurretEntNumber + >> mUserCount; } } -void* XPathNodeDynamic::GetOwner() const { +void XPathNodeDynamic::Clear() +{ + mFreeTime = 0; + mValidTime = QVector(); + mPlayerLostTime = 0; + mLinkCount = 0; + mOverlapCount = 0; + mTurretEntNumber = 0; + mUserCount = 0; +} + +XSentientHandle *XPathNodeDynamic::GetOwner() const { return mOwner; } -void XPathNodeDynamic::SetOwner(void* owner) { +void XPathNodeDynamic::SetOwner(XSentientHandle* owner) { mOwner = owner; } @@ -42,14 +62,12 @@ void XPathNodeDynamic::SetFreeTime(int time) { mFreeTime = time; } -const int* XPathNodeDynamic::GetValidTime() const { +QVector XPathNodeDynamic::GetValidTime() const { return mValidTime; } -void XPathNodeDynamic::SetValidTime(const int* times, size_t count) { - if (count <= 3) { - memcpy(mValidTime, times, count * sizeof(int)); - } +void XPathNodeDynamic::SetValidTime(QVector aValidTime) { + mValidTime = aValidTime; } int XPathNodeDynamic::GetPlayerLostTime() const { @@ -91,6 +109,3 @@ short XPathNodeDynamic::GetUserCount() const { void XPathNodeDynamic::SetUserCount(short count) { mUserCount = count; } - - - diff --git a/libs/xassets/xpathnodedynamic.h b/libs/xassets/xpathnodedynamic.h index bfdc7e6..f22dc7e 100644 --- a/libs/xassets/xpathnodedynamic.h +++ b/libs/xassets/xpathnodedynamic.h @@ -1,28 +1,28 @@ - - - - - #ifndef XPATHNODEDYNAMIC_H #define XPATHNODEDYNAMIC_H #include "xasset.h" +#include "xsentienthandle.h" + +#include class XPathNodeDynamic : public XAsset { public: explicit XPathNodeDynamic(); + ~XPathNodeDynamic(); void ParseData(QDataStream *aStream) override; + void Clear() override; - void* GetOwner() const; - void SetOwner(void* owner); + XSentientHandle* GetOwner() const; + void SetOwner(XSentientHandle *owner); int GetFreeTime() const; void SetFreeTime(int time); - const int* GetValidTime() const; - void SetValidTime(const int* times, size_t count = 3); + QVector GetValidTime() const; + void SetValidTime(QVector aValidTime); int GetPlayerLostTime() const; void SetPlayerLostTime(int time); @@ -40,18 +40,14 @@ public: void SetUserCount(short count); private: - void* mOwner = nullptr; - int mFreeTime = 0; - int mValidTime[3] = {0, 0, 0}; - int mPlayerLostTime = 0; - short mLinkCount = 0; - short mOverlapCount = 0; - short mTurretEntNumber = 0; - short mUserCount = 0; + XSentientHandle* mOwner; + int mFreeTime; + QVector mValidTime; + int mPlayerLostTime; + short mLinkCount; + short mOverlapCount; + short mTurretEntNumber; + short mUserCount; }; #endif // XPATHNODEDYNAMIC_H - - - - diff --git a/libs/xassets/xpathnodetransient.cpp b/libs/xassets/xpathnodetransient.cpp index cab969b..469bbe6 100644 --- a/libs/xassets/xpathnodetransient.cpp +++ b/libs/xassets/xpathnodetransient.cpp @@ -1,27 +1,34 @@ - - - - - - #include "xpathnodetransient.h" +#include "xpathnode.h" XPathNodeTransient::XPathNodeTransient() - : XAsset() { + : XAsset() + , mSearchFrame(0) + , mNextOpen(new XPathNode()) + , mPrevOpen(new XPathNode()) + , mParent(new XPathNode()) + , mCost(0.0f) + , mHeuristic(0.0f) + , mCostFactor(0.0f) +{ +} + +XPathNodeTransient::~XPathNodeTransient() +{ + } void XPathNodeTransient::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read((char*)&mSearchFrame, sizeof(int)); - - // We can't directly read pointers from the stream, so we'll skip these - aStream->ignore(sizeof(pathnode_t*)); - aStream->ignore(sizeof(pathnode_t*)); - aStream->ignore(sizeof(pathnode_t*)); - - aStream->read((char*)&mCost, sizeof(float)); - aStream->read((char*)&mHeuristic, sizeof(float)); - aStream->read((char*)&mCostFactor, sizeof(float)); + qint32 node1Ptr, node2Ptr, node3Ptr; + *aStream + >>mSearchFrame + >>node1Ptr + >>node2Ptr + >>node3Ptr + >>mCost + >>mHeuristic + >>mCostFactor; } } @@ -33,27 +40,27 @@ void XPathNodeTransient::SetSearchFrame(int frame) { mSearchFrame = frame; } -pathnode_t* XPathNodeTransient::GetNextOpen() const { +XPathNode* XPathNodeTransient::GetNextOpen() const { return mNextOpen; } -void XPathNodeTransient::SetNextOpen(pathnode_t* node) { +void XPathNodeTransient::SetNextOpen(XPathNode* node) { mNextOpen = node; } -pathnode_t* XPathNodeTransient::GetPrevOpen() const { +XPathNode* XPathNodeTransient::GetPrevOpen() const { return mPrevOpen; } -void XPathNodeTransient::SetPrevOpen(pathnode_t* node) { +void XPathNodeTransient::SetPrevOpen(XPathNode* node) { mPrevOpen = node; } -pathnode_t* XPathNodeTransient::GetParent() const { +XPathNode* XPathNodeTransient::GetParent() const { return mParent; } -void XPathNodeTransient::SetParent(pathnode_t* parent) { +void XPathNodeTransient::SetParent(XPathNode* parent) { mParent = parent; } @@ -80,7 +87,3 @@ float XPathNodeTransient::GetCostFactor() const { void XPathNodeTransient::SetCostFactor(float factor) { mCostFactor = factor; } - - - - diff --git a/libs/xassets/xpathnodetransient.h b/libs/xassets/xpathnodetransient.h index 1f7e1a0..8c7b889 100644 --- a/libs/xassets/xpathnodetransient.h +++ b/libs/xassets/xpathnodetransient.h @@ -2,26 +2,28 @@ #define XPATHNODETRANSIENT_H #include "xasset.h" -#include "xgameworld.h" // For pathnode_t reference + +class XPathNode; class XPathNodeTransient : public XAsset { public: explicit XPathNodeTransient(); + ~XPathNodeTransient(); void ParseData(QDataStream *aStream) override; int GetSearchFrame() const; void SetSearchFrame(int frame); - pathnode_t* GetNextOpen() const; - void SetNextOpen(pathnode_t* node); + XPathNode *GetNextOpen() const; + void SetNextOpen(XPathNode* node); - pathnode_t* GetPrevOpen() const; - void SetPrevOpen(pathnode_t* node); + XPathNode* GetPrevOpen() const; + void SetPrevOpen(XPathNode* node); - pathnode_t* GetParent() const; - void SetParent(pathnode_t* parent); + XPathNode* GetParent() const; + void SetParent(XPathNode* parent); float GetCost() const; void SetCost(float cost); @@ -33,13 +35,13 @@ public: void SetCostFactor(float factor); private: - int mSearchFrame = 0; - pathnode_t* mNextOpen = nullptr; - pathnode_t* mPrevOpen = nullptr; - pathnode_t* mParent = nullptr; - float mCost = 0.0f; - float mHeuristic = 0.0f; - float mCostFactor = 0.0f; + int mSearchFrame; + XPathNode* mNextOpen; + XPathNode* mPrevOpen; + XPathNode* mParent; + float mCost; + float mHeuristic; + float mCostFactor; }; #endif // XPATHNODETRANSIENT_H diff --git a/libs/xassets/xpathnodetree.cpp b/libs/xassets/xpathnodetree.cpp index c46584f..9f40f71 100644 --- a/libs/xassets/xpathnodetree.cpp +++ b/libs/xassets/xpathnodetree.cpp @@ -1,29 +1,40 @@ - - - - - - #include "xpathnodetree.h" XPathNodeTree::XPathNodeTree() - : XAsset() { + : XAsset() + , mAxis(0) + , mDist(0.0f) + , mInfo(new XPathNodeTreeInfo()) +{ +} + +XPathNodeTree::~XPathNodeTree() +{ + delete mInfo; } void XPathNodeTree::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read((char*)&mAxis, sizeof(int)); - aStream->read((char*)&mDist, sizeof(float)); + *aStream + >> mAxis + >> mDist; // Skip reading the union directly from the stream // We'll assume we're parsing as children by default for (int i = 0; i < 2; ++i) { - // Skip reading pointers directly from the stream - aStream->ignore(sizeof(PathNodeTree*)); + qint32 treePtr; + *aStream >> treePtr; } } } +void XPathNodeTree::Clear() +{ + mAxis = 0; + mDist = 0.0f; + mInfo->Clear(); +} + int XPathNodeTree::GetAxis() const { return mAxis; } @@ -40,17 +51,13 @@ void XPathNodeTree::SetDist(float dist) { mDist = dist; } -PathNodeTreeInfo* XPathNodeTree::GetInfo() const { +XPathNodeTreeInfo* XPathNodeTree::GetInfo() const { return mInfo; } -void XPathNodeTree::SetInfo(PathNodeTreeInfo* info) { +void XPathNodeTree::SetInfo(XPathNodeTreeInfo *info) { if (mInfo != nullptr) { delete mInfo; } - mInfo = new PathNodeTreeInfo(*info); + mInfo = new XPathNodeTreeInfo(*info); } - - - - diff --git a/libs/xassets/xpathnodetree.h b/libs/xassets/xpathnodetree.h index 2618bd2..18dc11b 100644 --- a/libs/xassets/xpathnodetree.h +++ b/libs/xassets/xpathnodetree.h @@ -1,22 +1,17 @@ - - - - - - #ifndef XPATHNODETREE_H #define XPATHNODETREE_H #include "xasset.h" -#include "gameworld.h" // For PathNodeTree reference #include "xpathnodetreeinfo.h" class XPathNodeTree : public XAsset { public: explicit XPathNodeTree(); + ~XPathNodeTree(); void ParseData(QDataStream *aStream) override; + void Clear() override; int GetAxis() const; void SetAxis(int axis); @@ -24,13 +19,13 @@ public: float GetDist() const; void SetDist(float dist); - PathNodeTreeInfo* GetInfo() const; - void SetInfo(PathNodeTreeInfo* info); + XPathNodeTreeInfo* GetInfo() const; + void SetInfo(XPathNodeTreeInfo* info); private: - int mAxis = 0; - float mDist = 0.0f; - PathNodeTreeInfo* mInfo = nullptr; // We'll need to manage memory for this + int mAxis; + float mDist; + XPathNodeTreeInfo* mInfo; }; #endif // XPATHNODETREE_H diff --git a/libs/xassets/xpathnodetreeinfo.cpp b/libs/xassets/xpathnodetreeinfo.cpp index 79ba9c0..86b52d3 100644 --- a/libs/xassets/xpathnodetreeinfo.cpp +++ b/libs/xassets/xpathnodetreeinfo.cpp @@ -1,33 +1,40 @@ - - - - - - #include "xpathnodetreeinfo.h" +#include "xpathnodetree.h" XPathNodeTreeInfo::XPathNodeTreeInfo() - : XAsset() { + : XAsset() + , mChildren() + , mNodes() +{ +} + +XPathNodeTreeInfo::~XPathNodeTreeInfo() +{ + } void XPathNodeTreeInfo::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { // We'll assume we're parsing as children by default for (int i = 0; i < 2; ++i) { - // Skip reading pointers directly from the stream - aStream->ignore(sizeof(PathNodeTree*)); + qint32 treePtr; + *aStream >> treePtr; + if (treePtr == -1) + { + + } } } } -PathNodeTree* XPathNodeTreeInfo::GetChild(int index) const { +XPathNodeTree *XPathNodeTreeInfo::GetChild(int index) const { if (index >= 0 && index < 2) { return mChildren[index]; } return nullptr; } -void XPathNodeTreeInfo::SetChild(int index, PathNodeTree* child) { +void XPathNodeTreeInfo::SetChild(int index, XPathNodeTree *child) { if (index >= 0 && index < 2) { mChildren[index] = child; } diff --git a/libs/xassets/xpathnodetreeinfo.h b/libs/xassets/xpathnodetreeinfo.h index fbd05be..13e0b11 100644 --- a/libs/xassets/xpathnodetreeinfo.h +++ b/libs/xassets/xpathnodetreeinfo.h @@ -1,38 +1,30 @@ - - - - - - #ifndef XPATHNODETREEINFO_H #define XPATHNODETREEINFO_H #include "xasset.h" -#include "gameworld.h" // For PathNodeTree reference +#include "xpathnodetreenodes.h" + +#include + +class XPathNodeTree; class XPathNodeTreeInfo : public XAsset { public: explicit XPathNodeTreeInfo(); + ~XPathNodeTreeInfo(); void ParseData(QDataStream *aStream) override; - PathNodeTree* GetChild(int index) const; - void SetChild(int index, PathNodeTree* child); + XPathNodeTree* GetChild(int index) const; + void SetChild(int index, XPathNodeTree* child); const XPathNodeTreeNodes& GetNodes() const; void SetNodes(const XPathNodeTreeNodes& nodes); private: - union { - PathNodeTree* mChildren[2]; - XPathNodeTreeNodes mNodes; - }; + QVector mChildren; + XPathNodeTreeNodes mNodes; }; #endif // XPATHNODETREEINFO_H - - - - - diff --git a/libs/xassets/xpathnodetreenodes.cpp b/libs/xassets/xpathnodetreenodes.cpp index 734f271..a38a5ab 100644 --- a/libs/xassets/xpathnodetreenodes.cpp +++ b/libs/xassets/xpathnodetreenodes.cpp @@ -1,31 +1,33 @@ - - - - - #include "xpathnodetreenodes.h" XPathNodeTreeNodes::XPathNodeTreeNodes() - : XAsset() { + : XAsset() + , mNodeCount(0) + , mNodes() +{ +} + +XPathNodeTreeNodes::~XPathNodeTreeNodes() +{ + } void XPathNodeTreeNodes::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read((char*)&mNodeCount, sizeof(int)); + *aStream >> mNodeCount; - // Allocate and parse nodes - if (mNodes != nullptr) { - delete[] mNodes; - mNodes = nullptr; - } - - if (mNodeCount > 0) { - mNodes = new unsigned short[mNodeCount]; - aStream->read((char*)mNodes, mNodeCount * sizeof(unsigned short)); + for (int i = 0; i < mNodeCount; i++) + { + *aStream >> mNodes[i]; } } } +void XPathNodeTreeNodes::Clear() +{ + +} + int XPathNodeTreeNodes::GetNodeCount() const { return mNodeCount; } @@ -34,20 +36,10 @@ void XPathNodeTreeNodes::SetNodeCount(int count) { mNodeCount = count; } -unsigned short* XPathNodeTreeNodes::GetNodes() const { +QVector XPathNodeTreeNodes::GetNodes() const { return mNodes; } -void XPathNodeTreeNodes::SetNodes(unsigned short* nodes, int count) { - if (mNodes != nullptr) { - delete[] mNodes; - } - - mNodeCount = count; - mNodes = new unsigned short[count]; - memcpy(mNodes, nodes, count * sizeof(unsigned short)); +void XPathNodeTreeNodes::SetNodes(QVector aNodes) { + mNodes = aNodes; } - - - - diff --git a/libs/xassets/xpathnodetreenodes.h b/libs/xassets/xpathnodetreenodes.h index ea2c86b..7c48388 100644 --- a/libs/xassets/xpathnodetreenodes.h +++ b/libs/xassets/xpathnodetreenodes.h @@ -1,35 +1,28 @@ - - - - - - #ifndef XPATHNODETREENODES_H #define XPATHNODETREENODES_H #include "xasset.h" +#include + class XPathNodeTreeNodes : public XAsset { public: explicit XPathNodeTreeNodes(); + ~XPathNodeTreeNodes(); void ParseData(QDataStream *aStream) override; + void Clear() override; int GetNodeCount() const; void SetNodeCount(int count); - unsigned short* GetNodes() const; - void SetNodes(unsigned short* nodes, int count); + QVector GetNodes() const; + void SetNodes(QVector aNodes); private: - int mNodeCount = 0; - unsigned short* mNodes = nullptr; // We'll need to manage memory for this array + int mNodeCount; + QVector mNodes; }; #endif // XPATHNODETREENODES_H - - - - - diff --git a/libs/xassets/xphyspreset.cpp b/libs/xassets/xphyspreset.cpp index 39a484a..7016b31 100644 --- a/libs/xassets/xphyspreset.cpp +++ b/libs/xassets/xphyspreset.cpp @@ -16,7 +16,8 @@ XPhysPreset::XPhysPreset() , mPiecesUpwardVelocity(0) , mTempDefaultToCylinder(false) { - + SetType(ASSET_TYPE_PHYSPRESET); + SetName("Phys Preset"); } XPhysPreset::~XPhysPreset() diff --git a/libs/xassets/xrawfile.cpp b/libs/xassets/xrawfile.cpp index 7b70215..4db063a 100644 --- a/libs/xassets/xrawfile.cpp +++ b/libs/xassets/xrawfile.cpp @@ -6,7 +6,8 @@ XRawFile::XRawFile() , mLength(0) , mBuffer() { - + SetType(ASSET_TYPE_RAWFILE); + SetName("Raw File"); } XRawFile::~XRawFile() diff --git a/libs/xassets/xscriptstringlist.cpp b/libs/xassets/xscriptstringlist.cpp index f49326f..77be195 100644 --- a/libs/xassets/xscriptstringlist.cpp +++ b/libs/xassets/xscriptstringlist.cpp @@ -24,7 +24,7 @@ void XScriptStringList::Clear() void XScriptStringList::ParseData(QDataStream *aStream) { - if (GetPtr()) + if (GetPtr() == -1) { for (int i = 0; i < mCount; i++) { @@ -48,4 +48,9 @@ void XScriptStringList::ParsePtr(QDataStream *aStream, bool aDataFlag) >> stringsPtr; SetPtr(stringsPtr); + + if (aDataFlag) + { + ParseData(aStream); + } } diff --git a/libs/xassets/xsoundalias.cpp b/libs/xassets/xsoundalias.cpp index bbdff35..40152ca 100644 --- a/libs/xassets/xsoundalias.cpp +++ b/libs/xassets/xsoundalias.cpp @@ -5,6 +5,11 @@ XSoundAlias::XSoundAlias() } +XSoundAlias::~XSoundAlias() +{ + +} + void XSoundAlias::Clear() { diff --git a/libs/xassets/xsoundalias.h b/libs/xassets/xsoundalias.h index b459db2..98e3b55 100644 --- a/libs/xassets/xsoundalias.h +++ b/libs/xassets/xsoundalias.h @@ -4,12 +4,14 @@ #include "xasset.h" #include "xsoundcurve.h" #include "xsoundfile.h" +#include "xspeakermap.h" #include "xstring.h" class XSoundAlias : public XAsset { public: XSoundAlias(); + ~XSoundAlias(); virtual void Clear() override; virtual void ParseData(QDataStream* aStream) override; diff --git a/libs/xassets/xsoundaliaslist.cpp b/libs/xassets/xsoundaliaslist.cpp index a1ac592..d925db9 100644 --- a/libs/xassets/xsoundaliaslist.cpp +++ b/libs/xassets/xsoundaliaslist.cpp @@ -1,6 +1,16 @@ #include "xsoundaliaslist.h" XSoundAliasList::XSoundAliasList() + : XAsset() + , mAliasName("") + , mHead(new XSoundAlias()) + , mCount(0) +{ + SetType(ASSET_TYPE_SOUND); + SetName("Sound Alias List"); +} + +XSoundAliasList::~XSoundAliasList() { } diff --git a/libs/xassets/xsoundaliaslist.h b/libs/xassets/xsoundaliaslist.h index 81c72c8..4058580 100644 --- a/libs/xassets/xsoundaliaslist.h +++ b/libs/xassets/xsoundaliaslist.h @@ -2,19 +2,21 @@ #define XSOUNDALIASLIST_H #include "xasset.h" -#include "xstring.h" +#include "xsoundalias.h" class XSoundAliasList : public XAsset { public: - XSoundAliasList(); + explicit XSoundAliasList(); ~XSoundAliasList(); virtual void Clear() override; virtual void ParseData(QDataStream* aStream) override; private: - + QString mAliasName; + XSoundAlias *mHead; + int mCount; }; #endif // XSOUNDALIASLIST_H diff --git a/libs/xassets/xsoundcurve.cpp b/libs/xassets/xsoundcurve.cpp index 414e91c..176b778 100644 --- a/libs/xassets/xsoundcurve.cpp +++ b/libs/xassets/xsoundcurve.cpp @@ -6,7 +6,8 @@ XSoundCurve::XSoundCurve() , mKnotCount(0) , mKnots(QVector>()) { - + SetType(ASSET_TYPE_SOUND_CURVE); + SetName("Sound Curve"); } XString *XSoundCurve::GetFileName() diff --git a/libs/xassets/xsounddriverglobals.cpp b/libs/xassets/xsounddriverglobals.cpp index 5db6de8..0506eb6 100644 --- a/libs/xassets/xsounddriverglobals.cpp +++ b/libs/xassets/xsounddriverglobals.cpp @@ -5,7 +5,8 @@ XSoundDriverGlobals::XSoundDriverGlobals() , mAudioReverbSettings(new XAudioReverbSettings()) , mName(new XString()) { - + SetType(ASSET_TYPE_SNDDRIVER_GLOBALS); + SetName("Sound Globals"); } XSoundDriverGlobals::~XSoundDriverGlobals() diff --git a/libs/xassets/xsounddriverglobals.h b/libs/xassets/xsounddriverglobals.h index c09ff85..edd5b12 100644 --- a/libs/xassets/xsounddriverglobals.h +++ b/libs/xassets/xsounddriverglobals.h @@ -1,5 +1,5 @@ -#ifndef SoundDriver_H -#define SoundDriver_H +#ifndef XSOUNDDRIVERGLOBALS_H +#define XSOUNDDRIVERGLOBALS_H #include "xasset.h" #include "xaudioreverbsettings.h" @@ -19,4 +19,4 @@ private: XString *mName; }; -#endif // SoundDriver_H +#endif // XSOUNDDRIVERGLOBALS_H diff --git a/libs/xassets/xsoundfileref.cpp b/libs/xassets/xsoundfileref.cpp index 3492026..325be58 100644 --- a/libs/xassets/xsoundfileref.cpp +++ b/libs/xassets/xsoundfileref.cpp @@ -1,3 +1,25 @@ #include "xsoundfileref.h" -XSoundFileRef::XSoundFileRef() {} +XSoundFileRef::XSoundFileRef() + : XAsset() + , mLoadSnd(new XLoadedSound()) + , mStreamSnd() +{ + +} + +XSoundFileRef::~XSoundFileRef() +{ + delete mLoadSnd; +} + +void XSoundFileRef::ParseData(QDataStream *aStream) +{ + +} + +void XSoundFileRef::Clear() +{ + mLoadSnd->Clear(); + mStreamSnd.Clear(); +} diff --git a/libs/xassets/xsoundfileref.h b/libs/xassets/xsoundfileref.h index 04895ea..2d42b32 100644 --- a/libs/xassets/xsoundfileref.h +++ b/libs/xassets/xsoundfileref.h @@ -2,11 +2,21 @@ #define XSOUNDFILEREF_H #include "xasset.h" +#include "xloadedsound.h" +#include "xstreamedsound.h" class XSoundFileRef : public XAsset { public: - XSoundFileRef(); + explicit XSoundFileRef(); + ~XSoundFileRef(); + + virtual void ParseData(QDataStream* aStream) override; + virtual void Clear() override; + +private: + XLoadedSound *mLoadSnd; + XStreamedSound mStreamSnd; }; #endif // XSOUNDFILEREF_H diff --git a/libs/xassets/xspeakermap.cpp b/libs/xassets/xspeakermap.cpp index 96f9e76..f969e2b 100644 --- a/libs/xassets/xspeakermap.cpp +++ b/libs/xassets/xspeakermap.cpp @@ -70,11 +70,14 @@ XAudioChannelMap *XSpeakerMap::GetChannelMapEntry(int aRow, int aCol) QVector XSpeakerMap::ParseChannelArray(QDataStream *aStream, int aCount) { + QVector result; for (int i = 0; i < aCount; i++) { XAudioChannelMap* newChannelMap = new XAudioChannelMap(); newChannelMap->ParseData(aStream); + result << newChannelMap; } + return result; } void XSpeakerMap::ParseData(QDataStream *aStream) diff --git a/libs/xassets/xstreamfileinfo.h b/libs/xassets/xstreamfileinfo.h index a835fc4..0dccc0d 100644 --- a/libs/xassets/xstreamfileinfo.h +++ b/libs/xassets/xstreamfileinfo.h @@ -2,8 +2,8 @@ #define XSTREAMFILEINFO_H #include "xasset.h" - -class XStreamFileName; +#include "xstreamfilenamepacked.h" +#include "xstreamfilenameraw.h" class XStreamFileInfo : public XAsset { @@ -15,7 +15,8 @@ public: virtual void ParseData(QDataStream* aStream) override; private: - XStreamFileName* mStream; + XStreamFileNameRaw mRaw; + XStreamFileNamePacked mPacked; }; #endif // XSTREAMFILEINFO_H diff --git a/libs/xassets/xstringtable.cpp b/libs/xassets/xstringtable.cpp index 1b5abc4..f2bb3f3 100644 --- a/libs/xassets/xstringtable.cpp +++ b/libs/xassets/xstringtable.cpp @@ -6,8 +6,10 @@ XStringTable::XStringTable() , mName(new XString()) , mValues(new XStringArray()) , mColumnCount(0) - , mRowCount(0) { - + , mRowCount(0) +{ + SetType(ASSET_TYPE_STRINGTABLE); + SetName("String Table"); } XStringTable::~XStringTable() diff --git a/libs/xassets/xsunlightparseparams.cpp b/libs/xassets/xsunlightparseparams.cpp index 0ef1dd9..87cc03e 100644 --- a/libs/xassets/xsunlightparseparams.cpp +++ b/libs/xassets/xsunlightparseparams.cpp @@ -1,106 +1,64 @@ - - - - - - #include "xsunlightparseparams.h" +#include "xstring.h" XSunLightParseParams::XSunLightParseParams() - : XAsset() { + : XAsset() + , mName("") + , mAmbientScale(1.0f) + , mAmbientColor() + , mDiffuseFraction(0.0f) + , mSunLight(0.0f) + , mSunColor() + , mDiffuseColor() + , mDiffuseColorHasBeenSet(false) + , mAngles() +{ +} + +XSunLightParseParams::~XSunLightParseParams() +{ + } void XSunLightParseParams::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read(mName, 64 * sizeof(char)); - aStream->read((char*)&mAmbientScale, sizeof(float)); - aStream->read((char*)mAmbientColor, 3 * sizeof(float)); - aStream->read((char*)&mDiffuseFraction, sizeof(float)); - aStream->read((char*)&mSunLight, sizeof(float)); - aStream->read((char*)mSunColor, 3 * sizeof(float)); - aStream->read((char*)mDiffuseColor, 3 * sizeof(float)); - aStream->read((char*)&mDiffuseColorHasBeenSet, sizeof(bool)); - aStream->read((char*)mAngles, 3 * sizeof(float)); + mName = XString::ParseCustom(aStream); + + quint32 ambientR, ambientG, ambientB, + sunR, sunG, sunB, + diffuseR, diffuseG, diffuseB; + *aStream + >> mAmbientScale + >> ambientR + >> ambientG + >> ambientB + >> mDiffuseFraction + >> mSunLight + >> sunR + >> sunG + >> sunB + >> diffuseR + >> diffuseG + >> diffuseB + >> mDiffuseColorHasBeenSet + >> mAngles[0] + >> mAngles[1] + >> mAngles[2]; + mAmbientColor = QColor(ambientR, ambientG, ambientB); + mSunColor = QColor(sunR, sunG, sunB); + mDiffuseColor = QColor(diffuseR, diffuseG, diffuseB); } } -const char* XSunLightParseParams::GetName() const { - return mName; +void XSunLightParseParams::Clear() +{ + mName.clear(); + mAmbientScale = 1.0f; + mAmbientColor = QColor(); + mDiffuseFraction = 0.0f; + mSunLight = 0.0f; + mSunColor = QColor(); + mDiffuseColor = QColor(); + mDiffuseColorHasBeenSet = false; + mAngles = QVector3D(); } - -void XSunLightParseParams::SetName(const char* name) { - strncpy(mName, name, 64); -} - -float XSunLightParseParams::GetAmbientScale() const { - return mAmbientScale; -} - -void XSunLightParseParams::SetAmbientScale(float scale) { - mAmbientScale = scale; -} - -const float* XSunLightParseParams::GetAmbientColor() const { - return mAmbientColor; -} - -void XSunLightParseParams::SetAmbientColor(const float* color, size_t count) { - if (count <= 3) { - memcpy(mAmbientColor, color, count * sizeof(float)); - } -} - -float XSunLightParseParams::GetDiffuseFraction() const { - return mDiffuseFraction; -} - -void XSunLightParseParams::SetDiffuseFraction(float fraction) { - mDiffuseFraction = fraction; -} - -float XSunLightParseParams::GetSunLight() const { - return mSunLight; -} - -void XSunLightParseParams::SetSunLight(float light) { - mSunLight = light; -} - -const float* XSunLightParseParams::GetSunColor() const { - return mSunColor; -} - -void XSunLightParseParams::SetSunColor(const float* color, size_t count) { - if (count <= 3) { - memcpy(mSunColor, color, count * sizeof(float)); - } -} - -const float* XSunLightParseParams::GetDiffuseColor() const { - return mDiffuseColor; -} - -void XSunLightParseParams::SetDiffuseColor(const float* color, size_t count) { - if (count <= 3) { - memcpy(mDiffuseColor, color, count * sizeof(float)); - } -} - -bool XSunLightParseParams::IsDiffuseColorSet() const { - return mDiffuseColorHasBeenSet; -} - -void XSunLightParseParams::SetDiffuseColorSet(bool set) { - mDiffuseColorHasBeenSet = set; -} - -const float* XSunLightParseParams::GetAngles() const { - return mAngles; -} - -void XSunLightParseParams::SetAngles(const float* angles, size_t count) { - if (count <= 3) { - memcpy(mAngles, angles, count * sizeof(float)); - } -} - diff --git a/libs/xassets/xsunlightparseparams.h b/libs/xassets/xsunlightparseparams.h index f30c583..324d386 100644 --- a/libs/xassets/xsunlightparseparams.h +++ b/libs/xassets/xsunlightparseparams.h @@ -1,61 +1,30 @@ - - - - - - - - - #ifndef XSUNLIGHTPARSEPARAMS_H #define XSUNLIGHTPARSEPARAMS_H #include "xasset.h" +#include +#include + class XSunLightParseParams : public XAsset { public: explicit XSunLightParseParams(); + ~XSunLightParseParams(); void ParseData(QDataStream *aStream) override; - - const char* GetName() const; - void SetName(const char* name); - - float GetAmbientScale() const; - void SetAmbientScale(float scale); - - const float* GetAmbientColor() const; - void SetAmbientColor(const float* color, size_t count = 3); - - float GetDiffuseFraction() const; - void SetDiffuseFraction(float fraction); - - float GetSunLight() const; - void SetSunLight(float light); - - const float* GetSunColor() const; - void SetSunColor(const float* color, size_t count = 3); - - const float* GetDiffuseColor() const; - void SetDiffuseColor(const float* color, size_t count = 3); - - bool IsDiffuseColorSet() const; - void SetDiffuseColorSet(bool set); - - const float* GetAngles() const; - void SetAngles(const float* angles, size_t count = 3); + void Clear() override; private: - char mName[64] = {0}; - float mAmbientScale = 1.0f; - float mAmbientColor[3] = {0.0f, 0.0f, 0.0f}; - float mDiffuseFraction = 0.0f; - float mSunLight = 0.0f; - float mSunColor[3] = {0.0f, 0.0f, 0.0f}; - float mDiffuseColor[3] = {0.0f, 0.0f, 0.0f}; - bool mDiffuseColorHasBeenSet = false; - float mAngles[3] = {0.0f, 0.0f, 0.0f}; + QString mName; + float mAmbientScale; + QColor mAmbientColor; + float mDiffuseFraction; + float mSunLight; + QColor mSunColor; + QColor mDiffuseColor; + bool mDiffuseColorHasBeenSet; + QVector3D mAngles; }; #endif // XSUNLIGHTPARSEPARAMS_H diff --git a/libs/xassets/xweapondef.cpp b/libs/xassets/xweapondef.cpp index e8cd754..2cf030b 100644 --- a/libs/xassets/xweapondef.cpp +++ b/libs/xassets/xweapondef.cpp @@ -1,48 +1,26 @@ - - - - - - #include "xweapondef.h" XWeaponDef::XWeaponDef() - : XAsset() { + : XAsset() +{ + SetType(ASSET_TYPE_WEAPON); + SetName("Weapon"); +} + +XWeaponDef::~XWeaponDef() +{ + } void XWeaponDef::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - aStream->read(mInternalName, 64 * sizeof(char)); - aStream->read(mDisplayName, 64 * sizeof(char)); - aStream->read(mOverlayName, 64 * sizeof(char)); - - // Parse more fields as needed... + mInternalName = XString::ParseCustom(aStream); + mDisplayName = XString::ParseCustom(aStream); + mOverlayName = XString::ParseCustom(aStream); } } -const char* XWeaponDef::GetInternalName() const { - return mInternalName; +void XWeaponDef::Clear() +{ + } - -void XWeaponDef::SetInternalName(const char* name) { - strncpy(mInternalName, name, 64); -} - -const char* XWeaponDef::GetDisplayName() const { - return mDisplayName; -} - -void XWeaponDef::SetDisplayName(const char* name) { - strncpy(mDisplayName, name, 64); -} - -const char* XWeaponDef::GetOverlayName() const { - return mOverlayName; -} - -void XWeaponDef::SetOverlayName(const char* name) { - strncpy(mOverlayName, name, 64); -} - -// Implement more getters and setters as needed... - diff --git a/libs/xassets/xweapondef.h b/libs/xassets/xweapondef.h index 8d7c7eb..792ea45 100644 --- a/libs/xassets/xweapondef.h +++ b/libs/xassets/xweapondef.h @@ -1,52 +1,421 @@ - - - - - - - - - - - #ifndef XWEAPONDEF_H #define XWEAPONDEF_H #include "xasset.h" -#include +#include "xmodel.h" +#include "xsoundaliaslist.h" +#include "xweaponenums.h" +#include "xfxeffectdef.h" -// Define the WeaponIconRatioType enum -enum WeaponIconRatioType : int { - WEAPON_ICON_RATIO_1TO1 = 0, - WEAPON_ICON_RATIO_2TO1 = 1, - WEAPON_ICON_RATIO_4TO1 = 2, - WEAPON_ICON_RATIO_COUNT = 3 -}; +#include class XWeaponDef : public XAsset { public: explicit XWeaponDef(); + ~XWeaponDef(); void ParseData(QDataStream *aStream) override; - - const char* GetInternalName() const; - void SetInternalName(const char* name); - - const char* GetDisplayName() const; - void SetDisplayName(const char* name); - - const char* GetOverlayName() const; - void SetOverlayName(const char* name); - - // Add more getters and setters as needed... + void Clear() override; private: - char mInternalName[64] = {0}; - char mDisplayName[64] = {0}; - char mOverlayName[64] = {0}; + QString mInternalName; + QString mDisplayName; + QString mOverlayName; + QVector mGunXModel; - // Add more member variables as needed... + XModel mHandXModel; + QStringList mXAnims; + QString mModeName; + + quint16 mHideTags[8]; + quint16 mNotetrackSoundMapKeys[16]; + quint16 mNotetrackSoundMapValues[16]; + int mPlayerAnimType; + XWeaponType mWeapType; + XWeaponClass mWeapClass; + XPenetrateType mPenetrateType; + XImpactType mImpactType; + XWeaponInventoryType mInventoryType; + XWeaponFireType mFireType; + XOffhandClass mOffhandClass; + XWeaponStance mStance; + + XFxEffectDef mViewFlashEffect; + XFxEffectDef mWorldFlashEffect; + XSoundAliasList mPickupSound; + XSoundAliasList mPickupSoundPlayer; + XSoundAliasList mAmmoPickupSound; + XSoundAliasList mAmmoPickupSoundPlayer; + XSoundAliasList mProjectileSound; + XSoundAliasList mPullbackSound; + XSoundAliasList mPullbackSoundPlayer; + XSoundAliasList mFireSound; + XSoundAliasList mFireSoundPlayer; + XSoundAliasList mFireLoopSound; + XSoundAliasList mFireLoopSoundPlayer; + XSoundAliasList mFireStopSound; + XSoundAliasList mFireStopSoundPlayer; + XSoundAliasList mFireLastSound; + XSoundAliasList mFireLastSoundPlayer; + XSoundAliasList mEmptyFireSound; + XSoundAliasList mEmptyFireSoundPlayer; + XSoundAliasList mMeleeSwipeSound; + XSoundAliasList mMeleeSwipeSoundPlayer; + XSoundAliasList mMeleeHitSound; + XSoundAliasList mMeleeMissSound; + XSoundAliasList mEechamberSound; + XSoundAliasList mRechamberSoundPlayer; + XSoundAliasList mReloadSound; + XSoundAliasList mReloadSoundPlayer; + XSoundAliasList mReloadEmptySound; + XSoundAliasList mReloadEmptySoundPlayer; + XSoundAliasList mReloadStartSound; + XSoundAliasList mReloadStartSoundPlayer; + XSoundAliasList mReloadEndSound; + XSoundAliasList mReloadEndSoundPlayer; + XSoundAliasList mDetonateSound; + XSoundAliasList mDetonateSoundPlayer; + XSoundAliasList mNightVisionWearSound; + XSoundAliasList mNightVisionWearSoundPlayer; + XSoundAliasList mNightVisionRemoveSound; + XSoundAliasList mNightVisionRemoveSoundPlayer; + XSoundAliasList mAltSwitchSound; + XSoundAliasList mAltSwitchSoundPlayer; + XSoundAliasList mRaiseSound; + XSoundAliasList mRaiseSoundPlayer; + XSoundAliasList mFirstRaiseSound; + XSoundAliasList mFirstRaiseSoundPlayer; + XSoundAliasList mPutawaySound; + XSoundAliasList mPutawaySoundPlayer; + XSoundAliasList *mBounceSound; + XFxEffectDef mViewShellEjectEffect; + XFxEffectDef mWorldShellEjectEffect; + XFxEffectDef mViewLastShotEjectEffect; + XFxEffectDef mWorldLastShotEjectEffect; + XMaterial mReticleCenter; + XMaterial mReticleSide; + + int mReticleCenterSize; + int mReticleSideSize; + int mReticleMinOfs; + XActiveReticleType mActiveReticleType; + float mStandMove[3]; + float mStandRot[3]; + float mDuckedOfs[3]; + float mDuckedMove[3]; + float mDuckedRot[3]; + float mProneOfs[3]; + float mProneMove[3]; + float mProneRot[3]; + float mPosMoveRate; + float mPosProneMoveRate; + float mStandMoveMinSpeed; + float mDuckedMoveMinSpeed; + float mProneMoveMinSpeed; + float mPosRotRate; + float mPosProneRotRate; + float mStandRotMinSpeed; + float mDuckedRotMinSpeed; + float mProneRotMinSpeed; + + QVector mWorldModel; + XModel mWorldClipModel; + XModel mWocketModel; + XModel mKnifeModel; + XModel mWorldKnifeModel; + XMaterial mHudIcon; + XWeaponIconRatioType mHudIconRatio; + XMaterial mAmmoCounterIcon; + + XWeaponIconRatioType mAmmoCounterIconRatio; + XAmmoCounterClipType mAmmoCounterClip; + int mStartAmmo; + + QString mAmmoName; + int mAmmoIndex; + QString mClipName; + + int mClipIndex; + int mMaxAmmo; + int mClipSize; + int mShotCount; + + QString mSharedAmmoCapName; + + int mSharedAmmoCapIndex; + int mSharedAmmoCap; + int mDamage; + int mPlayerDamage; + int mMeleeDamage; + int mDamageType; + int mFireDelay; + int mMeleeDelay; + int mMeleeChargeDelay; + int mDetonateDelay; + int mFireTime; + int mRechamberTime; + int mRechamberBoltTime; + int mHoldFireTime; + int mDetonateTime; + int mMeleeTime; + int mMeleeChargeTime; + int mReloadTime; + int mReloadShowRocketTime; + int mReloadEmptyTime; + int mReloadAddTime; + int mReloadStartTime; + int mReloadStartAddTime; + int mReloadEndTime; + int mDropTime; + int mRaiseTime; + int mAltDropTime; + int mAltRaiseTime; + int mQuickDropTime; + int mQuickRaiseTime; + int mFirstRaiseTime; + int mEmptyRaiseTime; + int mEmptyDropTime; + int mSprintInTime; + int mSprintLoopTime; + int mSprintOutTime; + int mNightVisionWearTime; + int mNightVisionWearTimeFadeOutEnd; + int mNightVisionWearTimePowerUp; + int mNightVisionRemoveTime; + int mNightVisionRemoveTimePowerDown; + int mNightVisionRemoveTimeFadeInStart; + int mFuseTime; + int mAiFuseTime; + int mRequireLockonToFire; + int mNoAdsWhenMagEmpty; + int mAvoidDropCleanup; + float mAutoAimRange; + float mAimAssistRange; + float mAimAssistRangeAds; + float mAimPadding; + float mEnemyCrosshairRange; + int mCrosshairColorChange; + float mMoveSpeedScale; + float mAdsMoveSpeedScale; + float mSprintDurationScale; + float mAdsZoomFov; + float mAdsZoomInFrac; + float mAdsZoomOutFrac; + + XMaterial mOverlayMaterial; + XMaterial mOverlayMaterialLowRes; + + XWeaponOverlayReticle mOverlayReticle; + XWeaponOverlayInteface mOverlayInterface; + + float mOverlayWidth; + float mOverlayHeight; + float mAdsBobFactor; + float mAdsViewBobMult; + float mHipSpreadStandMin; + float mHipSpreadDuckedMin; + float mHipSpreadProneMin; + float mHipSpreadStandMax; + float mHipSpreadDuckedMax; + float mHipSpreadProneMax; + float mHipSpreadDecayRate; + float mHipSpreadFireAdd; + float mHipSpreadTurnAdd; + float mHipSpreadMoveAdd; + float mHipSpreadDuckedDecay; + float mHipSpreadProneDecay; + float mHipReticleSidePos; + int mAdsTransInTime; + int mAdsTransOutTime; + float mAdsIdleAmount; + float mHipIdleAmount; + float mAdsIdleSpeed; + float mHipIdleSpeed; + float mIdleCrouchFactor; + float mIdleProneFactor; + float mGunMaxPitch; + float mGunMaxYaw; + float mSwayMaxAngle; + float mSwayLerpSpeed; + float mSwayPitchScale; + float mSwayYawScale; + float mSwayHorizScale; + float mSwayVertScale; + float mSwayShellShockScale; + float mAdsSwayMaxAngle; + float mAdsSwayLerpSpeed; + float mAdsSwayPitchScale; + float mAdsSwayYawScale; + float mAdsSwayHorizScale; + float mAdsSwayVertScale; + int mRifleBullet; + int mArmorPiercing; + int mBoltAction; + int mAimDownSight; + int mRechamberWhileAds; + float mAdsViewErrorMin; + float mAdsViewErrorMax; + int mCookOffHold; + int mClipOnly; + int mAdsFireOnly; + int mCancelAutoHolsterWhenEmpty; + int mSuppressAmmoReserveDisplay; + int mEnhanced; + int mLaserSightDuringNightvision; + + XMaterial mKillIcon; + XWeaponIconRatioType mKillIconRatio; + int mFlipKillIcon; + + XMaterial mDpadIcon; + + XWeaponIconRatioType mDpadIconRatio; + int mNoPartialReload; + int mSegmentedReload; + int mReloadAmmoAdd; + int mReloadStartAdd; + + QString mAltWeaponName; + + uint mAltWeaponIndex; + int mDropAmmoMin; + int mDropAmmoMax; + int mBlocksProne; + int mSilenced; + int mExplosionRadius; + int mExplosionRadiusMin; + int mExplosionInnerDamage; + int mExplosionOuterDamage; + float mDamageConeAngle; + int mProjectileSpeed; + int mProjectileSpeedUp; + int mProjectileSpeedForward; + int mProjectileActivateDist; + float mProjLifetime; + float mTimeToAccelerate; + float mProjectileCurvature; + + XModel mProjectileModel; + XWeaponProjExposion mProjExplosion; + + XFxEffectDef mProjExplosionEffect; + int mProjExplosionEffectForceNormalUp; + + XFxEffectDef mProjDudEffect; + XSoundAliasList mProjExplosionSound; + XSoundAliasList mProjDudSound; + + int mProjImpactExplode; + XWeaponStickinessType mStickiness; + int mHasDetonator; + int mTimedDetonation; + int mRotate; + int mHoldButtonToThrow; + int mFreezeMovementWhenFiring; + float mLowAmmoWarningThreshold; + float mParallelBounce[29]; + float mPerpendicularBounce[29]; + + XFxEffectDef mProjTrailEffect; + + float mProjectileColor[3]; + XGuidedMissileType mGuidedMissileType; + float mMaxSteeringAccel; + int mProjIgnitionDelay; + XFxEffectDef mProjIgnitionEffect; + + XSoundAliasList mProjIgnitionSound; + + float mAdsAimPitch; + float mAdsCrosshairInFrac; + float mAdsCrosshairOutFrac; + int mAdsGunKickReducedKickBullets; + float mAdsGunKickReducedKickPercent; + float mAdsGunKickPitchMin; + float mAdsGunKickPitchMax; + float mAdsGunKickYawMin; + float mAdsGunKickYawMax; + float mAdsGunKickAccel; + float mAdsGunKickSpeedMax; + float mAdsGunKickSpeedDecay; + float mAdsGunKickStaticDecay; + float mAdsViewKickPitchMin; + float mAdsViewKickPitchMax; + float mAdsViewKickYawMin; + float mAdsViewKickYawMax; + float mAdsViewKickCenterSpeed; + float mAdsViewScatterMin; + float mAdsViewScatterMax; + float mAdsSpread; + int mHipGunKickReducedKickBullets; + float mHipGunKickReducedKickPercent; + float mHipGunKickPitchMin; + float mHipGunKickPitchMax; + float mHipGunKickYawMin; + float mHipGunKickYawMax; + float mHipGunKickAccel; + float mHipGunKickSpeedMax; + float mHipGunKickSpeedDecay; + float mHipGunKickStaticDecay; + float mHipViewKickPitchMin; + float mHipViewKickPitchMax; + float mHipViewKickYawMin; + float mHipViewKickYawMax; + float mHipViewKickCenterSpeed; + float mHipViewScatterMin; + float mHipViewScatterMax; + float mMightDist; + float mMaxDist; + + QString mAccuracyGraphName[2]; + float mAccuracyGraphKnots[2]; + float mOriginalAccuracyGraphKnots[2]; + + int mAccuracyGraphKnotCount[2]; + int mOriginalAccuracyGraphKnotCount[2]; + int mPositionReloadTransTime; + float mLeftArc; + float mRightArc; + float mTopArc; + float mBottomArc; + float mAccuracy; + float mAiSpread; + float mPlayerSpread; + float mMinTurnSpeed[2]; + float mMaxTurnSpeed[2]; + float mPitchConvergenceTime; + float mYawConvergenceTime; + float mSuppressTime; + float mMaxRange; + float mAnimHorRotateInc; + float mPlayerPositionDist; + + QString mUseHintString; + QString mDropHintString; + + int mUseHintStringIndex; + int mDropHintStringIndex; + float mHorizViewJitter; + float mVertViewJitter; + + QString mScript; + + float mPosAnimLength[2]; + int mMinDamage; + int mMinPlayerDamage; + float mMaxDamageRange; + float mMinDamageRange; + float mDestabilizationRateTime; + float mDestabilizationCurvatureMax; + int mDestabilizeDistance; + float mLocationDamageMultipliers[19]; + + QString mFireRumble; + QString mMeleeImpactRumble; + + float mAdsDofStart; + float mAdsDofEnd; }; #endif // XWEAPONDEF_H diff --git a/libs/zonefile/360/zonefile_cod10_360.cpp b/libs/zonefile/360/zonefile_cod10_360.cpp index 82bb52d..793c9a5 100644 --- a/libs/zonefile/360/zonefile_cod10_360.cpp +++ b/libs/zonefile/360/zonefile_cod10_360.cpp @@ -5,8 +5,26 @@ #include ZoneFile_COD10_360::ZoneFile_COD10_360() + : ZoneFile() { - + pSetType(4, ASSET_TYPE_XANIMPARTS); + pSetType(5, ASSET_TYPE_XMODEL); + pSetType(6, ASSET_TYPE_IMAGE); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(11, ASSET_TYPE_COL_MAP_SP); + pSetType(12, ASSET_TYPE_COLLISION_MAP); + pSetType(13, ASSET_TYPE_D3DBSP); + pSetType(14, ASSET_TYPE_GAME_MAP_SP); + pSetType(17, ASSET_TYPE_GFX_MAP); + pSetType(18, ASSET_TYPE_LIGHT_DEF); + pSetType(18, ASSET_TYPE_WEAPON); + pSetType(20, ASSET_TYPE_FONT); + pSetType(21, ASSET_TYPE_MENU); + pSetType(26, ASSET_TYPE_FX); + pSetType(32, ASSET_TYPE_RAWFILE); + pSetType(33, ASSET_TYPE_STRINGTABLE); + pSetType(23, ASSET_TYPE_LOCALIZE_ENTRY); } ZoneFile_COD10_360::~ZoneFile_COD10_360() @@ -17,45 +35,3 @@ ZoneFile_COD10_360::~ZoneFile_COD10_360() bool ZoneFile_COD10_360::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD10_360::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "17000000") { // localized string PARTIALLY VERIFIED - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "20000000") { // raw_file PARTIALLY VERIFIED - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "1A000000") { // fx PARTIALLY VERIFIED - return Utils::ASSET_FX; - } else if (cleanedType == "09000000") { // loaded_sound PARTIALLY VERIFIED - return Utils::ASSET_SOUND; - } else if (cleanedType == "04000000") { // x_anim PARTIALLY VERIFIED - return Utils::ASSET_Animation; - } else if (cleanedType == "0C000000") { // collision_map PARTIALLY VERIFIED - return Utils::ASSET_COLLISION_MAP; - } else if (cleanedType == "21000000") { // string_table PARTIALLY VERIFIED - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "15000000") { // menu_file PARTIALLY VERIFIED - return Utils::ASSET_MENU; - } else if (cleanedType == "07000000") { // tech set PARTIALLY VERIFIED - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "18000000") { // weapon PARTIALLY VERIFIED - return Utils::ASSET_WEAPON; - } else if (cleanedType == "11000000") { // gfx map PARTIALLY VERIFIED - return Utils::ASSET_GFX_MAP; - } else if (cleanedType == "12000000") { // light_def PARTIALLY VERIFIED - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "14000000") { // font PARTIALLY VERIFIED - return Utils::ASSET_FONT; - } else if (cleanedType == "05000000") { // xmodel PARTIALLY VERIFIED - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0D000000") { // d3dbsp PARTIALLY VERIFIED - return Utils::ASSET_D3DBSP; - } else if (cleanedType == "06000000") { // image PARTIALLY VERIFIED - return Utils::ASSET_IMAGE; - } else if (cleanedType == "0E000000") { // game map sp PARTIALLY VERIFIED - return Utils::ASSET_GAME_MAP_SP; - } else if (cleanedType == "0B000000") { // col map sp PARTIALLY VERIFIED - return Utils::ASSET_COL_MAP_SP; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/360/zonefile_cod10_360.h b/libs/zonefile/360/zonefile_cod10_360.h index ba6a5fd..c717ff1 100644 --- a/libs/zonefile/360/zonefile_cod10_360.h +++ b/libs/zonefile/360/zonefile_cod10_360.h @@ -10,7 +10,7 @@ public: ~ZoneFile_COD10_360(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD10_360_H diff --git a/libs/zonefile/360/zonefile_cod11_360.cpp b/libs/zonefile/360/zonefile_cod11_360.cpp index b91eafa..994edf3 100644 --- a/libs/zonefile/360/zonefile_cod11_360.cpp +++ b/libs/zonefile/360/zonefile_cod11_360.cpp @@ -5,8 +5,67 @@ #include ZoneFile_COD11_360::ZoneFile_COD11_360() + : ZoneFile() { - + pSetType(0, ASSET_TYPE_PHYSPRESET); + pSetType(1, ASSET_TYPE_PHYSCOLLMAP); + pSetType(2, ASSET_TYPE_XANIMPARTS); + pSetType(3, ASSET_TYPE_XANIMPARTS); + pSetType(4, ASSET_TYPE_XMODEL_SURFS); + pSetType(5, ASSET_TYPE_XMODEL); + pSetType(6, ASSET_TYPE_PIXELSHADER); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(8, ASSET_TYPE_IMAGE); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(10, ASSET_TYPE_SOUND_SUBMIX); + pSetType(11, ASSET_TYPE_SOUND_CURVE); + pSetType(12, ASSET_TYPE_SOUND_EVENT); + pSetType(13, ASSET_TYPE_LPF_CURVE); + pSetType(14, ASSET_TYPE_REVERB_CURVE); + pSetType(15, ASSET_TYPE_LOADED_SOUND); + pSetType(16, ASSET_TYPE_CLIPMAP); + pSetType(17, ASSET_TYPE_COMWORLD); + pSetType(18, ASSET_TYPE_GLASSWORLD); + pSetType(19, ASSET_TYPE_PATHDATA); + pSetType(20, ASSET_TYPE_VEHICLE_TRACK); + pSetType(21, ASSET_TYPE_MAP_ENTS); + pSetType(22, ASSET_TYPE_FXWORLD); + pSetType(23, ASSET_TYPE_GFXWORLD); + pSetType(24, ASSET_TYPE_GFXWORLD_TRANSIENT_ZONE); + pSetType(25, ASSET_TYPE_LIGHT_DEF); + pSetType(26, ASSET_TYPE_UI_MAP); + pSetType(27, ASSET_TYPE_FONT); + pSetType(28, ASSET_TYPE_MENULIST); + pSetType(29, ASSET_TYPE_MENU); + pSetType(30, ASSET_TYPE_ANIMCLASS); + pSetType(31, ASSET_TYPE_LOCALIZE_ENTRY); + pSetType(32, ASSET_TYPE_ATTACHMENT); + pSetType(33, ASSET_TYPE_WEAPON); + pSetType(34, ASSET_TYPE_SNDDRIVER_GLOBALS); + pSetType(35, ASSET_TYPE_FX); + pSetType(36, ASSET_TYPE_IMPACT_FX); + pSetType(37, ASSET_TYPE_SURFACE_FX); + pSetType(38, ASSET_TYPE_AITYPE); + pSetType(39, ASSET_TYPE_MPTYPE); + pSetType(40, ASSET_TYPE_CHARACTER); + pSetType(41, ASSET_TYPE_XMODELALIAS); + pSetType(42, ASSET_TYPE_RAWFILE); + pSetType(43, ASSET_TYPE_SCRIPTFILE); + pSetType(44, ASSET_TYPE_STRINGTABLE); + pSetType(45, ASSET_TYPE_LEADERBOARD); + pSetType(46, ASSET_TYPE_STRUCTURED_DATA_DEF); + pSetType(47, ASSET_TYPE_TRACER); + pSetType(48, ASSET_TYPE_VEHICLE); + pSetType(49, ASSET_TYPE_ADDON_MAP_ENTS); + pSetType(50, ASSET_TYPE_NET_CONST_STRINGS); + pSetType(51, ASSET_TYPE_REVERB_PRESET); + pSetType(52, ASSET_TYPE_SCRIPTABLE); + pSetType(53, ASSET_TYPE_DOPPLER_PRESET); + pSetType(54, ASSET_TYPE_LASER); + pSetType(55, ASSET_TYPE_SKELETON_SCRIPT); + pSetType(56, ASSET_TYPE_COUNT); + pSetType(57, ASSET_TYPE_STRING); + pSetType(58, ASSET_TYPE_ASSETLIST); } ZoneFile_COD11_360::~ZoneFile_COD11_360() @@ -18,130 +77,3 @@ bool ZoneFile_COD11_360::Load(const QByteArray aFileData) { return true; } -Utils::AssetType ZoneFile_COD11_360::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "00000000") { - return Utils::ASSET_PHYSPRESET; - } else if (cleanedType == "00000001") { - return Utils::ASSET_PHYSCOLLMAP; - } else if (cleanedType == "00000002") { - return Utils::ASSET_Animation; - } else if (cleanedType == "00000003") { - return Utils::ASSET_XMODEL_SURFS; - } else if (cleanedType == "00000004") { - return Utils::ASSET_XMODEL; - } else if (cleanedType == "00000005") { - return Utils::ASSET_MATERIAL; - } else if (cleanedType == "00000006") { - return Utils::ASSET_PIXELSHADER; - } else if (cleanedType == "00000007") { - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "00000008") { - return Utils::ASSET_IMAGE; - } else if (cleanedType == "00000009") { - return Utils::ASSET_SOUND; - } else if (cleanedType == "0000000A") { - return Utils::ASSET_SOUND_SUBMIX; - } else if (cleanedType == "0000000B") { - return Utils::ASSET_SOUND_CURVE; - } else if (cleanedType == "0000000C") { - return Utils::ASSET_SOUND_EVENT; - } else if (cleanedType == "0000000D") { - return Utils::ASSET_LPF_CURVE; - } else if (cleanedType == "0000000E") { - return Utils::ASSET_REVERB_CURVE; - } else if (cleanedType == "0000000F") { - return Utils::ASSET_LOADED_SOUND; - } else if (cleanedType == "00000010") { - return Utils::ASSET_CLIPMAP; - } else if (cleanedType == "00000011") { - return Utils::ASSET_COMWORLD; - } else if (cleanedType == "00000012") { - return Utils::ASSET_GLASSWORLD; - } else if (cleanedType == "00000013") { - return Utils::ASSET_PATHDATA; - } else if (cleanedType == "00000014") { - return Utils::ASSET_VEHICLE_TRACK; - } else if (cleanedType == "00000015") { - return Utils::ASSET_MAP_ENTS; - } else if (cleanedType == "00000016") { - return Utils::ASSET_FXWORLD; - } else if (cleanedType == "00000017") { - return Utils::ASSET_GFXWORLD; - } else if (cleanedType == "00000018") { - return Utils::ASSET_GFXWORLD_TRANSIENT_ZONE; - } else if (cleanedType == "00000019") { - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "0000001A") { - return Utils::ASSET_UI_MAP; - } else if (cleanedType == "0000001B") { - return Utils::ASSET_FONT; - } else if (cleanedType == "0000001C") { - return Utils::ASSET_MENULIST; - } else if (cleanedType == "0000001D") { - return Utils::ASSET_MENU; - } else if (cleanedType == "0000001E") { - return Utils::ASSET_ANIMCLASS; - } else if (cleanedType == "0000001F") { - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "00000020") { - return Utils::ASSET_ATTACHMENT; - } else if (cleanedType == "00000021") { - return Utils::ASSET_WEAPON; - } else if (cleanedType == "00000022") { - return Utils::ASSET_SNDDRIVER_GLOBALS; - } else if (cleanedType == "00000023") { - return Utils::ASSET_FX; - } else if (cleanedType == "00000024") { - return Utils::ASSET_IMPACT_FX; - } else if (cleanedType == "00000025") { - return Utils::ASSET_SURFACE_FX; - } else if (cleanedType == "00000026") { - return Utils::ASSET_AITYPE; - } else if (cleanedType == "00000027") { - return Utils::ASSET_MPTYPE; - } else if (cleanedType == "00000028") { - return Utils::ASSET_CHARACTER; - } else if (cleanedType == "00000029") { - return Utils::ASSET_XMODELALIAS; - } else if (cleanedType == "0000002A") { - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "0000002B") { - return Utils::ASSET_SCRIPTFILE; - } else if (cleanedType == "0000002C") { - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "0000002D") { - return Utils::ASSET_LEADERBOARD; - } else if (cleanedType == "0000002E") { - return Utils::ASSET_STRUCTURED_DATA_DEF; - } else if (cleanedType == "0000002F") { - return Utils::ASSET_TRACER; - } else if (cleanedType == "00000030") { - return Utils::ASSET_VEHICLE; - } else if (cleanedType == "00000031") { - return Utils::ASSET_ADDON_MAP_ENTS; - } else if (cleanedType == "00000032") { - return Utils::ASSET_NET_CONST_STRINGS; - } else if (cleanedType == "00000033") { - return Utils::ASSET_REVERB_PRESET; - } else if (cleanedType == "00000034") { - return Utils::ASSET_LUA_FILE; - } else if (cleanedType == "00000035") { - return Utils::ASSET_SCRIPTABLE; - } else if (cleanedType == "00000036") { - return Utils::ASSET_EQUIPMENT_SND_TABLE; - } else if (cleanedType == "00000037") { - return Utils::ASSET_DOPPLER_PRESET; - } else if (cleanedType == "00000038") { - return Utils::ASSET_LASER; - } else if (cleanedType == "00000039") { - return Utils::ASSET_SKELETON_SCRIPT; - } else if (cleanedType == "0000003A") { - return Utils::ASSET_COUNT; - } else if (cleanedType == "0000003A") { - return Utils::ASSET_STRING; - } else if (cleanedType == "0000003B") { - return Utils::ASSET_ASSETLIST; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/360/zonefile_cod11_360.h b/libs/zonefile/360/zonefile_cod11_360.h index 05a9349..f0fac7a 100644 --- a/libs/zonefile/360/zonefile_cod11_360.h +++ b/libs/zonefile/360/zonefile_cod11_360.h @@ -10,7 +10,7 @@ public: ~ZoneFile_COD11_360(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD11_360_H diff --git a/libs/zonefile/360/zonefile_cod12_360.cpp b/libs/zonefile/360/zonefile_cod12_360.cpp index 57bcc66..455bc19 100644 --- a/libs/zonefile/360/zonefile_cod12_360.cpp +++ b/libs/zonefile/360/zonefile_cod12_360.cpp @@ -5,8 +5,74 @@ #include ZoneFile_COD12_360::ZoneFile_COD12_360() + : ZoneFile() { - + pSetType(0, ASSET_TYPE_PHYSPRESET); + pSetType(1, ASSET_TYPE_PHYS_CONSTRAINTS); + pSetType(2, ASSET_TYPE_DESTRUCTIBLE_DEF); + pSetType(3, ASSET_TYPE_XANIMPARTS); + pSetType(4, ASSET_TYPE_XMODEL); + pSetType(5, ASSET_TYPE_XMODEL_MESH); + pSetType(6, ASSET_TYPE_MATERIAL); + pSetType(7, ASSET_TYPE_COMPUTE_SHADER_SET); + pSetType(8, ASSET_TYPE_TECHNIQUE_SET); + pSetType(9, ASSET_TYPE_IMAGE); + pSetType(10, ASSET_TYPE_SOUND); + pSetType(17, ASSET_TYPE_LIGHT_DEF); + pSetType(21, ASSET_TYPE_FONT_ICON); + pSetType(23, ASSET_TYPE_WEAPON); + pSetType(27, ASSET_TYPE_CG_MEDIA_TABLE); + pSetType(28, ASSET_TYPE_PLAYER_SOUNDS_TABLE); + pSetType(29, ASSET_TYPE_PLAYER_FX_TABLE); + pSetType(30, ASSET_TYPE_SHARED_WEAPON_SOUNDS); + pSetType(31, ASSET_TYPE_ATTACHMENT); + pSetType(32, ASSET_TYPE_ATTACHMENT_UNIQUE); + pSetType(33, ASSET_TYPE_WEAPON_CAMO); + pSetType(34, ASSET_TYPE_CUSTOMIZATION_TABLE); + pSetType(35, ASSET_TYPE_CUSTOMIZATION_TABLE_FEIMAGES); + pSetType(36, ASSET_TYPE_CUSTOMIZATION_TABLE_COLOR); + pSetType(38, ASSET_TYPE_FX); + pSetType(47, ASSET_TYPE_RAWFILE); + pSetType(48, ASSET_TYPE_STRINGTABLE); + pSetType(49, ASSET_TYPE_STRUCTURED_TABLE); + pSetType(50, ASSET_TYPE_LEADERBOARD_DEF); + pSetType(51, ASSET_TYPE_DDL); + pSetType(54, ASSET_TYPE_SCRIPT_PARSE_TREE); + pSetType(55, ASSET_TYPE_KEY_VALUE_PAIRS); + pSetType(56, ASSET_TYPE_VEHICLE); + pSetType(58, ASSET_TYPE_VEHICLE_TRACER); + pSetType(60, ASSET_TYPE_SURFACE_FX_TABLE); + pSetType(61, ASSET_TYPE_SURFACE_SOUND_DEF); + pSetType(62, ASSET_TYPE_FOOTSTEP_TABLE); + pSetType(63, ASSET_TYPE_ENTITY_FX_IMPACTS); + pSetType(64, ASSET_TYPE_ENTITY_SOUND_IMPACTS); + pSetType(66, ASSET_TYPE_VEHICLE_FX_DEF); + pSetType(67, ASSET_TYPE_VEHICLE_SOUND_DEF); + pSetType(69, ASSET_TYPE_SCRIPT_BUNDLE); + pSetType(70, ASSET_TYPE_SCRIPT_BUNDLE_LIST); + pSetType(71, ASSET_TYPE_RUMBLE); + pSetType(74, ASSET_TYPE_AIM_TABLE); + pSetType(75, ASSET_TYPE_ANIM_SELECTOR_TABLE); + pSetType(76, ASSET_TYPE_ANIM_MAPPING_TABLE); + pSetType(77, ASSET_TYPE_ANIM_STATE_MACHINE); + pSetType(78, ASSET_TYPE_BEHAVIOR_TREE); + pSetType(79, ASSET_TYPE_BEHAVIOR_STATE_MACHINE); + pSetType(81, ASSET_TYPE_S_ANIM); + pSetType(82, ASSET_TYPE_LIGHT_DEF); + pSetType(83, ASSET_TYPE_BIT_FIELD); + pSetType(84, ASSET_TYPE_SURFACE_SOUND_DEF); + pSetType(85, ASSET_TYPE_SURFACE_FX_TABLE); + pSetType(86, ASSET_TYPE_RUMBLE); + pSetType(89, ASSET_TYPE_AIM_TABLE); + pSetType(90, ASSET_TYPE_MAP_TABLE); + pSetType(91, ASSET_TYPE_MAP_TABLE_LOADING_IMAGES); + pSetType(92, ASSET_TYPE_MEDAL); + pSetType(93, ASSET_TYPE_MEDAL_TABLE); + pSetType(94, ASSET_TYPE_OBJECTIVE); + pSetType(95, ASSET_TYPE_OBJECTIVE_LIST); + pSetType(100, ASSET_TYPE_LASER); + pSetType(101, ASSET_TYPE_BEAM); + pSetType(102, ASSET_TYPE_STREAMER_HINT); } ZoneFile_COD12_360::~ZoneFile_COD12_360() @@ -17,142 +83,3 @@ ZoneFile_COD12_360::~ZoneFile_COD12_360() bool ZoneFile_COD12_360::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD12_360::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "0000000000000000") { - return Utils::ASSET_PHYSPRESET; - } else if (cleanedType == "0100000000000000") { - return Utils::ASSET_PHYS_CONSTRAINTS; - } else if (cleanedType == "0200000000000000") { - return Utils::ASSET_DESTRUCTIBLE_DEF; - } else if (cleanedType == "0300000000000000") { - return Utils::ASSET_Animation; - } else if (cleanedType == "0400000000000000") { - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0500000000000000") { - return Utils::ASSET_XMODEL_MESH; - } else if (cleanedType == "0600000000000000") { - return Utils::ASSET_MATERIAL; - } else if (cleanedType == "0700000000000000") { - return Utils::ASSET_COMPUTE_SHADER_SET; - } else if (cleanedType == "0800000000000000") { - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "0900000000000000") { - return Utils::ASSET_IMAGE; - } else if (cleanedType == "0A00000000000000") { - return Utils::ASSET_SOUND; - } else if (cleanedType == "1100000000000000") { - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "1500000000000000") { - return Utils::ASSET_FONT_ICON; - } else if (cleanedType == "1700000000000000") { - return Utils::ASSET_WEAPON; - } else if (cleanedType == "1C00000000000000") { - return Utils::ASSET_PLAYER_SOUNDS_TABLE; - } else if (cleanedType == "1D00000000000000") { - return Utils::ASSET_PLAYER_FX_TABLE; - } else if (cleanedType == "1E00000000000000") { - return Utils::ASSET_SHARED_WEAPON_SOUNDS; - } else if (cleanedType == "1F00000000000000") { - return Utils::ASSET_ATTACHMENT; - } else if (cleanedType == "2000000000000000") { - return Utils::ASSET_ATTACHMENT_UNIQUE; - } else if (cleanedType == "2100000000000000") { - return Utils::ASSET_WEAPON_CAMO; - } else if (cleanedType == "2200000000000000") { - return Utils::ASSET_CUSTOMIZATION_TABLE; - } else if (cleanedType == "2300000000000000") { - return Utils::ASSET_CUSTOMIZATION_TABLE_FEIMAGES; - } else if (cleanedType == "2400000000000000") { - return Utils::ASSET_CUSTOMIZATION_TABLE_COLOR; - }else if (cleanedType == "2600000000000000") { - return Utils::ASSET_FX; - } else if (cleanedType == "2F00000000000000") { - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "3000000000000000") { - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "3100000000000000") { - return Utils::ASSET_STRUCTURED_TABLE; - } else if (cleanedType == "3200000000000000") { - return Utils::ASSET_LEADERBOARD_DEF; - } else if (cleanedType == "3300000000000000") { - return Utils::ASSET_DDL; - } else if (cleanedType == "3600000000000000") { - return Utils::ASSET_SCRIPT_PARSE_TREE; - } else if (cleanedType == "3700000000000000") { - return Utils::ASSET_KEY_VALUE_PAIRS; - } else if (cleanedType == "3800000000000000") { - return Utils::ASSET_VEHICLE; - } else if (cleanedType == "3A00000000000000") { - return Utils::ASSET_VEHICLE_TRACER; - } else if (cleanedType == "3C00000000000000") { - return Utils::ASSET_SURFACE_FX_TABLE; - } else if (cleanedType == "3D00000000000000") { - return Utils::ASSET_SURFACE_SOUND_DEF; - } else if (cleanedType == "3E00000000000000") { - return Utils::ASSET_FOOTSTEP_TABLE; - } else if (cleanedType == "3F00000000000000") { - return Utils::ASSET_ENTITY_FX_IMPACTS; - } else if (cleanedType == "4000000000000000") { - return Utils::ASSET_ENTITY_SOUND_IMPACTS; - } else if (cleanedType == "4200000000000000") { - return Utils::ASSET_VEHICLE_FX_DEF; - } else if (cleanedType == "4300000000000000") { - return Utils::ASSET_VEHICLE_SOUND_DEF; - } else if (cleanedType == "4500000000000000") { - return Utils::ASSET_SCRIPT_BUNDLE; - } else if (cleanedType == "4600000000000000") { - return Utils::ASSET_SCRIPT_BUNDLE_LIST; - } else if (cleanedType == "4700000000000000") { - return Utils::ASSET_RUMBLE; - } else if (cleanedType == "4A00000000000000") { - return Utils::ASSET_AIM_TABLE; - } else if (cleanedType == "4B00000000000000") { - return Utils::ASSET_ANIM_SELECTOR_TABLE; - } else if (cleanedType == "4C00000000000000") { - return Utils::ASSET_ANIM_MAPPING_TABLE; - } else if (cleanedType == "4D00000000000000") { - return Utils::ASSET_ANIM_STATE_MACHINE; - } else if (cleanedType == "4E00000000000000") { - return Utils::ASSET_BEHAVIOR_TREE; - } else if (cleanedType == "4F00000000000000") { - return Utils::ASSET_BEHAVIOR_STATE_MACHINE; - } else if (cleanedType == "5100000000000000") { - return Utils::ASSET_S_ANIM; - } else if (cleanedType == "5200000000000000") { - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "5300000000000000") { - return Utils::ASSET_BIT_FIELD; - } else if (cleanedType == "5400000000000000") { - return Utils::ASSET_SURFACE_SOUND_DEF; - } else if (cleanedType == "5500000000000000") { - return Utils::ASSET_SURFACE_FX_TABLE; - } else if (cleanedType == "5600000000000000") { - return Utils::ASSET_RUMBLE; - } else if (cleanedType == "5900000000000000") { - return Utils::ASSET_AIM_TABLE; - } else if (cleanedType == "5A00000000000000") { - return Utils::ASSET_MAP_TABLE; - } else if (cleanedType == "5B00000000000000") { - return Utils::ASSET_MAP_TABLE_LOADING_IMAGES; - } else if (cleanedType == "5C00000000000000") { - return Utils::ASSET_MEDAL; - } else if (cleanedType == "5D00000000000000") { - return Utils::ASSET_MEDAL_TABLE; - } else if (cleanedType == "5E00000000000000") { - return Utils::ASSET_OBJECTIVE; - } else if (cleanedType == "5F00000000000000") { - return Utils::ASSET_OBJECTIVE_LIST; - } else if (cleanedType == "6400000000000000") { - return Utils::ASSET_LASER; - } else if (cleanedType == "6500000000000000") { - return Utils::ASSET_BEAM; - } else if (cleanedType == "6600000000000000") { - return Utils::ASSET_STREAMER_HINT; - } else if (cleanedType == "1B00000000000000") { - return Utils::ASSET_CG_MEDIA_TABLE; - } - - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/360/zonefile_cod12_360.h b/libs/zonefile/360/zonefile_cod12_360.h index 6a88aa6..7f1700b 100644 --- a/libs/zonefile/360/zonefile_cod12_360.h +++ b/libs/zonefile/360/zonefile_cod12_360.h @@ -10,7 +10,7 @@ public: ~ZoneFile_COD12_360(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD12_PC_H diff --git a/libs/zonefile/360/zonefile_cod2_360.cpp b/libs/zonefile/360/zonefile_cod2_360.cpp index 14cac8b..ba3c16e 100644 --- a/libs/zonefile/360/zonefile_cod2_360.cpp +++ b/libs/zonefile/360/zonefile_cod2_360.cpp @@ -5,8 +5,29 @@ #include ZoneFile_COD2_360::ZoneFile_COD2_360() + : ZoneFile() { - + pSetType(23, ASSET_TYPE_RAWFILE); + pSetType(6, ASSET_TYPE_D3DBSP); + pSetType(2, ASSET_TYPE_MATERIAL); + pSetType(4, ASSET_TYPE_SHOCK_FILE); + + //pSetType(-1, ASSET_TYPE_FX); + //pSetType(-1, ASSET_TYPE_SOUND); + //pSetType(-1, ASSET_TYPE_XANIMPARTS); + //pSetType(-1, ASSET_TYPE_COLLISION_MAP); + //pSetType(-1, ASSET_TYPE_STRINGTABLE); + //pSetType(-1, ASSET_TYPE_MENU); + //pSetType(-1, ASSET_TYPE_TECHNIQUE_SET); + //pSetType(-1, ASSET_TYPE_LOCALIZE_ENTRY); + //pSetType(-1, ASSET_TYPE_GFX_MAP); + //pSetType(-1, ASSET_TYPE_LIGHT_DEF); + //pSetType(-1, ASSET_TYPE_FONT); + //pSetType(-1, ASSET_TYPE_XMODEL); + //pSetType(-1, ASSET_TYPE_GAME_MAP_SP); + //pSetType(-1, ASSET_TYPE_COL_MAP_SP); + //pSetType(-1, ASSET_TYPE_PHYSPRESET); + //pSetType(-1, ASSET_TYPE_DESTRUCTIBLE); } ZoneFile_COD2_360::~ZoneFile_COD2_360() @@ -17,49 +38,3 @@ ZoneFile_COD2_360::~ZoneFile_COD2_360() bool ZoneFile_COD2_360::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD2_360::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "00000017") { - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "") { - return Utils::ASSET_FX; - } else if (cleanedType == "") { - return Utils::ASSET_SOUND; - } else if (cleanedType == "") { - return Utils::ASSET_Animation; - } else if (cleanedType == "") { - return Utils::ASSET_COLLISION_MAP; - } else if (cleanedType == "") { - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "") { - return Utils::ASSET_MENU; - } else if (cleanedType == "") { - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "") { - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "") { - return Utils::ASSET_GFX_MAP; - } else if (cleanedType == "") { - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "") { - return Utils::ASSET_FONT; - } else if (cleanedType == "") { - return Utils::ASSET_XMODEL; - } else if (cleanedType == "00000006") { - return Utils::ASSET_D3DBSP; - } else if (cleanedType == "00000002") { - return Utils::ASSET_MATERIAL; - } else if (cleanedType == "") { - return Utils::ASSET_GAME_MAP_SP; - } else if (cleanedType == "") { - return Utils::ASSET_COL_MAP_SP; - } else if (cleanedType == "") { - return Utils::ASSET_PHYSPRESET; - } else if (cleanedType == "") { - return Utils::ASSET_DESTRUCTIBLE; - } else if (cleanedType == "00000004") { - return Utils::ASSET_SHOCK_FILE; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/360/zonefile_cod2_360.h b/libs/zonefile/360/zonefile_cod2_360.h index d10bc4e..6e7d92a 100644 --- a/libs/zonefile/360/zonefile_cod2_360.h +++ b/libs/zonefile/360/zonefile_cod2_360.h @@ -10,7 +10,7 @@ public: ~ZoneFile_COD2_360(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD2_360_H diff --git a/libs/zonefile/360/zonefile_cod4_360.cpp b/libs/zonefile/360/zonefile_cod4_360.cpp index b818b9d..7432593 100644 --- a/libs/zonefile/360/zonefile_cod4_360.cpp +++ b/libs/zonefile/360/zonefile_cod4_360.cpp @@ -1,211 +1,58 @@ #include "zonefile_cod4_360.h" -#include "utils.h" #include "xassetlist.h" -#include "xfile.h" -#include "assetlist.h" #include #include #include ZoneFile_COD4_360::ZoneFile_COD4_360() - : ZoneFile() { - + : ZoneFile() +{ + pSetType(0, ASSET_TYPE_XMODELPIECES); + pSetType(1, ASSET_TYPE_PHYSPRESET); + pSetType(2, ASSET_TYPE_XANIMPARTS); + pSetType(3, ASSET_TYPE_XMODEL); + pSetType(4, ASSET_TYPE_MATERIAL); + pSetType(5, ASSET_TYPE_PIXELSHADER); + pSetType(6, ASSET_TYPE_TECHNIQUE_SET); + pSetType(7, ASSET_TYPE_IMAGE); + pSetType(8, ASSET_TYPE_SOUND); + pSetType(9, ASSET_TYPE_SOUND_CURVE); + pSetType(10, ASSET_TYPE_LOADED_SOUND); + pSetType(11, ASSET_TYPE_CLIPMAP); + pSetType(12, ASSET_TYPE_CLIPMAP_PVS); + pSetType(13, ASSET_TYPE_COMWORLD); + pSetType(14, ASSET_TYPE_GAMEWORLD_SP); + pSetType(15, ASSET_TYPE_GAMEWORLD_MP); + pSetType(16, ASSET_TYPE_MAP_ENTS); + pSetType(17, ASSET_TYPE_GFXWORLD); + pSetType(18, ASSET_TYPE_LIGHT_DEF); + pSetType(19, ASSET_TYPE_UI_MAP); + pSetType(20, ASSET_TYPE_FONT); + pSetType(21, ASSET_TYPE_MENULIST); + pSetType(22, ASSET_TYPE_MENU); + pSetType(23, ASSET_TYPE_LOCALIZE_ENTRY); + pSetType(24, ASSET_TYPE_WEAPON); + pSetType(25, ASSET_TYPE_SNDDRIVER_GLOBALS); + pSetType(26, ASSET_TYPE_FX); + pSetType(27, ASSET_TYPE_IMPACT_FX); + pSetType(28, ASSET_TYPE_AITYPE); + pSetType(29, ASSET_TYPE_MPTYPE); + pSetType(30, ASSET_TYPE_CHARACTER); + pSetType(31, ASSET_TYPE_XMODELALIAS); + pSetType(32, ASSET_TYPE_RAWFILE); + pSetType(33, ASSET_TYPE_STRINGTABLE); + pSetType(34, ASSET_TYPE_COUNT); + pSetType(35, ASSET_TYPE_STRING); + pSetType(36, ASSET_TYPE_ASSETLIST); } ZoneFile_COD4_360::~ZoneFile_COD4_360() { } + + bool ZoneFile_COD4_360::Load(const QByteArray aFileData) { - QDataStream zoneStream(aFileData); - - // DB_LoadXFileData() - XFile headerData; - headerData.ParseData(&zoneStream); - - // Load_XAssetListCustom(); - XAssetList assetList; - assetList.ParseData(&zoneStream); - - assetList.GetStringList().ParseData(&zoneStream); - zoneStream.skipRawData(4); - - // for (int i = 0; i < assetList.assetCount; i++) { - // XAssetType type = assetList.assets[i].type; - // switch (type) { - // case ASSET_TYPE_XANIMPARTS: - // assets.assetMap.animations << assets.Load_Animation(&zoneStream); - // break; - // case ASSET_TYPE_XMODEL: - // assets.assetMap.models << assets.Load_Model(&zoneStream); - // break; - // case ASSET_TYPE_MATERIAL: - // assets.assetMap.materials << assets.Load_Material(&zoneStream); - // break; - // case ASSET_TYPE_PIXELSHADER: - // assets.assetMap.pixelShaders << assets.Load_MaterialPixelShader(&zoneStream); - // break; - // case ASSET_TYPE_TECHNIQUE_SET: - // assets.assetMap.techSets << assets.Load_MaterialTechSet(&zoneStream); - // break; - // case ASSET_TYPE_IMAGE: - // assets.assetMap.images << assets.Load_GfxImage(&zoneStream); - // break; - // case ASSET_TYPE_SOUND: - // assets.assetMap.sounds << assets.Load_SoundAliasList(&zoneStream); - // break; - // case ASSET_TYPE_SOUND_CURVE: - // assets.assetMap.soundCurves << assets.Load_SoundCurve(&zoneStream); - // break; - // case ASSET_TYPE_LOADED_SOUND: - // assets.assetMap.loadedSounds << assets.Load_LoadedSound(&zoneStream); - // break; - // case ASSET_TYPE_CLIPMAP: - // case ASSET_TYPE_CLIPMAP_PVS: - // assets.assetMap.clipMaps << assets.Load_ClipMap(&zoneStream); - // break; - // case ASSET_TYPE_COMWORLD: - // assets.assetMap.comWorlds << assets.Load_ComWorld(&zoneStream); - // break; - // case ASSET_TYPE_GAMEWORLD_SP: - // assets.assetMap.gameWorldSPs << assets.Load_GameWorldSp(&zoneStream); - // break; - // case ASSET_TYPE_GAMEWORLD_MP: - // assets.assetMap.gameWorldMPs << assets.Load_GameWorldMp(&zoneStream); - // break; - // case ASSET_TYPE_MAP_ENTS: - // assets.assetMap.mapEntities << assets.Load_MapEnts(&zoneStream); - // break; - // case ASSET_TYPE_GFXWORLD: - // assets.assetMap.gfxWorlds << assets.Load_GfxWorld(&zoneStream); - // break; - // case ASSET_TYPE_LIGHT_DEF: - // assets.assetMap.gfxLightDefs << assets.Load_GfxLightPtr(&zoneStream); - // break; - // case ASSET_TYPE_FONT: - // assets.assetMap.fonts << assets.Load_GameFont(&zoneStream); - // break; - // case ASSET_TYPE_MENULIST: - // assets.assetMap.menuLists << assets.Load_MenuList(&zoneStream); - // break; - // case ASSET_TYPE_MENU: - // assets.assetMap.menuDefinitions << assets.Load_MenuDef(&zoneStream); - // break; - // case ASSET_TYPE_LOCALIZE_ENTRY: - // assets.assetMap.localizeEntries << assets.Load_LocalizeEntry(&zoneStream); - // break; - // case ASSET_TYPE_WEAPON: - // assets.assetMap.weaponDefinitions << assets.Load_WeaponDef(&zoneStream); - // break; - // case ASSET_TYPE_SNDDRIVER_GLOBALS: - // assets.assetMap.soundDrivers << assets.Load_SoundDriver(&zoneStream); - // break; - // case ASSET_TYPE_FX: - // assets.assetMap.effectDefinitions << assets.Load_EffectDef(&zoneStream); - // break; - // case ASSET_TYPE_IMPACT_FX: - // assets.assetMap.impactTables << assets.Load_ImpactTable(&zoneStream); - // break; - // case ASSET_TYPE_RAWFILE: - // assets.assetMap.rawFiles << assets.Load_RawFile(&zoneStream); - // break; - // case ASSET_TYPE_STRINGTABLE: - // assets.assetMap.stringTables << assets.Load_StringTable(&zoneStream); - // break; - // case ASSET_TYPE_COUNT: - // case ASSET_TYPE_ASSETLIST: - // case ASSET_TYPE_XMODELPIECES: - // case ASSET_TYPE_PHYSPRESET: - // case ASSET_TYPE_UI_MAP: - // case ASSET_TYPE_AITYPE: - // case ASSET_TYPE_MPTYPE: - // case ASSET_TYPE_CHARACTER: - // case ASSET_TYPE_XMODELALIAS: - // default: - // break; - // } - // } - - return true; -} - -Utils::AssetType ZoneFile_COD4_360::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "00000000") { - return Utils::ASSET_XMODELPIECES; - } else if (cleanedType == "00000001") { - return Utils::ASSET_PHYSPRESET; - } else if (cleanedType == "00000002") { - return Utils::ASSET_Animation; - } else if (cleanedType == "00000003") { - return Utils::ASSET_XMODEL; - } else if (cleanedType == "00000004") { - return Utils::ASSET_MATERIAL; - } else if (cleanedType == "00000005") { - return Utils::ASSET_PIXELSHADER; - } else if (cleanedType == "00000006") { - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "00000007") { - return Utils::ASSET_IMAGE; - } else if (cleanedType == "00000008") { - return Utils::ASSET_SOUND; - } else if (cleanedType == "00000009") { - return Utils::ASSET_SOUND_CURVE; - } else if (cleanedType == "0000000A") { - return Utils::ASSET_LOADED_SOUND; - } else if (cleanedType == "0000000B") { - return Utils::ASSET_CLIPMAP; - } else if (cleanedType == "0000000C") { - return Utils::ASSET_CLIPMAP_PVS; - } else if (cleanedType == "0000000D") { - return Utils::ASSET_COMWORLD; - } else if (cleanedType == "0000000E") { - return Utils::ASSET_GAMEWORLD_SP; - } else if (cleanedType == "0000000F") { - return Utils::ASSET_GAMEWORLD_MP; - } else if (cleanedType == "00000010") { - return Utils::ASSET_MAP_ENTS; - } else if (cleanedType == "00000011") { - return Utils::ASSET_GFXWORLD; - } else if (cleanedType == "00000012") { - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "00000013") { - return Utils::ASSET_UI_MAP; - } else if (cleanedType == "00000014") { - return Utils::ASSET_FONT; - } else if (cleanedType == "00000015") { - return Utils::ASSET_MENULIST; - } else if (cleanedType == "00000016") { - return Utils::ASSET_MENU; - } else if (cleanedType == "00000017") { - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "00000018") { - return Utils::ASSET_WEAPON; - } else if (cleanedType == "00000019") { - return Utils::ASSET_SNDDRIVER_GLOBALS; - } else if (cleanedType == "0000001A") { - return Utils::ASSET_FX; - } else if (cleanedType == "0000001B") { - return Utils::ASSET_IMPACT_FX; - } else if (cleanedType == "0000001C") { - return Utils::ASSET_AITYPE; - } else if (cleanedType == "0000001D") { - return Utils::ASSET_MPTYPE; - } else if (cleanedType == "0000001E") { - return Utils::ASSET_CHARACTER; - } else if (cleanedType == "0000001F") { - return Utils::ASSET_XMODELALIAS; - } else if (cleanedType == "00000020") { - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "00000021") { - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "00000022") { - return Utils::ASSET_COUNT; - } else if (cleanedType == "00000022") { - return Utils::ASSET_STRING; - } else if (cleanedType == "00000023") { - return Utils::ASSET_ASSETLIST; - } - return Utils::ASSET_NONE; + return ZoneFile::Load(aFileData); } diff --git a/libs/zonefile/360/zonefile_cod4_360.h b/libs/zonefile/360/zonefile_cod4_360.h index a2d5fcb..9d81b16 100644 --- a/libs/zonefile/360/zonefile_cod4_360.h +++ b/libs/zonefile/360/zonefile_cod4_360.h @@ -12,10 +12,9 @@ public: ~ZoneFile_COD4_360(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + private: - //Assets_COD4_360 assets; }; #endif // ZONEFILE_COD4_360_H diff --git a/libs/zonefile/360/zonefile_cod5_360.cpp b/libs/zonefile/360/zonefile_cod5_360.cpp index 21a1d73..4fb1810 100644 --- a/libs/zonefile/360/zonefile_cod5_360.cpp +++ b/libs/zonefile/360/zonefile_cod5_360.cpp @@ -5,8 +5,29 @@ #include ZoneFile_COD5_360::ZoneFile_COD5_360() - : ZoneFile() { + : ZoneFile() +{ + pSetType(1, ASSET_TYPE_PHYSPRESET); + pSetType(3, ASSET_TYPE_DESTRUCTIBLE); + pSetType(4, ASSET_TYPE_XANIMPARTS); + pSetType(5, ASSET_TYPE_XMODEL); + pSetType(6, ASSET_TYPE_MATERIAL); + pSetType(8, ASSET_TYPE_TECHNIQUE_SET); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(11, ASSET_TYPE_COL_MAP_SP); + pSetType(12, ASSET_TYPE_COLLISION_MAP); + pSetType(13, ASSET_TYPE_D3DBSP); + pSetType(14, ASSET_TYPE_GAME_MAP_SP); + pSetType(17, ASSET_TYPE_GFX_MAP); + pSetType(18, ASSET_TYPE_LIGHT_DEF); + pSetType(20, ASSET_TYPE_FONT); + pSetType(21, ASSET_TYPE_MENU); + pSetType(22, ASSET_TYPE_MENU); + pSetType(24, ASSET_TYPE_LOCALIZE_ENTRY); + pSetType(26, ASSET_TYPE_FX); + pSetType(33, ASSET_TYPE_RAWFILE); + //pSetType(-1, ASSET_TYPE_STRINGTABLE); } ZoneFile_COD5_360::~ZoneFile_COD5_360() { @@ -16,49 +37,3 @@ ZoneFile_COD5_360::~ZoneFile_COD5_360() { bool ZoneFile_COD5_360::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD5_360::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "00000021") { - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "0000001A") { - return Utils::ASSET_FX; - } else if (cleanedType == "00000009") { - return Utils::ASSET_SOUND; - } else if (cleanedType == "00000004") { - return Utils::ASSET_Animation; - } else if (cleanedType == "0000000C") { - return Utils::ASSET_COLLISION_MAP; - } else if (cleanedType == "00000021") { - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "00000015") { - return Utils::ASSET_MENU; - } else if (cleanedType == "00000008") { - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "00000018") { - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "00000011") { - return Utils::ASSET_GFX_MAP; - } else if (cleanedType == "00000012") { - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "00000014") { - return Utils::ASSET_FONT; - } else if (cleanedType == "00000005") { - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0000000D") { - return Utils::ASSET_D3DBSP; - } else if (cleanedType == "00000006") { - return Utils::ASSET_MATERIAL; - } else if (cleanedType == "0000000E") { - return Utils::ASSET_GAME_MAP_SP; - } else if (cleanedType == "0000000B") { - return Utils::ASSET_COL_MAP_SP; - } else if (cleanedType == "00000001") { - return Utils::ASSET_PHYSPRESET; - } else if (cleanedType == "00000003") { - return Utils::ASSET_DESTRUCTIBLE; - } else if (cleanedType == "00000016") { - return Utils::ASSET_MENU; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/360/zonefile_cod5_360.h b/libs/zonefile/360/zonefile_cod5_360.h index 9b9dc48..5c0f1b3 100644 --- a/libs/zonefile/360/zonefile_cod5_360.h +++ b/libs/zonefile/360/zonefile_cod5_360.h @@ -12,7 +12,7 @@ public: ~ZoneFile_COD5_360(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD5_360_H diff --git a/libs/zonefile/360/zonefile_cod6_360.cpp b/libs/zonefile/360/zonefile_cod6_360.cpp index 6e04503..a91ffc8 100644 --- a/libs/zonefile/360/zonefile_cod6_360.cpp +++ b/libs/zonefile/360/zonefile_cod6_360.cpp @@ -5,8 +5,52 @@ #include ZoneFile_COD6_360::ZoneFile_COD6_360() - : ZoneFile() { - + : ZoneFile() +{ + pSetType(0, ASSET_TYPE_PHYSPRESET); + pSetType(1, ASSET_TYPE_PHYSCOLLMAP); + pSetType(2, ASSET_TYPE_XANIMPARTS); + pSetType(3, ASSET_TYPE_XMODEL_SURFS); + pSetType(4, ASSET_TYPE_XMODEL); + pSetType(5, ASSET_TYPE_MATERIAL); + pSetType(6, ASSET_TYPE_PIXELSHADER); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(8, ASSET_TYPE_IMAGE); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(10, ASSET_TYPE_SOUND_CURVE); + pSetType(11, ASSET_TYPE_LOADED_SOUND); + pSetType(12, ASSET_TYPE_CLIPMAP_SP); + pSetType(13, ASSET_TYPE_CLIPMAP_MP); + pSetType(14, ASSET_TYPE_COMWORLD); + pSetType(15, ASSET_TYPE_GAMEWORLD_SP); + pSetType(16, ASSET_TYPE_GAMEWORLD_MP); + pSetType(17, ASSET_TYPE_MAP_ENTS); + pSetType(18, ASSET_TYPE_FXWORLD); + pSetType(19, ASSET_TYPE_GFXWORLD); + pSetType(20, ASSET_TYPE_LIGHT_DEF); + pSetType(21, ASSET_TYPE_UI_MAP); + pSetType(22, ASSET_TYPE_FONT); + pSetType(23, ASSET_TYPE_MENULIST); + pSetType(24, ASSET_TYPE_MENU); + pSetType(25, ASSET_TYPE_LOCALIZE_ENTRY); + pSetType(26, ASSET_TYPE_WEAPON); + pSetType(27, ASSET_TYPE_SNDDRIVER_GLOBALS); + pSetType(28, ASSET_TYPE_FX); + pSetType(29, ASSET_TYPE_IMPACT_FX); + pSetType(30, ASSET_TYPE_AITYPE); + pSetType(31, ASSET_TYPE_MPTYPE); + pSetType(32, ASSET_TYPE_CHARACTER); + pSetType(33, ASSET_TYPE_XMODELALIAS); + pSetType(34, ASSET_TYPE_RAWFILE); + pSetType(35, ASSET_TYPE_STRINGTABLE); + pSetType(36, ASSET_TYPE_LEADERBOARD); + pSetType(37, ASSET_TYPE_STRUCTURED_DATA_DEF); + pSetType(38, ASSET_TYPE_TRACER); + pSetType(39, ASSET_TYPE_VEHICLE); + pSetType(40, ASSET_TYPE_ADDON_MAP_ENTS); + pSetType(41, ASSET_TYPE_COUNT); + pSetType(42, ASSET_TYPE_STRING); + pSetType(43, ASSET_TYPE_ASSETLIST); } ZoneFile_COD6_360::~ZoneFile_COD6_360() { @@ -211,56 +255,56 @@ bool ZoneFile_COD6_360::Load(const QByteArray aFileData) { // for (int i = 0; i < assetOrder.size(); i++) { // const QString typeHex = assetOrder[i]; -// const Utils::AssetType assetType = AssetStrToEnum(typeHex); -// const QString typeStr = Utils::AssetTypeToStr(assetType); +// const XAssetType assetType = ConvertRawType(typeHex); +// const QString typeStr = XAssetTypeToStr(assetType); -// if (assetType == Utils::ASSET_LOCALIZE_ENTRY) { // localized string asset +// if (assetType == ASSET_TYPE_LOCALIZE_ENTRY) { // localized string asset // result.localizeEntries << pParseAsset_LocalString(aZoneFileStream); -// } else if (assetType == Utils::ASSET_RAWFILE) { // gsc -// auto rawFile = pParseAsset_RawFile(aZoneFileStream); +// } else if (assetType == ASSET_TYPE_RAWFILE) { // gsc +// auto rawFile = pParseASSET_TYPE_RAWFILE(aZoneFileStream); // if (rawFile.length) { // result.rawFiles << rawFile; // } -// } else if (assetType == Utils::ASSET_PHYSPRESET) { // physpreset -// pParseAsset_PhysPreset(aZoneFileStream); -// } else if (assetType == Utils::ASSET_XMODEL) { // xmodel -// result.models << pParseAsset_XModel(aZoneFileStream); -// } else if (assetType == Utils::ASSET_MATERIAL) { // material -// result.materials << pParseAsset_Material(aZoneFileStream); -// } else if (assetType == Utils::ASSET_SHADER) { // pixelshader +// } else if (assetType == ASSET_TYPE_PHYSPRESET) { // physpreset +// pParseASSET_TYPE_PHYSPRESET(aZoneFileStream); +// } else if (assetType == ASSET_TYPE_XMODEL) { // xmodel +// result.models << pParseASSET_TYPE_XMODEL(aZoneFileStream); +// } else if (assetType == ASSET_TYPE_MATERIAL) { // material +// result.materials << pParseASSET_TYPE_MATERIAL(aZoneFileStream); +// } else if (assetType == ASSET_SHADER) { // pixelshader // pParseAsset_Shader(aZoneFileStream); -// } else if (assetType == Utils::ASSET_TECHNIQUE_SET) { // techset include +// } else if (assetType == ASSET_TYPE_TECHNIQUE_SET) { // techset include // result.techSets << pParseAsset_TechSet(aZoneFileStream); -// } else if (assetType == Utils::ASSET_IMAGE) { // image -// result.images << pParseAsset_Image(aZoneFileStream); -// } else if (assetType == Utils::ASSET_SOUND) { // loaded_sound -// result.sounds << pParseAsset_Sound(aZoneFileStream); -// } else if (assetType == Utils::ASSET_COLLISION_MAP) { // col_map_mp +// } else if (assetType == ASSET_TYPE_IMAGE) { // image +// result.images << pParseASSET_TYPE_IMAGE(aZoneFileStream); +// } else if (assetType == ASSET_TYPE_SOUND) { // loaded_sound +// result.sounds << pParseASSET_TYPE_SOUND(aZoneFileStream); +// } else if (assetType == ASSET_TYPE_COLLISION_MAP) { // col_map_mp // pParseAsset_ColMapMP(aZoneFileStream); -// } else if (assetType == Utils::ASSET_MP_MAP) { // game_map_sp +// } else if (assetType == ASSET_MP_MAP) { // game_map_sp // pParseAsset_GameMapSP(aZoneFileStream); -// } else if (assetType == Utils::ASSET_SP_MAP) { // game_map_mp +// } else if (assetType == ASSET_SP_MAP) { // game_map_mp // pParseAsset_GameMapMP(aZoneFileStream); -// } else if (assetType == Utils::ASSET_LIGHT_DEF) { // lightdef +// } else if (assetType == ASSET_TYPE_LIGHT_DEF) { // lightdef // pParseAsset_LightDef(aZoneFileStream); -// } else if (assetType == Utils::ASSET_UI_MAP) { // ui_map +// } else if (assetType == ASSET_TYPE_UI_MAP) { // ui_map // pParseAsset_UIMap(aZoneFileStream); -// } else if (assetType == Utils::ASSET_SNDDRIVER_GLOBALS) { // SoundDriver -// pParseAsset_SoundDriver(aZoneFileStream); -// } else if (assetType == Utils::ASSET_AI_TYPE) { // aitype -// pParseAsset_AIType(aZoneFileStream); -// } else if (assetType == Utils::ASSET_FX) { // aitype -// pParseAsset_FX(aZoneFileStream); -// } else if (assetType == Utils::ASSET_Animation) { // aitype -// result.animations << pParseAsset_Animation(aZoneFileStream); -// } else if (assetType == Utils::ASSET_STRINGTABLE) { // string_table -// result.stringTables << pParseAsset_StringTable(aZoneFileStream); -// } else if (assetType == Utils::ASSET_MENU) { // string_table -// result.menuDefinitions << pParseAsset_MenuDef(aZoneFileStream); -// } else if (assetType == Utils::ASSET_WEAPON) { // string_table -// pParseAsset_Weapon(aZoneFileStream); -// } else if (assetType == Utils::ASSET_D3DBSP) { // string_table -// pParseAsset_D3DBSP(aZoneFileStream); +// } else if (assetType == ASSET_TYPE_SNDDRIVER_GLOBALS) { // SoundDriver +// pParseASSET_TYPE_SOUNDDriver(aZoneFileStream); +// } else if (assetType == ASSET_AI_TYPE) { // aitype +// pParseASSET_TYPE_AITYPE(aZoneFileStream); +// } else if (assetType == ASSET_TYPE_FX) { // aitype +// pParseASSET_TYPE_FX(aZoneFileStream); +// } else if (assetType == ASSET_TYPE_XANIMPARTS) { // aitype +// result.animations << pParseASSET_TYPE_XANIMPARTS(aZoneFileStream); +// } else if (assetType == ASSET_TYPE_STRINGTABLE) { // string_table +// result.stringTables << pParseASSET_TYPE_STRINGTABLE(aZoneFileStream); +// } else if (assetType == ASSET_TYPE_MENU) { // string_table +// result.menuDefinitions << pParseASSET_TYPE_MENUDef(aZoneFileStream); +// } else if (assetType == ASSET_TYPE_WEAPON) { // string_table +// pParseASSET_TYPE_WEAPON(aZoneFileStream); +// } else if (assetType == ASSET_TYPE_D3DBSP) { // string_table +// pParseASSET_TYPE_D3DBSP(aZoneFileStream); // } // } // return result; @@ -300,7 +344,7 @@ bool ZoneFile_COD6_360::Load(const QByteArray aFileData) { // return result; // } -// RawFile ZoneFile_COD6_360::pParseAsset_RawFile(QDataStream *aZoneFileStream) { +// RawFile ZoneFile_COD6_360::pParseASSET_TYPE_RAWFILE(QDataStream *aZoneFileStream) { // RawFile result; // // Skip start separator FF FF FF FF (pointer?) @@ -349,11 +393,11 @@ bool ZoneFile_COD6_360::Load(const QByteArray aFileData) { // return result; // } -// void ZoneFile_COD6_360::pParseAsset_PhysPreset(QDataStream *aZoneFileStream) { +// void ZoneFile_COD6_360::pParseASSET_TYPE_PHYSPRESET(QDataStream *aZoneFileStream) { // Q_UNUSED(aZoneFileStream); // } -// Model ZoneFile_COD6_360::pParseAsset_XModel(QDataStream *aZoneFileStream) { +// Model ZoneFile_COD6_360::pParseASSET_TYPE_XMODEL(QDataStream *aZoneFileStream) { // Model result; // *aZoneFileStream >> result.namePtr >> result.tagCount >> result.rootTagCount @@ -410,7 +454,7 @@ bool ZoneFile_COD6_360::Load(const QByteArray aFileData) { // return result; // } -// Material ZoneFile_COD6_360::pParseAsset_Material(QDataStream *aZoneFileStream) { +// Material ZoneFile_COD6_360::pParseASSET_TYPE_MATERIAL(QDataStream *aZoneFileStream) { // Material result; // *aZoneFileStream >> result.namePtr; @@ -549,7 +593,7 @@ bool ZoneFile_COD6_360::Load(const QByteArray aFileData) { // return result; // } -// Image ZoneFile_COD6_360::pParseAsset_Image(QDataStream *aZoneFileStream) { +// Image ZoneFile_COD6_360::pParseASSET_TYPE_IMAGE(QDataStream *aZoneFileStream) { // Image result; // aZoneFileStream->skipRawData(4); @@ -618,7 +662,7 @@ bool ZoneFile_COD6_360::Load(const QByteArray aFileData) { // return result; // } -// SoundAliasList ZoneFile_COD6_360::pParseAsset_Sound(QDataStream *aZoneFileStream) { +// SoundAliasList ZoneFile_COD6_360::pParseASSET_TYPE_SOUND(QDataStream *aZoneFileStream) { // LoadedSound result; // return result; @@ -745,19 +789,19 @@ bool ZoneFile_COD6_360::Load(const QByteArray aFileData) { // Q_UNUSED(aZoneFileStream); // } -// void ZoneFile_COD6_360::pParseAsset_SoundDriver(QDataStream *aZoneFileStream) { +// void ZoneFile_COD6_360::pParseASSET_TYPE_SOUNDDriver(QDataStream *aZoneFileStream) { // Q_UNUSED(aZoneFileStream); // } -// void ZoneFile_COD6_360::pParseAsset_AIType(QDataStream *aZoneFileStream) { +// void ZoneFile_COD6_360::pParseASSET_TYPE_AITYPE(QDataStream *aZoneFileStream) { // Q_UNUSED(aZoneFileStream); // } -// void ZoneFile_COD6_360::pParseAsset_FX(QDataStream *aZoneFileStream) { +// void ZoneFile_COD6_360::pParseASSET_TYPE_FX(QDataStream *aZoneFileStream) { // Q_UNUSED(aZoneFileStream); // } -// Animation ZoneFile_COD6_360::pParseAsset_Animation(QDataStream *aZoneFileStream) { +// Animation ZoneFile_COD6_360::pParseASSET_TYPE_XANIMPARTS(QDataStream *aZoneFileStream) { // Animation result; // aZoneFileStream->skipRawData(4); @@ -825,7 +869,7 @@ bool ZoneFile_COD6_360::Load(const QByteArray aFileData) { // return result; // } -// MenuDef ZoneFile_COD6_360::pParseAsset_MenuDef(QDataStream *aZoneFileStream) { +// MenuDef ZoneFile_COD6_360::pParseASSET_TYPE_MENUDef(QDataStream *aZoneFileStream) { // //MENU_FILE // MenuDef result; @@ -1049,17 +1093,17 @@ bool ZoneFile_COD6_360::Load(const QByteArray aFileData) { // return result; // } -// void ZoneFile_COD6_360::pParseAsset_Weapon(QDataStream *aZoneFileStream) { +// void ZoneFile_COD6_360::pParseASSET_TYPE_WEAPON(QDataStream *aZoneFileStream) { // //WEAPON_FILE // Q_UNUSED(aZoneFileStream); // } -// void ZoneFile_COD6_360::pParseAsset_D3DBSP(QDataStream *aZoneFileStream) { +// void ZoneFile_COD6_360::pParseASSET_TYPE_D3DBSP(QDataStream *aZoneFileStream) { // //D3DBSP_DUMP // Q_UNUSED(aZoneFileStream); // } -// StringTable ZoneFile_COD6_360::pParseAsset_StringTable(QDataStream *aZoneFileStream) { +// StringTable ZoneFile_COD6_360::pParseASSET_TYPE_STRINGTABLE(QDataStream *aZoneFileStream) { // StringTable result; // aZoneFileStream->skipRawData(4); @@ -1114,97 +1158,3 @@ bool ZoneFile_COD6_360::Load(const QByteArray aFileData) { // } // return result; // } - -Utils::AssetType ZoneFile_COD6_360::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "00000000") { - return Utils::ASSET_PHYSPRESET; - } else if (cleanedType == "00000001") { - return Utils::ASSET_PHYSCOLLMAP; - } else if (cleanedType == "00000002") { - return Utils::ASSET_Animation; - } else if (cleanedType == "00000003") { - return Utils::ASSET_XMODEL_SURFS; - } else if (cleanedType == "00000004") { - return Utils::ASSET_XMODEL; - } else if (cleanedType == "00000005") { - return Utils::ASSET_MATERIAL; - } else if (cleanedType == "00000006") { - return Utils::ASSET_PIXELSHADER; - } else if (cleanedType == "00000007") { - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "00000008") { - return Utils::ASSET_IMAGE; - } else if (cleanedType == "00000009") { - return Utils::ASSET_SOUND; - } else if (cleanedType == "0000000A") { - return Utils::ASSET_SOUND_CURVE; - } else if (cleanedType == "0000000B") { - return Utils::ASSET_LOADED_SOUND; - } else if (cleanedType == "0000000C") { - return Utils::ASSET_CLIPMAP_SP; - } else if (cleanedType == "0000000D") { - return Utils::ASSET_CLIPMAP_MP; - } else if (cleanedType == "0000000E") { - return Utils::ASSET_COMWORLD; - } else if (cleanedType == "0000000F") { - return Utils::ASSET_GAMEWORLD_SP; - } else if (cleanedType == "00000010") { - return Utils::ASSET_GAMEWORLD_MP; - } else if (cleanedType == "00000011") { - return Utils::ASSET_MAP_ENTS; - } else if (cleanedType == "00000012") { - return Utils::ASSET_FXWORLD; - } else if (cleanedType == "00000013") { - return Utils::ASSET_GFXWORLD; - } else if (cleanedType == "00000014") { - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "00000015") { - return Utils::ASSET_UI_MAP; - } else if (cleanedType == "00000016") { - return Utils::ASSET_FONT; - } else if (cleanedType == "00000017") { - return Utils::ASSET_MENULIST; - } else if (cleanedType == "00000018") { - return Utils::ASSET_MENU; - } else if (cleanedType == "00000019") { - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "0000001A") { - return Utils::ASSET_WEAPON; - } else if (cleanedType == "0000001B") { - return Utils::ASSET_SNDDRIVER_GLOBALS; - } else if (cleanedType == "0000001C") { - return Utils::ASSET_FX; - } else if (cleanedType == "0000001D") { - return Utils::ASSET_IMPACT_FX; - } else if (cleanedType == "0000001E") { - return Utils::ASSET_AITYPE; - } else if (cleanedType == "0000001F") { - return Utils::ASSET_MPTYPE; - } else if (cleanedType == "00000020") { - return Utils::ASSET_CHARACTER; - } else if (cleanedType == "00000021") { - return Utils::ASSET_XMODELALIAS; - } else if (cleanedType == "00000022") { - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "00000023") { - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "00000024") { - return Utils::ASSET_LEADERBOARD; - } else if (cleanedType == "00000025") { - return Utils::ASSET_STRUCTURED_DATA_DEF; - } else if (cleanedType == "00000026") { - return Utils::ASSET_TRACER; - } else if (cleanedType == "00000027") { - return Utils::ASSET_VEHICLE; - } else if (cleanedType == "00000028") { - return Utils::ASSET_ADDON_MAP_ENTS; - } else if (cleanedType == "00000029") { - return Utils::ASSET_COUNT; - } else if (cleanedType == "00000029") { - return Utils::ASSET_STRING; - } else if (cleanedType == "0000002A") { - return Utils::ASSET_ASSETLIST; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/360/zonefile_cod6_360.h b/libs/zonefile/360/zonefile_cod6_360.h index afdf949..e61db51 100644 --- a/libs/zonefile/360/zonefile_cod6_360.h +++ b/libs/zonefile/360/zonefile_cod6_360.h @@ -12,7 +12,7 @@ public: ~ZoneFile_COD6_360(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD6_360_H diff --git a/libs/zonefile/360/zonefile_cod7_360.cpp b/libs/zonefile/360/zonefile_cod7_360.cpp index d343500..4b44bd3 100644 --- a/libs/zonefile/360/zonefile_cod7_360.cpp +++ b/libs/zonefile/360/zonefile_cod7_360.cpp @@ -5,8 +5,54 @@ #include ZoneFile_COD7_360::ZoneFile_COD7_360() + : ZoneFile() { - + pSetType(0, ASSET_TYPE_XMODELPIECES); + pSetType(1, ASSET_TYPE_PHYSPRESET); + pSetType(2, ASSET_TYPE_PHYSCONSTRAINTS); + pSetType(3, ASSET_TYPE_DESTRUCTIBLEDEF); + pSetType(4, ASSET_TYPE_XANIMPARTS); + pSetType(5, ASSET_TYPE_XMODEL); + pSetType(6, ASSET_TYPE_MATERIAL); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(8, ASSET_TYPE_IMAGE); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(10, ASSET_TYPE_SOUND_PATCH); + pSetType(11, ASSET_TYPE_CLIPMAP); + pSetType(12, ASSET_TYPE_CLIPMAP_PVS); + pSetType(13, ASSET_TYPE_COMWORLD); + pSetType(14, ASSET_TYPE_GAMEWORLD_SP); + pSetType(15, ASSET_TYPE_GAMEWORLD_MP); + pSetType(16, ASSET_TYPE_MAP_ENTS); + pSetType(17, ASSET_TYPE_GFXWORLD); + pSetType(18, ASSET_TYPE_LIGHT_DEF); + pSetType(19, ASSET_TYPE_UI_MAP); + pSetType(20, ASSET_TYPE_FONT); + pSetType(21, ASSET_TYPE_MENULIST); + pSetType(22, ASSET_TYPE_MENU); + pSetType(23, ASSET_TYPE_LOCALIZE_ENTRY); + pSetType(24, ASSET_TYPE_WEAPON); + pSetType(25, ASSET_TYPE_WEAPONDEF); + pSetType(26, ASSET_TYPE_WEAPON_VARIANT); + pSetType(27, ASSET_TYPE_SNDDRIVER_GLOBALS); + pSetType(28, ASSET_TYPE_FX); + pSetType(29, ASSET_TYPE_IMPACT_FX); + pSetType(30, ASSET_TYPE_AITYPE); + pSetType(31, ASSET_TYPE_MPTYPE); + pSetType(32, ASSET_TYPE_MPBODY); + pSetType(33, ASSET_TYPE_MPHEAD); + pSetType(34, ASSET_TYPE_CHARACTER); + pSetType(35, ASSET_TYPE_XMODELALIAS); + pSetType(36, ASSET_TYPE_RAWFILE); + pSetType(37, ASSET_TYPE_STRINGTABLE); + pSetType(38, ASSET_TYPE_PACK_INDEX); + pSetType(39, ASSET_TYPE_XGLOBALS); + pSetType(40, ASSET_TYPE_DDL); + pSetType(41, ASSET_TYPE_GLASSES); + pSetType(42, ASSET_TYPE_EMBLEMSET); + pSetType(43, ASSET_TYPE_COUNT); + pSetType(44, ASSET_TYPE_STRING); + pSetType(45, ASSET_TYPE_ASSETLIST); } ZoneFile_COD7_360::~ZoneFile_COD7_360() @@ -17,101 +63,3 @@ ZoneFile_COD7_360::~ZoneFile_COD7_360() bool ZoneFile_COD7_360::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD7_360::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "00000000") { - return Utils::ASSET_XMODELPIECES; - } else if (cleanedType == "00000001") { - return Utils::ASSET_PHYSPRESET; - } else if (cleanedType == "00000002") { - return Utils::ASSET_PHYSCONSTRAINTS; - } else if (cleanedType == "00000003") { - return Utils::ASSET_DESTRUCTIBLEDEF; - } else if (cleanedType == "00000004") { - return Utils::ASSET_Animation; - } else if (cleanedType == "00000005") { - return Utils::ASSET_XMODEL; - } else if (cleanedType == "00000006") { - return Utils::ASSET_MATERIAL; - } else if (cleanedType == "00000007") { - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "00000008") { - return Utils::ASSET_IMAGE; - } else if (cleanedType == "00000009") { - return Utils::ASSET_SOUND; - } else if (cleanedType == "0000000A") { - return Utils::ASSET_SOUND_PATCH; - } else if (cleanedType == "0000000B") { - return Utils::ASSET_CLIPMAP; - } else if (cleanedType == "0000000C") { - return Utils::ASSET_CLIPMAP_PVS; - } else if (cleanedType == "0000000D") { - return Utils::ASSET_COMWORLD; - } else if (cleanedType == "0000000E") { - return Utils::ASSET_GAMEWORLD_SP; - } else if (cleanedType == "0000000F") { - return Utils::ASSET_GAMEWORLD_MP; - } else if (cleanedType == "00000010") { - return Utils::ASSET_MAP_ENTS; - } else if (cleanedType == "00000011") { - return Utils::ASSET_GFXWORLD; - } else if (cleanedType == "00000012") { - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "00000013") { - return Utils::ASSET_UI_MAP; - } else if (cleanedType == "00000014") { - return Utils::ASSET_FONT; - } else if (cleanedType == "00000015") { - return Utils::ASSET_MENULIST; - } else if (cleanedType == "00000016") { - return Utils::ASSET_MENU; - } else if (cleanedType == "00000017") { - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "00000018") { - return Utils::ASSET_WEAPON; - } else if (cleanedType == "00000019") { - return Utils::ASSET_WEAPONDEF; - } else if (cleanedType == "0000001A") { - return Utils::ASSET_WEAPON_VARIANT; - } else if (cleanedType == "0000001B") { - return Utils::ASSET_SNDDRIVER_GLOBALS; - } else if (cleanedType == "0000001C") { - return Utils::ASSET_FX; - } else if (cleanedType == "0000001D") { - return Utils::ASSET_IMPACT_FX; - } else if (cleanedType == "0000001E") { - return Utils::ASSET_AITYPE; - } else if (cleanedType == "0000001F") { - return Utils::ASSET_MPTYPE; - } else if (cleanedType == "00000020") { - return Utils::ASSET_MPBODY; - } else if (cleanedType == "00000021") { - return Utils::ASSET_MPHEAD; - } else if (cleanedType == "00000022") { - return Utils::ASSET_CHARACTER; - } else if (cleanedType == "00000023") { - return Utils::ASSET_XMODELALIAS; - } else if (cleanedType == "00000024") { - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "00000025") { - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "00000026") { - return Utils::ASSET_PACK_INDEX; - } else if (cleanedType == "00000027") { - return Utils::ASSET_XGLOBALS; - } else if (cleanedType == "00000028") { - return Utils::ASSET_DDL; - } else if (cleanedType == "00000029") { - return Utils::ASSET_GLASSES; - } else if (cleanedType == "0000002A") { - return Utils::ASSET_EMBLEMSET; - } else if (cleanedType == "0000002B") { - return Utils::ASSET_COUNT; - } else if (cleanedType == "0000002B") { - return Utils::ASSET_STRING; - } else if (cleanedType == "0000002C") { - return Utils::ASSET_ASSETLIST; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/360/zonefile_cod7_360.h b/libs/zonefile/360/zonefile_cod7_360.h index 07af1e6..34c8ba4 100644 --- a/libs/zonefile/360/zonefile_cod7_360.h +++ b/libs/zonefile/360/zonefile_cod7_360.h @@ -10,7 +10,7 @@ public: ~ZoneFile_COD7_360(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD7_360_H diff --git a/libs/zonefile/360/zonefile_cod8_360.cpp b/libs/zonefile/360/zonefile_cod8_360.cpp index c46a4d7..ef85447 100644 --- a/libs/zonefile/360/zonefile_cod8_360.cpp +++ b/libs/zonefile/360/zonefile_cod8_360.cpp @@ -5,8 +5,57 @@ #include ZoneFile_COD8_360::ZoneFile_COD8_360() + : ZoneFile() { - + pSetType(0, ASSET_TYPE_PHYSPRESET); + pSetType(1, ASSET_TYPE_PHYSCOLLMAP); + pSetType(2, ASSET_TYPE_XANIMPARTS); + pSetType(3, ASSET_TYPE_XMODEL_SURFS); + pSetType(4, ASSET_TYPE_XMODEL); + pSetType(5, ASSET_TYPE_MATERIAL); + pSetType(6, ASSET_TYPE_PIXELSHADER); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(8, ASSET_TYPE_IMAGE); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(10, ASSET_TYPE_SOUND_CURVE); + pSetType(11, ASSET_TYPE_LOADED_SOUND); + pSetType(12, ASSET_TYPE_CLIPMAP); + pSetType(13, ASSET_TYPE_COMWORLD); + pSetType(14, ASSET_TYPE_GAMEWORLD_SP); + pSetType(15, ASSET_TYPE_GAMEWORLD_MP); + pSetType(16, ASSET_TYPE_GLASSWORLD); + pSetType(17, ASSET_TYPE_PATHDATA); + pSetType(18, ASSET_TYPE_VEHICLE_TRACK); + pSetType(19, ASSET_TYPE_MAP_ENTS); + pSetType(20, ASSET_TYPE_FXWORLD); + pSetType(21, ASSET_TYPE_GFXWORLD); + pSetType(22, ASSET_TYPE_LIGHT_DEF); + pSetType(23, ASSET_TYPE_UI_MAP); + pSetType(24, ASSET_TYPE_FONT); + pSetType(25, ASSET_TYPE_MENULIST); + pSetType(26, ASSET_TYPE_MENU); + pSetType(27, ASSET_TYPE_LOCALIZE_ENTRY); + pSetType(28, ASSET_TYPE_ATTACHMENT); + pSetType(29, ASSET_TYPE_WEAPON); + pSetType(30, ASSET_TYPE_SNDDRIVER_GLOBALS); + pSetType(31, ASSET_TYPE_FX); + pSetType(32, ASSET_TYPE_IMPACT_FX); + pSetType(33, ASSET_TYPE_SURFACE_FX); + pSetType(34, ASSET_TYPE_AITYPE); + pSetType(35, ASSET_TYPE_MPTYPE); + pSetType(36, ASSET_TYPE_CHARACTER); + pSetType(37, ASSET_TYPE_XMODELALIAS); + pSetType(38, ASSET_TYPE_RAWFILE); + pSetType(39, ASSET_TYPE_SCRIPTFILE); + pSetType(40, ASSET_TYPE_STRINGTABLE); + pSetType(41, ASSET_TYPE_LEADERBOARD); + pSetType(42, ASSET_TYPE_STRUCTURED_DATA_DEF); + pSetType(43, ASSET_TYPE_TRACER); + pSetType(44, ASSET_TYPE_VEHICLE); + pSetType(45, ASSET_TYPE_ADDON_MAP_ENTS); + pSetType(46, ASSET_TYPE_COUNT); + pSetType(47, ASSET_TYPE_STRING); + pSetType(48, ASSET_TYPE_ASSETLIST); } ZoneFile_COD8_360::~ZoneFile_COD8_360() @@ -17,102 +66,3 @@ ZoneFile_COD8_360::~ZoneFile_COD8_360() bool ZoneFile_COD8_360::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD8_360::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper();if (cleanedType == "0x00000000") { - return Utils::ASSET_PHYSPRESET; - } else if (cleanedType == "0x00000001") { - return Utils::ASSET_PHYSCOLLMAP; - } else if (cleanedType == "0x00000002") { - return Utils::ASSET_Animation; - } else if (cleanedType == "0x00000003") { - return Utils::ASSET_XMODEL_SURFS; - } else if (cleanedType == "0x00000004") { - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0x00000005") { - return Utils::ASSET_MATERIAL; - } else if (cleanedType == "0x00000006") { - return Utils::ASSET_PIXELSHADER; - } else if (cleanedType == "0x00000007") { - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "0x00000008") { - return Utils::ASSET_IMAGE; - } else if (cleanedType == "0x00000009") { - return Utils::ASSET_SOUND; - } else if (cleanedType == "0x0000000A") { - return Utils::ASSET_SOUND_CURVE; - } else if (cleanedType == "0x0000000B") { - return Utils::ASSET_LOADED_SOUND; - } else if (cleanedType == "0x0000000C") { - return Utils::ASSET_CLIPMAP; - } else if (cleanedType == "0x0000000D") { - return Utils::ASSET_COMWORLD; - } else if (cleanedType == "0x0000000E") { - return Utils::ASSET_GLASSWORLD; - } else if (cleanedType == "0x0000000F") { - return Utils::ASSET_PATHDATA; - } else if (cleanedType == "0x00000010") { - return Utils::ASSET_VEHICLE_TRACK; - } else if (cleanedType == "0x00000011") { - return Utils::ASSET_MAP_ENTS; - } else if (cleanedType == "0x00000012") { - return Utils::ASSET_FXWORLD; - } else if (cleanedType == "0x00000013") { - return Utils::ASSET_GFXWORLD; - } else if (cleanedType == "0x00000014") { - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "0x00000015") { - return Utils::ASSET_UI_MAP; - } else if (cleanedType == "0x00000016") { - return Utils::ASSET_FONT; - } else if (cleanedType == "0x00000017") { - return Utils::ASSET_MENULIST; - } else if (cleanedType == "0x00000018") { - return Utils::ASSET_MENU; - } else if (cleanedType == "0x00000019") { - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "0x0000001A") { - return Utils::ASSET_ATTACHMENT; - } else if (cleanedType == "0x0000001B") { - return Utils::ASSET_WEAPON; - } else if (cleanedType == "0x0000001C") { - return Utils::ASSET_SNDDRIVER_GLOBALS; - } else if (cleanedType == "0x0000001D") { - return Utils::ASSET_FX; - } else if (cleanedType == "0x0000001E") { - return Utils::ASSET_IMPACT_FX; - } else if (cleanedType == "0x0000001F") { - return Utils::ASSET_SURFACE_FX; - } else if (cleanedType == "0x00000020") { - return Utils::ASSET_AITYPE; - } else if (cleanedType == "0x00000021") { - return Utils::ASSET_MPTYPE; - } else if (cleanedType == "0x00000022") { - return Utils::ASSET_CHARACTER; - } else if (cleanedType == "0x00000023") { - return Utils::ASSET_XMODELALIAS; - } else if (cleanedType == "0x00000024") { - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "0x00000025") { - return Utils::ASSET_SCRIPTFILE; - } else if (cleanedType == "0x00000026") { - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "0x00000027") { - return Utils::ASSET_LEADERBOARD; - } else if (cleanedType == "0x00000028") { - return Utils::ASSET_STRUCTURED_DATA_DEF; - } else if (cleanedType == "0x00000029") { - return Utils::ASSET_TRACER; - } else if (cleanedType == "0x0000002A") { - return Utils::ASSET_VEHICLE; - } else if (cleanedType == "0x0000002B") { - return Utils::ASSET_ADDON_MAP_ENTS; - } else if (cleanedType == "0x0000002C") { - return Utils::ASSET_COUNT; - } else if (cleanedType == "0x0000002C") { - return Utils::ASSET_STRING; - } else if (cleanedType == "0x0000002D") { - return Utils::ASSET_ASSETLIST; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/360/zonefile_cod8_360.h b/libs/zonefile/360/zonefile_cod8_360.h index 453012d..874e71c 100644 --- a/libs/zonefile/360/zonefile_cod8_360.h +++ b/libs/zonefile/360/zonefile_cod8_360.h @@ -10,7 +10,7 @@ public: ~ZoneFile_COD8_360(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD8_360_H diff --git a/libs/zonefile/360/zonefile_cod9_360.cpp b/libs/zonefile/360/zonefile_cod9_360.cpp index 97c11d4..f0a9f7e 100644 --- a/libs/zonefile/360/zonefile_cod9_360.cpp +++ b/libs/zonefile/360/zonefile_cod9_360.cpp @@ -5,8 +5,26 @@ #include ZoneFile_COD9_360::ZoneFile_COD9_360() + : ZoneFile() { - + pSetType(4, ASSET_TYPE_XANIMPARTS); + pSetType(5, ASSET_TYPE_XMODEL); + pSetType(6, ASSET_TYPE_IMAGE); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(11, ASSET_TYPE_COL_MAP_SP); + pSetType(12, ASSET_TYPE_COLLISION_MAP); + pSetType(13, ASSET_TYPE_D3DBSP); + pSetType(14, ASSET_TYPE_GAME_MAP_SP); + pSetType(17, ASSET_TYPE_GFX_MAP); + pSetType(18, ASSET_TYPE_LIGHT_DEF); + //pSetType(18, ASSET_TYPE_WEAPON); + pSetType(20, ASSET_TYPE_FONT); + pSetType(21, ASSET_TYPE_MENU); + pSetType(26, ASSET_TYPE_FX); + pSetType(32, ASSET_TYPE_RAWFILE); + pSetType(33, ASSET_TYPE_STRINGTABLE); + pSetType(42, ASSET_TYPE_LOCALIZE_ENTRY); } ZoneFile_COD9_360::~ZoneFile_COD9_360() @@ -17,45 +35,3 @@ ZoneFile_COD9_360::~ZoneFile_COD9_360() bool ZoneFile_COD9_360::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD9_360::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "17000000") { // localized string PARTIALLY VERIFIED - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "20000000") { // raw_file PARTIALLY VERIFIED - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "1A000000") { // fx PARTIALLY VERIFIED - return Utils::ASSET_FX; - } else if (cleanedType == "09000000") { // loaded_sound PARTIALLY VERIFIED - return Utils::ASSET_SOUND; - } else if (cleanedType == "04000000") { // x_anim PARTIALLY VERIFIED - return Utils::ASSET_Animation; - } else if (cleanedType == "0C000000") { // collision_map PARTIALLY VERIFIED - return Utils::ASSET_COLLISION_MAP; - } else if (cleanedType == "21000000") { // string_table PARTIALLY VERIFIED - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "15000000") { // menu_file PARTIALLY VERIFIED - return Utils::ASSET_MENU; - } else if (cleanedType == "07000000") { // tech set PARTIALLY VERIFIED - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "18000000") { // weapon PARTIALLY VERIFIED - return Utils::ASSET_WEAPON; - } else if (cleanedType == "11000000") { // gfx map PARTIALLY VERIFIED - return Utils::ASSET_GFX_MAP; - } else if (cleanedType == "12000000") { // light_def PARTIALLY VERIFIED - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "14000000") { // font PARTIALLY VERIFIED - return Utils::ASSET_FONT; - } else if (cleanedType == "05000000") { // xmodel PARTIALLY VERIFIED - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0D000000") { // d3dbsp PARTIALLY VERIFIED - return Utils::ASSET_D3DBSP; - } else if (cleanedType == "06000000") { // image PARTIALLY VERIFIED - return Utils::ASSET_IMAGE; - } else if (cleanedType == "0E000000") { // game map sp PARTIALLY VERIFIED - return Utils::ASSET_GAME_MAP_SP; - } else if (cleanedType == "0B000000") { // col map sp PARTIALLY VERIFIED - return Utils::ASSET_COL_MAP_SP; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/360/zonefile_cod9_360.h b/libs/zonefile/360/zonefile_cod9_360.h index ff7341c..390bc7a 100644 --- a/libs/zonefile/360/zonefile_cod9_360.h +++ b/libs/zonefile/360/zonefile_cod9_360.h @@ -10,7 +10,7 @@ public: ~ZoneFile_COD9_360(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD9_360_H diff --git a/libs/zonefile/PC/zonefile_cod10_pc.cpp b/libs/zonefile/PC/zonefile_cod10_pc.cpp index 74cb021..e99eeb3 100644 --- a/libs/zonefile/PC/zonefile_cod10_pc.cpp +++ b/libs/zonefile/PC/zonefile_cod10_pc.cpp @@ -1,12 +1,26 @@ #include "zonefile_cod10_pc.h" -#include -#include -#include - ZoneFile_COD10_PC::ZoneFile_COD10_PC() + : ZoneFile() { - + pSetType(4, ASSET_TYPE_XANIMPARTS); + pSetType(5, ASSET_TYPE_XMODEL); + pSetType(6, ASSET_TYPE_IMAGE); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(11, ASSET_TYPE_COL_MAP_SP); + pSetType(12, ASSET_TYPE_COLLISION_MAP); + pSetType(13, ASSET_TYPE_D3DBSP); + pSetType(14, ASSET_TYPE_GAME_MAP_SP); + pSetType(17, ASSET_TYPE_GFX_MAP); + pSetType(18, ASSET_TYPE_LIGHT_DEF); + pSetType(20, ASSET_TYPE_FONT); + pSetType(21, ASSET_TYPE_MENU); + pSetType(23, ASSET_TYPE_LOCALIZE_ENTRY); + pSetType(24, ASSET_TYPE_WEAPON); + pSetType(26, ASSET_TYPE_FX); + pSetType(32, ASSET_TYPE_RAWFILE); + pSetType(33, ASSET_TYPE_STRINGTABLE); } ZoneFile_COD10_PC::~ZoneFile_COD10_PC() @@ -17,44 +31,3 @@ ZoneFile_COD10_PC::~ZoneFile_COD10_PC() bool ZoneFile_COD10_PC::Load(const QByteArray aFileData) { return true; } -Utils::AssetType ZoneFile_COD10_PC::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "17000000") { // localized string PARTIALLY VERIFIED - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "20000000") { // raw_file PARTIALLY VERIFIED - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "1A000000") { // fx PARTIALLY VERIFIED - return Utils::ASSET_FX; - } else if (cleanedType == "09000000") { // loaded_sound PARTIALLY VERIFIED - return Utils::ASSET_SOUND; - } else if (cleanedType == "04000000") { // x_anim PARTIALLY VERIFIED - return Utils::ASSET_Animation; - } else if (cleanedType == "0C000000") { // collision_map PARTIALLY VERIFIED - return Utils::ASSET_COLLISION_MAP; - } else if (cleanedType == "21000000") { // string_table PARTIALLY VERIFIED - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "15000000") { // menu_file PARTIALLY VERIFIED - return Utils::ASSET_MENU; - } else if (cleanedType == "07000000") { // tech set PARTIALLY VERIFIED - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "18000000") { // weapon PARTIALLY VERIFIED - return Utils::ASSET_WEAPON; - } else if (cleanedType == "11000000") { // gfx map PARTIALLY VERIFIED - return Utils::ASSET_GFX_MAP; - } else if (cleanedType == "12000000") { // light_def PARTIALLY VERIFIED - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "14000000") { // font PARTIALLY VERIFIED - return Utils::ASSET_FONT; - } else if (cleanedType == "05000000") { // xmodel PARTIALLY VERIFIED - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0D000000") { // d3dbsp PARTIALLY VERIFIED - return Utils::ASSET_D3DBSP; - } else if (cleanedType == "06000000") { // image PARTIALLY VERIFIED - return Utils::ASSET_IMAGE; - } else if (cleanedType == "0E000000") { // game map sp PARTIALLY VERIFIED - return Utils::ASSET_GAME_MAP_SP; - } else if (cleanedType == "0B000000") { // col map sp PARTIALLY VERIFIED - return Utils::ASSET_COL_MAP_SP; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/PC/zonefile_cod10_pc.h b/libs/zonefile/PC/zonefile_cod10_pc.h index 564b023..5307fb1 100644 --- a/libs/zonefile/PC/zonefile_cod10_pc.h +++ b/libs/zonefile/PC/zonefile_cod10_pc.h @@ -10,7 +10,7 @@ public: ~ZoneFile_COD10_PC(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD10_PC_H diff --git a/libs/zonefile/PC/zonefile_cod11_pc.cpp b/libs/zonefile/PC/zonefile_cod11_pc.cpp index d81803d..904e5ca 100644 --- a/libs/zonefile/PC/zonefile_cod11_pc.cpp +++ b/libs/zonefile/PC/zonefile_cod11_pc.cpp @@ -1,12 +1,26 @@ #include "zonefile_cod11_pc.h" -#include -#include -#include - ZoneFile_COD11_PC::ZoneFile_COD11_PC() + : ZoneFile() { - + pSetType(4, ASSET_TYPE_XANIMPARTS); + pSetType(5, ASSET_TYPE_XMODEL); + pSetType(6, ASSET_TYPE_IMAGE); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(11, ASSET_TYPE_COL_MAP_SP); + pSetType(12, ASSET_TYPE_COLLISION_MAP); + pSetType(13, ASSET_TYPE_D3DBSP); + pSetType(14, ASSET_TYPE_GAME_MAP_SP); + pSetType(17, ASSET_TYPE_GFX_MAP); + pSetType(18, ASSET_TYPE_LIGHT_DEF); + pSetType(20, ASSET_TYPE_FONT); + pSetType(21, ASSET_TYPE_MENU); + pSetType(23, ASSET_TYPE_LOCALIZE_ENTRY); + pSetType(24, ASSET_TYPE_WEAPON); + pSetType(26, ASSET_TYPE_FX); + pSetType(32, ASSET_TYPE_RAWFILE); + pSetType(33, ASSET_TYPE_STRINGTABLE); } ZoneFile_COD11_PC::~ZoneFile_COD11_PC() @@ -17,45 +31,3 @@ ZoneFile_COD11_PC::~ZoneFile_COD11_PC() bool ZoneFile_COD11_PC::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD11_PC::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "17000000") { // localized string PARTIALLY VERIFIED - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "20000000") { // raw_file PARTIALLY VERIFIED - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "1A000000") { // fx PARTIALLY VERIFIED - return Utils::ASSET_FX; - } else if (cleanedType == "09000000") { // loaded_sound PARTIALLY VERIFIED - return Utils::ASSET_SOUND; - } else if (cleanedType == "04000000") { // x_anim PARTIALLY VERIFIED - return Utils::ASSET_Animation; - } else if (cleanedType == "0C000000") { // collision_map PARTIALLY VERIFIED - return Utils::ASSET_COLLISION_MAP; - } else if (cleanedType == "21000000") { // string_table PARTIALLY VERIFIED - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "15000000") { // menu_file PARTIALLY VERIFIED - return Utils::ASSET_MENU; - } else if (cleanedType == "07000000") { // tech set PARTIALLY VERIFIED - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "18000000") { // weapon PARTIALLY VERIFIED - return Utils::ASSET_WEAPON; - } else if (cleanedType == "11000000") { // gfx map PARTIALLY VERIFIED - return Utils::ASSET_GFX_MAP; - } else if (cleanedType == "12000000") { // light_def PARTIALLY VERIFIED - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "14000000") { // font PARTIALLY VERIFIED - return Utils::ASSET_FONT; - } else if (cleanedType == "05000000") { // xmodel PARTIALLY VERIFIED - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0D000000") { // d3dbsp PARTIALLY VERIFIED - return Utils::ASSET_D3DBSP; - } else if (cleanedType == "06000000") { // image PARTIALLY VERIFIED - return Utils::ASSET_IMAGE; - } else if (cleanedType == "0E000000") { // game map sp PARTIALLY VERIFIED - return Utils::ASSET_GAME_MAP_SP; - } else if (cleanedType == "0B000000") { // col map sp PARTIALLY VERIFIED - return Utils::ASSET_COL_MAP_SP; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/PC/zonefile_cod11_pc.h b/libs/zonefile/PC/zonefile_cod11_pc.h index b7adaba..ed8d199 100644 --- a/libs/zonefile/PC/zonefile_cod11_pc.h +++ b/libs/zonefile/PC/zonefile_cod11_pc.h @@ -10,7 +10,7 @@ public: ~ZoneFile_COD11_PC(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD11_H diff --git a/libs/zonefile/PC/zonefile_cod12_pc.cpp b/libs/zonefile/PC/zonefile_cod12_pc.cpp index 70bddb0..a9d38ef 100644 --- a/libs/zonefile/PC/zonefile_cod12_pc.cpp +++ b/libs/zonefile/PC/zonefile_cod12_pc.cpp @@ -1,12 +1,74 @@ #include "zonefile_cod12_pc.h" -#include -#include -#include - ZoneFile_COD12_PC::ZoneFile_COD12_PC() + : ZoneFile() { - + pSetType(0, ASSET_TYPE_PHYSPRESET); + pSetType(1, ASSET_TYPE_PHYS_CONSTRAINTS); + pSetType(2, ASSET_TYPE_DESTRUCTIBLE_DEF); + pSetType(3, ASSET_TYPE_XANIMPARTS); + pSetType(4, ASSET_TYPE_XMODEL); + pSetType(5, ASSET_TYPE_XMODEL_MESH); + pSetType(6, ASSET_TYPE_MATERIAL); + pSetType(7, ASSET_TYPE_COMPUTE_SHADER_SET); + pSetType(8, ASSET_TYPE_TECHNIQUE_SET); + pSetType(9, ASSET_TYPE_IMAGE); + pSetType(10, ASSET_TYPE_SOUND); + pSetType(17, ASSET_TYPE_LIGHT_DEF); + pSetType(21, ASSET_TYPE_FONT_ICON); + pSetType(23, ASSET_TYPE_WEAPON); + pSetType(27, ASSET_TYPE_CG_MEDIA_TABLE); + pSetType(28, ASSET_TYPE_PLAYER_SOUNDS_TABLE); + pSetType(29, ASSET_TYPE_PLAYER_FX_TABLE); + pSetType(30, ASSET_TYPE_SHARED_WEAPON_SOUNDS); + pSetType(31, ASSET_TYPE_ATTACHMENT); + pSetType(32, ASSET_TYPE_ATTACHMENT_UNIQUE); + pSetType(33, ASSET_TYPE_WEAPON_CAMO); + pSetType(34, ASSET_TYPE_CUSTOMIZATION_TABLE); + pSetType(35, ASSET_TYPE_CUSTOMIZATION_TABLE_FEIMAGES); + pSetType(36, ASSET_TYPE_CUSTOMIZATION_TABLE_COLOR); + pSetType(38, ASSET_TYPE_FX); + pSetType(47, ASSET_TYPE_RAWFILE); + pSetType(48, ASSET_TYPE_STRINGTABLE); + pSetType(49, ASSET_TYPE_STRUCTURED_TABLE); + pSetType(50, ASSET_TYPE_LEADERBOARD_DEF); + pSetType(51, ASSET_TYPE_DDL); + pSetType(54, ASSET_TYPE_SCRIPT_PARSE_TREE); + pSetType(55, ASSET_TYPE_KEY_VALUE_PAIRS); + pSetType(56, ASSET_TYPE_VEHICLE); + pSetType(58, ASSET_TYPE_VEHICLE_TRACER); + pSetType(60, ASSET_TYPE_SURFACE_FX_TABLE); + pSetType(61, ASSET_TYPE_SURFACE_SOUND_DEF); + pSetType(62, ASSET_TYPE_FOOTSTEP_TABLE); + pSetType(63, ASSET_TYPE_ENTITY_FX_IMPACTS); + pSetType(64, ASSET_TYPE_ENTITY_SOUND_IMPACTS); + pSetType(66, ASSET_TYPE_VEHICLE_FX_DEF); + pSetType(67, ASSET_TYPE_VEHICLE_SOUND_DEF); + pSetType(69, ASSET_TYPE_SCRIPT_BUNDLE); + pSetType(70, ASSET_TYPE_SCRIPT_BUNDLE_LIST); + pSetType(71, ASSET_TYPE_RUMBLE); + pSetType(74, ASSET_TYPE_AIM_TABLE); + pSetType(75, ASSET_TYPE_ANIM_SELECTOR_TABLE); + pSetType(76, ASSET_TYPE_ANIM_MAPPING_TABLE); + pSetType(77, ASSET_TYPE_ANIM_STATE_MACHINE); + pSetType(78, ASSET_TYPE_BEHAVIOR_TREE); + pSetType(79, ASSET_TYPE_BEHAVIOR_STATE_MACHINE); + pSetType(81, ASSET_TYPE_S_ANIM); + pSetType(82, ASSET_TYPE_LIGHT_DEF); + pSetType(83, ASSET_TYPE_BIT_FIELD); + pSetType(84, ASSET_TYPE_SURFACE_SOUND_DEF); + pSetType(85, ASSET_TYPE_SURFACE_FX_TABLE); + pSetType(86, ASSET_TYPE_RUMBLE); + pSetType(89, ASSET_TYPE_AIM_TABLE); + pSetType(90, ASSET_TYPE_MAP_TABLE); + pSetType(91, ASSET_TYPE_MAP_TABLE_LOADING_IMAGES); + pSetType(92, ASSET_TYPE_MEDAL); + pSetType(93, ASSET_TYPE_MEDAL_TABLE); + pSetType(94, ASSET_TYPE_OBJECTIVE); + pSetType(95, ASSET_TYPE_OBJECTIVE_LIST); + pSetType(100, ASSET_TYPE_LASER); + pSetType(101, ASSET_TYPE_BEAM); + pSetType(102, ASSET_TYPE_STREAMER_HINT); } ZoneFile_COD12_PC::~ZoneFile_COD12_PC() @@ -17,143 +79,3 @@ ZoneFile_COD12_PC::~ZoneFile_COD12_PC() bool ZoneFile_COD12_PC::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD12_PC::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "0000000000000000") { - return Utils::ASSET_PHYSPRESET; - } else if (cleanedType == "0100000000000000") { - return Utils::ASSET_PHYS_CONSTRAINTS; - } else if (cleanedType == "0200000000000000") { - return Utils::ASSET_DESTRUCTIBLE_DEF; - } else if (cleanedType == "0300000000000000") { - return Utils::ASSET_Animation; - } else if (cleanedType == "0400000000000000") { - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0500000000000000") { - return Utils::ASSET_XMODEL_MESH; - } else if (cleanedType == "0600000000000000") { - return Utils::ASSET_MATERIAL; - } else if (cleanedType == "0700000000000000") { - return Utils::ASSET_COMPUTE_SHADER_SET; - } else if (cleanedType == "0800000000000000") { - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "0900000000000000") { - return Utils::ASSET_IMAGE; - } else if (cleanedType == "0A00000000000000") { - return Utils::ASSET_SOUND; - } else if (cleanedType == "1100000000000000") { - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "1500000000000000") { - return Utils::ASSET_FONT_ICON; - } else if (cleanedType == "1700000000000000") { - return Utils::ASSET_WEAPON; - } else if (cleanedType == "1C00000000000000") { - return Utils::ASSET_PLAYER_SOUNDS_TABLE; - } else if (cleanedType == "1D00000000000000") { - return Utils::ASSET_PLAYER_FX_TABLE; - } else if (cleanedType == "1E00000000000000") { - return Utils::ASSET_SHARED_WEAPON_SOUNDS; - } else if (cleanedType == "1F00000000000000") { - return Utils::ASSET_ATTACHMENT; - } else if (cleanedType == "2000000000000000") { - return Utils::ASSET_ATTACHMENT_UNIQUE; - } else if (cleanedType == "2100000000000000") { - return Utils::ASSET_WEAPON_CAMO; - } else if (cleanedType == "2200000000000000") { - return Utils::ASSET_CUSTOMIZATION_TABLE; - } else if (cleanedType == "2300000000000000") { - return Utils::ASSET_CUSTOMIZATION_TABLE_FEIMAGES; - } else if (cleanedType == "2400000000000000") { - return Utils::ASSET_CUSTOMIZATION_TABLE_COLOR; - }else if (cleanedType == "2600000000000000") { - return Utils::ASSET_FX; - } else if (cleanedType == "2F00000000000000") { - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "3000000000000000") { - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "3100000000000000") { - return Utils::ASSET_STRUCTURED_TABLE; - } else if (cleanedType == "3200000000000000") { - return Utils::ASSET_LEADERBOARD_DEF; - } else if (cleanedType == "3300000000000000") { - return Utils::ASSET_DDL; - } else if (cleanedType == "3600000000000000") { - return Utils::ASSET_SCRIPT_PARSE_TREE; - } else if (cleanedType == "3700000000000000") { - return Utils::ASSET_KEY_VALUE_PAIRS; - } else if (cleanedType == "3800000000000000") { - return Utils::ASSET_VEHICLE; - } else if (cleanedType == "3A00000000000000") { - return Utils::ASSET_VEHICLE_TRACER; - } else if (cleanedType == "3C00000000000000") { - return Utils::ASSET_SURFACE_FX_TABLE; - } else if (cleanedType == "3D00000000000000") { - return Utils::ASSET_SURFACE_SOUND_DEF; - } else if (cleanedType == "3E00000000000000") { - return Utils::ASSET_FOOTSTEP_TABLE; - } else if (cleanedType == "3F00000000000000") { - return Utils::ASSET_ENTITY_FX_IMPACTS; - } else if (cleanedType == "4000000000000000") { - return Utils::ASSET_ENTITY_SOUND_IMPACTS; - } else if (cleanedType == "4200000000000000") { - return Utils::ASSET_VEHICLE_FX_DEF; - } else if (cleanedType == "4300000000000000") { - return Utils::ASSET_VEHICLE_SOUND_DEF; - } else if (cleanedType == "4500000000000000") { - return Utils::ASSET_SCRIPT_BUNDLE; - } else if (cleanedType == "4600000000000000") { - return Utils::ASSET_SCRIPT_BUNDLE_LIST; - } else if (cleanedType == "4700000000000000") { - return Utils::ASSET_RUMBLE; - } else if (cleanedType == "4A00000000000000") { - return Utils::ASSET_AIM_TABLE; - } else if (cleanedType == "4B00000000000000") { - return Utils::ASSET_ANIM_SELECTOR_TABLE; - } else if (cleanedType == "4C00000000000000") { - return Utils::ASSET_ANIM_MAPPING_TABLE; - } else if (cleanedType == "4D00000000000000") { - return Utils::ASSET_ANIM_STATE_MACHINE; - } else if (cleanedType == "4E00000000000000") { - return Utils::ASSET_BEHAVIOR_TREE; - } else if (cleanedType == "4F00000000000000") { - return Utils::ASSET_BEHAVIOR_STATE_MACHINE; - } else if (cleanedType == "5100000000000000") { - return Utils::ASSET_S_ANIM; - } else if (cleanedType == "5200000000000000") { - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "5300000000000000") { - return Utils::ASSET_BIT_FIELD; - } else if (cleanedType == "5400000000000000") { - return Utils::ASSET_SURFACE_SOUND_DEF; - } else if (cleanedType == "5500000000000000") { - return Utils::ASSET_SURFACE_FX_TABLE; - } else if (cleanedType == "5600000000000000") { - return Utils::ASSET_RUMBLE; - } else if (cleanedType == "5900000000000000") { - return Utils::ASSET_AIM_TABLE; - } else if (cleanedType == "5A00000000000000") { - return Utils::ASSET_MAP_TABLE; - } else if (cleanedType == "5B00000000000000") { - return Utils::ASSET_MAP_TABLE_LOADING_IMAGES; - } else if (cleanedType == "5C00000000000000") { - return Utils::ASSET_MEDAL; - } else if (cleanedType == "5D00000000000000") { - return Utils::ASSET_MEDAL_TABLE; - } else if (cleanedType == "5E00000000000000") { - return Utils::ASSET_OBJECTIVE; - } else if (cleanedType == "5F00000000000000") { - return Utils::ASSET_OBJECTIVE_LIST; - } else if (cleanedType == "6400000000000000") { - return Utils::ASSET_LASER; - } else if (cleanedType == "6500000000000000") { - return Utils::ASSET_BEAM; - } else if (cleanedType == "6600000000000000") { - return Utils::ASSET_STREAMER_HINT; - } else if (cleanedType == "1B00000000000000") { - return Utils::ASSET_CG_MEDIA_TABLE; - } - - return Utils::ASSET_NONE; -} - diff --git a/libs/zonefile/PC/zonefile_cod12_pc.h b/libs/zonefile/PC/zonefile_cod12_pc.h index c484b3f..97f6155 100644 --- a/libs/zonefile/PC/zonefile_cod12_pc.h +++ b/libs/zonefile/PC/zonefile_cod12_pc.h @@ -10,7 +10,7 @@ public: ~ZoneFile_COD12_PC(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD12_PC_H diff --git a/libs/zonefile/PC/zonefile_cod4_pc.cpp b/libs/zonefile/PC/zonefile_cod4_pc.cpp index 952fd8f..6565b40 100644 --- a/libs/zonefile/PC/zonefile_cod4_pc.cpp +++ b/libs/zonefile/PC/zonefile_cod4_pc.cpp @@ -1,11 +1,30 @@ #include "zonefile_cod4_pc.h" -#include -#include -#include - ZoneFile_COD4_PC::ZoneFile_COD4_PC() - : ZoneFile() { + : ZoneFile() +{ + pSetType(1, ASSET_TYPE_PHYSPRESET); + pSetType(2, ASSET_TYPE_XANIMPARTS); + pSetType(3, ASSET_TYPE_XMODEL); + pSetType(5, ASSET_TYPE_DESTRUCTIBLE); + pSetType(6, ASSET_TYPE_IMAGE); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(10, ASSET_TYPE_COL_MAP_SP); + pSetType(11, ASSET_TYPE_COLLISION_MAP); + pSetType(12, ASSET_TYPE_D3DBSP); + pSetType(13, ASSET_TYPE_GAME_MAP_SP); + pSetType(16, ASSET_TYPE_GFX_MAP); + pSetType(18, ASSET_TYPE_LIGHT_DEF); + pSetType(20, ASSET_TYPE_MENU); + pSetType(21, ASSET_TYPE_FONT); + pSetType(22, ASSET_TYPE_SOUND); + pSetType(23, ASSET_TYPE_WEAPON); + pSetType(24, ASSET_TYPE_LOCALIZE_ENTRY); + pSetType(25, ASSET_TYPE_FX); + pSetType(26, ASSET_TYPE_UI_MAP); + pSetType(31, ASSET_TYPE_RAWFILE); + pSetType(32, ASSET_TYPE_SCRIPT_PARSE_TREE); + pSetType(33, ASSET_TYPE_STRINGTABLE); } @@ -16,53 +35,3 @@ ZoneFile_COD4_PC::~ZoneFile_COD4_PC() { bool ZoneFile_COD4_PC::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD4_PC::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "1F000000") { - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "20000000") { - return Utils::ASSET_SCRIPT_PARSE_TREE; - } else if (cleanedType == "19000000") { - return Utils::ASSET_FX; - } else if (cleanedType == "16000000") { - return Utils::ASSET_SOUND; - } else if (cleanedType == "02000000") { - return Utils::ASSET_Animation; - } else if (cleanedType == "0B000000") { - return Utils::ASSET_COLLISION_MAP; - } else if (cleanedType == "21000000") { - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "14000000") { - return Utils::ASSET_MENU; - } else if (cleanedType == "07000000") { - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "17000000") { - return Utils::ASSET_WEAPON; - } else if (cleanedType == "10000000") { - return Utils::ASSET_GFX_MAP; - } else if (cleanedType == "12000000") { - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "15000000") { - return Utils::ASSET_FONT; - } else if (cleanedType == "03000000") { - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0C000000") { - return Utils::ASSET_D3DBSP; - } else if (cleanedType == "06000000") { - return Utils::ASSET_IMAGE; - } else if (cleanedType == "0D000000") { - return Utils::ASSET_GAME_MAP_SP; - } else if (cleanedType == "0A000000") { - return Utils::ASSET_COL_MAP_SP; - } else if (cleanedType == "01000000") { - return Utils::ASSET_PHYSPRESET; - } else if (cleanedType == "05000000") { - return Utils::ASSET_DESTRUCTIBLE; - } else if (cleanedType == "18000000") { - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "1A000000") { - return Utils::ASSET_UI_MAP; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/PC/zonefile_cod4_pc.h b/libs/zonefile/PC/zonefile_cod4_pc.h index b3c99d3..27a8a60 100644 --- a/libs/zonefile/PC/zonefile_cod4_pc.h +++ b/libs/zonefile/PC/zonefile_cod4_pc.h @@ -12,7 +12,7 @@ public: ~ZoneFile_COD4_PC(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD4_PC_H diff --git a/libs/zonefile/PC/zonefile_cod5_pc.cpp b/libs/zonefile/PC/zonefile_cod5_pc.cpp index 2df0289..e28dc8c 100644 --- a/libs/zonefile/PC/zonefile_cod5_pc.cpp +++ b/libs/zonefile/PC/zonefile_cod5_pc.cpp @@ -1,11 +1,28 @@ #include "zonefile_cod5_pc.h" -#include -#include -#include - ZoneFile_COD5_PC::ZoneFile_COD5_PC() - : ZoneFile() { + : ZoneFile() +{ + pSetType(1, ASSET_TYPE_PHYSPRESET); + pSetType(3, ASSET_TYPE_DESTRUCTIBLE); + pSetType(4, ASSET_TYPE_XANIMPARTS); + pSetType(5, ASSET_TYPE_XMODEL); + pSetType(6, ASSET_TYPE_IMAGE); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(11, ASSET_TYPE_COL_MAP_SP); + pSetType(12, ASSET_TYPE_COLLISION_MAP); + pSetType(13, ASSET_TYPE_D3DBSP); + pSetType(14, ASSET_TYPE_GAME_MAP_SP); + pSetType(17, ASSET_TYPE_GFX_MAP); + pSetType(18, ASSET_TYPE_LIGHT_DEF); + pSetType(20, ASSET_TYPE_FONT); + pSetType(21, ASSET_TYPE_MENU); + pSetType(23, ASSET_TYPE_RAWFILE); + pSetType(24, ASSET_TYPE_WEAPON); + pSetType(26, ASSET_TYPE_FX); + pSetType(32, ASSET_TYPE_SCRIPT_PARSE_TREE); + pSetType(33, ASSET_TYPE_STRINGTABLE); } @@ -16,49 +33,3 @@ ZoneFile_COD5_PC::~ZoneFile_COD5_PC() { bool ZoneFile_COD5_PC::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD5_PC::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "17000000") { // localized string PARTIALLY VERIFIED - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "20000000") { // raw_file PARTIALLY VERIFIED - return Utils::ASSET_SCRIPT_PARSE_TREE; - } else if (cleanedType == "1A000000") { // fx PARTIALLY VERIFIED - return Utils::ASSET_FX; - } else if (cleanedType == "09000000") { // loaded_sound PARTIALLY VERIFIED - return Utils::ASSET_SOUND; - } else if (cleanedType == "04000000") { // x_anim PARTIALLY VERIFIED - return Utils::ASSET_Animation; - } else if (cleanedType == "0C000000") { // collision_map PARTIALLY VERIFIED - return Utils::ASSET_COLLISION_MAP; - } else if (cleanedType == "21000000") { // string_table PARTIALLY VERIFIED - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "15000000") { // menu_file PARTIALLY VERIFIED - return Utils::ASSET_MENU; - } else if (cleanedType == "07000000") { // tech set PARTIALLY VERIFIED - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "18000000") { // weapon PARTIALLY VERIFIED - return Utils::ASSET_WEAPON; - } else if (cleanedType == "11000000") { // gfx map PARTIALLY VERIFIED - return Utils::ASSET_GFX_MAP; - } else if (cleanedType == "12000000") { // light_def PARTIALLY VERIFIED - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "14000000") { // font PARTIALLY VERIFIED - return Utils::ASSET_FONT; - } else if (cleanedType == "05000000") { // xmodel PARTIALLY VERIFIED - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0D000000") { // d3dbsp PARTIALLY VERIFIED - return Utils::ASSET_D3DBSP; - } else if (cleanedType == "06000000") { // image PARTIALLY VERIFIED - return Utils::ASSET_IMAGE; - } else if (cleanedType == "0E000000") { // game map sp PARTIALLY VERIFIED - return Utils::ASSET_GAME_MAP_SP; - } else if (cleanedType == "0B000000") { // col map sp PARTIALLY VERIFIED - return Utils::ASSET_COL_MAP_SP; - } else if (cleanedType == "01000000") { // physics preset PARTIALLY VERIFIED - return Utils::ASSET_PHYSPRESET; - } else if (cleanedType == "03000000") { // destructible def PARTIALLY VERIFIED - return Utils::ASSET_DESTRUCTIBLE; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/PC/zonefile_cod5_pc.h b/libs/zonefile/PC/zonefile_cod5_pc.h index bd0cf71..ca38dfd 100644 --- a/libs/zonefile/PC/zonefile_cod5_pc.h +++ b/libs/zonefile/PC/zonefile_cod5_pc.h @@ -12,7 +12,7 @@ public: ~ZoneFile_COD5_PC(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD5_PC_H diff --git a/libs/zonefile/PC/zonefile_cod6_pc.cpp b/libs/zonefile/PC/zonefile_cod6_pc.cpp index 3b71215..2f05c08 100644 --- a/libs/zonefile/PC/zonefile_cod6_pc.cpp +++ b/libs/zonefile/PC/zonefile_cod6_pc.cpp @@ -1,11 +1,28 @@ #include "zonefile_cod6_pc.h" -#include -#include -#include - ZoneFile_COD6_PC::ZoneFile_COD6_PC() - : ZoneFile() { + : ZoneFile() +{ + pSetType(1, ASSET_TYPE_PHYSPRESET); + pSetType(3, ASSET_TYPE_DESTRUCTIBLE); + pSetType(4, ASSET_TYPE_XANIMPARTS); + pSetType(5, ASSET_TYPE_XMODEL); + pSetType(6, ASSET_TYPE_IMAGE); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(11, ASSET_TYPE_COL_MAP_SP); + pSetType(12, ASSET_TYPE_COLLISION_MAP); + pSetType(13, ASSET_TYPE_D3DBSP); + pSetType(14, ASSET_TYPE_GAME_MAP_SP); + pSetType(17, ASSET_TYPE_GFX_MAP); + pSetType(18, ASSET_TYPE_LIGHT_DEF); + pSetType(20, ASSET_TYPE_FONT); + pSetType(21, ASSET_TYPE_MENU); + pSetType(23, ASSET_TYPE_RAWFILE); + pSetType(24, ASSET_TYPE_WEAPON); + pSetType(26, ASSET_TYPE_FX); + pSetType(32, ASSET_TYPE_SCRIPT_PARSE_TREE); + pSetType(33, ASSET_TYPE_STRINGTABLE); } @@ -16,49 +33,3 @@ ZoneFile_COD6_PC::~ZoneFile_COD6_PC() { bool ZoneFile_COD6_PC::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD6_PC::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "17000000") { // localized string PARTIALLY VERIFIED - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "20000000") { // raw_file PARTIALLY VERIFIED - return Utils::ASSET_SCRIPT_PARSE_TREE; - } else if (cleanedType == "1A000000") { // fx PARTIALLY VERIFIED - return Utils::ASSET_FX; - } else if (cleanedType == "09000000") { // loaded_sound PARTIALLY VERIFIED - return Utils::ASSET_SOUND; - } else if (cleanedType == "04000000") { // x_anim PARTIALLY VERIFIED - return Utils::ASSET_Animation; - } else if (cleanedType == "0C000000") { // collision_map PARTIALLY VERIFIED - return Utils::ASSET_COLLISION_MAP; - } else if (cleanedType == "21000000") { // string_table PARTIALLY VERIFIED - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "15000000") { // menu_file PARTIALLY VERIFIED - return Utils::ASSET_MENU; - } else if (cleanedType == "07000000") { // tech set PARTIALLY VERIFIED - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "18000000") { // weapon PARTIALLY VERIFIED - return Utils::ASSET_WEAPON; - } else if (cleanedType == "11000000") { // gfx map PARTIALLY VERIFIED - return Utils::ASSET_GFX_MAP; - } else if (cleanedType == "12000000") { // light_def PARTIALLY VERIFIED - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "14000000") { // font PARTIALLY VERIFIED - return Utils::ASSET_FONT; - } else if (cleanedType == "05000000") { // xmodel PARTIALLY VERIFIED - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0D000000") { // d3dbsp PARTIALLY VERIFIED - return Utils::ASSET_D3DBSP; - } else if (cleanedType == "06000000") { // image PARTIALLY VERIFIED - return Utils::ASSET_IMAGE; - } else if (cleanedType == "0E000000") { // game map sp PARTIALLY VERIFIED - return Utils::ASSET_GAME_MAP_SP; - } else if (cleanedType == "0B000000") { // col map sp PARTIALLY VERIFIED - return Utils::ASSET_COL_MAP_SP; - } else if (cleanedType == "01000000") { // physics preset PARTIALLY VERIFIED - return Utils::ASSET_PHYSPRESET; - } else if (cleanedType == "03000000") { // destructible def PARTIALLY VERIFIED - return Utils::ASSET_DESTRUCTIBLE; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/PC/zonefile_cod6_pc.h b/libs/zonefile/PC/zonefile_cod6_pc.h index c70576e..4d2d904 100644 --- a/libs/zonefile/PC/zonefile_cod6_pc.h +++ b/libs/zonefile/PC/zonefile_cod6_pc.h @@ -12,7 +12,7 @@ public: ~ZoneFile_COD6_PC(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD6_PC_H diff --git a/libs/zonefile/PC/zonefile_cod7_pc.cpp b/libs/zonefile/PC/zonefile_cod7_pc.cpp index 0576ac0..cc32880 100644 --- a/libs/zonefile/PC/zonefile_cod7_pc.cpp +++ b/libs/zonefile/PC/zonefile_cod7_pc.cpp @@ -1,11 +1,53 @@ #include "zonefile_cod7_pc.h" -#include -#include -#include - ZoneFile_COD7_PC::ZoneFile_COD7_PC() + : ZoneFile() { + pSetType(0, ASSET_TYPE_XMODELPIECES); + pSetType(1, ASSET_TYPE_PHYSPRESET); + pSetType(2, ASSET_TYPE_PHYSCONSTRAINTS); + pSetType(3, ASSET_TYPE_DESTRUCTIBLEDEF); + pSetType(4, ASSET_TYPE_XANIMPARTS); + pSetType(5, ASSET_TYPE_XMODEL); + pSetType(6, ASSET_TYPE_MATERIAL); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(8, ASSET_TYPE_IMAGE); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(10, ASSET_TYPE_SOUND_PATCH); + pSetType(11, ASSET_TYPE_CLIPMAP); + pSetType(12, ASSET_TYPE_CLIPMAP_PVS); + pSetType(13, ASSET_TYPE_COMWORLD); + pSetType(14, ASSET_TYPE_GAMEWORLD_SP); + pSetType(15, ASSET_TYPE_GAMEWORLD_MP); + pSetType(16, ASSET_TYPE_MAP_ENTS); + pSetType(17, ASSET_TYPE_GFXWORLD); + pSetType(18, ASSET_TYPE_LIGHT_DEF); + pSetType(19, ASSET_TYPE_UI_MAP); + pSetType(20, ASSET_TYPE_FONT); + pSetType(21, ASSET_TYPE_MENULIST); + pSetType(22, ASSET_TYPE_MENU); + pSetType(23, ASSET_TYPE_LOCALIZE_ENTRY); + pSetType(24, ASSET_TYPE_WEAPON); + pSetType(25, ASSET_TYPE_WEAPONDEF); + pSetType(26, ASSET_TYPE_WEAPON_VARIANT); + pSetType(27, ASSET_TYPE_SNDDRIVER_GLOBALS); + pSetType(28, ASSET_TYPE_FX); + pSetType(29, ASSET_TYPE_IMPACT_FX); + pSetType(30, ASSET_TYPE_AITYPE); + pSetType(31, ASSET_TYPE_MPTYPE); + pSetType(32, ASSET_TYPE_MPBODY); + pSetType(33, ASSET_TYPE_MPHEAD); + pSetType(34, ASSET_TYPE_CHARACTER); + pSetType(35, ASSET_TYPE_XMODELALIAS); + pSetType(36, ASSET_TYPE_RAWFILE); + pSetType(37, ASSET_TYPE_STRINGTABLE); + pSetType(38, ASSET_TYPE_PACK_INDEX); + pSetType(39, ASSET_TYPE_XGLOBALS); + pSetType(40, ASSET_TYPE_DDL); + pSetType(41, ASSET_TYPE_GLASSES); + pSetType(42, ASSET_TYPE_EMBLEMSET); + pSetType(43, ASSET_TYPE_COUNT); + pSetType(44, ASSET_TYPE_ASSETLIST); } @@ -17,101 +59,3 @@ ZoneFile_COD7_PC::~ZoneFile_COD7_PC() bool ZoneFile_COD7_PC::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD7_PC::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "00000000") { - return Utils::ASSET_XMODELPIECES; - } else if (cleanedType == "01000000") { - return Utils::ASSET_PHYSPRESET; - } else if (cleanedType == "02000000") { - return Utils::ASSET_PHYSCONSTRAINTS; - } else if (cleanedType == "03000000") { - return Utils::ASSET_DESTRUCTIBLEDEF; - } else if (cleanedType == "04000000") { - return Utils::ASSET_Animation; - } else if (cleanedType == "05000000") { - return Utils::ASSET_XMODEL; - } else if (cleanedType == "06000000") { - return Utils::ASSET_MATERIAL; - } else if (cleanedType == "07000000") { - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "08000000") { - return Utils::ASSET_IMAGE; - } else if (cleanedType == "09000000") { - return Utils::ASSET_SOUND; - } else if (cleanedType == "0A000000") { - return Utils::ASSET_SOUND_PATCH; - } else if (cleanedType == "0B000000") { - return Utils::ASSET_CLIPMAP; - } else if (cleanedType == "0C000000") { - return Utils::ASSET_CLIPMAP_PVS; - } else if (cleanedType == "0D000000") { - return Utils::ASSET_COMWORLD; - } else if (cleanedType == "0E000000") { - return Utils::ASSET_GAMEWORLD_SP; - } else if (cleanedType == "0F000000") { - return Utils::ASSET_GAMEWORLD_MP; - } else if (cleanedType == "10000000") { - return Utils::ASSET_MAP_ENTS; - } else if (cleanedType == "11000000") { - return Utils::ASSET_GFXWORLD; - } else if (cleanedType == "12000000") { - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "13000000") { - return Utils::ASSET_UI_MAP; - } else if (cleanedType == "14000000") { - return Utils::ASSET_FONT; - } else if (cleanedType == "15000000") { - return Utils::ASSET_MENULIST; - } else if (cleanedType == "16000000") { - return Utils::ASSET_MENU; - } else if (cleanedType == "17000000") { - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "18000000") { - return Utils::ASSET_WEAPON; - } else if (cleanedType == "19000000") { - return Utils::ASSET_WEAPONDEF; - } else if (cleanedType == "1A000000") { - return Utils::ASSET_WEAPON_VARIANT; - } else if (cleanedType == "1B000000") { - return Utils::ASSET_SNDDRIVER_GLOBALS; - } else if (cleanedType == "1C000000") { - return Utils::ASSET_FX; - } else if (cleanedType == "1D000000") { - return Utils::ASSET_IMPACT_FX; - } else if (cleanedType == "1E000000") { - return Utils::ASSET_AITYPE; - } else if (cleanedType == "1F000000") { - return Utils::ASSET_MPTYPE; - } else if (cleanedType == "20000000") { - return Utils::ASSET_MPBODY; - } else if (cleanedType == "21000000") { - return Utils::ASSET_MPHEAD; - } else if (cleanedType == "22000000") { - return Utils::ASSET_CHARACTER; - } else if (cleanedType == "23000000") { - return Utils::ASSET_XMODELALIAS; - } else if (cleanedType == "24000000") { - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "25000000") { - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "26000000") { - return Utils::ASSET_PACK_INDEX; - } else if (cleanedType == "27000000") { - return Utils::ASSET_XGLOBALS; - } else if (cleanedType == "28000000") { - return Utils::ASSET_DDL; - } else if (cleanedType == "29000000") { - return Utils::ASSET_GLASSES; - } else if (cleanedType == "2A000000") { - return Utils::ASSET_EMBLEMSET; - } else if (cleanedType == "2B000000") { - return Utils::ASSET_COUNT; - } else if (cleanedType == "2B000000") { - return Utils::ASSET_STRING; - } else if (cleanedType == "2C000000") { - return Utils::ASSET_ASSETLIST; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/PC/zonefile_cod7_pc.h b/libs/zonefile/PC/zonefile_cod7_pc.h index 91f084a..6293c04 100644 --- a/libs/zonefile/PC/zonefile_cod7_pc.h +++ b/libs/zonefile/PC/zonefile_cod7_pc.h @@ -10,7 +10,7 @@ public: ~ZoneFile_COD7_PC(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD7_PC_H diff --git a/libs/zonefile/PC/zonefile_cod8_pc.cpp b/libs/zonefile/PC/zonefile_cod8_pc.cpp index 8ec1719..16bf686 100644 --- a/libs/zonefile/PC/zonefile_cod8_pc.cpp +++ b/libs/zonefile/PC/zonefile_cod8_pc.cpp @@ -1,12 +1,26 @@ #include "zonefile_cod8_pc.h" -#include -#include -#include - ZoneFile_COD8_PC::ZoneFile_COD8_PC() + : ZoneFile() { - + pSetType(4, ASSET_TYPE_XANIMPARTS); + pSetType(5, ASSET_TYPE_XMODEL); + pSetType(6, ASSET_TYPE_IMAGE); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(11, ASSET_TYPE_COL_MAP_SP); + pSetType(12, ASSET_TYPE_COLLISION_MAP); + pSetType(13, ASSET_TYPE_D3DBSP); + pSetType(14, ASSET_TYPE_GAME_MAP_SP); + pSetType(17, ASSET_TYPE_GFX_MAP); + pSetType(18, ASSET_TYPE_LIGHT_DEF); + pSetType(20, ASSET_TYPE_FONT); + pSetType(21, ASSET_TYPE_MENU); + pSetType(23, ASSET_TYPE_LOCALIZE_ENTRY); + pSetType(24, ASSET_TYPE_WEAPON); + pSetType(26, ASSET_TYPE_FX); + pSetType(32, ASSET_TYPE_RAWFILE); + pSetType(33, ASSET_TYPE_STRINGTABLE); } ZoneFile_COD8_PC::~ZoneFile_COD8_PC() @@ -17,45 +31,3 @@ ZoneFile_COD8_PC::~ZoneFile_COD8_PC() bool ZoneFile_COD8_PC::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD8_PC::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "17000000") { // localized string PARTIALLY VERIFIED - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "20000000") { // raw_file PARTIALLY VERIFIED - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "1A000000") { // fx PARTIALLY VERIFIED - return Utils::ASSET_FX; - } else if (cleanedType == "09000000") { // loaded_sound PARTIALLY VERIFIED - return Utils::ASSET_SOUND; - } else if (cleanedType == "04000000") { // x_anim PARTIALLY VERIFIED - return Utils::ASSET_Animation; - } else if (cleanedType == "0C000000") { // collision_map PARTIALLY VERIFIED - return Utils::ASSET_COLLISION_MAP; - } else if (cleanedType == "21000000") { // string_table PARTIALLY VERIFIED - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "15000000") { // menu_file PARTIALLY VERIFIED - return Utils::ASSET_MENU; - } else if (cleanedType == "07000000") { // tech set PARTIALLY VERIFIED - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "18000000") { // weapon PARTIALLY VERIFIED - return Utils::ASSET_WEAPON; - } else if (cleanedType == "11000000") { // gfx map PARTIALLY VERIFIED - return Utils::ASSET_GFX_MAP; - } else if (cleanedType == "12000000") { // light_def PARTIALLY VERIFIED - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "14000000") { // font PARTIALLY VERIFIED - return Utils::ASSET_FONT; - } else if (cleanedType == "05000000") { // xmodel PARTIALLY VERIFIED - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0D000000") { // d3dbsp PARTIALLY VERIFIED - return Utils::ASSET_D3DBSP; - } else if (cleanedType == "06000000") { // image PARTIALLY VERIFIED - return Utils::ASSET_IMAGE; - } else if (cleanedType == "0E000000") { // game map sp PARTIALLY VERIFIED - return Utils::ASSET_GAME_MAP_SP; - } else if (cleanedType == "0B000000") { // col map sp PARTIALLY VERIFIED - return Utils::ASSET_COL_MAP_SP; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/PC/zonefile_cod8_pc.h b/libs/zonefile/PC/zonefile_cod8_pc.h index 084a3f6..e9a4a14 100644 --- a/libs/zonefile/PC/zonefile_cod8_pc.h +++ b/libs/zonefile/PC/zonefile_cod8_pc.h @@ -10,7 +10,7 @@ public: ~ZoneFile_COD8_PC(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD7_PC_H diff --git a/libs/zonefile/PC/zonefile_cod9_pc.cpp b/libs/zonefile/PC/zonefile_cod9_pc.cpp index 200e984..75b4e4d 100644 --- a/libs/zonefile/PC/zonefile_cod9_pc.cpp +++ b/libs/zonefile/PC/zonefile_cod9_pc.cpp @@ -1,12 +1,26 @@ #include "zonefile_cod9_pc.h" -#include -#include -#include - ZoneFile_COD9_PC::ZoneFile_COD9_PC() + : ZoneFile() { - + pSetType(4, ASSET_TYPE_XANIMPARTS); + pSetType(5, ASSET_TYPE_XMODEL); + pSetType(6, ASSET_TYPE_IMAGE); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(11, ASSET_TYPE_COL_MAP_SP); + pSetType(12, ASSET_TYPE_COLLISION_MAP); + pSetType(13, ASSET_TYPE_D3DBSP); + pSetType(14, ASSET_TYPE_GAME_MAP_SP); + pSetType(17, ASSET_TYPE_GFX_MAP); + pSetType(18, ASSET_TYPE_LIGHT_DEF); + pSetType(20, ASSET_TYPE_FONT); + pSetType(21, ASSET_TYPE_MENU); + pSetType(23, ASSET_TYPE_LOCALIZE_ENTRY); + pSetType(24, ASSET_TYPE_WEAPON); + pSetType(26, ASSET_TYPE_FX); + pSetType(32, ASSET_TYPE_RAWFILE); + pSetType(33, ASSET_TYPE_STRINGTABLE); } ZoneFile_COD9_PC::~ZoneFile_COD9_PC() @@ -17,45 +31,3 @@ ZoneFile_COD9_PC::~ZoneFile_COD9_PC() bool ZoneFile_COD9_PC::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD9_PC::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "17000000") { // localized string PARTIALLY VERIFIED - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "20000000") { // raw_file PARTIALLY VERIFIED - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "1A000000") { // fx PARTIALLY VERIFIED - return Utils::ASSET_FX; - } else if (cleanedType == "09000000") { // loaded_sound PARTIALLY VERIFIED - return Utils::ASSET_SOUND; - } else if (cleanedType == "04000000") { // x_anim PARTIALLY VERIFIED - return Utils::ASSET_Animation; - } else if (cleanedType == "0C000000") { // collision_map PARTIALLY VERIFIED - return Utils::ASSET_COLLISION_MAP; - } else if (cleanedType == "21000000") { // string_table PARTIALLY VERIFIED - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "15000000") { // menu_file PARTIALLY VERIFIED - return Utils::ASSET_MENU; - } else if (cleanedType == "07000000") { // tech set PARTIALLY VERIFIED - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "18000000") { // weapon PARTIALLY VERIFIED - return Utils::ASSET_WEAPON; - } else if (cleanedType == "11000000") { // gfx map PARTIALLY VERIFIED - return Utils::ASSET_GFX_MAP; - } else if (cleanedType == "12000000") { // light_def PARTIALLY VERIFIED - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "14000000") { // font PARTIALLY VERIFIED - return Utils::ASSET_FONT; - } else if (cleanedType == "05000000") { // xmodel PARTIALLY VERIFIED - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0D000000") { // d3dbsp PARTIALLY VERIFIED - return Utils::ASSET_D3DBSP; - } else if (cleanedType == "06000000") { // image PARTIALLY VERIFIED - return Utils::ASSET_IMAGE; - } else if (cleanedType == "0E000000") { // game map sp PARTIALLY VERIFIED - return Utils::ASSET_GAME_MAP_SP; - } else if (cleanedType == "0B000000") { // col map sp PARTIALLY VERIFIED - return Utils::ASSET_COL_MAP_SP; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/PC/zonefile_cod9_pc.h b/libs/zonefile/PC/zonefile_cod9_pc.h index 4f1f9c6..6cbb206 100644 --- a/libs/zonefile/PC/zonefile_cod9_pc.h +++ b/libs/zonefile/PC/zonefile_cod9_pc.h @@ -10,7 +10,7 @@ public: ~ZoneFile_COD9_PC(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD9_PC_H diff --git a/libs/zonefile/PS3/zonefile_cod10_ps3.cpp b/libs/zonefile/PS3/zonefile_cod10_ps3.cpp index 96dd727..7656608 100644 --- a/libs/zonefile/PS3/zonefile_cod10_ps3.cpp +++ b/libs/zonefile/PS3/zonefile_cod10_ps3.cpp @@ -5,8 +5,26 @@ #include ZoneFile_COD10_PS3::ZoneFile_COD10_PS3() + : ZoneFile() { - + pSetType(4, ASSET_TYPE_XANIMPARTS); + pSetType(5, ASSET_TYPE_XMODEL); + pSetType(6, ASSET_TYPE_IMAGE); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(11, ASSET_TYPE_COL_MAP_SP); + pSetType(12, ASSET_TYPE_COLLISION_MAP); + pSetType(13, ASSET_TYPE_D3DBSP); + pSetType(14, ASSET_TYPE_GAME_MAP_SP); + pSetType(15, ASSET_TYPE_MENU); + pSetType(16, ASSET_TYPE_FONT); + pSetType(17, ASSET_TYPE_LOCALIZE_ENTRY); + pSetType(18, ASSET_TYPE_WEAPON); + pSetType(19, ASSET_TYPE_GFX_MAP); + pSetType(20, ASSET_TYPE_LIGHT_DEF); + pSetType(26, ASSET_TYPE_FX); + pSetType(32, ASSET_TYPE_RAWFILE); + pSetType(33, ASSET_TYPE_STRINGTABLE); } ZoneFile_COD10_PS3::~ZoneFile_COD10_PS3() @@ -17,45 +35,3 @@ ZoneFile_COD10_PS3::~ZoneFile_COD10_PS3() bool ZoneFile_COD10_PS3::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD10_PS3::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "17000000") { // localized string PARTIALLY VERIFIED - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "20000000") { // raw_file PARTIALLY VERIFIED - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "1A000000") { // fx PARTIALLY VERIFIED - return Utils::ASSET_FX; - } else if (cleanedType == "09000000") { // loaded_sound PARTIALLY VERIFIED - return Utils::ASSET_SOUND; - } else if (cleanedType == "04000000") { // x_anim PARTIALLY VERIFIED - return Utils::ASSET_Animation; - } else if (cleanedType == "0C000000") { // collision_map PARTIALLY VERIFIED - return Utils::ASSET_COLLISION_MAP; - } else if (cleanedType == "21000000") { // string_table PARTIALLY VERIFIED - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "15000000") { // menu_file PARTIALLY VERIFIED - return Utils::ASSET_MENU; - } else if (cleanedType == "07000000") { // tech set PARTIALLY VERIFIED - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "18000000") { // weapon PARTIALLY VERIFIED - return Utils::ASSET_WEAPON; - } else if (cleanedType == "11000000") { // gfx map PARTIALLY VERIFIED - return Utils::ASSET_GFX_MAP; - } else if (cleanedType == "12000000") { // light_def PARTIALLY VERIFIED - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "14000000") { // font PARTIALLY VERIFIED - return Utils::ASSET_FONT; - } else if (cleanedType == "05000000") { // xmodel PARTIALLY VERIFIED - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0D000000") { // d3dbsp PARTIALLY VERIFIED - return Utils::ASSET_D3DBSP; - } else if (cleanedType == "06000000") { // image PARTIALLY VERIFIED - return Utils::ASSET_IMAGE; - } else if (cleanedType == "0E000000") { // game map sp PARTIALLY VERIFIED - return Utils::ASSET_GAME_MAP_SP; - } else if (cleanedType == "0B000000") { // col map sp PARTIALLY VERIFIED - return Utils::ASSET_COL_MAP_SP; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/PS3/zonefile_cod10_ps3.h b/libs/zonefile/PS3/zonefile_cod10_ps3.h index 91acb35..679eac0 100644 --- a/libs/zonefile/PS3/zonefile_cod10_ps3.h +++ b/libs/zonefile/PS3/zonefile_cod10_ps3.h @@ -10,6 +10,6 @@ public: ~ZoneFile_COD10_PS3(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override;}; +}; #endif // ZONEFILE_COD10_PS3_H diff --git a/libs/zonefile/PS3/zonefile_cod11_ps3.cpp b/libs/zonefile/PS3/zonefile_cod11_ps3.cpp index a54e44a..0805d54 100644 --- a/libs/zonefile/PS3/zonefile_cod11_ps3.cpp +++ b/libs/zonefile/PS3/zonefile_cod11_ps3.cpp @@ -5,8 +5,26 @@ #include ZoneFile_COD11_PS3::ZoneFile_COD11_PS3() + : ZoneFile() { - + pSetType(4, ASSET_TYPE_XANIMPARTS); + pSetType(5, ASSET_TYPE_XMODEL); + pSetType(6, ASSET_TYPE_IMAGE); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(11, ASSET_TYPE_COL_MAP_SP); + pSetType(12, ASSET_TYPE_COLLISION_MAP); + pSetType(13, ASSET_TYPE_D3DBSP); + pSetType(14, ASSET_TYPE_GAME_MAP_SP); + pSetType(15, ASSET_TYPE_MENU); + pSetType(16, ASSET_TYPE_FONT); + pSetType(17, ASSET_TYPE_LOCALIZE_ENTRY); + pSetType(18, ASSET_TYPE_WEAPON); + pSetType(19, ASSET_TYPE_GFX_MAP); + pSetType(20, ASSET_TYPE_LIGHT_DEF); + pSetType(26, ASSET_TYPE_FX); + pSetType(32, ASSET_TYPE_RAWFILE); + pSetType(33, ASSET_TYPE_STRINGTABLE); } ZoneFile_COD11_PS3::~ZoneFile_COD11_PS3() @@ -17,45 +35,3 @@ ZoneFile_COD11_PS3::~ZoneFile_COD11_PS3() bool ZoneFile_COD11_PS3::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD11_PS3::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "17000000") { // localized string PARTIALLY VERIFIED - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "20000000") { // raw_file PARTIALLY VERIFIED - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "1A000000") { // fx PARTIALLY VERIFIED - return Utils::ASSET_FX; - } else if (cleanedType == "09000000") { // loaded_sound PARTIALLY VERIFIED - return Utils::ASSET_SOUND; - } else if (cleanedType == "04000000") { // x_anim PARTIALLY VERIFIED - return Utils::ASSET_Animation; - } else if (cleanedType == "0C000000") { // collision_map PARTIALLY VERIFIED - return Utils::ASSET_COLLISION_MAP; - } else if (cleanedType == "21000000") { // string_table PARTIALLY VERIFIED - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "15000000") { // menu_file PARTIALLY VERIFIED - return Utils::ASSET_MENU; - } else if (cleanedType == "07000000") { // tech set PARTIALLY VERIFIED - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "18000000") { // weapon PARTIALLY VERIFIED - return Utils::ASSET_WEAPON; - } else if (cleanedType == "11000000") { // gfx map PARTIALLY VERIFIED - return Utils::ASSET_GFX_MAP; - } else if (cleanedType == "12000000") { // light_def PARTIALLY VERIFIED - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "14000000") { // font PARTIALLY VERIFIED - return Utils::ASSET_FONT; - } else if (cleanedType == "05000000") { // xmodel PARTIALLY VERIFIED - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0D000000") { // d3dbsp PARTIALLY VERIFIED - return Utils::ASSET_D3DBSP; - } else if (cleanedType == "06000000") { // image PARTIALLY VERIFIED - return Utils::ASSET_IMAGE; - } else if (cleanedType == "0E000000") { // game map sp PARTIALLY VERIFIED - return Utils::ASSET_GAME_MAP_SP; - } else if (cleanedType == "0B000000") { // col map sp PARTIALLY VERIFIED - return Utils::ASSET_COL_MAP_SP; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/PS3/zonefile_cod11_ps3.h b/libs/zonefile/PS3/zonefile_cod11_ps3.h index ddf57b1..2b4e2ef 100644 --- a/libs/zonefile/PS3/zonefile_cod11_ps3.h +++ b/libs/zonefile/PS3/zonefile_cod11_ps3.h @@ -10,7 +10,7 @@ public: ~ZoneFile_COD11_PS3(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD11_PS3_H diff --git a/libs/zonefile/PS3/zonefile_cod12_ps3.cpp b/libs/zonefile/PS3/zonefile_cod12_ps3.cpp index 1e3a50f..6fade33 100644 --- a/libs/zonefile/PS3/zonefile_cod12_ps3.cpp +++ b/libs/zonefile/PS3/zonefile_cod12_ps3.cpp @@ -5,8 +5,26 @@ #include ZoneFile_COD12_PS3::ZoneFile_COD12_PS3() + : ZoneFile() { - + pSetType(4, ASSET_TYPE_XANIMPARTS); + pSetType(5, ASSET_TYPE_XMODEL); + pSetType(6, ASSET_TYPE_IMAGE); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(11, ASSET_TYPE_COL_MAP_SP); + pSetType(12, ASSET_TYPE_COLLISION_MAP); + pSetType(13, ASSET_TYPE_D3DBSP); + pSetType(14, ASSET_TYPE_GAME_MAP_SP); + pSetType(15, ASSET_TYPE_MENU); + pSetType(16, ASSET_TYPE_FONT); + pSetType(17, ASSET_TYPE_LOCALIZE_ENTRY); + pSetType(18, ASSET_TYPE_WEAPON); + pSetType(19, ASSET_TYPE_GFX_MAP); + pSetType(20, ASSET_TYPE_LIGHT_DEF); + pSetType(26, ASSET_TYPE_FX); + pSetType(32, ASSET_TYPE_RAWFILE); + pSetType(33, ASSET_TYPE_STRINGTABLE); } ZoneFile_COD12_PS3::~ZoneFile_COD12_PS3() @@ -17,45 +35,3 @@ ZoneFile_COD12_PS3::~ZoneFile_COD12_PS3() bool ZoneFile_COD12_PS3::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD12_PS3::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "17000000") { // localized string PARTIALLY VERIFIED - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "20000000") { // raw_file PARTIALLY VERIFIED - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "1A000000") { // fx PARTIALLY VERIFIED - return Utils::ASSET_FX; - } else if (cleanedType == "09000000") { // loaded_sound PARTIALLY VERIFIED - return Utils::ASSET_SOUND; - } else if (cleanedType == "04000000") { // x_anim PARTIALLY VERIFIED - return Utils::ASSET_Animation; - } else if (cleanedType == "0C000000") { // collision_map PARTIALLY VERIFIED - return Utils::ASSET_COLLISION_MAP; - } else if (cleanedType == "21000000") { // string_table PARTIALLY VERIFIED - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "15000000") { // menu_file PARTIALLY VERIFIED - return Utils::ASSET_MENU; - } else if (cleanedType == "07000000") { // tech set PARTIALLY VERIFIED - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "18000000") { // weapon PARTIALLY VERIFIED - return Utils::ASSET_WEAPON; - } else if (cleanedType == "11000000") { // gfx map PARTIALLY VERIFIED - return Utils::ASSET_GFX_MAP; - } else if (cleanedType == "12000000") { // light_def PARTIALLY VERIFIED - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "14000000") { // font PARTIALLY VERIFIED - return Utils::ASSET_FONT; - } else if (cleanedType == "05000000") { // xmodel PARTIALLY VERIFIED - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0D000000") { // d3dbsp PARTIALLY VERIFIED - return Utils::ASSET_D3DBSP; - } else if (cleanedType == "06000000") { // image PARTIALLY VERIFIED - return Utils::ASSET_IMAGE; - } else if (cleanedType == "0E000000") { // game map sp PARTIALLY VERIFIED - return Utils::ASSET_GAME_MAP_SP; - } else if (cleanedType == "0B000000") { // col map sp PARTIALLY VERIFIED - return Utils::ASSET_COL_MAP_SP; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/PS3/zonefile_cod12_ps3.h b/libs/zonefile/PS3/zonefile_cod12_ps3.h index e54f0db..ee2765d 100644 --- a/libs/zonefile/PS3/zonefile_cod12_ps3.h +++ b/libs/zonefile/PS3/zonefile_cod12_ps3.h @@ -10,7 +10,7 @@ public: ~ZoneFile_COD12_PS3(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD12_PS3_H diff --git a/libs/zonefile/PS3/zonefile_cod4_ps3.cpp b/libs/zonefile/PS3/zonefile_cod4_ps3.cpp index 4140783..b56ddd0 100644 --- a/libs/zonefile/PS3/zonefile_cod4_ps3.cpp +++ b/libs/zonefile/PS3/zonefile_cod4_ps3.cpp @@ -5,8 +5,19 @@ #include ZoneFile_COD4_PS3::ZoneFile_COD4_PS3() - : ZoneFile() { - + : ZoneFile() +{ + pSetType(2, ASSET_TYPE_XANIMPARTS); + pSetType(3, ASSET_TYPE_XMODEL); + pSetType(7, ASSET_TYPE_MATERIAL); + pSetType(9, ASSET_TYPE_TECHNIQUE_SET); + pSetType(12, ASSET_TYPE_COL_MAP_SP); + pSetType(14, ASSET_TYPE_D3DBSP); + pSetType(15, ASSET_TYPE_GAME_MAP_SP); + pSetType(18, ASSET_TYPE_SOUND); + pSetType(19, ASSET_TYPE_WEAPON); + pSetType(27, ASSET_TYPE_FX); + pSetType(18, ASSET_TYPE_GFX_MAP); } ZoneFile_COD4_PS3::~ZoneFile_COD4_PS3() { @@ -16,31 +27,3 @@ ZoneFile_COD4_PS3::~ZoneFile_COD4_PS3() { bool ZoneFile_COD4_PS3::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD4_PS3::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "00000003") { - return Utils::ASSET_XMODEL; - } else if (cleanedType == "00000002") { - return Utils::ASSET_Animation; - } else if (cleanedType == "00000007") { - return Utils::ASSET_MATERIAL; - } else if (cleanedType == "00000009") { - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "0000000C") { - return Utils::ASSET_COL_MAP_SP; - } else if (cleanedType == "0000000E") { - return Utils::ASSET_D3DBSP; - } else if (cleanedType == "0000000F") { - return Utils::ASSET_GAME_MAP_SP; - } else if (cleanedType == "00000012") { - return Utils::ASSET_GFX_MAP; - } else if (cleanedType == "00000019") { - return Utils::ASSET_WEAPON; - } else if (cleanedType == "0000001B") { - return Utils::ASSET_FX; - } else if (cleanedType == "00000018") { - return Utils::ASSET_SOUND; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/PS3/zonefile_cod4_ps3.h b/libs/zonefile/PS3/zonefile_cod4_ps3.h index e8179fe..f29a35a 100644 --- a/libs/zonefile/PS3/zonefile_cod4_ps3.h +++ b/libs/zonefile/PS3/zonefile_cod4_ps3.h @@ -12,7 +12,7 @@ public: ~ZoneFile_COD4_PS3(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD4_PS3_H diff --git a/libs/zonefile/PS3/zonefile_cod5_ps3.cpp b/libs/zonefile/PS3/zonefile_cod5_ps3.cpp index b39fe5e..6a89cbc 100644 --- a/libs/zonefile/PS3/zonefile_cod5_ps3.cpp +++ b/libs/zonefile/PS3/zonefile_cod5_ps3.cpp @@ -5,8 +5,28 @@ #include ZoneFile_COD5_PS3::ZoneFile_COD5_PS3() - : ZoneFile() { - + : ZoneFile() +{ + pSetType(1, ASSET_TYPE_PHYSPRESET); + pSetType(3, ASSET_TYPE_DESTRUCTIBLE); + pSetType(4, ASSET_TYPE_XANIMPARTS); + pSetType(5, ASSET_TYPE_XMODEL); + pSetType(6, ASSET_TYPE_IMAGE); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(11, ASSET_TYPE_COL_MAP_SP); + pSetType(12, ASSET_TYPE_COLLISION_MAP); + pSetType(13, ASSET_TYPE_D3DBSP); + pSetType(14, ASSET_TYPE_GAME_MAP_SP); + pSetType(15, ASSET_TYPE_MENU); + pSetType(16, ASSET_TYPE_FONT); + pSetType(17, ASSET_TYPE_RAWFILE); + pSetType(18, ASSET_TYPE_WEAPON); + pSetType(19, ASSET_TYPE_GFX_MAP); + pSetType(20, ASSET_TYPE_LIGHT_DEF); + pSetType(26, ASSET_TYPE_FX); + pSetType(32, ASSET_TYPE_SCRIPT_PARSE_TREE); + pSetType(33, ASSET_TYPE_STRINGTABLE); } ZoneFile_COD5_PS3::~ZoneFile_COD5_PS3() { @@ -16,49 +36,3 @@ ZoneFile_COD5_PS3::~ZoneFile_COD5_PS3() { bool ZoneFile_COD5_PS3::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD5_PS3::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "17000000") { // localized string PARTIALLY VERIFIED - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "20000000") { // raw_file PARTIALLY VERIFIED - return Utils::ASSET_SCRIPT_PARSE_TREE; - } else if (cleanedType == "1A000000") { // fx PARTIALLY VERIFIED - return Utils::ASSET_FX; - } else if (cleanedType == "09000000") { // loaded_sound PARTIALLY VERIFIED - return Utils::ASSET_SOUND; - } else if (cleanedType == "04000000") { // x_anim PARTIALLY VERIFIED - return Utils::ASSET_Animation; - } else if (cleanedType == "0C000000") { // collision_map PARTIALLY VERIFIED - return Utils::ASSET_COLLISION_MAP; - } else if (cleanedType == "21000000") { // string_table PARTIALLY VERIFIED - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "15000000") { // menu_file PARTIALLY VERIFIED - return Utils::ASSET_MENU; - } else if (cleanedType == "07000000") { // tech set PARTIALLY VERIFIED - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "18000000") { // weapon PARTIALLY VERIFIED - return Utils::ASSET_WEAPON; - } else if (cleanedType == "11000000") { // gfx map PARTIALLY VERIFIED - return Utils::ASSET_GFX_MAP; - } else if (cleanedType == "12000000") { // light_def PARTIALLY VERIFIED - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "14000000") { // font PARTIALLY VERIFIED - return Utils::ASSET_FONT; - } else if (cleanedType == "05000000") { // xmodel PARTIALLY VERIFIED - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0D000000") { // d3dbsp PARTIALLY VERIFIED - return Utils::ASSET_D3DBSP; - } else if (cleanedType == "06000000") { // image PARTIALLY VERIFIED - return Utils::ASSET_IMAGE; - } else if (cleanedType == "0E000000") { // game map sp PARTIALLY VERIFIED - return Utils::ASSET_GAME_MAP_SP; - } else if (cleanedType == "0B000000") { // col map sp PARTIALLY VERIFIED - return Utils::ASSET_COL_MAP_SP; - } else if (cleanedType == "01000000") { // physics preset PARTIALLY VERIFIED - return Utils::ASSET_PHYSPRESET; - } else if (cleanedType == "03000000") { // destructible def PARTIALLY VERIFIED - return Utils::ASSET_DESTRUCTIBLE; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/PS3/zonefile_cod5_ps3.h b/libs/zonefile/PS3/zonefile_cod5_ps3.h index 34760e7..d49ce5a 100644 --- a/libs/zonefile/PS3/zonefile_cod5_ps3.h +++ b/libs/zonefile/PS3/zonefile_cod5_ps3.h @@ -12,7 +12,7 @@ public: ~ZoneFile_COD5_PS3(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD5_PS3_H diff --git a/libs/zonefile/PS3/zonefile_cod6_ps3.cpp b/libs/zonefile/PS3/zonefile_cod6_ps3.cpp index 7604db3..dc3654c 100644 --- a/libs/zonefile/PS3/zonefile_cod6_ps3.cpp +++ b/libs/zonefile/PS3/zonefile_cod6_ps3.cpp @@ -1,12 +1,28 @@ #include "zonefile_cod6_ps3.h" -#include -#include -#include - ZoneFile_COD6_PS3::ZoneFile_COD6_PS3() - : ZoneFile() { - + : ZoneFile() +{ + pSetType(1, ASSET_TYPE_PHYSPRESET); + pSetType(3, ASSET_TYPE_DESTRUCTIBLE); + pSetType(4, ASSET_TYPE_XANIMPARTS); + pSetType(5, ASSET_TYPE_XMODEL); + pSetType(6, ASSET_TYPE_IMAGE); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(11, ASSET_TYPE_COL_MAP_SP); + pSetType(12, ASSET_TYPE_COLLISION_MAP); + pSetType(13, ASSET_TYPE_D3DBSP); + pSetType(14, ASSET_TYPE_GAME_MAP_SP); + pSetType(15, ASSET_TYPE_MENU); + pSetType(16, ASSET_TYPE_FONT); + pSetType(17, ASSET_TYPE_RAWFILE); + pSetType(18, ASSET_TYPE_WEAPON); + pSetType(19, ASSET_TYPE_GFX_MAP); + pSetType(20, ASSET_TYPE_LIGHT_DEF); + pSetType(26, ASSET_TYPE_FX); + pSetType(32, ASSET_TYPE_SCRIPT_PARSE_TREE); + pSetType(33, ASSET_TYPE_STRINGTABLE); } ZoneFile_COD6_PS3::~ZoneFile_COD6_PS3() { @@ -16,49 +32,3 @@ ZoneFile_COD6_PS3::~ZoneFile_COD6_PS3() { bool ZoneFile_COD6_PS3::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD6_PS3::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "17000000") { // localized string PARTIALLY VERIFIED - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "20000000") { // raw_file PARTIALLY VERIFIED - return Utils::ASSET_SCRIPT_PARSE_TREE; - } else if (cleanedType == "1A000000") { // fx PARTIALLY VERIFIED - return Utils::ASSET_FX; - } else if (cleanedType == "09000000") { // loaded_sound PARTIALLY VERIFIED - return Utils::ASSET_SOUND; - } else if (cleanedType == "04000000") { // x_anim PARTIALLY VERIFIED - return Utils::ASSET_Animation; - } else if (cleanedType == "0C000000") { // collision_map PARTIALLY VERIFIED - return Utils::ASSET_COLLISION_MAP; - } else if (cleanedType == "21000000") { // string_table PARTIALLY VERIFIED - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "15000000") { // menu_file PARTIALLY VERIFIED - return Utils::ASSET_MENU; - } else if (cleanedType == "07000000") { // tech set PARTIALLY VERIFIED - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "18000000") { // weapon PARTIALLY VERIFIED - return Utils::ASSET_WEAPON; - } else if (cleanedType == "11000000") { // gfx map PARTIALLY VERIFIED - return Utils::ASSET_GFX_MAP; - } else if (cleanedType == "12000000") { // light_def PARTIALLY VERIFIED - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "14000000") { // font PARTIALLY VERIFIED - return Utils::ASSET_FONT; - } else if (cleanedType == "05000000") { // xmodel PARTIALLY VERIFIED - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0D000000") { // d3dbsp PARTIALLY VERIFIED - return Utils::ASSET_D3DBSP; - } else if (cleanedType == "06000000") { // image PARTIALLY VERIFIED - return Utils::ASSET_IMAGE; - } else if (cleanedType == "0E000000") { // game map sp PARTIALLY VERIFIED - return Utils::ASSET_GAME_MAP_SP; - } else if (cleanedType == "0B000000") { // col map sp PARTIALLY VERIFIED - return Utils::ASSET_COL_MAP_SP; - } else if (cleanedType == "01000000") { // physics preset PARTIALLY VERIFIED - return Utils::ASSET_PHYSPRESET; - } else if (cleanedType == "03000000") { // destructible def PARTIALLY VERIFIED - return Utils::ASSET_DESTRUCTIBLE; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/PS3/zonefile_cod6_ps3.h b/libs/zonefile/PS3/zonefile_cod6_ps3.h index 4214c5a..7471b3a 100644 --- a/libs/zonefile/PS3/zonefile_cod6_ps3.h +++ b/libs/zonefile/PS3/zonefile_cod6_ps3.h @@ -12,7 +12,7 @@ public: ~ZoneFile_COD6_PS3(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD6_PS3_H diff --git a/libs/zonefile/PS3/zonefile_cod7_ps3.cpp b/libs/zonefile/PS3/zonefile_cod7_ps3.cpp index 5359205..0e50a63 100644 --- a/libs/zonefile/PS3/zonefile_cod7_ps3.cpp +++ b/libs/zonefile/PS3/zonefile_cod7_ps3.cpp @@ -5,8 +5,26 @@ #include ZoneFile_COD7_PS3::ZoneFile_COD7_PS3() + : ZoneFile() { - + pSetType(4, ASSET_TYPE_XANIMPARTS); + pSetType(5, ASSET_TYPE_XMODEL); + pSetType(6, ASSET_TYPE_IMAGE); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(11, ASSET_TYPE_COL_MAP_SP); + pSetType(12, ASSET_TYPE_COLLISION_MAP); + pSetType(13, ASSET_TYPE_D3DBSP); + pSetType(14, ASSET_TYPE_GAME_MAP_SP); + pSetType(15, ASSET_TYPE_MENU); + pSetType(16, ASSET_TYPE_FONT); + pSetType(17, ASSET_TYPE_LOCALIZE_ENTRY); + pSetType(18, ASSET_TYPE_WEAPON); + pSetType(19, ASSET_TYPE_GFX_MAP); + pSetType(20, ASSET_TYPE_LIGHT_DEF); + pSetType(26, ASSET_TYPE_FX); + pSetType(32, ASSET_TYPE_RAWFILE); + pSetType(33, ASSET_TYPE_STRINGTABLE); } ZoneFile_COD7_PS3::~ZoneFile_COD7_PS3() @@ -17,45 +35,3 @@ ZoneFile_COD7_PS3::~ZoneFile_COD7_PS3() bool ZoneFile_COD7_PS3::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD7_PS3::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "17000000") { // localized string PARTIALLY VERIFIED - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "20000000") { // raw_file PARTIALLY VERIFIED - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "1A000000") { // fx PARTIALLY VERIFIED - return Utils::ASSET_FX; - } else if (cleanedType == "09000000") { // loaded_sound PARTIALLY VERIFIED - return Utils::ASSET_SOUND; - } else if (cleanedType == "04000000") { // x_anim PARTIALLY VERIFIED - return Utils::ASSET_Animation; - } else if (cleanedType == "0C000000") { // collision_map PARTIALLY VERIFIED - return Utils::ASSET_COLLISION_MAP; - } else if (cleanedType == "21000000") { // string_table PARTIALLY VERIFIED - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "15000000") { // menu_file PARTIALLY VERIFIED - return Utils::ASSET_MENU; - } else if (cleanedType == "07000000") { // tech set PARTIALLY VERIFIED - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "18000000") { // weapon PARTIALLY VERIFIED - return Utils::ASSET_WEAPON; - } else if (cleanedType == "11000000") { // gfx map PARTIALLY VERIFIED - return Utils::ASSET_GFX_MAP; - } else if (cleanedType == "12000000") { // light_def PARTIALLY VERIFIED - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "14000000") { // font PARTIALLY VERIFIED - return Utils::ASSET_FONT; - } else if (cleanedType == "05000000") { // xmodel PARTIALLY VERIFIED - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0D000000") { // d3dbsp PARTIALLY VERIFIED - return Utils::ASSET_D3DBSP; - } else if (cleanedType == "06000000") { // image PARTIALLY VERIFIED - return Utils::ASSET_IMAGE; - } else if (cleanedType == "0E000000") { // game map sp PARTIALLY VERIFIED - return Utils::ASSET_GAME_MAP_SP; - } else if (cleanedType == "0B000000") { // col map sp PARTIALLY VERIFIED - return Utils::ASSET_COL_MAP_SP; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/PS3/zonefile_cod7_ps3.h b/libs/zonefile/PS3/zonefile_cod7_ps3.h index fd403a6..de3d924 100644 --- a/libs/zonefile/PS3/zonefile_cod7_ps3.h +++ b/libs/zonefile/PS3/zonefile_cod7_ps3.h @@ -10,7 +10,7 @@ public: ~ZoneFile_COD7_PS3(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD7_PS3_H diff --git a/libs/zonefile/PS3/zonefile_cod8_ps3.cpp b/libs/zonefile/PS3/zonefile_cod8_ps3.cpp index f2bf547..40577d9 100644 --- a/libs/zonefile/PS3/zonefile_cod8_ps3.cpp +++ b/libs/zonefile/PS3/zonefile_cod8_ps3.cpp @@ -5,8 +5,26 @@ #include ZoneFile_COD8_PS3::ZoneFile_COD8_PS3() + : ZoneFile() { - + pSetType(4, ASSET_TYPE_XANIMPARTS); + pSetType(5, ASSET_TYPE_XMODEL); + pSetType(6, ASSET_TYPE_IMAGE); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(11, ASSET_TYPE_COL_MAP_SP); + pSetType(12, ASSET_TYPE_COLLISION_MAP); + pSetType(13, ASSET_TYPE_D3DBSP); + pSetType(14, ASSET_TYPE_GAME_MAP_SP); + pSetType(15, ASSET_TYPE_MENU); + pSetType(16, ASSET_TYPE_FONT); + pSetType(17, ASSET_TYPE_LOCALIZE_ENTRY); + pSetType(18, ASSET_TYPE_WEAPON); + pSetType(19, ASSET_TYPE_GFX_MAP); + pSetType(20, ASSET_TYPE_LIGHT_DEF); + pSetType(26, ASSET_TYPE_FX); + pSetType(32, ASSET_TYPE_RAWFILE); + pSetType(33, ASSET_TYPE_STRINGTABLE); } ZoneFile_COD8_PS3::~ZoneFile_COD8_PS3() @@ -17,45 +35,3 @@ ZoneFile_COD8_PS3::~ZoneFile_COD8_PS3() bool ZoneFile_COD8_PS3::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD8_PS3::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "17000000") { // localized string PARTIALLY VERIFIED - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "20000000") { // raw_file PARTIALLY VERIFIED - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "1A000000") { // fx PARTIALLY VERIFIED - return Utils::ASSET_FX; - } else if (cleanedType == "09000000") { // loaded_sound PARTIALLY VERIFIED - return Utils::ASSET_SOUND; - } else if (cleanedType == "04000000") { // x_anim PARTIALLY VERIFIED - return Utils::ASSET_Animation; - } else if (cleanedType == "0C000000") { // collision_map PARTIALLY VERIFIED - return Utils::ASSET_COLLISION_MAP; - } else if (cleanedType == "21000000") { // string_table PARTIALLY VERIFIED - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "15000000") { // menu_file PARTIALLY VERIFIED - return Utils::ASSET_MENU; - } else if (cleanedType == "07000000") { // tech set PARTIALLY VERIFIED - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "18000000") { // weapon PARTIALLY VERIFIED - return Utils::ASSET_WEAPON; - } else if (cleanedType == "11000000") { // gfx map PARTIALLY VERIFIED - return Utils::ASSET_GFX_MAP; - } else if (cleanedType == "12000000") { // light_def PARTIALLY VERIFIED - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "14000000") { // font PARTIALLY VERIFIED - return Utils::ASSET_FONT; - } else if (cleanedType == "05000000") { // xmodel PARTIALLY VERIFIED - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0D000000") { // d3dbsp PARTIALLY VERIFIED - return Utils::ASSET_D3DBSP; - } else if (cleanedType == "06000000") { // image PARTIALLY VERIFIED - return Utils::ASSET_IMAGE; - } else if (cleanedType == "0E000000") { // game map sp PARTIALLY VERIFIED - return Utils::ASSET_GAME_MAP_SP; - } else if (cleanedType == "0B000000") { // col map sp PARTIALLY VERIFIED - return Utils::ASSET_COL_MAP_SP; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/PS3/zonefile_cod8_ps3.h b/libs/zonefile/PS3/zonefile_cod8_ps3.h index b6fb0fd..36d3897 100644 --- a/libs/zonefile/PS3/zonefile_cod8_ps3.h +++ b/libs/zonefile/PS3/zonefile_cod8_ps3.h @@ -10,7 +10,7 @@ public: ~ZoneFile_COD8_PS3(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD8_PS3_H diff --git a/libs/zonefile/PS3/zonefile_cod9_ps3.cpp b/libs/zonefile/PS3/zonefile_cod9_ps3.cpp index 12ef987..32737a3 100644 --- a/libs/zonefile/PS3/zonefile_cod9_ps3.cpp +++ b/libs/zonefile/PS3/zonefile_cod9_ps3.cpp @@ -6,7 +6,24 @@ ZoneFile_COD9_PS3::ZoneFile_COD9_PS3() { - + pSetType(4, ASSET_TYPE_XANIMPARTS); + pSetType(5, ASSET_TYPE_XMODEL); + pSetType(6, ASSET_TYPE_IMAGE); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(11, ASSET_TYPE_COL_MAP_SP); + pSetType(12, ASSET_TYPE_COLLISION_MAP); + pSetType(13, ASSET_TYPE_D3DBSP); + pSetType(14, ASSET_TYPE_GAME_MAP_SP); + pSetType(15, ASSET_TYPE_MENU); + pSetType(16, ASSET_TYPE_FONT); + pSetType(17, ASSET_TYPE_LOCALIZE_ENTRY); + pSetType(18, ASSET_TYPE_WEAPON); + pSetType(19, ASSET_TYPE_GFX_MAP); + pSetType(20, ASSET_TYPE_LIGHT_DEF); + pSetType(26, ASSET_TYPE_FX); + pSetType(32, ASSET_TYPE_RAWFILE); + pSetType(33, ASSET_TYPE_STRINGTABLE); } ZoneFile_COD9_PS3::~ZoneFile_COD9_PS3() @@ -17,45 +34,3 @@ ZoneFile_COD9_PS3::~ZoneFile_COD9_PS3() bool ZoneFile_COD9_PS3::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD9_PS3::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "17000000") { // localized string PARTIALLY VERIFIED - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "20000000") { // raw_file PARTIALLY VERIFIED - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "1A000000") { // fx PARTIALLY VERIFIED - return Utils::ASSET_FX; - } else if (cleanedType == "09000000") { // loaded_sound PARTIALLY VERIFIED - return Utils::ASSET_SOUND; - } else if (cleanedType == "04000000") { // x_anim PARTIALLY VERIFIED - return Utils::ASSET_Animation; - } else if (cleanedType == "0C000000") { // collision_map PARTIALLY VERIFIED - return Utils::ASSET_COLLISION_MAP; - } else if (cleanedType == "21000000") { // string_table PARTIALLY VERIFIED - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "15000000") { // menu_file PARTIALLY VERIFIED - return Utils::ASSET_MENU; - } else if (cleanedType == "07000000") { // tech set PARTIALLY VERIFIED - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "18000000") { // weapon PARTIALLY VERIFIED - return Utils::ASSET_WEAPON; - } else if (cleanedType == "11000000") { // gfx map PARTIALLY VERIFIED - return Utils::ASSET_GFX_MAP; - } else if (cleanedType == "12000000") { // light_def PARTIALLY VERIFIED - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "14000000") { // font PARTIALLY VERIFIED - return Utils::ASSET_FONT; - } else if (cleanedType == "05000000") { // xmodel PARTIALLY VERIFIED - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0D000000") { // d3dbsp PARTIALLY VERIFIED - return Utils::ASSET_D3DBSP; - } else if (cleanedType == "06000000") { // image PARTIALLY VERIFIED - return Utils::ASSET_IMAGE; - } else if (cleanedType == "0E000000") { // game map sp PARTIALLY VERIFIED - return Utils::ASSET_GAME_MAP_SP; - } else if (cleanedType == "0B000000") { // col map sp PARTIALLY VERIFIED - return Utils::ASSET_COL_MAP_SP; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/PS3/zonefile_cod9_ps3.h b/libs/zonefile/PS3/zonefile_cod9_ps3.h index 63c46bc..9e2b333 100644 --- a/libs/zonefile/PS3/zonefile_cod9_ps3.h +++ b/libs/zonefile/PS3/zonefile_cod9_ps3.h @@ -10,7 +10,7 @@ public: ~ZoneFile_COD9_PS3(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD9_PS3_H diff --git a/libs/zonefile/Wii/zonefile_cod4_wii.cpp b/libs/zonefile/Wii/zonefile_cod4_wii.cpp index 0af01a7..dfda7d8 100644 --- a/libs/zonefile/Wii/zonefile_cod4_wii.cpp +++ b/libs/zonefile/Wii/zonefile_cod4_wii.cpp @@ -5,8 +5,26 @@ #include ZoneFile_COD4_Wii::ZoneFile_COD4_Wii() + : ZoneFile() { - + pSetType(4, ASSET_TYPE_XANIMPARTS); + pSetType(5, ASSET_TYPE_XMODEL); + pSetType(6, ASSET_TYPE_IMAGE); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(11, ASSET_TYPE_COL_MAP_SP); + pSetType(12, ASSET_TYPE_COLLISION_MAP); + pSetType(13, ASSET_TYPE_D3DBSP); + pSetType(14, ASSET_TYPE_GAME_MAP_SP); + pSetType(15, ASSET_TYPE_MENU); + pSetType(16, ASSET_TYPE_FONT); + pSetType(17, ASSET_TYPE_LOCALIZE_ENTRY); + pSetType(18, ASSET_TYPE_WEAPON); + pSetType(19, ASSET_TYPE_GFX_MAP); + pSetType(20, ASSET_TYPE_LIGHT_DEF); + pSetType(26, ASSET_TYPE_FX); + pSetType(32, ASSET_TYPE_RAWFILE); + pSetType(33, ASSET_TYPE_STRINGTABLE); } ZoneFile_COD4_Wii::~ZoneFile_COD4_Wii() @@ -17,45 +35,3 @@ ZoneFile_COD4_Wii::~ZoneFile_COD4_Wii() bool ZoneFile_COD4_Wii::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD4_Wii::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "17000000") { // localized string PARTIALLY VERIFIED - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "20000000") { // raw_file PARTIALLY VERIFIED - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "1A000000") { // fx PARTIALLY VERIFIED - return Utils::ASSET_FX; - } else if (cleanedType == "09000000") { // loaded_sound PARTIALLY VERIFIED - return Utils::ASSET_SOUND; - } else if (cleanedType == "04000000") { // x_anim PARTIALLY VERIFIED - return Utils::ASSET_Animation; - } else if (cleanedType == "0C000000") { // collision_map PARTIALLY VERIFIED - return Utils::ASSET_COLLISION_MAP; - } else if (cleanedType == "21000000") { // string_table PARTIALLY VERIFIED - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "15000000") { // menu_file PARTIALLY VERIFIED - return Utils::ASSET_MENU; - } else if (cleanedType == "07000000") { // tech set PARTIALLY VERIFIED - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "18000000") { // weapon PARTIALLY VERIFIED - return Utils::ASSET_WEAPON; - } else if (cleanedType == "11000000") { // gfx map PARTIALLY VERIFIED - return Utils::ASSET_GFX_MAP; - } else if (cleanedType == "12000000") { // light_def PARTIALLY VERIFIED - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "14000000") { // font PARTIALLY VERIFIED - return Utils::ASSET_FONT; - } else if (cleanedType == "05000000") { // xmodel PARTIALLY VERIFIED - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0D000000") { // d3dbsp PARTIALLY VERIFIED - return Utils::ASSET_D3DBSP; - } else if (cleanedType == "06000000") { // image PARTIALLY VERIFIED - return Utils::ASSET_IMAGE; - } else if (cleanedType == "0E000000") { // game map sp PARTIALLY VERIFIED - return Utils::ASSET_GAME_MAP_SP; - } else if (cleanedType == "0B000000") { // col map sp PARTIALLY VERIFIED - return Utils::ASSET_COL_MAP_SP; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/Wii/zonefile_cod4_wii.h b/libs/zonefile/Wii/zonefile_cod4_wii.h index ad1f426..f70c595 100644 --- a/libs/zonefile/Wii/zonefile_cod4_wii.h +++ b/libs/zonefile/Wii/zonefile_cod4_wii.h @@ -10,7 +10,7 @@ public: ~ZoneFile_COD4_Wii(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD4_WII_H diff --git a/libs/zonefile/Wii/zonefile_cod7_wii.cpp b/libs/zonefile/Wii/zonefile_cod7_wii.cpp index 465f3c4..75b1f94 100644 --- a/libs/zonefile/Wii/zonefile_cod7_wii.cpp +++ b/libs/zonefile/Wii/zonefile_cod7_wii.cpp @@ -5,8 +5,26 @@ #include ZoneFile_COD7_Wii::ZoneFile_COD7_Wii() + : ZoneFile() { - + pSetType(4, ASSET_TYPE_XANIMPARTS); + pSetType(5, ASSET_TYPE_XMODEL); + pSetType(6, ASSET_TYPE_IMAGE); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(11, ASSET_TYPE_COL_MAP_SP); + pSetType(12, ASSET_TYPE_COLLISION_MAP); + pSetType(13, ASSET_TYPE_D3DBSP); + pSetType(14, ASSET_TYPE_GAME_MAP_SP); + pSetType(15, ASSET_TYPE_MENU); + pSetType(16, ASSET_TYPE_FONT); + pSetType(17, ASSET_TYPE_LOCALIZE_ENTRY); + pSetType(18, ASSET_TYPE_WEAPON); + pSetType(19, ASSET_TYPE_GFX_MAP); + pSetType(20, ASSET_TYPE_LIGHT_DEF); + pSetType(26, ASSET_TYPE_FX); + pSetType(32, ASSET_TYPE_RAWFILE); + pSetType(33, ASSET_TYPE_STRINGTABLE); } ZoneFile_COD7_Wii::~ZoneFile_COD7_Wii() @@ -17,46 +35,3 @@ ZoneFile_COD7_Wii::~ZoneFile_COD7_Wii() bool ZoneFile_COD7_Wii::Load(const QByteArray aFileData) { return true; } - - -Utils::AssetType ZoneFile_COD7_Wii::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "17000000") { // localized string PARTIALLY VERIFIED - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "20000000") { // raw_file PARTIALLY VERIFIED - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "1A000000") { // fx PARTIALLY VERIFIED - return Utils::ASSET_FX; - } else if (cleanedType == "09000000") { // loaded_sound PARTIALLY VERIFIED - return Utils::ASSET_SOUND; - } else if (cleanedType == "04000000") { // x_anim PARTIALLY VERIFIED - return Utils::ASSET_Animation; - } else if (cleanedType == "0C000000") { // collision_map PARTIALLY VERIFIED - return Utils::ASSET_COLLISION_MAP; - } else if (cleanedType == "21000000") { // string_table PARTIALLY VERIFIED - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "15000000") { // menu_file PARTIALLY VERIFIED - return Utils::ASSET_MENU; - } else if (cleanedType == "07000000") { // tech set PARTIALLY VERIFIED - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "18000000") { // weapon PARTIALLY VERIFIED - return Utils::ASSET_WEAPON; - } else if (cleanedType == "11000000") { // gfx map PARTIALLY VERIFIED - return Utils::ASSET_GFX_MAP; - } else if (cleanedType == "12000000") { // light_def PARTIALLY VERIFIED - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "14000000") { // font PARTIALLY VERIFIED - return Utils::ASSET_FONT; - } else if (cleanedType == "05000000") { // xmodel PARTIALLY VERIFIED - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0D000000") { // d3dbsp PARTIALLY VERIFIED - return Utils::ASSET_D3DBSP; - } else if (cleanedType == "06000000") { // image PARTIALLY VERIFIED - return Utils::ASSET_IMAGE; - } else if (cleanedType == "0E000000") { // game map sp PARTIALLY VERIFIED - return Utils::ASSET_GAME_MAP_SP; - } else if (cleanedType == "0B000000") { // col map sp PARTIALLY VERIFIED - return Utils::ASSET_COL_MAP_SP; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/Wii/zonefile_cod7_wii.h b/libs/zonefile/Wii/zonefile_cod7_wii.h index ccf6db2..6f5c3a0 100644 --- a/libs/zonefile/Wii/zonefile_cod7_wii.h +++ b/libs/zonefile/Wii/zonefile_cod7_wii.h @@ -10,7 +10,7 @@ public: ~ZoneFile_COD7_Wii(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD7_WII_H diff --git a/libs/zonefile/Wii/zonefile_cod8_wii.cpp b/libs/zonefile/Wii/zonefile_cod8_wii.cpp index ed42eb5..6f53d4b 100644 --- a/libs/zonefile/Wii/zonefile_cod8_wii.cpp +++ b/libs/zonefile/Wii/zonefile_cod8_wii.cpp @@ -5,8 +5,26 @@ #include ZoneFile_COD8_Wii::ZoneFile_COD8_Wii() + : ZoneFile() { - + pSetType(4, ASSET_TYPE_XANIMPARTS); + pSetType(5, ASSET_TYPE_XMODEL); + pSetType(6, ASSET_TYPE_IMAGE); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(11, ASSET_TYPE_COL_MAP_SP); + pSetType(12, ASSET_TYPE_COLLISION_MAP); + pSetType(13, ASSET_TYPE_D3DBSP); + pSetType(14, ASSET_TYPE_GAME_MAP_SP); + pSetType(15, ASSET_TYPE_MENU); + pSetType(16, ASSET_TYPE_FONT); + pSetType(17, ASSET_TYPE_LOCALIZE_ENTRY); + pSetType(18, ASSET_TYPE_WEAPON); + pSetType(19, ASSET_TYPE_GFX_MAP); + pSetType(20, ASSET_TYPE_LIGHT_DEF); + pSetType(26, ASSET_TYPE_FX); + pSetType(32, ASSET_TYPE_RAWFILE); + pSetType(33, ASSET_TYPE_STRINGTABLE); } ZoneFile_COD8_Wii::~ZoneFile_COD8_Wii() @@ -17,45 +35,3 @@ ZoneFile_COD8_Wii::~ZoneFile_COD8_Wii() bool ZoneFile_COD8_Wii::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD8_Wii::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "17000000") { // localized string PARTIALLY VERIFIED - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "20000000") { // raw_file PARTIALLY VERIFIED - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "1A000000") { // fx PARTIALLY VERIFIED - return Utils::ASSET_FX; - } else if (cleanedType == "09000000") { // loaded_sound PARTIALLY VERIFIED - return Utils::ASSET_SOUND; - } else if (cleanedType == "04000000") { // x_anim PARTIALLY VERIFIED - return Utils::ASSET_Animation; - } else if (cleanedType == "0C000000") { // collision_map PARTIALLY VERIFIED - return Utils::ASSET_COLLISION_MAP; - } else if (cleanedType == "21000000") { // string_table PARTIALLY VERIFIED - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "15000000") { // menu_file PARTIALLY VERIFIED - return Utils::ASSET_MENU; - } else if (cleanedType == "07000000") { // tech set PARTIALLY VERIFIED - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "18000000") { // weapon PARTIALLY VERIFIED - return Utils::ASSET_WEAPON; - } else if (cleanedType == "11000000") { // gfx map PARTIALLY VERIFIED - return Utils::ASSET_GFX_MAP; - } else if (cleanedType == "12000000") { // light_def PARTIALLY VERIFIED - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "14000000") { // font PARTIALLY VERIFIED - return Utils::ASSET_FONT; - } else if (cleanedType == "05000000") { // xmodel PARTIALLY VERIFIED - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0D000000") { // d3dbsp PARTIALLY VERIFIED - return Utils::ASSET_D3DBSP; - } else if (cleanedType == "06000000") { // image PARTIALLY VERIFIED - return Utils::ASSET_IMAGE; - } else if (cleanedType == "0E000000") { // game map sp PARTIALLY VERIFIED - return Utils::ASSET_GAME_MAP_SP; - } else if (cleanedType == "0B000000") { // col map sp PARTIALLY VERIFIED - return Utils::ASSET_COL_MAP_SP; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/Wii/zonefile_cod8_wii.h b/libs/zonefile/Wii/zonefile_cod8_wii.h index dd520c0..ea209fd 100644 --- a/libs/zonefile/Wii/zonefile_cod8_wii.h +++ b/libs/zonefile/Wii/zonefile_cod8_wii.h @@ -10,7 +10,7 @@ public: ~ZoneFile_COD8_Wii(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD8_WII_H diff --git a/libs/zonefile/WiiU/zonefile_cod10_wiiu.cpp b/libs/zonefile/WiiU/zonefile_cod10_wiiu.cpp index 299f1e8..0671eb7 100644 --- a/libs/zonefile/WiiU/zonefile_cod10_wiiu.cpp +++ b/libs/zonefile/WiiU/zonefile_cod10_wiiu.cpp @@ -5,8 +5,26 @@ #include ZoneFile_COD10_WiiU::ZoneFile_COD10_WiiU() + : ZoneFile() { - + pSetType(4, ASSET_TYPE_XANIMPARTS); + pSetType(5, ASSET_TYPE_XMODEL); + pSetType(6, ASSET_TYPE_IMAGE); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(11, ASSET_TYPE_COL_MAP_SP); + pSetType(12, ASSET_TYPE_COLLISION_MAP); + pSetType(13, ASSET_TYPE_D3DBSP); + pSetType(14, ASSET_TYPE_GAME_MAP_SP); + pSetType(15, ASSET_TYPE_MENU); + pSetType(16, ASSET_TYPE_FONT); + pSetType(17, ASSET_TYPE_LOCALIZE_ENTRY); + pSetType(18, ASSET_TYPE_WEAPON); + pSetType(19, ASSET_TYPE_GFX_MAP); + pSetType(20, ASSET_TYPE_LIGHT_DEF); + pSetType(26, ASSET_TYPE_FX); + pSetType(32, ASSET_TYPE_RAWFILE); + pSetType(33, ASSET_TYPE_STRINGTABLE); } ZoneFile_COD10_WiiU::~ZoneFile_COD10_WiiU() @@ -17,45 +35,3 @@ ZoneFile_COD10_WiiU::~ZoneFile_COD10_WiiU() bool ZoneFile_COD10_WiiU::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD10_WiiU::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "17000000") { // localized string PARTIALLY VERIFIED - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "20000000") { // raw_file PARTIALLY VERIFIED - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "1A000000") { // fx PARTIALLY VERIFIED - return Utils::ASSET_FX; - } else if (cleanedType == "09000000") { // loaded_sound PARTIALLY VERIFIED - return Utils::ASSET_SOUND; - } else if (cleanedType == "04000000") { // x_anim PARTIALLY VERIFIED - return Utils::ASSET_Animation; - } else if (cleanedType == "0C000000") { // collision_map PARTIALLY VERIFIED - return Utils::ASSET_COLLISION_MAP; - } else if (cleanedType == "21000000") { // string_table PARTIALLY VERIFIED - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "15000000") { // menu_file PARTIALLY VERIFIED - return Utils::ASSET_MENU; - } else if (cleanedType == "07000000") { // tech set PARTIALLY VERIFIED - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "18000000") { // weapon PARTIALLY VERIFIED - return Utils::ASSET_WEAPON; - } else if (cleanedType == "11000000") { // gfx map PARTIALLY VERIFIED - return Utils::ASSET_GFX_MAP; - } else if (cleanedType == "12000000") { // light_def PARTIALLY VERIFIED - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "14000000") { // font PARTIALLY VERIFIED - return Utils::ASSET_FONT; - } else if (cleanedType == "05000000") { // xmodel PARTIALLY VERIFIED - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0D000000") { // d3dbsp PARTIALLY VERIFIED - return Utils::ASSET_D3DBSP; - } else if (cleanedType == "06000000") { // image PARTIALLY VERIFIED - return Utils::ASSET_IMAGE; - } else if (cleanedType == "0E000000") { // game map sp PARTIALLY VERIFIED - return Utils::ASSET_GAME_MAP_SP; - } else if (cleanedType == "0B000000") { // col map sp PARTIALLY VERIFIED - return Utils::ASSET_COL_MAP_SP; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/WiiU/zonefile_cod10_wiiu.h b/libs/zonefile/WiiU/zonefile_cod10_wiiu.h index 2283fa2..0026f0a 100644 --- a/libs/zonefile/WiiU/zonefile_cod10_wiiu.h +++ b/libs/zonefile/WiiU/zonefile_cod10_wiiu.h @@ -10,7 +10,7 @@ public: ~ZoneFile_COD10_WiiU(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD10_WIIU_H diff --git a/libs/zonefile/WiiU/zonefile_cod9_wiiu.cpp b/libs/zonefile/WiiU/zonefile_cod9_wiiu.cpp index e8d705c..0734775 100644 --- a/libs/zonefile/WiiU/zonefile_cod9_wiiu.cpp +++ b/libs/zonefile/WiiU/zonefile_cod9_wiiu.cpp @@ -5,8 +5,26 @@ #include ZoneFile_COD9_WiiU::ZoneFile_COD9_WiiU() + : ZoneFile() { - + pSetType(4, ASSET_TYPE_XANIMPARTS); + pSetType(5, ASSET_TYPE_XMODEL); + pSetType(6, ASSET_TYPE_IMAGE); + pSetType(7, ASSET_TYPE_TECHNIQUE_SET); + pSetType(9, ASSET_TYPE_SOUND); + pSetType(11, ASSET_TYPE_COL_MAP_SP); + pSetType(12, ASSET_TYPE_COLLISION_MAP); + pSetType(13, ASSET_TYPE_D3DBSP); + pSetType(14, ASSET_TYPE_GAME_MAP_SP); + pSetType(15, ASSET_TYPE_MENU); + pSetType(16, ASSET_TYPE_FONT); + pSetType(17, ASSET_TYPE_LOCALIZE_ENTRY); + pSetType(18, ASSET_TYPE_WEAPON); + pSetType(19, ASSET_TYPE_GFX_MAP); + pSetType(20, ASSET_TYPE_LIGHT_DEF); + pSetType(26, ASSET_TYPE_FX); + pSetType(32, ASSET_TYPE_RAWFILE); + pSetType(33, ASSET_TYPE_STRINGTABLE); } ZoneFile_COD9_WiiU::~ZoneFile_COD9_WiiU() @@ -17,45 +35,3 @@ ZoneFile_COD9_WiiU::~ZoneFile_COD9_WiiU() bool ZoneFile_COD9_WiiU::Load(const QByteArray aFileData) { return true; } - -Utils::AssetType ZoneFile_COD9_WiiU::AssetStrToEnum(const QString aAssetType) { - const QString cleanedType = aAssetType.toUpper(); - if (cleanedType == "17000000") { // localized string PARTIALLY VERIFIED - return Utils::ASSET_LOCALIZE_ENTRY; - } else if (cleanedType == "20000000") { // raw_file PARTIALLY VERIFIED - return Utils::ASSET_RAWFILE; - } else if (cleanedType == "1A000000") { // fx PARTIALLY VERIFIED - return Utils::ASSET_FX; - } else if (cleanedType == "09000000") { // loaded_sound PARTIALLY VERIFIED - return Utils::ASSET_SOUND; - } else if (cleanedType == "04000000") { // x_anim PARTIALLY VERIFIED - return Utils::ASSET_Animation; - } else if (cleanedType == "0C000000") { // collision_map PARTIALLY VERIFIED - return Utils::ASSET_COLLISION_MAP; - } else if (cleanedType == "21000000") { // string_table PARTIALLY VERIFIED - return Utils::ASSET_STRINGTABLE; - } else if (cleanedType == "15000000") { // menu_file PARTIALLY VERIFIED - return Utils::ASSET_MENU; - } else if (cleanedType == "07000000") { // tech set PARTIALLY VERIFIED - return Utils::ASSET_TECHNIQUE_SET; - } else if (cleanedType == "18000000") { // weapon PARTIALLY VERIFIED - return Utils::ASSET_WEAPON; - } else if (cleanedType == "11000000") { // gfx map PARTIALLY VERIFIED - return Utils::ASSET_GFX_MAP; - } else if (cleanedType == "12000000") { // light_def PARTIALLY VERIFIED - return Utils::ASSET_LIGHT_DEF; - } else if (cleanedType == "14000000") { // font PARTIALLY VERIFIED - return Utils::ASSET_FONT; - } else if (cleanedType == "05000000") { // xmodel PARTIALLY VERIFIED - return Utils::ASSET_XMODEL; - } else if (cleanedType == "0D000000") { // d3dbsp PARTIALLY VERIFIED - return Utils::ASSET_D3DBSP; - } else if (cleanedType == "06000000") { // image PARTIALLY VERIFIED - return Utils::ASSET_IMAGE; - } else if (cleanedType == "0E000000") { // game map sp PARTIALLY VERIFIED - return Utils::ASSET_GAME_MAP_SP; - } else if (cleanedType == "0B000000") { // col map sp PARTIALLY VERIFIED - return Utils::ASSET_COL_MAP_SP; - } - return Utils::ASSET_NONE; -} diff --git a/libs/zonefile/WiiU/zonefile_cod9_wiiu.h b/libs/zonefile/WiiU/zonefile_cod9_wiiu.h index 0a9b5cc..2febacc 100644 --- a/libs/zonefile/WiiU/zonefile_cod9_wiiu.h +++ b/libs/zonefile/WiiU/zonefile_cod9_wiiu.h @@ -10,7 +10,7 @@ public: ~ZoneFile_COD9_WiiU(); bool Load(const QByteArray aFileData) override; - Utils::AssetType AssetStrToEnum(const QString aAssetType) override; + }; #endif // ZONEFILE_COD9_H diff --git a/libs/zonefile/zonefile.cpp b/libs/zonefile/zonefile.cpp index cf329a4..823ca80 100644 --- a/libs/zonefile/zonefile.cpp +++ b/libs/zonefile/zonefile.cpp @@ -1,4 +1,6 @@ #include "zonefile.h" +#include "xassetlist.h" +#include "xfile.h" #include #include @@ -11,7 +13,12 @@ ZoneFile::ZoneFile() : mTags(), mRecordCount(), mRecords(), - mAssetMap() { + mPlatform(), + mGame(), + mTypeMap(), + mHeaderData(), + mAssetList(this) +{ } @@ -26,7 +33,8 @@ ZoneFile::ZoneFile(const ZoneFile &aZoneFile) { mTags = aZoneFile.mTags; mRecordCount = aZoneFile.mRecordCount; mRecords = aZoneFile.mRecords; - mAssetMap = aZoneFile.mAssetMap; + mAssetList = aZoneFile.mAssetList; + mHeaderData = aZoneFile.mHeaderData; } ZoneFile &ZoneFile::operator=(const ZoneFile &other) { @@ -37,40 +45,83 @@ ZoneFile &ZoneFile::operator=(const ZoneFile &other) { mTags = other.mTags; mRecordCount = other.mRecordCount; mRecords = other.mRecords; - mAssetMap = other.mAssetMap; + mAssetList = other.mAssetList; + mHeaderData = other.mHeaderData; } return *this; } -QString ZoneFile::GetStem() { +bool ZoneFile::Load(const QByteArray aFileData) +{ + QDataStream zoneStream(aFileData); + + mHeaderData.ParseData(&zoneStream); + mAssetList.ParseData(&zoneStream); + + return true; +} + +bool ZoneFile::Load(const QString aFilePath) +{ + QFile file(aFilePath); + if (!file.open(QIODevice::ReadOnly)) + { + qDebug() << "Failed to open file: " << aFilePath; + return false; + } + + return Load(file.readAll()); +} + +QByteArray ZoneFile::GetBinaryData() { + return {}; +} + +QString ZoneFile::GetStem() const { return mStem; } -QString ZoneFile::GetBaseStem() { +QString ZoneFile::GetBaseStem() const { return mStem.split('.').first(); } -quint32 ZoneFile::GetSize() { +quint32 ZoneFile::GetSize() const { return mSize; } -quint32 ZoneFile::GetTagCount() { +quint32 ZoneFile::GetTagCount() const { return mTagCount; } -QStringList ZoneFile::GetTags() { +QStringList ZoneFile::GetTags() const { return mTags; } -quint32 ZoneFile::GetRecordCount() { - return mRecordCount; +QStringList ZoneFile::GetNames() const { + QStringList result; + + for (int i = 0; i < mAssetList.Size(); i++) + { + auto current = mAssetList.GetAsset(i); + result.append(current->GetName()); + } + + return result; } -QStringList ZoneFile::GetRecords() { - return mRecords; +QVector ZoneFile::GetTypes() const +{ + QVector result; + + for (int i = 0; i < mAssetList.Size(); i++) + { + result.append(mAssetList.GetAsset(i)->GetType()); + } + + return result; } -QVector ZoneFile::GetAssetList() { +XAssetList ZoneFile::GetAssetList() const { return mAssetList; } @@ -98,7 +149,25 @@ void ZoneFile::SetRecords(const QStringList aRecords) { mRecords = aRecords; } -void ZoneFile::SetAssetMap(const AssetMap aAssetMap) { - mAssetMap = aAssetMap; +void ZoneFile::SetHeaderData(XFile aHeaderData) +{ + mHeaderData = aHeaderData; } +void ZoneFile::SetAssetList(XAssetList aAssetList) { + mAssetList = aAssetList; +} + +XAssetType ZoneFile::GetType(quint32 aRawType) const +{ + if (mTypeMap.contains(aRawType)) + { + return mTypeMap[aRawType]; + } + return ASSET_TYPE_NONE; +} + +void ZoneFile::pSetType(quint32 aRawType, XAssetType aType) +{ + mTypeMap[aRawType] = aType; +} diff --git a/libs/zonefile/zonefile.h b/libs/zonefile/zonefile.h index aaae555..ed1012c 100644 --- a/libs/zonefile/zonefile.h +++ b/libs/zonefile/zonefile.h @@ -2,10 +2,12 @@ #define ZONEFILE_H #include "xasset.h" -#include "utils.h" +#include "xassetlist.h" +#include "xfile.h" #include #include +#include class ZoneFile { @@ -15,20 +17,18 @@ public: ZoneFile(const ZoneFile &aZoneFile); ZoneFile &operator=(const ZoneFile &other); - virtual bool Load(const QByteArray aFileData) = 0; - virtual Utils::AssetType AssetStrToEnum(const QString aAssetType) = 0; - virtual QByteArray GetBinaryData() { - return {}; - } + virtual bool Load(const QByteArray aFileData); + virtual bool Load(const QString aFilePath); + virtual QByteArray GetBinaryData(); - QString GetStem(); - QString GetBaseStem(); - quint32 GetSize(); - quint32 GetTagCount(); - QStringList GetTags(); - quint32 GetRecordCount(); - QStringList GetRecords(); - QVector GetAssetList(); + QString GetStem() const; + QString GetBaseStem() const; + quint32 GetSize() const; + quint32 GetTagCount() const; + QStringList GetTags() const; + QVector GetTypes() const; + XAssetList GetAssetList() const; + QStringList GetNames() const; void SetStem(const QString aStem); void SetSize(quint32 aSize); @@ -36,7 +36,12 @@ public: void SetTags(const QStringList aTags); void SetRecordCount(quint32 aRecordCount); void SetRecords(const QStringList aRecords); - void SetAssetList(const QVector aAssetList); + void SetHeaderData(XFile aHeaderData); + void SetAssetList(XAssetList aAssetList); + XAssetType GetType(quint32 aRawType) const; + +protected: + void pSetType(quint32 aRawType, XAssetType aType); private: QString mStem; @@ -45,9 +50,14 @@ private: QStringList mTags; quint32 mRecordCount; QStringList mRecords; - QVector mAssetList; + QVector mAssetTypes; QString mPlatform; QString mGame; + + QMap mTypeMap; + + XFile mHeaderData; + XAssetList mAssetList; }; #endif // ZONEFILE_H diff --git a/tests/360/autotest_cod10_360.cpp b/tests/360/autotest_cod10_360.cpp index 7da3e78..0b9e1f8 100644 --- a/tests/360/autotest_cod10_360.cpp +++ b/tests/360/autotest_cod10_360.cpp @@ -120,7 +120,7 @@ void AutoTest_COD10_360::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD10"; diff --git a/tests/360/autotest_cod11_360.cpp b/tests/360/autotest_cod11_360.cpp index 74fe896..cc41316 100644 --- a/tests/360/autotest_cod11_360.cpp +++ b/tests/360/autotest_cod11_360.cpp @@ -120,7 +120,7 @@ void AutoTest_COD11_360::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD11"; diff --git a/tests/360/autotest_cod12_360.cpp b/tests/360/autotest_cod12_360.cpp index f5f10bf..4c50098 100644 --- a/tests/360/autotest_cod12_360.cpp +++ b/tests/360/autotest_cod12_360.cpp @@ -238,7 +238,7 @@ void AutoTest_COD12_360::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD12"; diff --git a/tests/360/autotest_cod2_360.cpp b/tests/360/autotest_cod2_360.cpp index 11a8cc2..37b2223 100644 --- a/tests/360/autotest_cod2_360.cpp +++ b/tests/360/autotest_cod2_360.cpp @@ -143,7 +143,7 @@ void AutoTest_COD2_360::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD2"; diff --git a/tests/360/autotest_cod4_360.cpp b/tests/360/autotest_cod4_360.cpp index a27f2da..837839d 100644 --- a/tests/360/autotest_cod4_360.cpp +++ b/tests/360/autotest_cod4_360.cpp @@ -122,7 +122,7 @@ void AutoTest_COD4_360::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD4"; diff --git a/tests/360/autotest_cod5_360.cpp b/tests/360/autotest_cod5_360.cpp index 039c8a5..aa21cae 100644 --- a/tests/360/autotest_cod5_360.cpp +++ b/tests/360/autotest_cod5_360.cpp @@ -126,7 +126,7 @@ void AutoTest_COD5_360::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD5"; diff --git a/tests/360/autotest_cod6_360.cpp b/tests/360/autotest_cod6_360.cpp index 259b10b..24ebd11 100644 --- a/tests/360/autotest_cod6_360.cpp +++ b/tests/360/autotest_cod6_360.cpp @@ -146,7 +146,7 @@ void AutoTest_COD6_360::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD6"; diff --git a/tests/360/autotest_cod7_360.cpp b/tests/360/autotest_cod7_360.cpp index 2b32e58..0c2d70d 100644 --- a/tests/360/autotest_cod7_360.cpp +++ b/tests/360/autotest_cod7_360.cpp @@ -222,7 +222,7 @@ void AutoTest_COD7_360::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD7"; diff --git a/tests/360/autotest_cod8_360.cpp b/tests/360/autotest_cod8_360.cpp index 18bc90b..a5d56ce 100644 --- a/tests/360/autotest_cod8_360.cpp +++ b/tests/360/autotest_cod8_360.cpp @@ -139,7 +139,7 @@ void AutoTest_COD8_360::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD8"; diff --git a/tests/360/autotest_cod9_360.cpp b/tests/360/autotest_cod9_360.cpp index 6df0cbc..d0c75ce 100644 --- a/tests/360/autotest_cod9_360.cpp +++ b/tests/360/autotest_cod9_360.cpp @@ -120,7 +120,7 @@ void AutoTest_COD9_360::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD9"; diff --git a/tests/PC/autotest_cod10_pc.cpp b/tests/PC/autotest_cod10_pc.cpp index ab58eef..36f74d0 100644 --- a/tests/PC/autotest_cod10_pc.cpp +++ b/tests/PC/autotest_cod10_pc.cpp @@ -116,7 +116,7 @@ void AutoTest_COD10_PC::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD10"; diff --git a/tests/PC/autotest_cod11_pc.cpp b/tests/PC/autotest_cod11_pc.cpp index 9874b66..b81ee92 100644 --- a/tests/PC/autotest_cod11_pc.cpp +++ b/tests/PC/autotest_cod11_pc.cpp @@ -116,7 +116,7 @@ void AutoTest_COD11_PC::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD11"; diff --git a/tests/PC/autotest_cod12_pc.cpp b/tests/PC/autotest_cod12_pc.cpp index 0f05a55..d5fcafe 100644 --- a/tests/PC/autotest_cod12_pc.cpp +++ b/tests/PC/autotest_cod12_pc.cpp @@ -209,7 +209,7 @@ void AutoTest_COD12_PC::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD12"; diff --git a/tests/PC/autotest_cod4_pc.cpp b/tests/PC/autotest_cod4_pc.cpp index ab3cc1f..eb195fe 100644 --- a/tests/PC/autotest_cod4_pc.cpp +++ b/tests/PC/autotest_cod4_pc.cpp @@ -113,7 +113,7 @@ void AutoTest_COD4_PC::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD4"; diff --git a/tests/PC/autotest_cod5_pc.cpp b/tests/PC/autotest_cod5_pc.cpp index e4e6955..86dbb9d 100644 --- a/tests/PC/autotest_cod5_pc.cpp +++ b/tests/PC/autotest_cod5_pc.cpp @@ -117,7 +117,7 @@ void AutoTest_COD5_PC::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD5"; diff --git a/tests/PC/autotest_cod6_pc.cpp b/tests/PC/autotest_cod6_pc.cpp index 4d0b75f..87eb93a 100644 --- a/tests/PC/autotest_cod6_pc.cpp +++ b/tests/PC/autotest_cod6_pc.cpp @@ -109,7 +109,7 @@ void AutoTest_COD6_PC::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD6"; diff --git a/tests/PC/autotest_cod7_pc.cpp b/tests/PC/autotest_cod7_pc.cpp index 465d053..013ebe4 100644 --- a/tests/PC/autotest_cod7_pc.cpp +++ b/tests/PC/autotest_cod7_pc.cpp @@ -116,7 +116,7 @@ void AutoTest_COD7_PC::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD7"; diff --git a/tests/PC/autotest_cod8_pc.cpp b/tests/PC/autotest_cod8_pc.cpp index e4df99c..5fb2c92 100644 --- a/tests/PC/autotest_cod8_pc.cpp +++ b/tests/PC/autotest_cod8_pc.cpp @@ -116,7 +116,7 @@ void AutoTest_COD8_PC::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD8"; diff --git a/tests/PC/autotest_cod9_pc.cpp b/tests/PC/autotest_cod9_pc.cpp index 2d578e4..6a2ae24 100644 --- a/tests/PC/autotest_cod9_pc.cpp +++ b/tests/PC/autotest_cod9_pc.cpp @@ -116,7 +116,7 @@ void AutoTest_COD9_PC::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD9"; diff --git a/tests/PS3/autotest_cod10_ps3.cpp b/tests/PS3/autotest_cod10_ps3.cpp index 204417d..1df3745 100644 --- a/tests/PS3/autotest_cod10_ps3.cpp +++ b/tests/PS3/autotest_cod10_ps3.cpp @@ -118,7 +118,7 @@ void AutoTest_COD10_PS3::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD10"; diff --git a/tests/PS3/autotest_cod11_ps3.cpp b/tests/PS3/autotest_cod11_ps3.cpp index 06d5af0..0487076 100644 --- a/tests/PS3/autotest_cod11_ps3.cpp +++ b/tests/PS3/autotest_cod11_ps3.cpp @@ -118,7 +118,7 @@ void AutoTest_COD11_PS3::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD11"; diff --git a/tests/PS3/autotest_cod12_ps3.cpp b/tests/PS3/autotest_cod12_ps3.cpp index 6dda192..70508c9 100644 --- a/tests/PS3/autotest_cod12_ps3.cpp +++ b/tests/PS3/autotest_cod12_ps3.cpp @@ -211,7 +211,7 @@ void AutoTest_COD12_PS3::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD12"; diff --git a/tests/PS3/autotest_cod4_ps3.cpp b/tests/PS3/autotest_cod4_ps3.cpp index 8b1ae15..2402d2d 100644 --- a/tests/PS3/autotest_cod4_ps3.cpp +++ b/tests/PS3/autotest_cod4_ps3.cpp @@ -157,7 +157,7 @@ void AutoTest_COD4_PS3::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD4"; diff --git a/tests/PS3/autotest_cod5_ps3.cpp b/tests/PS3/autotest_cod5_ps3.cpp index df8e22a..be875aa 100644 --- a/tests/PS3/autotest_cod5_ps3.cpp +++ b/tests/PS3/autotest_cod5_ps3.cpp @@ -155,7 +155,7 @@ void AutoTest_COD5_PS3::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD5"; diff --git a/tests/PS3/autotest_cod6_ps3.cpp b/tests/PS3/autotest_cod6_ps3.cpp index 42fbcac..04fa719 100644 --- a/tests/PS3/autotest_cod6_ps3.cpp +++ b/tests/PS3/autotest_cod6_ps3.cpp @@ -118,7 +118,7 @@ void AutoTest_COD6_PS3::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD6"; diff --git a/tests/PS3/autotest_cod7_ps3.cpp b/tests/PS3/autotest_cod7_ps3.cpp index 488c30b..95c368c 100644 --- a/tests/PS3/autotest_cod7_ps3.cpp +++ b/tests/PS3/autotest_cod7_ps3.cpp @@ -181,7 +181,7 @@ void AutoTest_COD7_PS3::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD7"; diff --git a/tests/PS3/autotest_cod8_ps3.cpp b/tests/PS3/autotest_cod8_ps3.cpp index 99d1bff..ce80f1a 100644 --- a/tests/PS3/autotest_cod8_ps3.cpp +++ b/tests/PS3/autotest_cod8_ps3.cpp @@ -118,7 +118,7 @@ void AutoTest_COD8_PS3::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD8"; diff --git a/tests/PS3/autotest_cod9_ps3.cpp b/tests/PS3/autotest_cod9_ps3.cpp index c3b3f78..2cd3742 100644 --- a/tests/PS3/autotest_cod9_ps3.cpp +++ b/tests/PS3/autotest_cod9_ps3.cpp @@ -118,7 +118,7 @@ void AutoTest_COD9_PS3::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD9"; diff --git a/tests/Wii/autotest_cod4_wii.cpp b/tests/Wii/autotest_cod4_wii.cpp index 14dbe3f..da5dc11 100644 --- a/tests/Wii/autotest_cod4_wii.cpp +++ b/tests/Wii/autotest_cod4_wii.cpp @@ -117,7 +117,7 @@ void AutoTest_COD4_Wii::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD4"; diff --git a/tests/Wii/autotest_cod7_wii.cpp b/tests/Wii/autotest_cod7_wii.cpp index 8a986b5..806031a 100644 --- a/tests/Wii/autotest_cod7_wii.cpp +++ b/tests/Wii/autotest_cod7_wii.cpp @@ -117,7 +117,7 @@ void AutoTest_COD7_Wii::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD7"; diff --git a/tests/Wii/autotest_cod8_wii.cpp b/tests/Wii/autotest_cod8_wii.cpp index 1ab4a00..b3bd141 100644 --- a/tests/Wii/autotest_cod8_wii.cpp +++ b/tests/Wii/autotest_cod8_wii.cpp @@ -109,7 +109,7 @@ void AutoTest_COD8_Wii::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD8"; diff --git a/tests/WiiU/autotest_cod10_wiiu.cpp b/tests/WiiU/autotest_cod10_wiiu.cpp index 2eb61b0..583cf87 100644 --- a/tests/WiiU/autotest_cod10_wiiu.cpp +++ b/tests/WiiU/autotest_cod10_wiiu.cpp @@ -118,7 +118,7 @@ void AutoTest_COD10_WiiU::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD10"; diff --git a/tests/WiiU/autotest_cod9_wiiu.cpp b/tests/WiiU/autotest_cod9_wiiu.cpp index 8025fc6..46ad0ba 100644 --- a/tests/WiiU/autotest_cod9_wiiu.cpp +++ b/tests/WiiU/autotest_cod9_wiiu.cpp @@ -118,7 +118,7 @@ void AutoTest_COD9_WiiU::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - std::shared_ptr fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFileFactory::Create(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD9"; diff --git a/tests/tests.pro b/tests/tests.pro index 7afd677..c1da1a0 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -20,27 +20,49 @@ HEADERS += $$files($$PWD/*.h, true) # } LIBS += \ - -L$$OUT_PWD/../libs/ -lcore -lencryption -lcompression -lfastfile -lzonefile -lassets \ - -L$$PWD/../third_party/xbox_sdk/lib -lxcompress64 + -L$$PWD/../third_party/devil_sdk/lib/ -lDevIL -lILU -lILUT \ + -L$$PWD/../third_party/zlib/lib/ -lzlib \ + -L$$PWD/../third_party/xbox_sdk/lib -lxcompress64 \ + -L$$OUT_PWD/../libs/ -lcore \ + -L$$OUT_PWD/../libs/ -lxassets\ + -L$$OUT_PWD/../libs/ -lcompression \ + -L$$OUT_PWD/../libs/ -lencryption \ + -L$$OUT_PWD/../libs/ -lfastfile \ + -L$$OUT_PWD/../libs/ -lddsfile \ + -L$$OUT_PWD/../libs/ -lipakfile \ + -L$$OUT_PWD/../libs/ -liwifile \ + -L$$OUT_PWD/../libs/ -lzonefile INCLUDEPATH += \ + $$PWD/../third_party/devil_sdk/include/ \ + $$PWD/../third_party/zlib/include \ $$PWD/../third_party/xbox_sdk/include \ $$PWD/../libs/core \ - $$PWD/../libs/encryption \ $$PWD/../libs/compression \ + $$PWD/../libs/encryption \ $$PWD/../libs/fastfile \ - $$PWD/../libs/assets \ + $$PWD/../libs/ddsfile \ + $$PWD/../libs/ipakfile \ + $$PWD/../libs/iwifile \ + $$PWD/../libs/xassets \ $$PWD/../libs/zonefile DEPENDPATH += \ + $$PWD/../third_party/devil_sdk/include/ \ + $$PWD/../third_party/zlib/include \ $$PWD/../third_party/xbox_sdk/include \ $$PWD/../libs/core \ - $$PWD/../libs/encryption \ $$PWD/../libs/compression \ + $$PWD/../libs/encryption \ $$PWD/../libs/fastfile \ - $$PWD/../libs/assets \ + $$PWD/../libs/ddsfile \ + $$PWD/../libs/ipakfile \ + $$PWD/../libs/iwifile \ + $$PWD/../libs/xassets \ $$PWD/../libs/zonefile -# Copy DLLs to Debug & Release folder -QMAKE_POST_LINK += xcopy /Y /E /I \"$$PWD/../third_party/xbox_sdk/lib\\*.dll\" \"$$OUT_PWD/debug/\" $$escape_expand(\\n\\t) -QMAKE_POST_LINK += xcopy /Y /E /I \"$$PWD/../third_party/xbox_sdk/lib\\*.dll\" \"$$OUT_PWD/release/\" $$escape_expand(\\n\\t) + +win32 { + QMAKE_POST_LINK = + QMAKE_POST_LINK += for /D %%G in (\"$$PWD/../third_party/*/lib\") do copy /Y \"%%~G\*.dll\" \"$$OUT_PWD/$$DESTDIR/\" >NUL $$escape_expand(\\n\\t) +} diff --git a/tools/asset_assess/asset_assess.pro b/tools/asset_assess/asset_assess.pro index 9f2a614..c63325e 100644 --- a/tools/asset_assess/asset_assess.pro +++ b/tools/asset_assess/asset_assess.pro @@ -8,11 +8,48 @@ SOURCES += $$files($$PWD/*.cpp, true) HEADERS += $$files($$PWD/*.h, true) LIBS += \ - -L$$OUT_PWD/../../libs -lassets + -L$$PWD/../../third_party/devil_sdk/lib/ -lDevIL -lILU -lILUT \ + -L$$PWD/../../third_party/zlib/lib/ -lzlib \ + -L$$PWD/../../third_party/xbox_sdk/lib -lxcompress64 \ + -L$$OUT_PWD/../../libs/ -lcore \ + -L$$OUT_PWD/../../libs/ -lxassets\ + -L$$OUT_PWD/../../libs/ -lcompression \ + -L$$OUT_PWD/../../libs/ -lencryption \ + -L$$OUT_PWD/../../libs/ -lfastfile \ + -L$$OUT_PWD/../../libs/ -lddsfile \ + -L$$OUT_PWD/../../libs/ -lipakfile \ + -L$$OUT_PWD/../../libs/ -liwifile \ + -L$$OUT_PWD/../../libs/ -lzonefile INCLUDEPATH += \ - $$PWD/../../libs/assets + $$PWD/../../third_party/devil_sdk/include/ \ + $$PWD/../../third_party/zlib/include \ + $$PWD/../../third_party/xbox_sdk/include \ + $$PWD/../../libs/core \ + $$PWD/../../libs/compression \ + $$PWD/../../libs/encryption \ + $$PWD/../../libs/fastfile \ + $$PWD/../../libs/ddsfile \ + $$PWD/../../libs/ipakfile \ + $$PWD/../../libs/iwifile \ + $$PWD/../../libs/xassets \ + $$PWD/../../libs/zonefile DEPENDPATH += \ - $$PWD/../../libs/assets + $$PWD/../../third_party/devil_sdk/include/ \ + $$PWD/../../third_party/zlib/include \ + $$PWD/../../third_party/xbox_sdk/include \ + $$PWD/../../libs/core \ + $$PWD/../../libs/compression \ + $$PWD/../../libs/encryption \ + $$PWD/../../libs/fastfile \ + $$PWD/../../libs/ddsfile \ + $$PWD/../../libs/ipakfile \ + $$PWD/../../libs/iwifile \ + $$PWD/../../libs/xassets \ + $$PWD/../../libs/zonefile +win32 { + QMAKE_POST_LINK = + QMAKE_POST_LINK += for /D %%G in (\"$$PWD/../../third_party/*/lib\") do copy /Y \"%%~G\*.dll\" \"$$OUT_PWD/$$DESTDIR/\" >NUL $$escape_expand(\\n\\t) +} diff --git a/tools/asset_assess/mainwindow.cpp b/tools/asset_assess/mainwindow.cpp index ca838d0..03137ea 100644 --- a/tools/asset_assess/mainwindow.cpp +++ b/tools/asset_assess/mainwindow.cpp @@ -1,5 +1,5 @@ #include "mainwindow.h" -#include "animparts.h" +//#include "xanimparts.h" #include #include @@ -54,30 +54,30 @@ void MainWindow::dragLeaveEvent(QDragLeaveEvent *event) { } void MainWindow::dropEvent(QDropEvent *event) { - const QMimeData *mimeData = event->mimeData(); - if (mimeData->hasUrls()) { - foreach (const QUrl &url, mimeData->urls()) { - const QString fileName = url.toString().split('/').last(); - LogLine(QString("Processing %1").arg(fileName)); + // const QMimeData *mimeData = event->mimeData(); + // if (mimeData->hasUrls()) { + // foreach (const QUrl &url, mimeData->urls()) { + // const QString fileName = url.toString().split('/').last(); + // LogLine(QString("Processing %1").arg(fileName)); - QFile file(url.toLocalFile()); - if (!file.open(QIODevice::ReadOnly)) { - LogLine(QString("Failed to open %1").arg(fileName)); - continue; - } - LogLine(QString("Opened %1").arg(fileName)); + // QFile file(url.toLocalFile()); + // if (!file.open(QIODevice::ReadOnly)) { + // LogLine(QString("Failed to open %1").arg(fileName)); + // continue; + // } + // LogLine(QString("Opened %1").arg(fileName)); - QDataStream dataStream(file.readAll()); - dataStream.setByteOrder(QDataStream::LittleEndian); - LogLine(QString("Created data stream")); + // QDataStream dataStream(file.readAll()); + // dataStream.setByteOrder(QDataStream::LittleEndian); + // LogLine(QString("Created data stream")); - if (fileName.contains(".xanim_raw")) { - LogLine(QString("Opening XANIM raw file")); + // if (fileName.contains(".xanim_raw")) { + // LogLine(QString("Opening XANIM raw file")); - XAnimParts animParts; - dataStream >> animParts; - LogLine(XAnimPartsToString(animParts)); - } - } - } + // XAnimParts animParts; + // dataStream >> animParts; + // LogLine(XAnimPartsToString(animParts)); + // } + // } + // } } diff --git a/tools/compro/compro.pro b/tools/compro/compro.pro index b29ada2..4c35d77 100644 --- a/tools/compro/compro.pro +++ b/tools/compro/compro.pro @@ -7,14 +7,48 @@ HEADERS += $$files($$PWD/*.h, true) FORMS += $$files($$PWD/*.ui, true) LIBS += \ + -L$$PWD/../../third_party/devil_sdk/lib/ -lDevIL -lILU -lILUT \ + -L$$PWD/../../third_party/zlib/lib/ -lzlib \ + -L$$PWD/../../third_party/xbox_sdk/lib -lxcompress64 \ + -L$$OUT_PWD/../../libs/ -lcore \ + -L$$OUT_PWD/../../libs/ -lxassets\ -L$$OUT_PWD/../../libs/ -lcompression \ - -L$$PWD/../../third_party/xbox_sdk/lib -lxcompress64 + -L$$OUT_PWD/../../libs/ -lencryption \ + -L$$OUT_PWD/../../libs/ -lfastfile \ + -L$$OUT_PWD/../../libs/ -lddsfile \ + -L$$OUT_PWD/../../libs/ -lipakfile \ + -L$$OUT_PWD/../../libs/ -liwifile \ + -L$$OUT_PWD/../../libs/ -lzonefile INCLUDEPATH += \ + $$PWD/../../third_party/devil_sdk/include/ \ + $$PWD/../../third_party/zlib/include \ + $$PWD/../../third_party/xbox_sdk/include \ + $$PWD/../../libs/core \ $$PWD/../../libs/compression \ - $$PWD/../../third_party/xbox_sdk/include + $$PWD/../../libs/encryption \ + $$PWD/../../libs/fastfile \ + $$PWD/../../libs/ddsfile \ + $$PWD/../../libs/ipakfile \ + $$PWD/../../libs/iwifile \ + $$PWD/../../libs/xassets \ + $$PWD/../../libs/zonefile DEPENDPATH += \ + $$PWD/../../third_party/devil_sdk/include/ \ + $$PWD/../../third_party/zlib/include \ + $$PWD/../../third_party/xbox_sdk/include \ + $$PWD/../../libs/core \ $$PWD/../../libs/compression \ - $$PWD/../../third_party/xbox_sdk/include + $$PWD/../../libs/encryption \ + $$PWD/../../libs/fastfile \ + $$PWD/../../libs/ddsfile \ + $$PWD/../../libs/ipakfile \ + $$PWD/../../libs/iwifile \ + $$PWD/../../libs/xassets \ + $$PWD/../../libs/zonefile +win32 { + QMAKE_POST_LINK = + QMAKE_POST_LINK += for /D %%G in (\"$$PWD/../../third_party/*/lib\") do copy /Y \"%%~G\*.dll\" \"$$OUT_PWD/$$DESTDIR/\" >NUL $$escape_expand(\\n\\t) +} diff --git a/tools/zentry/zentry.pro b/tools/zentry/zentry.pro index d14aae2..46d982e 100644 --- a/tools/zentry/zentry.pro +++ b/tools/zentry/zentry.pro @@ -9,16 +9,48 @@ HEADERS += $$files($$PWD/*.h, true) FORMS += $$files($$PWD/*.ui, true) LIBS += \ + -L$$PWD/../../third_party/devil_sdk/lib/ -lDevIL -lILU -lILUT \ + -L$$PWD/../../third_party/zlib/lib/ -lzlib \ + -L$$PWD/../../third_party/xbox_sdk/lib -lxcompress64 \ -L$$OUT_PWD/../../libs/ -lcore \ + -L$$OUT_PWD/../../libs/ -lxassets\ -L$$OUT_PWD/../../libs/ -lcompression \ - -L$$PWD/../../third_party/xbox_sdk/lib -lxcompress64 + -L$$OUT_PWD/../../libs/ -lencryption \ + -L$$OUT_PWD/../../libs/ -lfastfile \ + -L$$OUT_PWD/../../libs/ -lddsfile \ + -L$$OUT_PWD/../../libs/ -lipakfile \ + -L$$OUT_PWD/../../libs/ -liwifile \ + -L$$OUT_PWD/../../libs/ -lzonefile INCLUDEPATH += \ + $$PWD/../../third_party/devil_sdk/include/ \ + $$PWD/../../third_party/zlib/include \ + $$PWD/../../third_party/xbox_sdk/include \ $$PWD/../../libs/core \ $$PWD/../../libs/compression \ - $$PWD/../../third_party/xbox_sdk/include + $$PWD/../../libs/encryption \ + $$PWD/../../libs/fastfile \ + $$PWD/../../libs/ddsfile \ + $$PWD/../../libs/ipakfile \ + $$PWD/../../libs/iwifile \ + $$PWD/../../libs/xassets \ + $$PWD/../../libs/zonefile DEPENDPATH += \ + $$PWD/../../third_party/devil_sdk/include/ \ + $$PWD/../../third_party/zlib/include \ + $$PWD/../../third_party/xbox_sdk/include \ $$PWD/../../libs/core \ $$PWD/../../libs/compression \ - $$PWD/../../third_party/xbox_sdk/include + $$PWD/../../libs/encryption \ + $$PWD/../../libs/fastfile \ + $$PWD/../../libs/ddsfile \ + $$PWD/../../libs/ipakfile \ + $$PWD/../../libs/iwifile \ + $$PWD/../../libs/xassets \ + $$PWD/../../libs/zonefile + +win32 { + QMAKE_POST_LINK = + QMAKE_POST_LINK += for /D %%G in (\"$$PWD/../../third_party/*/lib\") do copy /Y \"%%~G\*.dll\" \"$$OUT_PWD/$$DESTDIR/\" >NUL $$escape_expand(\\n\\t) +}