2004-01-12 11:11:19 +00:00
|
|
|
#ifndef ANIMATION_H
|
|
|
|
#define ANIMATION_H
|
|
|
|
|
|
|
|
#ifdef USE_MPEG2
|
|
|
|
extern "C" {
|
|
|
|
#include <mpeg2dec/mpeg2.h>
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
namespace Sword2 {
|
|
|
|
|
2004-01-12 19:08:04 +00:00
|
|
|
#define SQR(x) ((x) * (x))
|
2004-01-12 11:11:19 +00:00
|
|
|
|
|
|
|
#define SHIFT 3
|
2004-01-12 19:08:04 +00:00
|
|
|
#define BITDEPTH (1 << (8 - SHIFT))
|
|
|
|
#define ROUNDADD (1 << (SHIFT - 1))
|
2004-01-12 11:11:19 +00:00
|
|
|
|
|
|
|
#define BUFFER_SIZE 4096
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int palnum;
|
|
|
|
|
2004-01-12 19:08:04 +00:00
|
|
|
byte lookup[2][BITDEPTH * BITDEPTH * BITDEPTH];
|
|
|
|
byte *lut;
|
|
|
|
byte *lut2;
|
2004-01-12 11:11:19 +00:00
|
|
|
int lutcalcnum;
|
|
|
|
|
|
|
|
int framenum;
|
|
|
|
|
|
|
|
#ifdef USE_MPEG2
|
2004-01-12 19:08:04 +00:00
|
|
|
mpeg2dec_t *decoder;
|
|
|
|
const mpeg2_info_t *info;
|
2004-01-12 11:11:19 +00:00
|
|
|
#endif
|
2004-01-12 19:08:04 +00:00
|
|
|
File *mpgfile;
|
2004-01-12 11:11:19 +00:00
|
|
|
|
|
|
|
int curpal;
|
|
|
|
int cr;
|
|
|
|
int pos;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
int cnt;
|
|
|
|
int end;
|
2004-01-12 19:08:04 +00:00
|
|
|
byte pal[4 * 256];
|
2004-01-12 11:11:19 +00:00
|
|
|
} palettes[50];
|
|
|
|
|
2004-01-12 19:08:04 +00:00
|
|
|
byte buffer[BUFFER_SIZE];
|
2004-01-12 11:11:19 +00:00
|
|
|
|
|
|
|
PlayingSoundHandle bgSound;
|
|
|
|
|
|
|
|
} AnimationState;
|
|
|
|
|
|
|
|
} // End of namespace Sword2
|
|
|
|
|
|
|
|
#endif
|