summaryrefslogtreecommitdiffstats
path: root/src/animation/backend/animationutils.cpp
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2017-10-07 15:35:39 +0100
committerSean Harmer <sean.harmer@kdab.com>2018-01-18 09:20:55 +0000
commit3c037cc837d257f45d7a55d9fcf7aa5a29ebc00f (patch)
tree9f1654deb672d3b39dde181607e8ad7f28a95ae1 /src/animation/backend/animationutils.cpp
parente9594f27ccad5667ebc27451f87184296c5cd297 (diff)
Don't clear the target indices vector when building the format
This will impact on the future format building when there are multiple clips to be blended. For now we fill them with -1 values and alter the check when building the channel mapping data structures. A follow up commit will make the input to this function immutable and instead output the masked off channels as part of the format which can be used to build the channel mappings. Change-Id: I7eb42041ccfe253a449f13fde89236eab56dba18 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/animation/backend/animationutils.cpp')
-rw-r--r--src/animation/backend/animationutils.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/animation/backend/animationutils.cpp b/src/animation/backend/animationutils.cpp
index fb5b19a5d..d8a3f6ab8 100644
--- a/src/animation/backend/animationutils.cpp
+++ b/src/animation/backend/animationutils.cpp
@@ -501,7 +501,14 @@ QVector<MappingData> buildPropertyMappings(const QVector<ChannelMapping*> &chann
// Do we have any animation data for this channel? If not, don't bother
// adding a mapping for it.
- if (channelComponentIndices[index].isEmpty())
+ bool hasChannelIndices = false;
+ for (const auto componentIndex : channelComponentIndices[index]) {
+ if (componentIndex != -1) {
+ hasChannelIndices = true;
+ break;
+ }
+ }
+ if (!hasChannelIndices)
continue;
if (index != -1) {
@@ -692,7 +699,7 @@ ComponentIndices generateClipFormatIndices(const QVector<ChannelNameAndType> &ta
// No such channel in this clip. We'll use default values when
// mapping from the clip to the formatted clip results.
std::fill(formatIt, formatIt + componentCount, -1);
- targetIndices[i].clear();
+ std::fill(targetIndices[i].begin(), targetIndices[i].end(), -1);
}
formatIt += componentCount;