]> icculus.org git repositories - taylor/freespace2.git/blob - include/animplay.h
Initial revision
[taylor/freespace2.git] / include / animplay.h
1 /*
2  * $Logfile: /Freespace2/code/Anim/AnimPlay.h $
3  * $Revision$
4  * $Date$
5  * $Author$
6  *
7  * Header file for playing back anim files
8  *
9  * $Log$
10  * Revision 1.1  2002/05/03 03:28:11  root
11  * Initial revision
12  *
13  * 
14  * 3     10/22/98 6:14p Dave
15  * Optimized some #includes in Anim folder. Put in the beginnings of
16  * parse/localization support for externalized strings and tstrings.tbl
17  * 
18  * 2     10/07/98 10:52a Dave
19  * Initial checkin.
20  * 
21  * 1     10/07/98 10:48a Dave
22  * 
23  * 11    5/07/98 3:11a Lawrance
24  * Implement custom streaming code
25  * 
26  * 10    4/27/98 3:36p Dave
27  * 
28  * 9     3/25/98 8:43p Hoffoss
29  * Changed anim_play() to not be so damn complex when you try and call it.
30  * 
31  * 8     12/24/97 8:57p Lawrance
32  * Added anim_ignore_next_frametime()
33  * 
34  * 7     11/19/97 8:28p Dave
35  * Hooked in Main Hall screen. Put in Anim support for ping ponging
36  * animations as well as general reversal of anim direction.
37  * 
38  * 6     8/30/97 2:11p Lawrance
39  * allow animations to loop
40  * 
41  * 5     8/25/97 11:13p Lawrance
42  * support framerate independent playback with the option of now advancing
43  * more than one frame at a time
44  * 
45  * 4     7/21/97 11:41a Lawrance
46  * make playback time of .ani files keyed of frametime
47  * 
48  * 3     7/20/97 6:57p Lawrance
49  * supporting new RLE format
50  * 
51  * 2     6/26/97 12:12a Lawrance
52  * supporting anti-aliased bitmap animations
53  * 
54  * 1     6/23/97 5:09p Lawrance
55  * 
56  * 10    5/19/97 2:28p Lawrance
57  * changes some variables to flags
58  * 
59  * 9     5/15/97 5:58p Lawrance
60  * fix some bugs that were present with animations when playing multiple
61  * missions
62  * 
63  * 8     5/15/97 4:42p Lawrance
64  * suporting anims in-game
65  * 
66  * 7     5/15/97 11:46a Lawrance
67  * add function to check if an anim is playing
68  * 
69  * 6     2/28/97 12:17p Lawrance
70  * supporting mapping file to memory
71  * 
72  * 5     2/25/97 11:06a Lawrance
73  * moved some higher level functions to from PackUnpack to AnimPlay
74  * 
75  * 4     2/19/97 9:27p Lawrance
76  * added pause capability to anim playback
77  * 
78  * 3     2/17/97 4:19p Lawrance
79  * using frame numbers instead of percentages for accessing keyframes
80  * 
81  * 2     2/17/97 3:01p Lawrance
82  * code for playing back an anim
83  *
84  * $NoKeywords: $
85  */
86
87 #ifndef __ANIMPLAY_H__
88 #define __ANIMPLAY_H__
89
90 #include "pstypes.h"
91
92 struct anim;
93 struct anim_info;
94 struct anim_instance;
95 struct CFILE;
96
97 // structure passed in when playing an anim.  Talk about overkill..
98 typedef struct {
99         anim *anim_info;
100         int x;
101         int y;
102         int start_at;
103         int stop_at;
104         int screen_id;
105         vector *world_pos;
106         float radius;
107         int framerate_independent;
108         void *color;
109         int skip_frames;
110         int looped;
111         int ping_pong;
112 } anim_play_struct;
113
114 extern int Anim_paused;
115
116 void                            anim_init();
117 void                            anim_level_init();
118 void                            anim_level_close();
119 void                            anim_render_all(int screen_id, float frametime);
120 void                            anim_render_one(int screen_id, anim_instance *ani, float frametime);
121 void                            anim_play_init(anim_play_struct *aps, anim *a_info, int x, int y);
122 anim_instance *anim_play(anim_play_struct *aps);
123 void                            anim_ignore_next_frametime();
124 int                             anim_stop_playing(anim_instance* anim_instance);
125 int                             anim_show_next_frame(anim_instance *instance, float frametime);
126 void                            anim_release_all_instances(int screen_id = 0);
127 void                            anim_release_render_instance(anim_instance* instance);
128 anim                      *anim_load(char *name, int file_mapped = 0);
129 int                             anim_free(anim *ptr);
130 int                             anim_playing(anim_instance *ai);
131 int                             anim_write_frames_out(char *filename);
132 void                            anim_display_info(char *filename);
133 void                            anim_read_header(anim *ptr, CFILE *fp);
134 void                            anim_reverse_direction(anim_instance *ai);                                              // called automatically for ping-ponging, and can also be called externally
135 void                            anim_pause(anim_instance *ai);
136 void                            anim_unpause(anim_instance *ai);
137
138 int     anim_instance_is_streamed(anim_instance *ai);
139 unsigned char anim_instance_get_byte(anim_instance *ai, int offset);
140
141 #endif /* __ANIMPLAY_H__ */
142