22 #ifndef MADS_CORE_ANIM_H 23 #define MADS_CORE_ANIM_H 25 #include "audio/audiostream.h" 26 #include "common/stream.h" 27 #include "mads/core/general.h" 28 #include "mads/core/font.h" 29 #include "mads/core/image.h" 30 #include "mads/core/room.h" 31 #include "mads/core/sprite.h" 32 #include "mads/core/tile.h" 39 #define ANIM_LOAD_TRANSLATE 0x0001 40 #define ANIM_LOAD_BACKGROUND 0x0100 41 #define ANIM_LOAD_BACK_ONLY 0x0200 42 #define ANIM_INTERFACE 0x4000 46 #define depth_coded misc[0] 47 #define misc_any_packed misc[1] 48 #define misc_packed_series misc[2] 49 #define misc_peel_x misc[3] 50 #define misc_peel_y misc[4] 51 #define misc_peel_rate misc[5] 52 #define misc_slow_fade misc[6] 54 #define misc_no_catchup misc[7] 56 #define seg_misc_coordinate_style misc[0] 57 #define seg_misc_displace_x misc[1] 58 #define seg_misc_displace_y misc[2] 60 #define seg_misc_disp_good_1 misc[3] 61 #define seg_misc_disp_good_2 misc[4] 62 #define SEG_MAGIC_1 0x1234 63 #define SEG_MAGIC_2 0x5678 65 #define seg_misc_accel_x misc[5] 66 #define seg_misc_accel_y misc[6] 68 #define seg_misc_special_scale misc[7] 70 #define SEG_SPECIAL_SCALE_UP 0x8000 71 #define SEG_SPECIAL_SCALE_DOWN 0x4000 72 #define SEG_SPECIAL_SCALE_MASK 0xf000 74 #define AA_MAX_SERIES 50 75 #define AA_MAX_SEGMENTS 25 76 #define AA_MAX_FRAMES 500 77 #define AA_MAX_IMAGES 500 78 #define AA_MAX_SPEECH 25 80 #define AA_MAX_IMAGES_PER_FRAME 250 82 #define AA_MAX_SPAWNED 2 84 #define AA_MAX_CHANGES 100 89 #define AA_BLACKSCREEN 3 90 #define AA_INTERFACE 4 93 #define AA_DONTCARE -1 100 #define AA_MULTIPLE 2 102 #define AA_ROOMBASED -1 105 #define AA_ABSOLUTEFRAME 1 106 #define AA_DELTAFIRST 2 107 #define AA_DELTALAST 3 108 #define AA_ABSOLUTEFIRST 4 109 #define AA_ABSOLUTELAST 5 110 #define AA_RANDOMACCESS 6 113 #define AA_MARK 0x8000 114 #define AA_TIMING 0x7fff 116 #define AA_LOAD_SOUND 0x8000 117 #define AA_LOAD_SPEECH 0x4000 118 #define AA_LOAD_FONT 0x2000 120 #define AA_NO_SPEECH (-1) 122 #define AA_SPEECH 0x8000 123 #define AA_TEXT 0x4000 124 #define AA_SPEECH_XOR_TEXT 0x2000 125 #define AA_SPEECH_AND_TEXT 0x1000 126 #define AA_SPEECH_NOR_TEXT 0x0800 128 #define AA_ABORTABLE 0x8000 129 #define AA_CONVENTIONAL 0x4000 130 #define AA_PRELOAD 0x2000 133 #define AA_ERR_OPENFILE -128 134 #define AA_ERR_WRITEFILE -129 135 #define AA_ERR_READFILE -130 136 #define AA_ERR_NOMOREMEMORY -131 137 #define AA_ERR_MAKEDIALOG -132 138 #define AA_ERR_TOOMANYIMAGES -133 139 #define AA_ERR_TOOMANYFRAMES -134 140 #define AA_ERR_TOOMANYSEGMENTS -135 141 #define AA_ERR_TOOMANYSPEECH -136 142 #define AA_ERR_NODAMNFONT -137 143 #define AA_ERR_BADDEFINITION -138 144 #define AA_ERR_OLDDEFINITION -139 147 #define IMAGE_UNSCALED 0xff 149 #define IMAGE_UPDATE_READY 0x40 151 #define IMAGE_UPDATE 1 152 #define IMAGE_STATIC 0 153 #define IMAGE_ERASE -1 154 #define IMAGE_REFRESH -2 155 #define IMAGE_OVERPRINT -3 156 #define IMAGE_DELTA -4 157 #define IMAGE_FULLUPDATE -5 159 #define IMAGE_UPDATE_ONLY -20 171 int sprite_loop_mode;
172 int sprite_repeat_mode;
173 double loop_direction;
180 byte low_level_change;
184 int front_scale, back_scale;
188 byte spawn[AA_MAX_SPAWNED];
189 int spawn_frame[AA_MAX_SPAWNED];
193 int start_x, start_y;
196 double delta_x, delta_y;
204 int num_sprite_changes;
205 word sprite_change_frame[AA_MAX_CHANGES];
206 word sprite_change_target[AA_MAX_CHANGES];
213 #define zone_low spawn_frame[0] 214 #define zone_high spawn_frame[1] 241 static constexpr
size_t SIZE = 2 + 1 + 1 + 1 + 1 + 2 + 1 + 1;
287 static constexpr
size_t SIZE = 1 + 1 + 2 + 2 + 2 + 1 + 1;
299 byte spawn[AA_MAX_SPAWNED];
300 int16 spawn_frame[AA_MAX_SPAWNED];
305 static constexpr
size_t SIZE = 5 * 2 + AA_MAX_SPAWNED + AA_MAX_SPAWNED * 2 + 2 + 2;
317 uint16 display_condition;
321 int16 non_speech_loops;
322 int16 segment_to_loop;
327 static constexpr
size_t SIZE = 2 + 60 + 3 + 1 + 4 + 2 + 2 + 2 + 2 * RGBcolor::SIZE + 7 * 2;
347 int font_auto_spacing;
353 char background_name[80];
355 char sound_file_name[80];
360 char series_name[AA_MAX_SERIES][80];
362 char background_depth[80];
364 char speech_file[80];
380 uint16 font_auto_spacing;
381 uint16 background_type;
382 uint16 background_room;
384 char background_name[13];
385 char series_name[AA_MAX_SERIES][13];
386 char sound_file_name[13];
387 char background_depth[13];
388 char speech_file[13];
391 static constexpr
size_t SIZE = (8 * 2) + (10 * 2) + 13 +
392 (AA_MAX_SERIES * 13) + 13 + 13 + 13 + 13 +
407 int series_id[AA_MAX_SERIES];
418 SegmentInterPtr segment;
421 int series_id[AA_MAX_SERIES];
426 extern int anim_error;
428 int anim_load_background(
AnimFile *anim_in,
437 int load_flags,
int star_search);
440 void anim_unload(AnimPtr anim);
442 AnimPtr anim_load(
const char *file_name,
451 int anim_get_sound_info(
const char *file_name,
char *sound_file_buffer,
452 int *sound_load_flag);
454 int anim_get_header_info(
char *file_name,
458 int anim_himem_preload(
char *name,
int level);
460 extern void init_anim();
Definition: anim_timer.h:27