summaryrefslogtreecommitdiff
path: root/src/factories/LightsFactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/factories/LightsFactory.cpp')
-rw-r--r--src/factories/LightsFactory.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/factories/LightsFactory.cpp b/src/factories/LightsFactory.cpp
index a14e12f..a26a17a 100644
--- a/src/factories/LightsFactory.cpp
+++ b/src/factories/LightsFactory.cpp
@@ -4,18 +4,19 @@
#include "spdlog/spdlog.h"
#include "Companion.h"
-void LightsHeaderExporter::Export(std::ostream &write, std::shared_ptr<IParsedData> raw, std::string& entryName, YAML::Node &node, std::string* replacement) {
+ExportResult LightsHeaderExporter::Export(std::ostream &write, std::shared_ptr<IParsedData> raw, std::string& entryName, YAML::Node &node, std::string* replacement) {
const auto symbol = GetSafeNode(node, "symbol", entryName);
if(Companion::Instance->IsOTRMode()){
write << "static const char " << symbol << "[] = \"__OTR__" << (*replacement) << "\";\n\n";
- return;
+ return std::nullopt;
}
write << "extern Lights1 " << symbol << ";\n";
+ return std::nullopt;
}
-void LightsCodeExporter::Export(std::ostream &write, std::shared_ptr<IParsedData> raw, std::string& entryName, YAML::Node &node, std::string* replacement ) {
+ExportResult LightsCodeExporter::Export(std::ostream &write, std::shared_ptr<IParsedData> raw, std::string& entryName, YAML::Node &node, std::string* replacement ) {
auto light = std::static_pointer_cast<LightsData>(raw)->mLights;
auto symbol = GetSafeNode(node, "symbol", entryName);
@@ -44,9 +45,10 @@ void LightsCodeExporter::Export(std::ostream &write, std::shared_ptr<IParsedData
write << r2 << ", " << g2 << ", " << b2 << ", " << x << ", " << y << ", " << z << "\n";
write << ");\n\n";
+ return std::nullopt;
}
-void LightsBinaryExporter::Export(std::ostream &write, std::shared_ptr<IParsedData> raw, std::string& entryName, YAML::Node &node, std::string* replacement ) {
+ExportResult LightsBinaryExporter::Export(std::ostream &write, std::shared_ptr<IParsedData> raw, std::string& entryName, YAML::Node &node, std::string* replacement ) {
auto light = std::static_pointer_cast<LightsData>(raw)->mLights;
auto writer = LUS::BinaryWriter();
auto size = sizeof(light.l) / sizeof(LightRaw);
@@ -65,6 +67,7 @@ void LightsBinaryExporter::Export(std::ostream &write, std::shared_ptr<IParsedDa
}
writer.Finish(write);
writer.Close();
+ return std::nullopt;
}
std::optional<std::shared_ptr<IParsedData>> LightsFactory::parse(std::vector<uint8_t>& buffer, YAML::Node& node) {