summaryrefslogtreecommitdiff
path: root/src/sorted.cpp
diff options
context:
space:
mode:
authorFox Caminiti <fox@foxcam.net>2023-02-05 14:04:50 -0500
committerFox Caminiti <fox@foxcam.net>2023-02-05 14:04:50 -0500
commite2e0e630ca51a4fd80a8186c5795c96693a2815b (patch)
tree51e473a4869e7eea3fc18bb42851fb669d6b947f /src/sorted.cpp
parent04a91de8f8432f3cff461983db3d12d24e1a4c1c (diff)
fully working comp-recursive transforms!
Diffstat (limited to 'src/sorted.cpp')
-rw-r--r--src/sorted.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/sorted.cpp b/src/sorted.cpp
index 03f5b0a..1d2b4f2 100644
--- a/src/sorted.cpp
+++ b/src/sorted.cpp
@@ -17,14 +17,16 @@ Property_GetSortedArray(uint16 *SortedKeyframeArray, int i, int h)
}
static sorted_layer_array *
-Sorted_GetLayerStart(sorted_layer_array *LayerArrayStart, sorted_comp_array *SortedCompStart, uint32 TargetComp)
+Sorted_GetLayerStart(sorted_layer_array *SortedLayerArray, sorted_comp_array *SortedCompArray, uint32 TargetComp)
{
uint32 LayerOffset = 0; int s = 0;
while (s < TargetComp) {
- LayerOffset += SortedCompStart[s].LayerCount + SortedCompStart[s].FakeLayerCount;
+ Assert(SortedCompArray[s].LayerCount < 10000); // passed Start instead of Array!
+ Assert(SortedCompArray[s].FakeLayerCount < 10000);
+ LayerOffset += SortedCompArray[s].LayerCount + SortedCompArray[s].FakeLayerCount;
s++;
}
- return LayerArrayStart + LayerOffset;
+ return SortedLayerArray + LayerOffset;
}
// The sorting algorithm is straightforward: read every point, evaluate it if
@@ -122,6 +124,8 @@ Layer_Sort_DisplayOffset(project_state *State, memory *Memory,
// real32 SmallestY = Layer_Top->Vertical_Offset;
// real32 LargestY = Layer_Bottom->Vertical_Offset;
DisplayOffset = LargestY - SmallestY + 2 + DisplayOffset;
+ } else {
+ DisplayOffset = 2;
}
return DisplayOffset;
}