]> icculus.org git repositories - taylor/freespace2.git/blob - include/animplay.h
fix issue with looping audio streams
[taylor/freespace2.git] / include / animplay.h
1 /*
2  * Copyright (C) Volition, Inc. 1999.  All rights reserved.
3  *
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
6  * the source.
7  */
8
9 /*
10  * $Logfile: /Freespace2/code/Anim/AnimPlay.h $
11  * $Revision$
12  * $Date$
13  * $Author$
14  *
15  * Header file for playing back anim files
16  *
17  * $Log$
18  * Revision 1.2  2002/06/09 04:41:12  relnev
19  * added copyright header
20  *
21  * Revision 1.1.1.1  2002/05/03 03:28:11  root
22  * Initial import.
23  *
24  * 
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
28  * 
29  * 2     10/07/98 10:52a Dave
30  * Initial checkin.
31  * 
32  * 1     10/07/98 10:48a Dave
33  * 
34  * 11    5/07/98 3:11a Lawrance
35  * Implement custom streaming code
36  * 
37  * 10    4/27/98 3:36p Dave
38  * 
39  * 9     3/25/98 8:43p Hoffoss
40  * Changed anim_play() to not be so damn complex when you try and call it.
41  * 
42  * 8     12/24/97 8:57p Lawrance
43  * Added anim_ignore_next_frametime()
44  * 
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.
48  * 
49  * 6     8/30/97 2:11p Lawrance
50  * allow animations to loop
51  * 
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
55  * 
56  * 4     7/21/97 11:41a Lawrance
57  * make playback time of .ani files keyed of frametime
58  * 
59  * 3     7/20/97 6:57p Lawrance
60  * supporting new RLE format
61  * 
62  * 2     6/26/97 12:12a Lawrance
63  * supporting anti-aliased bitmap animations
64  * 
65  * 1     6/23/97 5:09p Lawrance
66  * 
67  * 10    5/19/97 2:28p Lawrance
68  * changes some variables to flags
69  * 
70  * 9     5/15/97 5:58p Lawrance
71  * fix some bugs that were present with animations when playing multiple
72  * missions
73  * 
74  * 8     5/15/97 4:42p Lawrance
75  * suporting anims in-game
76  * 
77  * 7     5/15/97 11:46a Lawrance
78  * add function to check if an anim is playing
79  * 
80  * 6     2/28/97 12:17p Lawrance
81  * supporting mapping file to memory
82  * 
83  * 5     2/25/97 11:06a Lawrance
84  * moved some higher level functions to from PackUnpack to AnimPlay
85  * 
86  * 4     2/19/97 9:27p Lawrance
87  * added pause capability to anim playback
88  * 
89  * 3     2/17/97 4:19p Lawrance
90  * using frame numbers instead of percentages for accessing keyframes
91  * 
92  * 2     2/17/97 3:01p Lawrance
93  * code for playing back an anim
94  *
95  * $NoKeywords: $
96  */
97
98 #ifndef __ANIMPLAY_H__
99 #define __ANIMPLAY_H__
100
101 #include "pstypes.h"
102
103 struct anim;
104 struct anim_info;
105 struct anim_instance;
106 struct CFILE;
107
108 // structure passed in when playing an anim.  Talk about overkill..
109 typedef struct {
110         anim *anim_info;
111         int x;
112         int y;
113         int start_at;
114         int stop_at;
115         int screen_id;
116         vector *world_pos;
117         float radius;
118         int framerate_independent;
119         void *color;
120         int skip_frames;
121         int looped;
122         int ping_pong;
123 } anim_play_struct;
124
125 extern int Anim_paused;
126
127 void                            anim_init();
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);
148
149 int     anim_instance_is_streamed(anim_instance *ai);
150 unsigned char anim_instance_get_byte(anim_instance *ai, int offset);
151
152 #endif /* __ANIMPLAY_H__ */
153