MRI-Binding: Add 'Graphics.width/height' bindings (RGSS2)

This commit is contained in:
Jonas Kulla 2014-04-11 13:34:19 +02:00
parent 8203e32900
commit 6dfa4f6b7d
1 changed files with 23 additions and 0 deletions

View File

@ -99,6 +99,24 @@ RB_METHOD(graphicsFrameReset)
DEF_GRA_PROP_I(FrameRate) DEF_GRA_PROP_I(FrameRate)
DEF_GRA_PROP_I(FrameCount) DEF_GRA_PROP_I(FrameCount)
#ifdef RGSS2
RB_METHOD(graphicsWidth)
{
RB_UNUSED_PARAM;
return rb_fix_new(shState->graphics().width());
}
RB_METHOD(graphicsHeight)
{
RB_UNUSED_PARAM;
return rb_fix_new(shState->graphics().height());
}
#endif
DEF_GRA_PROP_B(Fullscreen) DEF_GRA_PROP_B(Fullscreen)
DEF_GRA_PROP_B(ShowCursor) DEF_GRA_PROP_B(ShowCursor)
@ -120,6 +138,11 @@ void graphicsBindingInit()
INIT_GRA_PROP_BIND( FrameRate, "frame_rate" ); INIT_GRA_PROP_BIND( FrameRate, "frame_rate" );
INIT_GRA_PROP_BIND( FrameCount, "frame_count" ); INIT_GRA_PROP_BIND( FrameCount, "frame_count" );
#ifdef RGSS2
_rb_define_module_function(module, "width", graphicsWidth);
_rb_define_module_function(module, "height", graphicsHeight);
#endif
INIT_GRA_PROP_BIND( Fullscreen, "fullscreen" ); INIT_GRA_PROP_BIND( Fullscreen, "fullscreen" );
INIT_GRA_PROP_BIND( ShowCursor, "show_cursor" ); INIT_GRA_PROP_BIND( ShowCursor, "show_cursor" );
} }