ZoriaRPG

script_bitmaps.cpp

Sep 18th, 2018
90
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class ffscript
  2. {
  3.     typedef struct user_bitmap
  4.     {
  5.         BITMAP *u_bmp;
  6.         int width;
  7.         int height;
  8.         int depth = 8;
  9.     }
  10.     #define MAX_USER_BITMAPS 256
  11.     typedef struct script_bitmaps
  12.     {
  13.         int num_active = 0;
  14.         user_bitmap[MAX_USER_BITMAPS];
  15.     }
  16.    
  17.     int get_free_bitmap()
  18.     {
  19.         int num_free = mscript_bitmaps.num_active;
  20.         if ( num_free < ( MAX_USER_BITMAPS-1 )
  21.         {
  22.             ++script_bitmaps.num_active;
  23.             return num_free;
  24.         }
  25.         return 0;
  26.     }
  27.     long create_user_bitmap_ex(int w, int h, int d, ...)
  28.     {
  29.         int id = get_free_bitmap();
  30.         if ( id > 0 )
  31.         {
  32.             script_bitmaps.user_bitmap[id].width = w;
  33.             script_bitmaps.user_bitmap[id].height = h;
  34.             script_bitmaps.user_bitmap[id].depth = d;
  35.             script_bitmaps.user_bitmap[id].u_bmp = CreateBitmapEx(...args);
  36.         }
  37.     }
  38. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×