-
-
Save syureri/f2c029156707558fa4f22b2bb98bfb57 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "RubyStuff.hpp" | |
namespace RubyStuff | |
{ | |
pfn_rb_funcall2 rb_funcall2; | |
pfn_rb_define_class rb_define_class; | |
pfn_rb_const_defined rb_const_defined; | |
pfn_rb_const_get rb_const_get; | |
pfn_rb_intern rb_intern; | |
pfn_rb_define_module rb_define_module; | |
pfn_rb_define_module_function rb_define_module_function; | |
pfn_rb_define_global_const rb_define_global_const; | |
pfn_rb_define_global_function rb_define_global_function; | |
pfn_rb_eval_string_protect rb_eval_string_protect;; | |
pfn_rb_id2name rb_id2name; | |
pfn_rb_scan_args rb_scan_args; | |
pfn_rb_class_new_instance rb_class_new_instance; | |
pfn_rb_define_method rb_define_method; | |
pfn_rb_str_new rb_str_new; | |
pfn_rb_str_new2 rb_str_new2; | |
pfn_rb_define_const rb_define_const; | |
pfn_rb_string_value rb_string_value; | |
pfn_rb_string_value_ptr rb_string_value_ptr; | |
pfn_rb_obj_is_kind_of rb_obj_is_kind_of; | |
pfn_rb_raise rb_raise; | |
pfn_rb_obj_classname rb_obj_classname; | |
pfn_rb_ary_aref rb_ary_aref; | |
pfn_rb_ary_aset rb_ary_aset; | |
pfn_rb_ary_new rb_ary_new; | |
pfn_rb_ary_push rb_ary_push; | |
pfn_rb_iv_set rb_iv_set; | |
pfn_rgss_load_rgssad_file rgss_load_rgssad_file; | |
pfn_rb_eval_string rb_eval_string; | |
pfn_rb_protect rb_protect; | |
void Init(void* rgssDLL) | |
{ | |
HMODULE dll = (HMODULE)rgssDLL; | |
#define __load_func(fn) fn = (pfn_##fn)((DWORD)addr_##fn + (DWORD)dll) | |
__load_func(rb_funcall2); | |
__load_func(rb_define_class); | |
__load_func(rb_intern); | |
__load_func(rb_define_module); | |
__load_func(rb_define_module_function); | |
__load_func(rb_define_global_const); | |
__load_func(rb_eval_string_protect); | |
__load_func(rb_ary_new); | |
__load_func(rb_str_new); | |
__load_func(rb_define_method); | |
__load_func(rb_scan_args); | |
__load_func(rb_class_new_instance); | |
__load_func(rb_iv_set); | |
__load_func(rb_protect); | |
__load_func(rb_eval_string); | |
__load_func(rgss_load_rgssad_file); | |
#undef __load_func | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment