From 7acbb06fbd720a7d8cba9f5102a0d2e04b4bbda8 Mon Sep 17 00:00:00 2001 From: cremno Date: Tue, 2 Sep 2014 19:45:50 +0200 Subject: [PATCH 1/2] add RGSS 3.0.1 etc classes equality comparison RGSS 3.0.1 finally fixed #==, #===, #eql? for Color, Tone, and Rect. Now instances of them can be compared to other kinds of objects. --- binding-mri/etc-binding.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/binding-mri/etc-binding.cpp b/binding-mri/etc-binding.cpp index 32ad494..731ccca 100644 --- a/binding-mri/etc-binding.cpp +++ b/binding-mri/etc-binding.cpp @@ -22,6 +22,7 @@ #include "etc.h" #include "binding-util.h" #include "serializable-binding.h" +#include "sharedstate.h" DEF_TYPE(Color); DEF_TYPE(Tone); @@ -68,6 +69,9 @@ ATTR_INT_RW(Rect, Height) VALUE otherObj; \ Klass *other; \ rb_get_args(argc, argv, "o", &otherObj RB_ARG_END); \ + if (rgssVer >= 3) \ + if (!rb_typeddata_is_kind_of(otherObj, &Klass##Type)) \ + return Qfalse; \ other = getPrivateDataCheck(otherObj, Klass##Type); \ return rb_bool_new(*p == *other); \ } From fd4f7c66d1af89a6518676c90c824a4ef0e19608 Mon Sep 17 00:00:00 2001 From: cremno Date: Tue, 2 Sep 2014 19:48:47 +0200 Subject: [PATCH 2/2] bump RGSS_VERSION to 3.0.1 --- binding-mri/binding-mri.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binding-mri/binding-mri.cpp b/binding-mri/binding-mri.cpp index 12c9e86..962b51e 100644 --- a/binding-mri/binding-mri.cpp +++ b/binding-mri/binding-mri.cpp @@ -114,7 +114,7 @@ static void mriBindingInit() _rb_define_module_function(rb_mKernel, "msgbox", mriPrint); _rb_define_module_function(rb_mKernel, "msgbox_p", mriP); - rb_define_global_const("RGSS_VERSION", rb_str_new_cstr("3.0.0")); + rb_define_global_const("RGSS_VERSION", rb_str_new_cstr("3.0.1")); } else {