mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-18 12:19:20 +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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user