mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-17 03:41:48 +01:00
Add alot of memory leak fixes
This commit is contained in:
@@ -4,8 +4,6 @@
|
||||
#include "utils.h"
|
||||
Animation::Animation(Texture* pTexture, int frames, float frameDuration, Rectf srcRect): m_pTexture(pTexture), m_SrcRect(srcRect), m_Frames(frames) {
|
||||
|
||||
}
|
||||
Animation::~Animation() {
|
||||
}
|
||||
void Animation::Update(float elapsedSec) {
|
||||
if (m_isPlaying) {
|
||||
@@ -25,7 +23,7 @@ void Animation::Draw(const Vector2f& pos) const {
|
||||
|
||||
void Animation::Draw(const Vector2f& pos, const Rectf& dst) const {
|
||||
Rectf src = m_SrcRect;
|
||||
src.left += m_CurrentFrame * src.width;
|
||||
src.left += static_cast<float>(m_CurrentFrame) * src.width;
|
||||
|
||||
m_pTexture->Draw(dst, src, m_isFlipped);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ class Animation
|
||||
{
|
||||
public:
|
||||
Animation(Texture* pTexture, int frames, float frameDuration, Rectf srcRect);
|
||||
~Animation();
|
||||
~Animation() = default;
|
||||
|
||||
void Update(float elapsedSec);
|
||||
void Draw(const Vector2f& pos) const;
|
||||
|
||||
Reference in New Issue
Block a user