1
/* This file is part of KsirK.
2
Copyright (C) 2007 Gael de Chalendar <kleag@free.fr>
4
KsirK is free software; you can redistribute it and/or
5
modify it under the terms of the GNU General Public
6
License as published by the Free Software Foundation, version 2.
8
This program is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
General Public License for more details.
13
You should have received a copy of the GNU General Public License
14
along with this program; if not, write to the Free Software
15
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19
/* begin : Thu Feb 22 2007 */
21
#include "animspritespool.h"
22
#include "animsprite.h"
30
AnimSpritePool* AnimSpritePool::m_pool = 0;
32
AnimSpritePool::AnimSpritePool()
34
connect(&m_timer,SIGNAL(timeout()),this,SLOT(update()));
35
m_timer.setSingleShot(true);
39
const AnimSpritePool& AnimSpritePool::single()
43
m_pool = new AnimSpritePool();
48
AnimSpritePool& AnimSpritePool::changeable()
52
m_pool = new AnimSpritePool();
57
void AnimSpritePool::addSprite(AnimSprite* sprite)
59
int index = m_sprites.indexOf(sprite);
62
m_sprites.push_back(sprite);
66
void AnimSpritePool::removeSprite(AnimSprite* sprite)
68
int index = m_sprites.indexOf(sprite);
71
m_sprites.removeAt(index);
75
void AnimSpritePool::update()
77
kDebug() << "AnimSpritePool::update" << endl;
78
QList<AnimSprite*>::iterator it, it_end;
79
it = m_sprites.begin(); it_end = m_sprites.end();
80
for (; it != it_end; it++)
88
} // closing namespace Ksirk
90
#include "animspritespool.moc"