summaryrefslogtreecommitdiff
path: root/ZAPD/Main.cpp
diff options
context:
space:
mode:
authorNicholas Estelami <NEstelami@users.noreply.github.com>2021-05-05 13:56:39 -0400
committerGitHub <noreply@github.com>2021-05-05 13:56:39 -0400
commitcc52fe66109f0ae9dfec8280e439a567796db787 (patch)
tree1f900f53a8fc39ad33d99dc9f1f67288f4ec2c03 /ZAPD/Main.cpp
parent8fc46959753b946accf56c9e410a2e9d136815d6 (diff)
Background array declarations now use string literal (#128)
* Initial implementation * Fixed typo * Minor tweaks * Fixed merge issues Co-authored-by: Jack Walker <7463599+Jack-Walker@users.noreply.github.com>
Diffstat (limited to 'ZAPD/Main.cpp')
-rw-r--r--ZAPD/Main.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/ZAPD/Main.cpp b/ZAPD/Main.cpp
index a1dfb21..e33209f 100644
--- a/ZAPD/Main.cpp
+++ b/ZAPD/Main.cpp
@@ -252,11 +252,11 @@ int main(int argc, char* argv[])
else if (fileMode == ZFileMode::BuildOverlay)
{
ZOverlay* overlay =
- ZOverlay::FromBuild(Path::GetDirectoryName(Globals::Instance->inputPath),
- Path::GetDirectoryName(Globals::Instance->cfgPath));
+ ZOverlay::FromBuild(Path::GetDirectoryName(Globals::Instance->inputPath.string()),
+ Path::GetDirectoryName(Globals::Instance->cfgPath.string()));
if (overlay)
- File::WriteAllText(Globals::Instance->outputPath, overlay->GetSourceOutputCode(""));
+ File::WriteAllText(Globals::Instance->outputPath.string(), overlay->GetSourceOutputCode(""));
}
}
catch (std::runtime_error& e)
@@ -271,7 +271,7 @@ bool Parse(const fs::path& xmlFilePath, const fs::path& basePath, const fs::path
ZFileMode fileMode)
{
XMLDocument doc;
- XMLError eResult = doc.LoadFile(xmlFilePath.c_str());
+ XMLError eResult = doc.LoadFile(xmlFilePath.string().c_str());
if (eResult != tinyxml2::XML_SUCCESS)
{
@@ -323,17 +323,17 @@ bool Parse(const fs::path& xmlFilePath, const fs::path& basePath, const fs::path
void BuildAssetTexture(const fs::path& pngFilePath, TextureType texType, const fs::path& outPath)
{
- string name = outPath.stem();
+ string name = outPath.stem().string();
- ZTexture* tex = ZTexture::FromPNG(pngFilePath, texType);
- string cfgPath = StringHelper::Split(pngFilePath, ".")[0] + ".cfg";
+ ZTexture* tex = ZTexture::FromPNG(pngFilePath.string(), texType);
+ string cfgPath = StringHelper::Split(pngFilePath.string(), ".")[0] + ".cfg";
if (File::Exists(cfgPath))
name = File::ReadAllText(cfgPath);
string src = tex->GetSourceOutputCode(name);
- File::WriteAllText(outPath, src);
+ File::WriteAllText(outPath.string(), src);
delete tex;
}
@@ -341,19 +341,19 @@ void BuildAssetTexture(const fs::path& pngFilePath, TextureType texType, const f
void BuildAssetBackground(const fs::path& imageFilePath, const fs::path& outPath)
{
ZBackground background(nullptr);
- background.ParseBinaryFile(imageFilePath, false);
+ background.ParseBinaryFile(imageFilePath.string(), false);
- File::WriteAllText(outPath, background.GetBodySourceCode());
+ File::WriteAllText(outPath.string(), background.GetBodySourceCode());
}
void BuildAssetBlob(const fs::path& blobFilePath, const fs::path& outPath)
{
- ZBlob* blob = ZBlob::FromFile(blobFilePath);
- string name = outPath.stem(); // filename without extension
+ ZBlob* blob = ZBlob::FromFile(blobFilePath.string());
+ string name = outPath.stem().string(); // filename without extension
string src = blob->GetSourceOutputCode(name);
- File::WriteAllText(outPath, src);
+ File::WriteAllText(outPath.string(), src);
delete blob;
}
@@ -365,16 +365,16 @@ void BuildAssetModelIntermediette(const fs::path& outPath)
HLModelIntermediette* mdl = HLModelIntermediette::FromXML(doc.RootElement());
string output = mdl->OutputCode();
- File::WriteAllText(outPath, output);
+ File::WriteAllText(outPath.string(), output);
delete mdl;
}
void BuildAssetAnimationIntermediette(const fs::path& animPath, const fs::path& outPath)
{
- vector<string> split = StringHelper::Split(outPath, "/");
+ vector<string> split = StringHelper::Split(outPath.string(), "/");
ZFile* file = new ZFile("", split[split.size() - 2]);
- HLAnimationIntermediette* anim = HLAnimationIntermediette::FromXML(animPath);
+ HLAnimationIntermediette* anim = HLAnimationIntermediette::FromXML(animPath.string());
ZAnimation* zAnim = anim->ToZAnimation();
zAnim->SetName(Path::GetFileNameWithoutExtension(split[split.size() - 1]));
zAnim->parent = file;
@@ -386,7 +386,7 @@ void BuildAssetAnimationIntermediette(const fs::path& animPath, const fs::path&
output += file->declarations[1]->text + "\n";
output += file->declarations[0]->text + "\n";
- File::WriteAllText(outPath, output);
+ File::WriteAllText(outPath.string(), output);
delete zAnim;
delete file;