Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //18-Sept-2018
- class ffscript
- {
- typedef struct user_bitmap
- {
- BITMAP *u_bmp;
- int width;
- int height;
- int depth = 8;
- }
- #define MAX_USER_BITMAPS 256
- typedef struct script_bitmaps
- {
- int num_active = 0;
- user_bitmap[MAX_USER_BITMAPS];
- }
- int get_free_bitmap()
- {
- int num_free = mscript_bitmaps.num_active;
- if ( num_free < ( MAX_USER_BITMAPS-1 )
- {
- ++script_bitmaps.num_active;
- return num_free;
- }
- return 0;
- }
- long create_user_bitmap_ex(int w, int h, int d, ...)
- {
- int id = get_free_bitmap();
- if ( id > 0 )
- {
- script_bitmaps.user_bitmap[id].width = w;
- script_bitmaps.user_bitmap[id].height = h;
- script_bitmaps.user_bitmap[id].depth = d;
- script_bitmaps.user_bitmap[id].u_bmp = CreateBitmapEx(...args);
- }
- }
- }
Add Comment
Please, Sign In to add comment