2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
10 * $Logfile: /Freespace2/code/Anim/AnimPlay.h $
15 * Header file for playing back anim files
18 * Revision 1.2 2002/06/09 04:41:12 relnev
19 * added copyright header
21 * Revision 1.1.1.1 2002/05/03 03:28:11 root
25 * 3 10/22/98 6:14p Dave
26 * Optimized some #includes in Anim folder. Put in the beginnings of
27 * parse/localization support for externalized strings and tstrings.tbl
29 * 2 10/07/98 10:52a Dave
32 * 1 10/07/98 10:48a Dave
34 * 11 5/07/98 3:11a Lawrance
35 * Implement custom streaming code
37 * 10 4/27/98 3:36p Dave
39 * 9 3/25/98 8:43p Hoffoss
40 * Changed anim_play() to not be so damn complex when you try and call it.
42 * 8 12/24/97 8:57p Lawrance
43 * Added anim_ignore_next_frametime()
45 * 7 11/19/97 8:28p Dave
46 * Hooked in Main Hall screen. Put in Anim support for ping ponging
47 * animations as well as general reversal of anim direction.
49 * 6 8/30/97 2:11p Lawrance
50 * allow animations to loop
52 * 5 8/25/97 11:13p Lawrance
53 * support framerate independent playback with the option of now advancing
54 * more than one frame at a time
56 * 4 7/21/97 11:41a Lawrance
57 * make playback time of .ani files keyed of frametime
59 * 3 7/20/97 6:57p Lawrance
60 * supporting new RLE format
62 * 2 6/26/97 12:12a Lawrance
63 * supporting anti-aliased bitmap animations
65 * 1 6/23/97 5:09p Lawrance
67 * 10 5/19/97 2:28p Lawrance
68 * changes some variables to flags
70 * 9 5/15/97 5:58p Lawrance
71 * fix some bugs that were present with animations when playing multiple
74 * 8 5/15/97 4:42p Lawrance
75 * suporting anims in-game
77 * 7 5/15/97 11:46a Lawrance
78 * add function to check if an anim is playing
80 * 6 2/28/97 12:17p Lawrance
81 * supporting mapping file to memory
83 * 5 2/25/97 11:06a Lawrance
84 * moved some higher level functions to from PackUnpack to AnimPlay
86 * 4 2/19/97 9:27p Lawrance
87 * added pause capability to anim playback
89 * 3 2/17/97 4:19p Lawrance
90 * using frame numbers instead of percentages for accessing keyframes
92 * 2 2/17/97 3:01p Lawrance
93 * code for playing back an anim
98 #ifndef __ANIMPLAY_H__
99 #define __ANIMPLAY_H__
105 struct anim_instance;
108 // structure passed in when playing an anim. Talk about overkill..
118 int framerate_independent;
125 extern int Anim_paused;
128 void anim_level_init();
129 void anim_level_close();
130 void anim_render_all(int screen_id, float frametime);
131 void anim_render_one(int screen_id, anim_instance *ani, float frametime);
132 void anim_play_init(anim_play_struct *aps, anim *a_info, int x, int y);
133 anim_instance *anim_play(anim_play_struct *aps);
134 void anim_ignore_next_frametime();
135 int anim_stop_playing(anim_instance* anim_instance);
136 int anim_show_next_frame(anim_instance *instance, float frametime);
137 void anim_release_all_instances(int screen_id = 0);
138 void anim_release_render_instance(anim_instance* instance);
139 anim *anim_load(const char *name);
140 int anim_free(anim *ptr);
141 int anim_playing(anim_instance *ai);
142 int anim_write_frames_out(const char *filename);
143 void anim_display_info(const char *filename);
144 void anim_read_header(anim *ptr, CFILE *fp);
145 void anim_reverse_direction(anim_instance *ai); // called automatically for ping-ponging, and can also be called externally
146 void anim_pause(anim_instance *ai);
147 void anim_unpause(anim_instance *ai);
149 int anim_instance_is_streamed(anim_instance *ai);
150 unsigned char anim_instance_get_byte(anim_instance *ai, int offset);
152 #endif /* __ANIMPLAY_H__ */