cleaned up unneeded fields in animation_frame
This commit is contained in:
parent
5e6ac25490
commit
e51188398d
|
@ -102,13 +102,6 @@ struct animation_frame
|
|||
{
|
||||
animation_layer_frame* Layers;
|
||||
u32 LayersCount;
|
||||
|
||||
// NOTE(pjs): These are all parallel arrays of equal length
|
||||
animation_block* Blocks;
|
||||
b8* BlocksFilled;
|
||||
|
||||
u32 BlocksCountMax;
|
||||
u32 BlocksCount;
|
||||
};
|
||||
|
||||
#define ANIMATION_SYSTEM_LAYERS_MAX 128
|
||||
|
@ -442,12 +435,7 @@ AnimationSystem_CalculateAnimationFrame(animation_system* System, gs_memory_aren
|
|||
animation_frame Result = {0};
|
||||
Result.LayersCount = ActiveAnim->Layers.Count;
|
||||
Result.Layers = PushArray(Arena, animation_layer_frame, Result.LayersCount);
|
||||
ZeroArray(Result.Layers, animation_frame, Result.LayersCount);
|
||||
|
||||
Result.BlocksCountMax = ActiveAnim->Layers.Count;
|
||||
Result.Blocks = PushArray(Arena, animation_block, Result.BlocksCountMax);
|
||||
Result.BlocksFilled = PushArray(Arena, b8, Result.BlocksCountMax);
|
||||
ZeroArray(Result.BlocksFilled, b8, Result.BlocksCountMax);
|
||||
ZeroArray(Result.Layers, animation_layer_frame, Result.LayersCount);
|
||||
|
||||
for (u32 i = 0; i < ActiveAnim->Blocks_.Count; i++)
|
||||
{
|
||||
|
@ -486,11 +474,6 @@ AnimationSystem_CalculateAnimationFrame(animation_system* System, gs_memory_aren
|
|||
Layer->HotOpacity = 1.0f;
|
||||
Layer->HasHot = true;
|
||||
}
|
||||
|
||||
// TODO(pjs): Get rid of these fields, they're redundant now
|
||||
Result.BlocksFilled[Block.Layer] = true;
|
||||
Result.Blocks[Block.Layer] = Block;
|
||||
Result.BlocksCount++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -179,10 +179,10 @@ AnimationSystem_RenderToLedBuffers(animation_system* System, assembly_array Asse
|
|||
|
||||
// Consolidate Temp Buffers
|
||||
// We do this in reverse order so that they go from top to bottom
|
||||
for (u32 Layer = 0; Layer < CurrFrame.BlocksCountMax; Layer++)
|
||||
for (u32 Layer = 0; Layer < CurrFrame.LayersCount; Layer++)
|
||||
{
|
||||
if (CurrFrame.Layers[Layer].HasHot)
|
||||
{
|
||||
if (!CurrFrame.BlocksFilled[Layer]) { continue; }
|
||||
|
||||
led_blend_proc* Blend = LedBlend_GetProc(ActiveAnim->Layers.Values[Layer].BlendMode);
|
||||
Assert(Blend != 0);
|
||||
for (u32 LED = 0; LED < AssemblyLedBuffer->LedCount; LED++)
|
||||
|
@ -193,6 +193,7 @@ AnimationSystem_RenderToLedBuffers(animation_system* System, assembly_array Asse
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define FOLDHAUS_ANIMATION_RENDERER_CPP
|
||||
|
|
Loading…
Reference in New Issue