From d075bd255c2d4b0c3d30d398d31cda23edab8a45 Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Sat, 16 Aug 2014 23:38:04 +0200 Subject: [PATCH] MRI-Binding: WindowVX: Since RGSS2 'contents' has a 1x1 dummy bitmap --- binding-mri/windowvx-binding.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/binding-mri/windowvx-binding.cpp b/binding-mri/windowvx-binding.cpp index 49372b9..0bf06df 100644 --- a/binding-mri/windowvx-binding.cpp +++ b/binding-mri/windowvx-binding.cpp @@ -24,8 +24,12 @@ #include "viewportelement-binding.h" #include "binding-util.h" +#include "bitmap.h" + DEF_TYPE(WindowVX); +void bitmapInitProps(Bitmap *b, VALUE self); + RB_METHOD(windowVXInitialize) { int x, y, width, height; @@ -41,10 +45,16 @@ RB_METHOD(windowVXInitialize) w->setCursorRect(new Rect); w->setTone(new Tone); wrapNilProperty(self, "windowskin"); - wrapNilProperty(self, "contents"); wrapProperty(self, w->getTone(), "tone", ToneType); 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; }