Don't do it with its ID :b
Bitmaps should probably have a different structure in RGSS2, checks it by reading the memory of a Bitmap object ^^'
- struct RGSSBMINFO{
- DWORD unk1;
- DWORD unk2;
- BITMAPINFOHEADER *infoheader;
- LPBYTE firstRow; //RGBQUAD *firstRow;
- LPBYTE lastRow;
- };
- struct BITMAPSTRUCT {
- DWORD unk1;
- DWORD unk2;
- RGSSBMINFO *bminfo;
- };
- struct RGSSBITMAP {
- struct RBasic basic;
- void (*dmark)(void*);
- void (*dfree)(void*);
- BITMAPSTRUCT *bm;
- };
- #define RBITMAP(obj) (R_CAST(RGSSBITMAP)(obj))
- VALUE Function_that_receive_a_bitmap(VALUE self,VALUE object)
- {
- rb_check_type(object,T_DATA); //Checking if it's a DATA object. (Bitmap Are Data Object)
- struct RGSSBITMAP* bitmap=RBITMAP(object); //Not sure for "RGSSBITMAP*"
- if(bitmap->basic.klass != RGSSConst(kBitmap)) //RGSSConst(kbitmap) is the bitmap class, you should define it somewhere.
- {
- rb_raise(RGSSConst(eArgError),"Argument is not a Bitmap.");
- return 0;
- }
- //Do your stuff here
- return 2;//true
- }
Expand to see the code.
Bitmaps should probably have a different structure in RGSS2, checks it by reading the memory of a Bitmap object ^^'



