Merge pull request #67 from cremno/add-rgss-3-0-1-etc-classes-equality-comparison

add RGSS 3.0.1 etc classes equality comparison
This commit is contained in:
Jonas Kulla 2014-09-02 20:09:10 +02:00
commit 8c1cf27b7c
2 changed files with 5 additions and 1 deletions

View File

@ -115,7 +115,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
{

View File

@ -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<Klass>(otherObj, Klass##Type); \
return rb_bool_new(*p == *other); \
}