Esempio n. 1
0
static void mriBindingInit()
{
	tableBindingInit();
	etcBindingInit();
	fontBindingInit();
	bitmapBindingInit();
	spriteBindingInit();
	viewportBindingInit();
	planeBindingInit();
	windowBindingInit();
	tilemapBindingInit();

	inputBindingInit();
	audioBindingInit();
	graphicsBindingInit();

	fileIntBindingInit();

#ifdef RGSS3
	_rb_define_module_function(rb_mKernel, "msgbox",   mriPrint);
	_rb_define_module_function(rb_mKernel, "msgbox_p", mriP);
#else
	_rb_define_module_function(rb_mKernel, "print", mriPrint);
	_rb_define_module_function(rb_mKernel, "p",     mriP);
#endif

	rb_eval_string(module_rpg);

	VALUE mod = rb_define_module("System");
	_rb_define_module_function(mod, "data_directory", mriDataDirectory);
	_rb_define_module_function(mod, "puts", mkxpPuts);

#ifndef RGSS3
	rb_define_alias(rb_singleton_class(rb_mKernel), "_mkxp_kernel_caller_alias", "caller");
	_rb_define_module_function(rb_mKernel, "caller", _kernelCaller);
#endif

	rb_define_global_const("MKXP", Qtrue);
}
Esempio n. 2
0
static void mriBindingInit()
{
	tableBindingInit();
	etcBindingInit();
	fontBindingInit();
	bitmapBindingInit();
	spriteBindingInit();
	viewportBindingInit();
	planeBindingInit();

	if (rgssVer == 1)
	{
		windowBindingInit();
		tilemapBindingInit();
	}
	else
	{
		windowVXBindingInit();
		tilemapVXBindingInit();
	}

	inputBindingInit();
	audioBindingInit();
	graphicsBindingInit();

	fileIntBindingInit();

	if (rgssVer >= 3)
	{
		_rb_define_module_function(rb_mKernel, "rgss_main", mriRgssMain);
		_rb_define_module_function(rb_mKernel, "rgss_stop", mriRgssStop);

		_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.1"));
	}
	else
	{
		_rb_define_module_function(rb_mKernel, "print", mriPrint);
		_rb_define_module_function(rb_mKernel, "p",     mriP);

		rb_define_alias(rb_singleton_class(rb_mKernel), "_mkxp_kernel_caller_alias", "caller");
		_rb_define_module_function(rb_mKernel, "caller", _kernelCaller);
	}

	if (rgssVer == 1)
		rb_eval_string(module_rpg1);
	else if (rgssVer == 2)
		rb_eval_string(module_rpg2);
	else if (rgssVer == 3)
		rb_eval_string(module_rpg3);
	else
		assert(!"unreachable");

	VALUE mod = rb_define_module("MKXP");
	_rb_define_module_function(mod, "data_directory", mkxpDataDirectory);
	_rb_define_module_function(mod, "puts", mkxpPuts);
	_rb_define_module_function(mod, "raw_key_states", mkxpRawKeyStates);
	_rb_define_module_function(mod, "mouse_in_window", mkxpMouseInWindow);

	rb_gv_set("MKXP", Qtrue);
}