From a0ba40916d66aaf8909c9aac2b42251ae91fb150 Mon Sep 17 00:00:00 2001 From: Mathew Velasquez Date: Wed, 7 Dec 2016 23:53:14 -0500 Subject: [PATCH 1/2] Smooth scaling Graphics option --- binding-mri/filesystem-binding.cpp | 2 +- binding-mri/graphics-binding.cpp | 2 ++ src/graphics.cpp | 10 ++++++++++ src/graphics.h | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/binding-mri/filesystem-binding.cpp b/binding-mri/filesystem-binding.cpp index 4bc5e03..f45d564 100644 --- a/binding-mri/filesystem-binding.cpp +++ b/binding-mri/filesystem-binding.cpp @@ -129,7 +129,7 @@ kernelLoadDataInt(const char *filename, bool rubyExc) VALUE port = fileIntForPath(filename, rubyExc); - VALUE marsh = rb_const_get(rb_cObject, rb_intern("Marshal")); + VALUE marsh = rb_const_get(rb_cObject, rb_intern("PureRubyMarshal")); // FIXME need to catch exceptions here with begin rescue VALUE result = rb_funcall2(marsh, rb_intern("load"), 1, &port); diff --git a/binding-mri/graphics-binding.cpp b/binding-mri/graphics-binding.cpp index 6b39697..d8a874e 100644 --- a/binding-mri/graphics-binding.cpp +++ b/binding-mri/graphics-binding.cpp @@ -201,6 +201,7 @@ DEF_GRA_PROP_I(Brightness) DEF_GRA_PROP_B(Fullscreen) DEF_GRA_PROP_B(ShowCursor) +DEF_GRA_PROP_B(Smooth) #define INIT_GRA_PROP_BIND(PropName, prop_name_s) \ { \ @@ -242,4 +243,5 @@ void graphicsBindingInit() INIT_GRA_PROP_BIND( Fullscreen, "fullscreen" ); INIT_GRA_PROP_BIND( ShowCursor, "show_cursor" ); + INIT_GRA_PROP_BIND( Smooth, "smooth" ); } diff --git a/src/graphics.cpp b/src/graphics.cpp index ef70267..0f921ef 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -1036,6 +1036,16 @@ void Graphics::setFullscreen(bool value) p->threadData->ethread->requestFullscreenMode(value); } +bool Graphics::getSmooth() const +{ + return p->threadData->config.smoothScaling; +} + +void Graphics::setSmooth(bool value) +{ + p->threadData->config.smoothScaling = value; +} + bool Graphics::getShowCursor() const { return p->threadData->ethread->getShowCursor(); diff --git a/src/graphics.h b/src/graphics.h index 46f8204..c52f95d 100644 --- a/src/graphics.h +++ b/src/graphics.h @@ -62,6 +62,7 @@ public: /* Non-standard extension */ DECL_ATTR( Fullscreen, bool ) DECL_ATTR( ShowCursor, bool ) + DECL_ATTR( Smooth, bool ) /* */ Scene *getScreen() const; From 99d0c2888a3466a98318d05ecb686807d4ca8177 Mon Sep 17 00:00:00 2001 From: Mathew Velasquez Date: Thu, 8 Dec 2016 20:20:12 -0500 Subject: [PATCH 2/2] Marshal tweaks --- binding-mri/filesystem-binding.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/binding-mri/filesystem-binding.cpp b/binding-mri/filesystem-binding.cpp index f45d564..7076326 100644 --- a/binding-mri/filesystem-binding.cpp +++ b/binding-mri/filesystem-binding.cpp @@ -129,7 +129,7 @@ kernelLoadDataInt(const char *filename, bool rubyExc) VALUE port = fileIntForPath(filename, rubyExc); - VALUE marsh = rb_const_get(rb_cObject, rb_intern("PureRubyMarshal")); + VALUE marsh = rb_const_get(rb_cObject, rb_intern("Marshal")); // FIXME need to catch exceptions here with begin rescue VALUE result = rb_funcall2(marsh, rb_intern("load"), 1, &port); @@ -223,7 +223,7 @@ fileIntBindingInit() /* We overload the built-in 'Marshal::load()' function to silently * insert our utf8proc that ensures all read strings will be * UTF-8 encoded */ - VALUE marsh = rb_const_get(rb_cObject, rb_intern("Marshal")); - rb_define_alias(rb_singleton_class(marsh), "_mkxp_load_alias", "load"); - _rb_define_module_function(marsh, "load", _marshalLoad); + // VALUE marsh = rb_const_get(rb_cObject, rb_intern("Marshal")); + // rb_define_alias(rb_singleton_class(marsh), "_mkxp_load_alias", "load"); + // _rb_define_module_function(marsh, "load", _marshalLoad); }