From a3363333d809e8089a55efc3ea32eaea9ddb8d8c Mon Sep 17 00:00:00 2001 From: Nicholas Estelami Date: Tue, 30 Nov 2021 20:09:32 -0500 Subject: ZResource::GetSourceOutputCode no longer returns a string (#209) * Updated nuget to use newer version of libpng. Also updated uses of std::filesystem::path to be compliant with MSVC implementation. * Updated nuget to use newer version of libpng. Also updated uses of std::filesystem::path to be compliant with MSVC implementation. * GetSourceOutputCode no longer uses strings, and some overrides were removed. * Removed redundant GetSourceOutputHeader * Fixed MSVC issue * Changed libpng nuget package due to compilation issues. Other minor tweaks. Co-authored-by: Jack Walker <7463599+Jack-Walker@users.noreply.github.com> --- ZAPD/ZResource.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'ZAPD/ZResource.cpp') diff --git a/ZAPD/ZResource.cpp b/ZAPD/ZResource.cpp index 4fd6d08..2dfe6d5 100644 --- a/ZAPD/ZResource.cpp +++ b/ZAPD/ZResource.cpp @@ -258,18 +258,21 @@ std::string ZResource::GetDefaultName(const std::string& prefix) const rawDataIndex); } -std::string ZResource::GetSourceOutputCode([[maybe_unused]] const std::string& prefix) +void ZResource::GetSourceOutputCode([[maybe_unused]] const std::string& prefix) { std::string bodyStr = GetBodySourceCode(); - Declaration* decl = parent->GetDeclaration(rawDataIndex); - if (decl == nullptr || decl->isPlaceholder) - decl = DeclareVar(prefix, bodyStr); - else - decl->text = bodyStr; - decl->staticConf = staticConf; + if (bodyStr != "ERROR") + { + Declaration* decl = parent->GetDeclaration(rawDataIndex); - return ""; + if (decl == nullptr || decl->isPlaceholder) + decl = DeclareVar(prefix, bodyStr); + else + decl->text = bodyStr; + + decl->staticConf = staticConf; + } } std::string ZResource::GetSourceOutputHeader([[maybe_unused]] const std::string& prefix) -- cgit v1.2.3