5 #define BMPMAN_INTERNAL
18 #define ANI_BPP_CHECK (ga->ani.bg_type == BM_TYPE_PCX) ? 16 : 32
34 int stream_result = -1;
39 Assert(anim_filename != NULL);
49 p = strchr(filename,
'.');
56 ga->
ani.bg_type = bg_type;
61 if (stream_result < 0) {
65 p = strchr(filename,
'.');
72 ga->
ani.bg_type = bg_type;
104 ga->
ani.animation = NULL;
105 ga->
ani.instance = NULL;
126 if (filename == NULL) {
161 CFILE *img_cfp = NULL;
165 const int NUM_TYPES = 2;
167 const char *ext_list[NUM_TYPES] = {
".eff",
".ani"};
176 if ( (rval < 0) || (rval >= NUM_TYPES) )
182 if (img_cfp == NULL) {
187 ga->
type = type_list[rval];
197 if (ga->
ani.animation ==
nullptr) {
200 if (ga->
ani.instance ==
nullptr) {
210 anim_fps = ga->
ani.animation->fps;
212 ga->
width = ga->
ani.animation->width;
215 ga->
ani.instance->last_bitmap = -1;
217 ga->
ani.instance->file_offset = ga->
ani.animation->file_offset;
218 ga->
ani.instance->data = ga->
ani.animation->data;
234 mprintf((
"Cannot find first frame for eff streaming. eff Filename: %s", ga->
filename));
248 if(ga->
ani.animation->num_keys == 2) {
249 int key1 = ga->
ani.animation->keys[0].frame_num;
250 int key2 = ga->
ani.animation->keys[1].frame_num;
253 if (key2 < 0 || key2 >= ga->
num_frames) key2 = -1;
257 if (key1 >= 0 && key1 >= key2) {
258 ga->
keyframe = ga->
ani.animation->keys[0].frame_num;
261 else if (key2 >= 0 && key2 >= key1) {
262 ga->
keyframe = ga->
ani.animation->keys[1].frame_num;
300 if(ga->
eff.next_frame >= 0)
330 mprintf((
"=========================\n"));
338 if(next_frame_bmp->
data)
350 mprintf((
"=========================\n"));
368 mprintf((
"=========================\n"));
378 ga->
ani.instance->file_offset = ga->
ani.animation->file_offset + ga->
ani.animation->keys[ga->
current_frame].offset;
395 ga->
ani.instance->file_offset = ga->
ani.animation->file_offset + ga->
keyoffset;
403 ga->
ani.instance->file_offset = ga->
ani.animation->file_offset;
404 ga->
ani.instance->data = ga->
ani.animation->data;
433 mprintf((
"=========================\n"));
void bm_unlock(int handle)
Unlocks a bitmap.
int unpack_frame_from_file(anim_instance *ai, ubyte *frame, int size, ubyte *pal_translate, int aabitmap, int bpp)
Unpack frame from file.
const char * bm_ext_list[]
List of extensions for those types.
bool bm_load_and_parse_eff(const char *filename, int dir_type, int *nframes, int *nfps, int *key, BM_TYPE *type)
Loads and parses an .EFF.
unsigned char done_playing
int generic_anim_load(generic_anim *ga)
void generic_bitmap_init(generic_bitmap *gb, const char *filename)
int bm_get_info(int handle, int *w, int *h, ubyte *flags, int *nframes, int *fps)
Gets info on the bitmap indexed by handle.
int generic_bitmap_load(generic_bitmap *gb)
const int BM_ANI_NUM_TYPES
Calculated number of bitmap animation types.
bool generic_anim_exists(const char *filename)
#define gr_update_texture
#define BMP_TEX_NONCOMP
Non-compressed textures.
int cf_find_file_location_ext(const char *filename, const int ext_num, const char **ext_list, int pathtype, int max_out=0, char *pack_filename=NULL, int *size=NULL, int *offset=NULL, bool localize=false)
std::basic_string< char, std::char_traits< char >, std::allocator< char > > SCP_string
void gr_set_bitmap(int bitmap_num, int alphablend_mode, int bitblt_mode, float alpha)
void generic_render_ani_stream(generic_anim *ga)
void free_anim_instance(anim_instance *inst)
#define cfopen_special(...)
int bm_release(int handle, int clear_render_targets)
Frees both a bitmap's data and it's associated slot.
void BM_SELECT_TEX_FORMAT()
Sets bm_set_components and bm_get_components to reference texture format functions.
#define BMP_AABITMAP
antialiased bitmap
void generic_anim_unload(generic_anim *ga)
int bm_load_animation(const char *real_filename, int *nframes, int *fps, int *keyframe, int can_drop_frames, int dir_type)
Loads a bitmap sequance so we can draw with it.
#define CLAMP(x, min, max)
#define GENERIC_ANIM_DIRECTION_FORWARDS
const char * bm_ani_ext_list[]
List of extensions for those types.
specifies any type of animated image, the EFF itself is just text
void generic_anim_render(generic_anim *ga, float frametime, int x, int y, bool menu)
GLuint64EXT GLuint GLuint GLenum GLenum GLuint GLuint GLenum GLuint GLuint key1
int anim_free(anim *ptr)
Free an animation that was loaded with anim_load().
bitmap * bm_lock(int handle, ubyte bpp, ubyte flags, bool nodebug)
Locks down the bitmap indexed by bitmapnum.
ubyte * unpack_frame(anim_instance *ai, ubyte *ptr, ubyte *frame, int size, ubyte *pal_translate, int aabitmap, int bpp)
Unpack frame.
GLint GLint GLint GLint GLint x
int bm_create(int bpp, int w, int h, void *data, int flags)
const int BM_NUM_TYPES
Calculated number of bitmap types.
#define GENERIC_ANIM_DIRECTION_PAUSED
int bm_load(const char *real_filename)
Loads a bitmap so we can draw with it later.
void generic_render_eff_stream(generic_anim *ga)
struct generic_anim::@239::@241 ani
#define GENERIC_ANIM_DIRECTION_NOLOOP
typedef float(SCP_EXT_CALLCONV *SCPTRACKIR_PFFLOATVOID)()
fix timer_get_fixed_seconds()
void generic_anim_init(generic_anim *ga)
__inline void gr_aabitmap(int x, int y, int resize_mode=GR_RESIZE_FULL, bool mirror=false)
ptr_u data
Pointer to data, or maybe offset into VRAM.
struct generic_anim::@239::@242 eff
void gr_bitmap(int _x, int _y, int resize_mode)
anim_instance * init_anim_instance(anim *ptr, int bpp)
int generic_anim_init_and_stream(generic_anim *ga, const char *anim_filename, BM_TYPE bg_type, bool attempt_hi_res)
bool generic_bitmap_exists(const char *filename)
char filename[MAX_FILENAME_LEN]
int bm_unload(int handle, int clear_render_targets, bool nodebug)
Unloads a bitmap's data, but not the bitmap info.
char filename[MAX_FILENAME_LEN]
int cfclose(CFILE *cfile)
int generic_anim_stream(generic_anim *ga)
#define GENERIC_ANIM_DIRECTION_BACKWARDS
anim * anim_load(char *real_filename, int cf_dir_type, int file_mapped)
Load an animation. This stores the compressed data, which instances of the animation can reference...
int cf_exists_full_ext(const char *filename, int dir_type, const int num_ext, const char **ext_list)
void BM_SELECT_SCREEN_FORMAT()
Sets bm_set_components and bm_get_components to reference screen format functions.
int bm_reload(int bitmap_handle, const char *filename)
Reloads an existing bmpman slot with different bitmap.
int cfseek(CFILE *fp, int offset, int where)
void anim_check_for_palette_change(anim_instance *instance)