#include "Animation.h" #include "Crawler.h" #include "DEFINES.h" #include "safemap.h" INCLUDE_game INCLUDE_ANIMATION_DATA INCLUDE_DATA INCLUDE_GFX void sig::Animation::InitializeAnimations(){ auto CreateStillAnimation=[&](std::string imgName,vf2d size,AnimationData data={}){ Animate2D::FrameSequence anim(data.frameDuration,data.style); anim.AddFrame({&GFX[imgName],{{0,0},size}}); ANIMATION_DATA[imgName]=anim; }; auto CreateHorizontalAnimationSequence=[&](std::string imgName,int frameCount,vf2d size,AnimationData data={}){ Animate2D::FrameSequence anim(data.frameDuration,data.style); for(int i=0;iSize()); std::maptest; test.begin(); } } } void sig::Animation::SetupPlayerAnimations(){ int counter=0; while("Player"_A.HasProperty("PLAYER_ANIMATION["+std::to_string(counter)+"]")){ game->GetPlayer()->AddAnimation(DATA["Player"]["PLAYER_ANIMATION["+std::to_string(counter)+"]"].GetString()+"_N"); game->GetPlayer()->AddAnimation(DATA["Player"]["PLAYER_ANIMATION["+std::to_string(counter)+"]"].GetString()+"_E"); game->GetPlayer()->AddAnimation(DATA["Player"]["PLAYER_ANIMATION["+std::to_string(counter)+"]"].GetString()+"_S"); game->GetPlayer()->AddAnimation(DATA["Player"]["PLAYER_ANIMATION["+std::to_string(counter)+"]"].GetString()+"_W"); counter++; } ANIMATION_DATA.SetInitialized(); }