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=%~dp0
SET MyPath=%MyPath:~0,-1% SET MyPath=%MyPath:~0,-1%
call %MyPath%\_prebuild_win32.bat app debug msvc call %MyPath%\_prebuild_win32.bat app debug msvc
call %MyPath%\setup_cl.bat call %MyPath%\setup_cl.bat

View File

@ -1,5 +1,7 @@
@echo off @echo off
ECHO SETUP CL
SET "LIB=" SET "LIB="
SET VC_PATH=C:\Program Files (x86)\Microsoft Visual Studio 12.0 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 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)) 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 // 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* internal animation*
AnimationSystem_GetActiveAnimation(animation_system* System) AnimationSystem_GetActiveAnimation(animation_system* System)
{ {

View File

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