예제 #1
0
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;
}
예제 #2
0
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;
}
예제 #3
0
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);
}
예제 #4
0
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;
}
예제 #5
0
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);
}