mirror of
https://github.com/zoriya/Bomberman.git
synced 2025-12-20 21:35:12 +00:00
creation of animation containers
This commit is contained in:
32
lib/Ray/sources/Model/ModelAnimations.cpp
Normal file
32
lib/Ray/sources/Model/ModelAnimations.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
** EPITECH PROJECT, 2021
|
||||
** Bomberman
|
||||
** File description:
|
||||
** ModelAnimations
|
||||
*/
|
||||
|
||||
#include "Model/ModelAnimations.hpp"
|
||||
|
||||
RAY::ModelAnimations::ModelAnimations(const std::string &filePath):
|
||||
_animationsPtr(LoadModelAnimations(filePath.c_str(), &this->_animationCount))
|
||||
{
|
||||
::ModelAnimation *ptr = this->_animationsPtr.get();
|
||||
for (int i = 0; i < this->_animationCount; i++)
|
||||
this->_animations.push_back(RAY::ModelAnimation(ptr[i]));
|
||||
}
|
||||
|
||||
RAY::ModelAnimations::~ModelAnimations()
|
||||
{
|
||||
UnloadModelAnimations(this->_animationsPtr.release(), this->_animationCount);
|
||||
}
|
||||
|
||||
RAY::ModelAnimation &RAY::ModelAnimations::operator[](int index)
|
||||
{
|
||||
return this->_animations[index];
|
||||
}
|
||||
|
||||
size_t RAY::ModelAnimations::getAnimationsCount() const
|
||||
{
|
||||
return this->_animationCount;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user