From d39551a9f72acc928f7886956d8a3e5adedda181 Mon Sep 17 00:00:00 2001 From: Tom Black Date: Sun, 6 Jan 2019 01:09:34 -0800 Subject: Move `ext_screenshot` to the right place in the file --- ext/ruby2d/ruby2d.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/ext/ruby2d/ruby2d.c b/ext/ruby2d/ruby2d.c index 7c17bac..6df2a20 100644 --- a/ext/ruby2d/ruby2d.c +++ b/ext/ruby2d/ruby2d.c @@ -166,26 +166,6 @@ static R_VAL ruby2d_ext_base_path(R_VAL self) { } -/* - * Ruby2D#self.ext_screenshot - */ -#if MRUBY -static R_VAL ruby2d_ext_screenshot(mrb_state* mrb, R_VAL self) { - mrb_value path; - mrb_get_args(mrb, "o", &path); -#else -static R_VAL ruby2d_ext_screenshot(R_VAL self, R_VAL path) { -#endif - if (window) { - S2D_Screenshot(window, RSTRING_PTR(path)); - return path; - } else { - S2D_Log(S2D_WARN, "Cannot take screenshot before window is shown"); - return R_FALSE; - } -} - - /* * Ruby2D::Triangle#ext_render */ @@ -1088,6 +1068,26 @@ static R_VAL ruby2d_window_ext_show(R_VAL self) { } +/* + * Ruby2D::Window#ext_screenshot + */ +#if MRUBY +static R_VAL ruby2d_ext_screenshot(mrb_state* mrb, R_VAL self) { + mrb_value path; + mrb_get_args(mrb, "o", &path); +#else +static R_VAL ruby2d_ext_screenshot(R_VAL self, R_VAL path) { +#endif + if (window) { + S2D_Screenshot(window, RSTRING_PTR(path)); + return path; + } else { + S2D_Log(S2D_WARN, "Cannot take screenshot before window is shown"); + return R_FALSE; + } +} + + /* * Ruby2D::Window#ext_close */ -- cgit v1.2.3