cleaning up build system. added animation_system_desc

This commit is contained in:
PS 2021-01-23 12:46:46 -08:00
parent 2769640adf
commit 6d8d642dfb
4 changed files with 28 additions and 5 deletions

View File

@ -2,6 +2,7 @@
SET MyPath=%~dp0
SET MyPath=%MyPath:~0,-1%
call %MyPath%\_prebuild_win32.bat app debug msvc
call %MyPath%\setup_cl.bat

View File

@ -1,5 +1,7 @@
@echo off
ECHO SETUP CL
SET "LIB="
SET VC_PATH=C:\Program Files (x86)\Microsoft Visual Studio 12.0
@ -35,3 +37,4 @@ IF NOT DEFINED LIB (IF EXIST "%VC_PATH%" (call "%VC_PATH%\VC\Auxiliary\Build\vcv
SET VC_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional
IF NOT DEFINED LIB (IF EXIST "%VC_PATH%" (call "%VC_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64))
ECHO SETUP CL COMPLETE

View File

@ -484,6 +484,24 @@ ClampFrameToRange(s32 Frame, frame_range Range)
// System
struct animation_system_desc
{
gs_memory_arena* Storage;
u32 AnimArrayCount;
r32 SecondsPerFrame;
};
internal animation_system
AnimationSystem_Init(animation_system_desc Desc)
{
animation_system Result = {};
Result.Storage = Desc.Storage;
Result.Animations = AnimationArray_Create(Result.Storage, Desc.AnimArrayCount);
Result.SecondsPerFrame = Desc.SecondsPerFrame;
return Result;
}
internal animation*
AnimationSystem_GetActiveAnimation(animation_system* System)
{

View File

@ -91,11 +91,11 @@ INITIALIZE_APPLICATION(InitializeApplication)
#endif
{ // Animation PLAYGROUND
State->AnimationSystem = {};
State->AnimationSystem.Storage = &State->Permanent;
State->AnimationSystem.Animations = AnimationArray_Create(State->AnimationSystem.Storage, 32);
State->AnimationSystem.SecondsPerFrame = 1.f / 24.f;
animation_system_desc AnimSysDesc = {};
AnimSysDesc.Storage = &State->Permanent;
AnimSysDesc.AnimArrayCount = 32;
AnimSysDesc.SecondsPerFrame = 1.0f / 24.0f;
State->AnimationSystem = AnimationSystem_Init(AnimSysDesc);
animation Anim = {0};
Anim.Name = PushStringF(&State->Permanent, 256, "test_anim_one");
@ -103,6 +103,7 @@ INITIALIZE_APPLICATION(InitializeApplication)
Anim.Blocks_ = AnimBlockArray_Create(State->AnimationSystem.Storage, 8);
Anim.PlayableRange.Min = 0;
Anim.PlayableRange.Max = SecondsToFrames(15, State->AnimationSystem);
Animation_AddLayer(&Anim, MakeString("Base Layer"), BlendMode_Overwrite, &State->AnimationSystem);
Animation_AddLayer(&Anim, MakeString("Color Layer"), BlendMode_Multiply, &State->AnimationSystem);
Animation_AddLayer(&Anim, MakeString("Sparkles"), BlendMode_Add, &State->AnimationSystem);