VALUE MHWorldBindings::LoadEmpty(VALUE rSelf, VALUE width, VALUE height, VALUE depth, VALUE rCore) { MHWorld *cSelf = MHWorldBindings::Get()->getPointer(rSelf); MHCore *cCore = MHCoreBindings::Get()->getPointer(rCore); cSelf->loadEmpty(NUM2INT(width), NUM2INT(height), NUM2INT(depth), cCore); NEW_RUBY_OBJECT(LiquidManagerBindings, cSelf->getLiquidManager()); NEW_RUBY_OBJECT(TerrainBindings, cSelf->getTerrain()); return rSelf; }
VALUE MHWorldBindings::Load(VALUE rSelf, VALUE world) { MHWorld *cSelf = MHWorldBindings::Get()->getPointer(rSelf); std::string cWorld = rb_string_value_cstr(&world); cSelf->load(cWorld); NEW_RUBY_OBJECT(LiquidManagerBindings, cSelf->getLiquidManager()); NEW_RUBY_OBJECT(TerrainBindings, cSelf->getTerrain()); return rSelf; }
VALUE MHLookNFeelBindings::CreateRectRenderable(VALUE rSelf, VALUE rW, VALUE rH, VALUE rMatName) { MHLookNFeel *cSelf = Get()->getPointer(rSelf); std::string cMatName = rb_string_value_cstr(&rMatName); Renderable *cRenderable = cSelf->createRectRenderable(NUM2INT(rW), NUM2INT(rH), 0, 0, cMatName); return NEW_RUBY_OBJECT(RenderableBindings, cRenderable); }
VALUE MHWorldBindings::Initialize(VALUE rSelf, VALUE rCore) { MHWorld *cSelf = MHWorldBindings::Get()->getPointer(rSelf); MHCore *cCore = MHCoreBindings::Get()->getPointer(rCore); cSelf->initialize(cCore); NEW_RUBY_OBJECT(MHSelectionBindings, cSelf->getSelection()); return rSelf; }
VALUE MHLookNFeelBindings::CreateTextRenderable(VALUE rSelf, VALUE rFont, VALUE rColor, VALUE rText) { MHLookNFeel *cSelf = Get()->getPointer(rSelf); std::string cText = rb_string_value_cstr(&rText); std::string cFont = rb_string_value_cstr(&rFont); Color4 cColor; for(int i=0; i < RARRAY_LEN(rColor) && i < 4; i++) { cColor[i] = NUM2DBL(rb_ary_entry(rColor, i)); } Renderable *cRenderable = cSelf->createTextRenderable(cFont, cColor, cText); return NEW_RUBY_OBJECT(RenderableBindings, cRenderable); }