FS2_Open
Open source remastering of the Freespace 2 engine
bm_internal.h
Go to the documentation of this file.
1 #ifndef __BM_INTERNAL_H__
2 #define __BM_INTERNAL_H__
3 /*
4 * Copyright (C) Volition, Inc. 1999. All rights reserved.
5 *
6 * All source code herein is the property of Volition, Inc. You may not sell
7 * or otherwise commercially exploit the source or things you created based on the
8 * source.
9 *
10 */
11 
20 #ifndef BMPMAN_INTERNAL
21 #error The file header "bmpman/bm_internal.h" is protected. Make sure you know what you are doing!
22 #endif
23 
24 #include "bmpman/bmpman.h"
25 
27  struct {
28  // Stuff needed for animations
30  int num_frames;
31  int keyframe;
33 
34  struct {
35  // stuff for static animations
38  } eff;
39  } ani;
40 
41  struct {
42  // Stuff needed for user bitmaps
43  void* data;
46  } user;
47 };
48 
49 struct bitmap_entry {
50  // identification
52 
55  int handle;
56  int last_used;
57 
60  signed char ref_count;
61 
62  int dir_type;
63 
64  // compressed bitmap stuff (.dds) - RT please take a look at this and tell me if we really need it
65  size_t mem_taken;
67 
68  // Stuff to keep track of usage
73 
75 
77 
78 #ifdef BMPMAN_NDEBUG
79  // bookeeping
80  ubyte used_last_frame; // If set, then it was used last frame
81  ubyte used_this_frame; // If set, then it was used this frame
82  int data_size; // How much data this bitmap uses
83  int used_count; // How many times it was accessed
84 #endif
85 };
86 
88 
89 // image specific lock functions
90 void bm_lock_ani( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
91 void bm_lock_dds( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
92 void bm_lock_png( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
93 void bm_lock_jpg( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
94 void bm_lock_pcx( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
95 void bm_lock_tga( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
96 void bm_lock_user( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
97 
98 
99 #endif // __BM_INTERNAL_H__
#define MAX_FILENAME_LEN
Definition: pstypes.h:324
void bm_lock_tga(int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags)
Definition: bmpman.cpp:2170
int dir_type
which directory this was loaded from (to skip other locations with same name)
Definition: bm_internal.h:62
struct bm_extra_info::@6 user
size_t mem_taken
How much memory does this bitmap use? - UnknownPlayer.
Definition: bm_internal.h:65
bitmap_entry bm_bitmaps[MAX_BITMAPS]
Definition: bmpman.cpp:85
BM_TYPE type
PCX, USER, ANI, etc.
Definition: bm_internal.h:58
struct bm_extra_info::@5 ani
ubyte used_flags
What flags it was accessed thru.
Definition: bm_internal.h:71
uint signature
a unique signature identifying the data
Definition: bm_internal.h:53
void bm_lock_jpg(int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags)
Definition: bmpman.cpp:2042
ubyte flags
For user bitmaps, Flags passed to bm_create.
Definition: bm_internal.h:45
int handle
Handle = id*MAX_BITMAPS + bitmapnum.
Definition: bm_internal.h:55
Definition: bm_internal.h:49
int preload_count
how many times this gets used in game, for unlocking
Definition: bm_internal.h:70
void bm_lock_png(int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags)
Definition: bmpman.cpp:2127
unsigned int uint
Definition: pstypes.h:64
uint palette_checksum
checksum used to be sure bitmap is in current palette
Definition: bm_internal.h:54
char filename[MAX_FILENAME_LEN]
filename for this bitmap
Definition: bm_internal.h:51
Definition: bmpman.h:101
struct bm_extra_info::@5::@7 eff
int first_frame
used for animations – points to index of first frame
Definition: bm_internal.h:29
BM_TYPE type
type for individual images
Definition: bm_internal.h:36
BM_TYPE
Definition: bmpman.h:71
char filename[MAX_FILENAME_LEN]
filename for individual images
Definition: bm_internal.h:37
void bm_lock_pcx(int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags)
Definition: bmpman.cpp:2084
signed char ref_count
Number of locks on bitmap. Can't unload unless ref_count is 0.
Definition: bm_internal.h:60
unsigned char ubyte
Definition: pstypes.h:62
GLbitfield flags
Definition: Glext.h:6722
void * data
For user bitmaps, this is where the data comes from.
Definition: bm_internal.h:43
int last_used
When this bitmap was last used.
Definition: bm_internal.h:56
void bm_lock_ani(int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags)
Definition: bmpman.cpp:1860
bitmap bm
Bitmap info.
Definition: bm_internal.h:74
void bm_lock_user(int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags)
Definition: bmpman.cpp:2226
ubyte preloaded
If set, then this was loaded from the lst file.
Definition: bm_internal.h:69
ubyte fps
used for animations – frames per second
Definition: bm_internal.h:32
int num_mipmaps
number of mipmap levels, we need to read all of them
Definition: bm_internal.h:66
bm_extra_info info
Data for animations and user bitmaps.
Definition: bm_internal.h:76
int load_count
Definition: bm_internal.h:72
void bm_lock_dds(int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags)
Definition: bmpman.cpp:1980
#define MAX_BITMAPS
How many bitmaps the game can handle.
Definition: bmpman.h:48
ubyte bpp
For user bitmaps, this is what format the data is.
Definition: bm_internal.h:44
int num_frames
used for animations – number of frames in the animation
Definition: bm_internal.h:30
BM_TYPE comp_type
What sort of compressed type, BM_TYPE_NONE if not compressed.
Definition: bm_internal.h:59
int keyframe
used for animations – keyframe info
Definition: bm_internal.h:31