diff options
author | Gregory Montoir | 2005-10-03 20:21:18 +0000 |
---|---|---|
committer | Gregory Montoir | 2005-10-03 20:21:18 +0000 |
commit | 3bcb098fd31a0f68171fd4053f2600bb84814a5a (patch) | |
tree | f62249c1ee390eccf590de2b15ef22db509a5838 /kyra/sprites.h | |
parent | efa1c130640f4588ccdbba060448d53b51b26a86 (diff) | |
download | scummvm-rg350-3bcb098fd31a0f68171fd4053f2600bb84814a5a.tar.gz scummvm-rg350-3bcb098fd31a0f68171fd4053f2600bb84814a5a.tar.bz2 scummvm-rg350-3bcb098fd31a0f68171fd4053f2600bb84814a5a.zip |
committed patch #1312156 'Various sprite-related things'. Thanks Oystein Eftevaag/vinterstum
svn-id: r18930
Diffstat (limited to 'kyra/sprites.h')
-rw-r--r-- | kyra/sprites.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/kyra/sprites.h b/kyra/sprites.h new file mode 100644 index 0000000000..3a87b05153 --- /dev/null +++ b/kyra/sprites.h @@ -0,0 +1,76 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2004-2005 The ScummVM project + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#ifndef KYRASPRITES_H +#define KYRASPRITES_H + +namespace Kyra { + +#define MAX_NUM_SPRITES 50 +#define MAX_NUM_ANIMS 11 + +struct Sprite { + uint16 x; + uint16 y; + uint16 width; + uint16 height; +}; + +struct Anim { + uint8 *script; + uint16 length; + uint16 x; + uint16 y; + bool flag0; + int8 sprite; + uint8 *loopStart; + uint16 loopsLeft; + uint8 *reentry; + uint32 nextRun; + bool play; +}; + +class Sprites { +public: + + Sprites(KyraEngine *engine, OSystem *system); + ~Sprites(); + + void doAnims(); + void loadDAT(const char* filename); + Sprite getSprite(uint8 spriteID); + void drawSprites(uint8 srcPage, uint8 dstPage); + +protected: + KyraEngine *_engine; + Resource *_res; + OSystem *_system; + Screen *_screen; + Sprite _sprites[MAX_NUM_SPRITES]; + uint8 *_dat; + Anim _anims[MAX_NUM_ANIMS]; + Common::RandomSource _rnd; + uint8 _animDelay; +}; + +} // End of namespace Kyra + +#endif |