2009-09-03 20:59:17 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
2009-09-03 21:20:13 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2009-09-03 20:59:17 +00:00
|
|
|
*/
|
|
|
|
|
2009-09-04 20:06:19 +00:00
|
|
|
#ifndef TEENAGENT_ANIMATION_H
|
|
|
|
#define TEENAGENT_ANIMATION_H
|
2009-09-03 20:59:17 +00:00
|
|
|
|
|
|
|
#include "common/stream.h"
|
2009-09-04 20:08:33 +00:00
|
|
|
#include "teenagent/surface.h"
|
2009-09-03 20:59:17 +00:00
|
|
|
|
|
|
|
namespace TeenAgent {
|
2009-09-04 20:08:33 +00:00
|
|
|
|
2009-09-03 20:59:17 +00:00
|
|
|
class Animation {
|
2009-09-15 08:54:06 +00:00
|
|
|
public:
|
2009-09-03 20:59:17 +00:00
|
|
|
uint16 id, x, y;
|
2009-11-09 07:58:27 +00:00
|
|
|
bool loop, paused, ignore;
|
2009-09-15 08:54:06 +00:00
|
|
|
|
2009-09-15 20:21:18 +00:00
|
|
|
enum Type {kTypeLan, kTypeVaria, kTypeInventory};
|
2009-09-15 08:54:06 +00:00
|
|
|
|
2009-09-03 20:59:17 +00:00
|
|
|
Animation();
|
2009-09-15 20:21:18 +00:00
|
|
|
void load(Common::SeekableReadStream *s, Type type = kTypeLan);
|
2009-09-03 20:59:17 +00:00
|
|
|
void free();
|
2009-09-15 08:54:06 +00:00
|
|
|
|
2009-09-15 07:41:05 +00:00
|
|
|
Surface *firstFrame();
|
2010-01-05 22:09:16 +00:00
|
|
|
Surface *currentFrame(int dt);
|
2009-09-07 20:38:02 +00:00
|
|
|
uint16 currentIndex() const { return index; }
|
2010-01-04 11:12:19 +00:00
|
|
|
void resetIndex() { index = 0; }
|
2009-09-15 08:54:06 +00:00
|
|
|
|
2009-09-03 20:59:17 +00:00
|
|
|
~Animation();
|
2009-09-15 08:54:06 +00:00
|
|
|
|
2009-09-03 20:59:17 +00:00
|
|
|
bool empty() const { return frames == NULL; }
|
2009-11-08 11:04:22 +00:00
|
|
|
void restart();
|
2009-09-15 08:54:06 +00:00
|
|
|
|
2009-09-03 20:59:17 +00:00
|
|
|
//uint16 width() const { return frames? frames[0].w: 0; }
|
|
|
|
//uint16 height() const { return frames? frames[0].h: 0; }
|
|
|
|
|
|
|
|
protected:
|
2009-09-15 07:41:05 +00:00
|
|
|
byte *data;
|
2009-09-03 20:59:17 +00:00
|
|
|
uint16 data_size;
|
2009-09-15 08:54:06 +00:00
|
|
|
|
2009-09-03 20:59:17 +00:00
|
|
|
uint16 frames_count;
|
2009-09-15 07:41:05 +00:00
|
|
|
Surface *frames;
|
2009-09-03 20:59:17 +00:00
|
|
|
uint16 index;
|
|
|
|
};
|
|
|
|
|
2009-09-04 20:08:33 +00:00
|
|
|
} // End of namespace TeenAgent
|
2009-09-03 20:59:17 +00:00
|
|
|
|
|
|
|
#endif
|