Animations that are missing from the animation map now auto-generate after animations have been defined.

This commit is contained in:
2023-09-16 07:22:44 -05:00
parent 465fb0b6c2
commit 14564d814d
3 changed files with 20 additions and 1 deletions
+10
View File
@@ -208,6 +208,16 @@ void sig::Animation::InitializeAnimations(){
CreateStillAnimation("charged_shot_arrow.png",{48,48});
CreateStillAnimation("laser.png",{5,1});
CreateStillAnimation("range_indicator.png",{24,24});
for(auto&dat:GFX){
std::string imgFile=dat.first;
if(!ANIMATION_DATA.count(imgFile)){
std::cout<<"WARNING! Animation data for "<<imgFile<<" not found! Auto-generating..."<<std::endl;
CreateStillAnimation(imgFile,GFX[imgFile].Sprite()->Size());
std::map<int,int>test;
test.begin();
}
}
}
void sig::Animation::SetupPlayerAnimations(){