MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / dumpRaw

Function dumpRaw

tools/dump_everything/dump_everything.cpp:1090–1107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1088}
1089
1090static void dumpRaw(fs::path outDir, const RawImage &i)
1091{
1092 auto inName = i.prefix + i.suffix;
1093 auto fileName = i.prefix + ".png";
1094 auto outPath = outDir / fileName.str();
1095 auto imageString = format("RAW:%s:%u:%u:%s", inName, i.size.x, i.size.y, i.palette);
1096 LogWarning("Reading \"%s\"", imageString);
1097
1098 auto img = fw().data->loadImage(imageString);
1099 if (!img)
1100 {
1101 LogError("Failed to read \"%s\"", imageString);
1102 return;
1103 }
1104
1105 fs::create_directories(outPath.parent_path());
1106 fw().data->writeImage(outPath.native(), img);
1107}
1108
1109static void dumpPck(fs::path outDir, const UString &prefix, const UString &paletteString,
1110 const UString &type)

Callers 1

mainFunction · 0.85

Calls 3

formatFunction · 0.85
loadImageMethod · 0.45
writeImageMethod · 0.45

Tested by

no test coverage detected