2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
2006-05-23 23:43:52 +00:00
|
|
|
*
|
2007-05-30 21:56:52 +00:00
|
|
|
* 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.
|
2006-05-23 23:43:52 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* $URL$
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2006-05-24 14:25:42 +00:00
|
|
|
#ifndef AGI_SPRITE_H
|
|
|
|
#define AGI_SPRITE_H
|
2006-05-23 23:43:52 +00:00
|
|
|
|
2006-05-30 18:53:01 +00:00
|
|
|
#include "common/list.h"
|
|
|
|
|
2006-05-23 23:43:52 +00:00
|
|
|
namespace Agi {
|
|
|
|
|
2006-05-30 18:53:01 +00:00
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
struct Sprite;
|
|
|
|
typedef Common::List<Sprite*> SpriteList;
|
2006-05-30 18:53:01 +00:00
|
|
|
|
2006-12-06 19:27:02 +00:00
|
|
|
class AgiEngine;
|
|
|
|
class GfxMgr;
|
|
|
|
class Obejcts;
|
|
|
|
|
|
|
|
class SpritesMgr {
|
2006-05-30 18:53:01 +00:00
|
|
|
private:
|
2006-12-06 19:27:02 +00:00
|
|
|
GfxMgr *_gfx;
|
|
|
|
AgiEngine *_vm;
|
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
uint8 *_spritePool;
|
|
|
|
uint8 *_poolTop;
|
2006-05-30 18:53:01 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Sprite management functions
|
|
|
|
*/
|
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
SpriteList _sprUpd;
|
|
|
|
SpriteList _sprNonupd;
|
2006-05-30 18:53:01 +00:00
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
void *poolAlloc(int size);
|
|
|
|
void poolRelease(void *s);
|
|
|
|
void blitPixel(uint8 *p, uint8 *end, uint8 col, int spr, int width, int *hidden);
|
2007-06-20 23:56:08 +00:00
|
|
|
int blitCel(int x, int y, int spr, ViewCel *c, bool agi256_2);
|
2007-01-16 12:40:51 +00:00
|
|
|
void objsSaveArea(Sprite *s);
|
|
|
|
void objsRestoreArea(Sprite *s);
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
FORCEINLINE int prioToY(int p);
|
|
|
|
Sprite *newSprite(VtEntry *v);
|
|
|
|
void sprAddlist(SpriteList &l, VtEntry *v);
|
|
|
|
void buildList(SpriteList &l, bool (*test)(VtEntry *, AgiEngine *));
|
|
|
|
void buildUpdBlitlist();
|
|
|
|
void buildNonupdBlitlist();
|
|
|
|
void freeList(SpriteList &l);
|
|
|
|
void commitSprites(SpriteList &l);
|
|
|
|
void eraseSprites(SpriteList &l);
|
2008-01-27 19:47:41 +00:00
|
|
|
void blitSprites(SpriteList &l);
|
2007-01-16 12:40:51 +00:00
|
|
|
static bool testUpdating(VtEntry *v, AgiEngine *);
|
|
|
|
static bool testNotUpdating(VtEntry *v, AgiEngine *);
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2006-05-30 18:53:01 +00:00
|
|
|
public:
|
2006-12-06 19:27:02 +00:00
|
|
|
SpritesMgr(AgiEngine *agi, GfxMgr *gfx);
|
|
|
|
~SpritesMgr();
|
2006-05-30 18:53:01 +00:00
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
int initSprites();
|
|
|
|
void deinitSprites();
|
|
|
|
void eraseUpdSprites();
|
|
|
|
void eraseNonupdSprites();
|
|
|
|
void eraseBoth();
|
|
|
|
void blitUpdSprites();
|
|
|
|
void blitNonupdSprites();
|
|
|
|
void blitBoth();
|
|
|
|
void commitUpdSprites();
|
|
|
|
void commitNonupdSprites();
|
|
|
|
void commitBoth();
|
|
|
|
void addToPic(int, int, int, int, int, int, int);
|
|
|
|
void showObj(int);
|
|
|
|
void commitBlock(int, int, int, int);
|
2006-05-30 18:53:01 +00:00
|
|
|
};
|
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
} // End of namespace Agi
|
2006-05-23 23:43:52 +00:00
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
#endif /* AGI_SPRITE_H */
|