Skip to content

Commit 13f6b83

Browse files
authored
Merge pull request #1 from hindercanrun/main
poosh yeah!
2 parents 397d4fa + 51554c0 commit 13f6b83

File tree

1 file changed

+64
-2
lines changed

1 file changed

+64
-2
lines changed

src/unlinker.cpp

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,67 @@
1515

1616
namespace fs = std::filesystem;
1717

18+
static const char* XAssetTypeNames[] =
19+
{
20+
"physpreset",
21+
"physcollmap",
22+
"xanimparts",
23+
"xmodel_surfs",
24+
"xmodel",
25+
"material",
26+
"pixelshader",
27+
"techset",
28+
"image",
29+
"sound",
30+
"snd_vol_falloff_curve",
31+
"snd_lpf_curve",
32+
"loaded_sound",
33+
"clipmap_sp",
34+
"clipmap_mp",
35+
"comworld",
36+
"gameworld_sp",
37+
"gameworld_mp",
38+
"map_ents",
39+
"fxworld",
40+
"gfxworld",
41+
"light_def",
42+
"ui_map",
43+
"font",
44+
"menulist",
45+
"menu",
46+
"localize",
47+
"weapon",
48+
"snddriver_globals",
49+
"fx",
50+
"impactfx",
51+
"surfacefx",
52+
"aitype",
53+
"mptype",
54+
"character",
55+
"xmodelalias",
56+
"rawfile",
57+
"stringtable",
58+
"leaderboard",
59+
"structured_data_def",
60+
"tracer",
61+
"laser",
62+
"vehicle",
63+
"addon_map_ents",
64+
"shockfile",
65+
"volumesetting",
66+
"reverbpreset",
67+
"fog"
68+
};
69+
70+
inline const char* XAssetTypeToString(int type)
71+
{
72+
if (type >= 0 && type < sizeof(XAssetTypeNames) / sizeof(XAssetTypeNames[0]))
73+
{
74+
return XAssetTypeNames[type];
75+
}
76+
return "unknown";
77+
}
78+
1879
int unlink_fastfile(const std::string& infile, const std::string& outdir)
1980
{
2081
std::ifstream fin(infile, std::ios::binary);
@@ -104,8 +165,9 @@ int unlink_fastfile(const std::string& infile, const std::string& outdir)
104165
}
105166

106167
fs::create_directories(outdir);
168+
fs::create_directories(outdir + "/zone_source");
107169

108-
std::string csvpath = outdir + ".csv";
170+
std::string csvpath = outdir + "/zone_source/" + outdir + ".csv";
109171
std::ofstream csvfile(csvpath);
110172
if (!csvfile.is_open())
111173
{
@@ -145,7 +207,7 @@ int unlink_fastfile(const std::string& infile, const std::string& outdir)
145207
// return -1;
146208
// break;
147209
default:
148-
std::cout << "Skipping unknown asset type: 0x" << std::hex << type << std::dec << std::endl;
210+
std::cout << "Skipping unknown asset type: " << XAssetTypeToString(type) << " (0x" << std::hex << type << std::dec << ")" << std::endl;
149211

150212
if (pos + 8 <= dest_len)
151213
{

0 commit comments

Comments
 (0)