Recording now uses new write

This commit is contained in:
2022-09-10 02:05:38 +02:00
parent 94fbc1f558
commit d6d3c0b4d9
11 changed files with 58 additions and 62 deletions
+2 -6
View File
@@ -217,11 +217,7 @@ PLUGIN_API void XPluginStop(void)
serverThread.join();
recordingThread.join();
std::ofstream out(XPLANE_PLUGIN_DIRECTORY RECORDING_DIRECTORY "flight.rec",
std::fstream::binary);
out.write(reinterpret_cast<const char *>(p.getBinaryData()),
(std::streamsize)p.getBinaryLength());
out.close();
p.toFile("flight.rec");
}
PLUGIN_API void XPluginDisable(void) {}
@@ -318,7 +314,7 @@ void recordingWorker()
{copy.lat, copy.lon});
if (strcmp(copy.path, "") != 0 && copy.pause && lastPath != currentPath) {
p.addSegment(currentPath);
p.addEntry(currentPath);
lastPath = currentPath;
}