Prevented array index out of bounds error when accessing animation procs form the GlobalAnimationClips array

This commit is contained in:
Peter Slattery 2020-09-06 21:18:49 -07:00
parent 337b4ac271
commit 736b7ab85e
2 changed files with 4 additions and 22 deletions

View File

@ -359,27 +359,10 @@ UPDATE_AND_RENDER(UpdateAndRender)
u32 FramesIntoBlock = CurrentFrame - Block.Range.Min;
r32 SecondsIntoBlock = FramesIntoBlock * State->AnimationSystem.SecondsPerFrame;
// TODO(Peter): Temporary
switch(Block.AnimationProcHandle)
{
case 1:
{
TestPatternOne(&LayerLEDBuffers[Layer], *Assembly, SecondsIntoBlock, &State->Transient);
}break;
case 2:
{
TestPatternTwo(&LayerLEDBuffers[Layer], *Assembly, SecondsIntoBlock, &State->Transient);
}break;
case 3:
{
TestPatternThree(&LayerLEDBuffers[Layer], *Assembly, SecondsIntoBlock, &State->Transient);
}break;
// NOTE(Peter): Zero is invalid
InvalidDefaultCase;
}
u32 AnimationProcIndex = Block.AnimationProcHandle - 1;
animation_proc* AnimationProc = GlobalAnimationClips[AnimationProcIndex].Proc;
AnimationProc(&LayerLEDBuffers[Layer], *Assembly, SecondsIntoBlock, &State->Transient);
}
// Consolidate Temp Buffers

View File

@ -29,7 +29,6 @@ STREAM #1: 3D Overhaul
- custom sculpture update functions (for motion)
- placing sculptures
- editing sculpture files (change universe output)
- led groups & subgroups - defined in file
- motion
- Sculpture View