Open source remastering of the Freespace 2 engine
Go to the documentation of this file.
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 the
6  * source.
7  *
8 */
12 #ifndef __ANIMPLAY_H__
13 #define __ANIMPLAY_H__
15 #include "cfile/cfile.h"
16 #include "globalincs/pstypes.h"
18 struct anim;
19 struct anim_info;
20 struct anim_instance;
22 // structure passed in when playing an anim. Talk about overkill..
23 typedef struct {
25  int x;
26  int y;
27  int base_w;
28  int base_h;
29  int start_at;
30  int stop_at;
31  int screen_id;
33  float radius;
35  void *color;
37  int looped;
38  int ping_pong;
41 enum
42 {
46 };
48 extern int Anim_paused;
50 void anim_init();
51 void anim_level_init();
52 void anim_level_close();
53 void anim_render_all(int screen_id, float frametime);
54 void anim_render_one(int screen_id, anim_instance *ani, float frametime);
55 void anim_play_init(anim_play_struct *aps, anim *a_info, int x, int y, int max_x = -1, int max_y = -1);
59 int anim_show_next_frame(anim_instance *instance, float frametime);
60 void anim_release_all_instances(int screen_id = 0);
62 anim *anim_load(char *name, int cf_dir_type = CF_TYPE_ANY, int file_mapped = PAGE_FROM_MEM);
63 int anim_free(anim *ptr);
66 void anim_display_info(char *filename);
67 void anim_read_header(anim *ptr, CFILE *fp);
68 void anim_reverse_direction(anim_instance *ai); // called automatically for ping-ponging, and can also be called externally
69 void anim_pause(anim_instance *ai);
70 void anim_unpause(anim_instance *ai);
73 unsigned char anim_instance_get_byte(anim_instance *ai, int offset);
75 #endif /* __ANIMPLAY_H__ */
vec3d * world_pos
Definition: animplay.h:32
void * color
Definition: animplay.h:35
int anim_stop_playing(anim_instance *anim_instance)
Stop an anim instance that is on the anim_render_list from playing.
Definition: animplay.cpp:522
unsigned char anim_instance_get_byte(anim_instance *ai, int offset)
Definition: animplay.cpp:1073
int Anim_paused
Definition: animplay.cpp:34
Definition: pstypes.h:88
void anim_render_one(int screen_id, anim_instance *ani, float frametime)
Display the frames for the passed animation.
Definition: animplay.cpp:93
Definition: cfile.h:28
void anim_play_init(anim_play_struct *aps, anim *a_info, int x, int y, int max_x=-1, int max_y=-1)
Setup an anim_play_struct for passing into anim_play().
Definition: animplay.cpp:117
void anim_unpause(anim_instance *ai)
Definition: animplay.cpp:1057
GLintptr offset
Definition: Glext.h:5497
void anim_pause(anim_instance *ai)
Definition: animplay.cpp:1052
int anim_instance_is_streamed(anim_instance *ai)
Definition: animplay.cpp:1067
void anim_level_close()
Called after the end of a mission to clean up any mission dependent anim data.
Definition: animplay.cpp:887
int anim_show_next_frame(anim_instance *instance, float frametime)
This function is called to blit the next frame of an anim instance to the screen. This is normally ca...
Definition: animplay.cpp:254
char * filename
void anim_release_render_instance(anim_instance *instance)
Free a particular animation instance that is on the anim_render_list. Do not call this function to fr...
Definition: animplay.cpp:538
void anim_read_header(anim *ptr, CFILE *fp)
Definition: animplay.cpp:607
cfbp fp
Definition: cfile.cpp:1065
void anim_release_all_instances(int screen_id=0)
Free all anim instances that are on the anim_render_list.
Definition: animplay.cpp:567
GLint GLint GLint GLint GLint x
Definition: Glext.h:5182
int anim_playing(anim_instance *ai)
Return if an anim is playing or not.
Definition: animplay.cpp:866
void anim_render_all(int screen_id, float frametime)
Display the frames for the currently playing anims.
Definition: animplay.cpp:67
anim_instance * anim_play(anim_play_struct *aps)
Will add an anim instance to the anim_render_list. This will cause the anim to be played at the x...
Definition: animplay.cpp:143
anim * anim_info
Definition: animplay.h:24
GLuint const GLchar * name
Definition: Glext.h:5608
void anim_level_init()
Called at the beginning of a mission to initialize any mission dependent anim data.
Definition: animplay.cpp:880
int anim_free(anim *ptr)
Free an animation that was loaded with anim_load().
Definition: animplay.cpp:813
int anim_write_frames_out(char *filename)
Write the frames of a .ani file out to disk as .pcx files.
Definition: animplay.cpp:898
int framerate_independent
Definition: animplay.h:34
void anim_init()
Initialise animation.
Definition: animplay.cpp:45
void anim_reverse_direction(anim_instance *ai)
Definition: animplay.cpp:1019
void anim_ignore_next_frametime()
Definition: animplay.cpp:1062
anim * anim_load(char *name, int cf_dir_type=CF_TYPE_ANY, int file_mapped=PAGE_FROM_MEM)
Load an animation. This stores the compressed data, which instances of the animation can reference...
Definition: animplay.cpp:687
#define CF_TYPE_ANY
Definition: cfile.h:42
void anim_display_info(char *filename)
Display information and statistics about a .ani file.
Definition: animplay.cpp:947
GLint y
Definition: Gl.h:1505