diff --git a/definitions/cod/assetheader.xscript b/definitions/cod/assetheader.xscript index f7e8713..efc2c33 100644 --- a/definitions/cod/assetheader.xscript +++ b/definitions/cod/assetheader.xscript @@ -12,41 +12,39 @@ type assetheader if (game == "COD4" && platform == "PC") { // COD4 PC zone file asset type mapping // Note: No pixelshader or vertexshader on PC - asset_type = match(raw_type, - 0x00, "xmodelpieces", - 0x01, "physpreset", - 0x02, "xanim", - 0x03, "xmodel", - 0x04, "material", - 0x05, "techset", - 0x06, "image", - 0x07, "sound", - 0x08, "sndcurve", - 0x09, "loaded_sound", - 0x0A, "col_map_sp", - 0x0B, "col_map_mp", - 0x0C, "com_map", - 0x0D, "game_map_sp", - 0x0E, "game_map_mp", - 0x0F, "map_ents", - 0x10, "gfx_map", - 0x11, "lightdef", - 0x12, "ui_map", - 0x13, "font", - 0x14, "menufile", - 0x15, "menu", - 0x16, "localize", - 0x17, "weapon", - 0x18, "snddriverglobals", - 0x19, "fx", - 0x1A, "impactfx", - 0x1B, "aitype", - 0x1C, "mptype", - 0x1D, "character", - 0x1E, "xmodelalias", - 0x1F, "rawfile", - 0x20, "stringtable", - "UNKNOWN"); + if (raw_type == 0x00) { asset_type = "xmodelpieces"; } + if (raw_type == 0x01) { asset_type = "physpreset"; } + if (raw_type == 0x02) { asset_type = "xanim"; } + if (raw_type == 0x03) { asset_type = "xmodel"; } + if (raw_type == 0x04) { asset_type = "material"; } + if (raw_type == 0x05) { asset_type = "techset"; } + if (raw_type == 0x06) { asset_type = "image"; } + if (raw_type == 0x07) { asset_type = "sound"; } + if (raw_type == 0x08) { asset_type = "sndcurve"; } + if (raw_type == 0x09) { asset_type = "loaded_sound"; } + if (raw_type == 0x0A) { asset_type = "col_map_sp"; } + if (raw_type == 0x0B) { asset_type = "col_map_mp"; } + if (raw_type == 0x0C) { asset_type = "com_map"; } + if (raw_type == 0x0D) { asset_type = "game_map_sp"; } + if (raw_type == 0x0E) { asset_type = "game_map_mp"; } + if (raw_type == 0x0F) { asset_type = "map_ents"; } + if (raw_type == 0x10) { asset_type = "gfx_map"; } + if (raw_type == 0x11) { asset_type = "lightdef"; } + if (raw_type == 0x12) { asset_type = "ui_map"; } + if (raw_type == 0x13) { asset_type = "font"; } + if (raw_type == 0x14) { asset_type = "menufile"; } + if (raw_type == 0x15) { asset_type = "menu"; } + if (raw_type == 0x16) { asset_type = "localize"; } + if (raw_type == 0x17) { asset_type = "weapon"; } + if (raw_type == 0x18) { asset_type = "snddriverglobals"; } + if (raw_type == 0x19) { asset_type = "fx"; } + if (raw_type == 0x1A) { asset_type = "impactfx"; } + if (raw_type == 0x1B) { asset_type = "aitype"; } + if (raw_type == 0x1C) { asset_type = "mptype"; } + if (raw_type == 0x1D) { asset_type = "character"; } + if (raw_type == 0x1E) { asset_type = "xmodelalias"; } + if (raw_type == 0x1F) { asset_type = "rawfile"; } + if (raw_type == 0x20) { asset_type = "stringtable"; } } ui("asset_type", "Asset Type"); diff --git a/definitions/cod/assetlist.xscript b/definitions/cod/assetlist.xscript index 7d4ad01..416e11b 100644 --- a/definitions/cod/assetlist.xscript +++ b/definitions/cod/assetlist.xscript @@ -31,7 +31,7 @@ type assetlist [display="Asset List"] strings = push("strings", _str); } - strings = strings [table="Strings", columns="ptr,value"]; + // Table: strings (columns: ptr,value) skip_tree("strings"); stringlist = strings; } @@ -47,7 +47,7 @@ type assetlist [display="Asset List"] assets = push("assets", _a); } - assets = assets [table="Assets", columns="asset_ptr,raw_type,asset_type", format_asset_ptr="hex", format_raw_type="hex"]; + // Table: assets (columns: asset_ptr,raw_type,asset_type) skip_tree("assets"); // Second pass: Parse actual asset data based on headers diff --git a/definitions/cod/fastfile.xscript b/definitions/cod/fastfile.xscript index 7063a62..3b88b52 100644 --- a/definitions/cod/fastfile.xscript +++ b/definitions/cod/fastfile.xscript @@ -30,12 +30,11 @@ type fastfile [root, display="Fast File"] byteorder LE detected_platform = "UNKNOWN"; // Early version-based platform detection - detected_platform = match(version_i, - 5, "PC", - 6, "XBOX360", - 12, "PS3", - 14, "WII", - "UNKNOWN"); + if (version_i == 5) { detected_platform = "PC"; } + if (version_i == 6) { detected_platform = "XBOX360"; } + if (version_i == 12) { detected_platform = "PS3"; } + if (version_i == 14) { detected_platform = "WII"; } + // version match replaced if (version_i > 276 && version_i < 1000) { detected_platform = match(platform_u32, 0, "PC", @@ -43,7 +42,6 @@ type fastfile [root, display="Fast File"] byteorder LE 2, "PS3", 3, "WII", 4, "WIIU", - "UNKNOWN"); } // Set globals early so they're available for all parsing diff --git a/definitions/cod/menulist.xscript b/definitions/cod/menulist.xscript index 38ebe6d..870e039 100644 --- a/definitions/cod/menulist.xscript +++ b/definitions/cod/menulist.xscript @@ -12,7 +12,11 @@ type menulist [display="Menu List"] ui("menus_ptr", "Menus Ptr"); // Inline data - inline cstring name when name_ptr [ui="Name", set_name]; + if (name_ptr == PTR_INLINE) { + name = cstring(); + ui("name", "Name"); + set_name(name); + } // Menu definitions (complex - need two passes) if (menus_ptr == PTR_INLINE && menu_count > 0) { @@ -33,6 +37,6 @@ type menulist [display="Menu List"] menus = push("menus", _menu); } } - menus = menus [table="Menus", columns="name"]; + // Table: menus (columns: name) } }