summaryrefslogtreecommitdiff
path: root/src/sorted.cpp
diff options
context:
space:
mode:
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;
}