2004-04-12 21:40:49 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
|
|
|
* Copyright (C) 2004 The ScummVM project
|
|
|
|
*
|
|
|
|
* The ReInherit Engine is (C)2000-2003 by Daniel Balsom.
|
|
|
|
*
|
|
|
|
* 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$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2004-05-01 06:16:57 +00:00
|
|
|
// Background animation management module private header
|
2004-04-12 21:40:49 +00:00
|
|
|
|
|
|
|
#ifndef SAGA_ANIMATION_H_
|
|
|
|
#define SAGA_ANIMATION_H_
|
|
|
|
|
|
|
|
namespace Saga {
|
|
|
|
|
|
|
|
#define R_MAX_ANIMATIONS 7
|
|
|
|
#define R_DEFAULT_FRAME_TIME 140
|
|
|
|
|
|
|
|
#define SAGA_FRAME_HEADER_MAGIC 15
|
|
|
|
#define SAGA_FRAME_HEADER_LEN 12
|
|
|
|
|
2004-05-01 06:16:57 +00:00
|
|
|
// All animation resources begin with an ANIMATION_HEADER
|
|
|
|
// at 0x00, followed by a RLE code stream
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-04-25 14:42:14 +00:00
|
|
|
struct R_ANIMATION_HEADER {
|
2004-04-30 23:02:23 +00:00
|
|
|
uint16 magic;
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-04-30 23:02:23 +00:00
|
|
|
uint16 screen_w;
|
|
|
|
uint16 screen_h;
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-04-30 23:02:23 +00:00
|
|
|
uint16 unknown06;
|
|
|
|
uint16 unknown07;
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-04-30 23:02:23 +00:00
|
|
|
uint16 nframes;
|
|
|
|
uint16 flags;
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-04-30 23:02:23 +00:00
|
|
|
uint16 unknown10;
|
|
|
|
uint16 unknown11;
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-04-25 14:42:14 +00:00
|
|
|
};
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-04-25 14:42:14 +00:00
|
|
|
struct R_FRAME_HEADER {
|
2004-04-12 21:40:49 +00:00
|
|
|
int x_start;
|
|
|
|
int y_start;
|
|
|
|
|
|
|
|
int x_pos;
|
|
|
|
int y_pos;
|
|
|
|
|
|
|
|
int width;
|
|
|
|
int height;
|
2004-04-25 14:42:14 +00:00
|
|
|
};
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-05-01 06:16:57 +00:00
|
|
|
// Animation info array member
|
2004-04-25 14:42:14 +00:00
|
|
|
struct R_ANIMATION {
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-04-30 23:02:23 +00:00
|
|
|
const byte *resdata;
|
2004-04-12 21:40:49 +00:00
|
|
|
size_t resdata_len;
|
|
|
|
|
2004-04-30 23:02:23 +00:00
|
|
|
uint16 n_frames;
|
2004-04-12 21:40:49 +00:00
|
|
|
size_t *frame_offsets;
|
2004-04-30 23:02:23 +00:00
|
|
|
uint16 current_frame;
|
|
|
|
uint16 end_frame;
|
|
|
|
uint16 stop_frame;
|
|
|
|
const byte *cur_frame_p;
|
2004-04-12 21:40:49 +00:00
|
|
|
size_t cur_frame_len;
|
|
|
|
int frame_time;
|
|
|
|
|
2004-04-30 23:02:23 +00:00
|
|
|
uint16 play_flag;
|
2004-04-12 21:40:49 +00:00
|
|
|
int link_flag;
|
2004-04-30 23:02:23 +00:00
|
|
|
uint16 link_id;
|
|
|
|
uint16 flags;
|
2004-04-25 14:42:14 +00:00
|
|
|
};
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-04-25 14:42:14 +00:00
|
|
|
struct R_ANIMINFO {
|
2004-04-12 21:40:49 +00:00
|
|
|
int initialized;
|
2004-04-30 23:02:23 +00:00
|
|
|
uint16 anim_count;
|
|
|
|
uint16 anim_limit;
|
2004-04-12 21:40:49 +00:00
|
|
|
R_ANIMATION *anim_tbl[R_MAX_ANIMATIONS];
|
2004-04-25 14:42:14 +00:00
|
|
|
};
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-05-01 06:16:57 +00:00
|
|
|
int ANIM_GetNumFrames(const byte *anim_resource, uint16 *n_frames);
|
|
|
|
int ITE_DecodeFrame(const byte * anim_resource, size_t frame_offset, byte * buf, size_t buf_len);
|
|
|
|
int IHNM_DecodeFrame(byte * decode_buf, size_t decode_buf_len, const byte * thisf_p,
|
|
|
|
size_t thisf_len, const byte ** nextf_p, size_t * nextf_len);
|
|
|
|
int ANIM_GetFrameOffset(const byte * anim_resource, uint16 find_frame, size_t * frame_offset);
|
2004-04-12 21:40:49 +00:00
|
|
|
static void CF_anim_info(int argc, char *argv[]);
|
|
|
|
|
|
|
|
} // End of namespace Saga
|
|
|
|
|
|
|
|
#endif /* R_ANIMATION_H_ */
|
|
|
|
/* end "r_animation.h" */
|