From 5dc511d56a863a3430eac6545eaa0a95daa974b3 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 24 Mar 2015 15:12:39 +0000 Subject: [PATCH] Fixed steps and keyframes not saving correctly. --- common/lc_model.cpp | 2 +- common/object.h | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/common/lc_model.cpp b/common/lc_model.cpp index acec26e6..0caa309f 100644 --- a/common/lc_model.cpp +++ b/common/lc_model.cpp @@ -299,7 +299,7 @@ void lcModel::SaveLDraw(QTextStream& Stream, bool MPD, bool SelectedOnly) const CurrentLine++; } - while (Piece->GetStepShow() < Step) + while (Piece->GetStepShow() > Step) { Stream << QLatin1String("0 STEP\r\n"); Step++; diff --git a/common/object.h b/common/object.h index 4c6b02db..9e2dd823 100644 --- a/common/object.h +++ b/common/object.h @@ -115,7 +115,7 @@ protected: lcObjectKey& Key = Keys[KeyIdx]; Stream << QLatin1String("0 !LEOCAD ") << KeyName << Key.Step << ' '; for (int ValueIdx = 0; ValueIdx < Count; ValueIdx++) - Stream << Key.Value[ValueIdx] << ' '; + Stream << ((float*)&Key.Value)[ValueIdx] << ' '; Stream << QLatin1String("\r\n"); } } @@ -133,9 +133,7 @@ protected: for (int ValueIdx = 0; ValueIdx < Count; ValueIdx++) Stream >> ((float*)&Value)[ValueIdx]; - lcObjectKey& Key = Keys.Add(); - Key.Step = Step; - Key.Value = Value; + ChangeKey(Keys, Value, Step, true); } template