MRI-Binding: WindowVX: Since RGSS2 'contents' has a 1x1 dummy bitmap

This commit is contained in:
Jonas Kulla 2014-08-16 23:38:04 +02:00
parent 169f9e9285
commit d075bd255c
1 changed files with 11 additions and 1 deletions

View File

@ -24,8 +24,12 @@
#include "viewportelement-binding.h" #include "viewportelement-binding.h"
#include "binding-util.h" #include "binding-util.h"
#include "bitmap.h"
DEF_TYPE(WindowVX); DEF_TYPE(WindowVX);
void bitmapInitProps(Bitmap *b, VALUE self);
RB_METHOD(windowVXInitialize) RB_METHOD(windowVXInitialize)
{ {
int x, y, width, height; int x, y, width, height;
@ -41,10 +45,16 @@ RB_METHOD(windowVXInitialize)
w->setCursorRect(new Rect); w->setCursorRect(new Rect);
w->setTone(new Tone); w->setTone(new Tone);
wrapNilProperty(self, "windowskin"); wrapNilProperty(self, "windowskin");
wrapNilProperty(self, "contents");
wrapProperty(self, w->getTone(), "tone", ToneType); wrapProperty(self, w->getTone(), "tone", ToneType);
wrapProperty(self, w->getCursorRect(), "cursor_rect", RectType); wrapProperty(self, w->getCursorRect(), "cursor_rect", RectType);
#ifdef RGSS2
Bitmap *contents = new Bitmap(1, 1);
VALUE contentsObj = wrapObject(contents, BitmapType);
bitmapInitProps(contents, contentsObj);
rb_iv_set(self, "contents", contentsObj);
#endif
return self; return self;
} }