2007-05-30 21:56:52 +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.
|
2002-03-22 03:31:55 +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
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2002-03-22 03:31:55 +00:00
|
|
|
*
|
2006-02-11 09:55:41 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2002-03-22 03:31:55 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2007-02-19 17:48:19 +00:00
|
|
|
#ifndef SCUMM_AKOS_H
|
|
|
|
#define SCUMM_AKOS_H
|
2002-04-12 10:34:46 +00:00
|
|
|
|
2003-10-03 18:33:57 +00:00
|
|
|
#include "scumm/base-costume.h"
|
|
|
|
|
|
|
|
namespace Scumm {
|
2002-03-31 02:01:14 +00:00
|
|
|
|
2002-05-14 23:35:28 +00:00
|
|
|
struct CostumeData;
|
2003-01-07 17:35:20 +00:00
|
|
|
struct AkosHeader;
|
|
|
|
struct AkosOffset;
|
2002-04-12 10:34:46 +00:00
|
|
|
|
2005-03-27 00:42:53 +00:00
|
|
|
class AkosCostumeLoader : public BaseCostumeLoader {
|
2005-03-27 01:07:22 +00:00
|
|
|
protected:
|
|
|
|
const byte *_akos;
|
|
|
|
|
2005-03-27 00:23:38 +00:00
|
|
|
public:
|
2005-03-27 01:07:22 +00:00
|
|
|
AkosCostumeLoader(ScummEngine *vm) : BaseCostumeLoader(vm) {}
|
2005-03-27 00:42:53 +00:00
|
|
|
|
2005-03-27 00:23:38 +00:00
|
|
|
void loadCostume(int id);
|
|
|
|
byte increaseAnims(Actor *a);
|
2005-03-27 00:42:53 +00:00
|
|
|
void costumeDecodeData(Actor *a, int frame, uint usemask);
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2005-03-27 00:42:53 +00:00
|
|
|
//void animateLimb(int limb, int f);
|
2005-03-27 01:07:22 +00:00
|
|
|
bool hasManyDirections(int id) {
|
|
|
|
loadCostume(id);
|
|
|
|
return hasManyDirections();
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
bool hasManyDirections();
|
2005-03-27 00:23:38 +00:00
|
|
|
};
|
|
|
|
|
2003-01-07 17:35:20 +00:00
|
|
|
class AkosRenderer : public BaseCostumeRenderer {
|
2003-01-05 23:53:16 +00:00
|
|
|
protected:
|
2007-03-10 13:26:39 +00:00
|
|
|
uint16 _codec;
|
2003-01-05 23:53:16 +00:00
|
|
|
|
2007-03-10 13:26:39 +00:00
|
|
|
// actor _palette
|
|
|
|
byte _palette[256];
|
|
|
|
bool _useBompPalette;
|
2002-07-07 19:31:51 +00:00
|
|
|
|
2003-01-07 17:35:20 +00:00
|
|
|
// pointer to various parts of the costume resource
|
2007-03-10 13:26:39 +00:00
|
|
|
const AkosHeader *akhd; // header
|
2002-03-22 03:30:57 +00:00
|
|
|
|
2007-03-10 13:26:39 +00:00
|
|
|
const byte *akpl; // palette data
|
|
|
|
const byte *akci; // CostumeInfo table
|
|
|
|
const byte *aksq; // command sequence
|
|
|
|
const AkosOffset *akof; // offsets into ci and cd table
|
|
|
|
const byte *akcd; // costume data (contains the data for the codecs)
|
|
|
|
|
|
|
|
const byte *akct; // HE specific: condition table
|
|
|
|
const uint8 *xmap; // HE specific: shadow color table ?!?
|
2002-10-22 12:18:17 +00:00
|
|
|
|
2002-10-22 11:47:45 +00:00
|
|
|
struct {
|
2007-03-10 13:26:39 +00:00
|
|
|
bool repeatMode;
|
|
|
|
int repeatCount;
|
2002-10-22 11:47:45 +00:00
|
|
|
byte mask;
|
|
|
|
byte color;
|
|
|
|
byte shift;
|
|
|
|
uint16 bits;
|
|
|
|
byte numbits;
|
2003-05-28 20:01:47 +00:00
|
|
|
const byte *dataptr;
|
2002-10-22 11:47:45 +00:00
|
|
|
byte buffer[336];
|
2007-03-10 13:26:39 +00:00
|
|
|
} _akos16;
|
2002-10-22 11:47:45 +00:00
|
|
|
|
2002-05-23 00:37:00 +00:00
|
|
|
public:
|
2003-10-02 22:42:03 +00:00
|
|
|
AkosRenderer(ScummEngine *scumm) : BaseCostumeRenderer(scumm) {
|
2007-03-10 13:26:39 +00:00
|
|
|
_useBompPalette = false;
|
2003-01-07 17:35:20 +00:00
|
|
|
akhd = 0;
|
|
|
|
akpl = 0;
|
|
|
|
akci = 0;
|
|
|
|
aksq = 0;
|
|
|
|
akof = 0;
|
|
|
|
akcd = 0;
|
2004-09-08 21:14:12 +00:00
|
|
|
akct = 0;
|
2005-10-29 01:59:18 +00:00
|
|
|
xmap = 0;
|
2003-06-16 15:11:24 +00:00
|
|
|
_actorHitMode = false;
|
2002-10-22 12:18:17 +00:00
|
|
|
}
|
2003-01-05 23:53:16 +00:00
|
|
|
|
2003-06-16 15:11:24 +00:00
|
|
|
bool _actorHitMode;
|
|
|
|
int16 _actorHitX, _actorHitY;
|
|
|
|
bool _actorHitResult;
|
|
|
|
|
2007-03-10 13:26:39 +00:00
|
|
|
void setPalette(byte *_palette);
|
2004-09-30 23:49:46 +00:00
|
|
|
void setFacing(const Actor *a);
|
2005-10-29 01:59:18 +00:00
|
|
|
void setCostume(int costume, int shadow);
|
2003-01-05 23:53:16 +00:00
|
|
|
|
2002-10-22 11:47:45 +00:00
|
|
|
protected:
|
2004-09-08 21:14:12 +00:00
|
|
|
byte drawLimb(const Actor *a, int limb);
|
2003-01-05 23:53:16 +00:00
|
|
|
|
2003-05-30 17:52:17 +00:00
|
|
|
byte codec1(int xmoveCur, int ymoveCur);
|
2004-11-25 23:36:02 +00:00
|
|
|
void codec1_genericDecode(Codec1 &v1);
|
2003-05-30 17:52:17 +00:00
|
|
|
byte codec5(int xmoveCur, int ymoveCur);
|
|
|
|
byte codec16(int xmoveCur, int ymoveCur);
|
2004-09-08 21:38:44 +00:00
|
|
|
byte codec32(int xmoveCur, int ymoveCur);
|
2003-05-28 20:01:47 +00:00
|
|
|
void akos16SetupBitReader(const byte *src);
|
2002-10-21 06:01:04 +00:00
|
|
|
void akos16SkipData(int32 numskip);
|
|
|
|
void akos16DecodeLine(byte *buf, int32 numbytes, int32 dir);
|
2004-04-04 01:11:27 +00:00
|
|
|
void akos16Decompress(byte *dest, int32 pitch, const byte *src, int32 t_width, int32 t_height, int32 dir, int32 numskip_before, int32 numskip_after, byte transparency, int maskLeft, int maskTop, int zBuf);
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-11-28 02:36:01 +00:00
|
|
|
void markRectAsDirty(Common::Rect rect);
|
2002-03-22 03:30:57 +00:00
|
|
|
};
|
|
|
|
|
2003-10-03 18:33:57 +00:00
|
|
|
} // End of namespace Scumm
|
|
|
|
|
2003-01-05 23:53:16 +00:00
|
|
|
#endif
|