diff --git a/bin/tests/test_math.cpp b/bin/tests/test_math.cpp index 9329002f769..2ffef83f798 100644 --- a/bin/tests/test_math.cpp +++ b/bin/tests/test_math.cpp @@ -518,7 +518,7 @@ MainLoop* test() { Vector hashes; List tl; - ObjectTypeDB::get_type_list(&tl); + ClassDB::get_class_list(&tl); for (List::Element *E=tl.front();E;E=E->next()) { diff --git a/bin/tests/test_physics.cpp b/bin/tests/test_physics.cpp index 3a8ca657349..8a270f721fb 100644 --- a/bin/tests/test_physics.cpp +++ b/bin/tests/test_physics.cpp @@ -40,7 +40,7 @@ class TestPhysicsMainLoop : public MainLoop { - OBJ_TYPE( TestPhysicsMainLoop, MainLoop ); + GDCLASS( TestPhysicsMainLoop, MainLoop ); enum { LINK_COUNT = 20, @@ -81,7 +81,7 @@ protected: static void _bind_methods() { - ObjectTypeDB::bind_method("body_changed_transform",&TestPhysicsMainLoop::body_changed_transform); + ClassDB::bind_method("body_changed_transform",&TestPhysicsMainLoop::body_changed_transform); } RID create_body(PhysicsServer::ShapeType p_shape, PhysicsServer::BodyMode p_body,const Transform p_location,bool p_active_default=true,const Transform&p_shape_xform=Transform()) { diff --git a/bin/tests/test_physics_2d.cpp b/bin/tests/test_physics_2d.cpp index f369c361d3e..93d707b26a5 100644 --- a/bin/tests/test_physics_2d.cpp +++ b/bin/tests/test_physics_2d.cpp @@ -42,7 +42,7 @@ static const unsigned char convex_png[]={ class TestPhysics2DMainLoop : public MainLoop { - OBJ_TYPE( TestPhysics2DMainLoop, MainLoop ); + GDCLASS( TestPhysics2DMainLoop, MainLoop ); RID circle_img; @@ -354,8 +354,8 @@ protected: static void _bind_methods() { - ObjectTypeDB::bind_method(_MD("_body_moved"),&TestPhysics2DMainLoop::_body_moved); - ObjectTypeDB::bind_method(_MD("_ray_query_callback"),&TestPhysics2DMainLoop::_ray_query_callback); + ClassDB::bind_method(_MD("_body_moved"),&TestPhysics2DMainLoop::_body_moved); + ClassDB::bind_method(_MD("_ray_query_callback"),&TestPhysics2DMainLoop::_ray_query_callback); } diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 3d93ec9fa52..02f3c4c5f31 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -114,13 +114,13 @@ Ref _ResourceLoader::load_import_metadata(const String& void _ResourceLoader::_bind_methods() { - ObjectTypeDB::bind_method(_MD("load_interactive:ResourceInteractiveLoader","path","type_hint"),&_ResourceLoader::load_interactive,DEFVAL("")); - ObjectTypeDB::bind_method(_MD("load:Resource","path","type_hint", "p_no_cache"),&_ResourceLoader::load,DEFVAL(""), DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("load_import_metadata:ResourceImportMetadata","path"),&_ResourceLoader::load_import_metadata); - ObjectTypeDB::bind_method(_MD("get_recognized_extensions_for_type","type"),&_ResourceLoader::get_recognized_extensions_for_type); - ObjectTypeDB::bind_method(_MD("set_abort_on_missing_resources","abort"),&_ResourceLoader::set_abort_on_missing_resources); - ObjectTypeDB::bind_method(_MD("get_dependencies","path"),&_ResourceLoader::get_dependencies); - ObjectTypeDB::bind_method(_MD("has","path"),&_ResourceLoader::has); + ClassDB::bind_method(_MD("load_interactive:ResourceInteractiveLoader","path","type_hint"),&_ResourceLoader::load_interactive,DEFVAL("")); + ClassDB::bind_method(_MD("load:Resource","path","type_hint", "p_no_cache"),&_ResourceLoader::load,DEFVAL(""), DEFVAL(false)); + ClassDB::bind_method(_MD("load_import_metadata:ResourceImportMetadata","path"),&_ResourceLoader::load_import_metadata); + ClassDB::bind_method(_MD("get_recognized_extensions_for_type","type"),&_ResourceLoader::get_recognized_extensions_for_type); + ClassDB::bind_method(_MD("set_abort_on_missing_resources","abort"),&_ResourceLoader::set_abort_on_missing_resources); + ClassDB::bind_method(_MD("get_dependencies","path"),&_ResourceLoader::get_dependencies); + ClassDB::bind_method(_MD("has","path"),&_ResourceLoader::has); } _ResourceLoader::_ResourceLoader() { @@ -153,8 +153,8 @@ _ResourceSaver *_ResourceSaver::singleton=NULL; void _ResourceSaver::_bind_methods() { - ObjectTypeDB::bind_method(_MD("save","path","resource:Resource","flags"),&_ResourceSaver::save,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("get_recognized_extensions","type"),&_ResourceSaver::get_recognized_extensions); + ClassDB::bind_method(_MD("save","path","resource:Resource","flags"),&_ResourceSaver::save,DEFVAL(0)); + ClassDB::bind_method(_MD("get_recognized_extensions","type"),&_ResourceSaver::get_recognized_extensions); BIND_CONSTANT(FLAG_RELATIVE_PATHS); BIND_CONSTANT(FLAG_BUNDLE_RESOURCES); @@ -836,7 +836,7 @@ void _OS::print_all_textures_by_size() { for (List >::Element *E=rsrc.front();E;E=E->next()) { - if (!E->get()->is_type("ImageTexture")) + if (!E->get()->is_class("ImageTexture")) continue; Size2 size = E->get()->call("get_size"); @@ -878,18 +878,18 @@ void _OS::print_resources_by_type(const Vector& p_types) { bool found = false; for (int i=0; iis_type(p_types[i])) + if (r->is_class(p_types[i])) found = true; } if (!found) continue; - if (!type_count.has(r->get_type())) { - type_count[r->get_type()]=0; + if (!type_count.has(r->get_class())) { + type_count[r->get_class()]=0; } - type_count[r->get_type()]++; + type_count[r->get_class()]++; } }; @@ -1027,154 +1027,154 @@ _OS *_OS::singleton=NULL; void _OS::_bind_methods() { - //ObjectTypeDB::bind_method(_MD("get_mouse_pos"),&_OS::get_mouse_pos); - //ObjectTypeDB::bind_method(_MD("is_mouse_grab_enabled"),&_OS::is_mouse_grab_enabled); + //ClassDB::bind_method(_MD("get_mouse_pos"),&_OS::get_mouse_pos); + //ClassDB::bind_method(_MD("is_mouse_grab_enabled"),&_OS::is_mouse_grab_enabled); - ObjectTypeDB::bind_method(_MD("set_clipboard","clipboard"),&_OS::set_clipboard); - ObjectTypeDB::bind_method(_MD("get_clipboard"),&_OS::get_clipboard); + ClassDB::bind_method(_MD("set_clipboard","clipboard"),&_OS::set_clipboard); + ClassDB::bind_method(_MD("get_clipboard"),&_OS::get_clipboard); - ObjectTypeDB::bind_method(_MD("set_video_mode","size","fullscreen","resizable","screen"),&_OS::set_video_mode,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("get_video_mode_size","screen"),&_OS::get_video_mode,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("is_video_mode_fullscreen","screen"),&_OS::is_video_mode_fullscreen,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("is_video_mode_resizable","screen"),&_OS::is_video_mode_resizable,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("get_fullscreen_mode_list","screen"),&_OS::get_fullscreen_mode_list,DEFVAL(0)); + ClassDB::bind_method(_MD("set_video_mode","size","fullscreen","resizable","screen"),&_OS::set_video_mode,DEFVAL(0)); + ClassDB::bind_method(_MD("get_video_mode_size","screen"),&_OS::get_video_mode,DEFVAL(0)); + ClassDB::bind_method(_MD("is_video_mode_fullscreen","screen"),&_OS::is_video_mode_fullscreen,DEFVAL(0)); + ClassDB::bind_method(_MD("is_video_mode_resizable","screen"),&_OS::is_video_mode_resizable,DEFVAL(0)); + ClassDB::bind_method(_MD("get_fullscreen_mode_list","screen"),&_OS::get_fullscreen_mode_list,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("get_screen_count"),&_OS::get_screen_count); - ObjectTypeDB::bind_method(_MD("get_current_screen"),&_OS::get_current_screen); - ObjectTypeDB::bind_method(_MD("set_current_screen","screen"),&_OS::set_current_screen); - ObjectTypeDB::bind_method(_MD("get_screen_position","screen"),&_OS::get_screen_position,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("get_screen_size","screen"),&_OS::get_screen_size,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("get_screen_dpi","screen"),&_OS::get_screen_dpi,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("get_window_position"),&_OS::get_window_position); - ObjectTypeDB::bind_method(_MD("set_window_position","position"),&_OS::set_window_position); - ObjectTypeDB::bind_method(_MD("get_window_size"),&_OS::get_window_size); - ObjectTypeDB::bind_method(_MD("set_window_size","size"),&_OS::set_window_size); - ObjectTypeDB::bind_method(_MD("set_window_fullscreen","enabled"),&_OS::set_window_fullscreen); - ObjectTypeDB::bind_method(_MD("is_window_fullscreen"),&_OS::is_window_fullscreen); - ObjectTypeDB::bind_method(_MD("set_window_resizable","enabled"),&_OS::set_window_resizable); - ObjectTypeDB::bind_method(_MD("is_window_resizable"),&_OS::is_window_resizable); - ObjectTypeDB::bind_method(_MD("set_window_minimized", "enabled"),&_OS::set_window_minimized); - ObjectTypeDB::bind_method(_MD("is_window_minimized"),&_OS::is_window_minimized); - ObjectTypeDB::bind_method(_MD("set_window_maximized", "enabled"),&_OS::set_window_maximized); - ObjectTypeDB::bind_method(_MD("is_window_maximized"),&_OS::is_window_maximized); - ObjectTypeDB::bind_method(_MD("request_attention"), &_OS::request_attention); + ClassDB::bind_method(_MD("get_screen_count"),&_OS::get_screen_count); + ClassDB::bind_method(_MD("get_current_screen"),&_OS::get_current_screen); + ClassDB::bind_method(_MD("set_current_screen","screen"),&_OS::set_current_screen); + ClassDB::bind_method(_MD("get_screen_position","screen"),&_OS::get_screen_position,DEFVAL(0)); + ClassDB::bind_method(_MD("get_screen_size","screen"),&_OS::get_screen_size,DEFVAL(0)); + ClassDB::bind_method(_MD("get_screen_dpi","screen"),&_OS::get_screen_dpi,DEFVAL(0)); + ClassDB::bind_method(_MD("get_window_position"),&_OS::get_window_position); + ClassDB::bind_method(_MD("set_window_position","position"),&_OS::set_window_position); + ClassDB::bind_method(_MD("get_window_size"),&_OS::get_window_size); + ClassDB::bind_method(_MD("set_window_size","size"),&_OS::set_window_size); + ClassDB::bind_method(_MD("set_window_fullscreen","enabled"),&_OS::set_window_fullscreen); + ClassDB::bind_method(_MD("is_window_fullscreen"),&_OS::is_window_fullscreen); + ClassDB::bind_method(_MD("set_window_resizable","enabled"),&_OS::set_window_resizable); + ClassDB::bind_method(_MD("is_window_resizable"),&_OS::is_window_resizable); + ClassDB::bind_method(_MD("set_window_minimized", "enabled"),&_OS::set_window_minimized); + ClassDB::bind_method(_MD("is_window_minimized"),&_OS::is_window_minimized); + ClassDB::bind_method(_MD("set_window_maximized", "enabled"),&_OS::set_window_maximized); + ClassDB::bind_method(_MD("is_window_maximized"),&_OS::is_window_maximized); + ClassDB::bind_method(_MD("request_attention"), &_OS::request_attention); - ObjectTypeDB::bind_method(_MD("set_borderless_window", "borderless"), &_OS::set_borderless_window); - ObjectTypeDB::bind_method(_MD("get_borderless_window"), &_OS::get_borderless_window); + ClassDB::bind_method(_MD("set_borderless_window", "borderless"), &_OS::set_borderless_window); + ClassDB::bind_method(_MD("get_borderless_window"), &_OS::get_borderless_window); - ObjectTypeDB::bind_method(_MD("set_screen_orientation","orientation"),&_OS::set_screen_orientation); - ObjectTypeDB::bind_method(_MD("get_screen_orientation"),&_OS::get_screen_orientation); + ClassDB::bind_method(_MD("set_screen_orientation","orientation"),&_OS::set_screen_orientation); + ClassDB::bind_method(_MD("get_screen_orientation"),&_OS::get_screen_orientation); - ObjectTypeDB::bind_method(_MD("set_keep_screen_on","enabled"),&_OS::set_keep_screen_on); - ObjectTypeDB::bind_method(_MD("is_keep_screen_on"),&_OS::is_keep_screen_on); + ClassDB::bind_method(_MD("set_keep_screen_on","enabled"),&_OS::set_keep_screen_on); + ClassDB::bind_method(_MD("is_keep_screen_on"),&_OS::is_keep_screen_on); - ObjectTypeDB::bind_method(_MD("set_iterations_per_second","iterations_per_second"),&_OS::set_iterations_per_second); - ObjectTypeDB::bind_method(_MD("get_iterations_per_second"),&_OS::get_iterations_per_second); - ObjectTypeDB::bind_method(_MD("set_target_fps","target_fps"),&_OS::set_target_fps); - ObjectTypeDB::bind_method(_MD("get_target_fps"),&_OS::get_target_fps); + ClassDB::bind_method(_MD("set_iterations_per_second","iterations_per_second"),&_OS::set_iterations_per_second); + ClassDB::bind_method(_MD("get_iterations_per_second"),&_OS::get_iterations_per_second); + ClassDB::bind_method(_MD("set_target_fps","target_fps"),&_OS::set_target_fps); + ClassDB::bind_method(_MD("get_target_fps"),&_OS::get_target_fps); - ObjectTypeDB::bind_method(_MD("set_time_scale","time_scale"),&_OS::set_time_scale); - ObjectTypeDB::bind_method(_MD("get_time_scale"),&_OS::get_time_scale); + ClassDB::bind_method(_MD("set_time_scale","time_scale"),&_OS::set_time_scale); + ClassDB::bind_method(_MD("get_time_scale"),&_OS::get_time_scale); - ObjectTypeDB::bind_method(_MD("has_touchscreen_ui_hint"),&_OS::has_touchscreen_ui_hint); + ClassDB::bind_method(_MD("has_touchscreen_ui_hint"),&_OS::has_touchscreen_ui_hint); - ObjectTypeDB::bind_method(_MD("set_window_title","title"),&_OS::set_window_title); + ClassDB::bind_method(_MD("set_window_title","title"),&_OS::set_window_title); - ObjectTypeDB::bind_method(_MD("set_low_processor_usage_mode","enable"),&_OS::set_low_processor_usage_mode); - ObjectTypeDB::bind_method(_MD("is_in_low_processor_usage_mode"),&_OS::is_in_low_processor_usage_mode); + ClassDB::bind_method(_MD("set_low_processor_usage_mode","enable"),&_OS::set_low_processor_usage_mode); + ClassDB::bind_method(_MD("is_in_low_processor_usage_mode"),&_OS::is_in_low_processor_usage_mode); - ObjectTypeDB::bind_method(_MD("get_processor_count"),&_OS::get_processor_count); + ClassDB::bind_method(_MD("get_processor_count"),&_OS::get_processor_count); - ObjectTypeDB::bind_method(_MD("get_executable_path"),&_OS::get_executable_path); - ObjectTypeDB::bind_method(_MD("execute","path","arguments","blocking","output"),&_OS::execute,DEFVAL(Array())); - ObjectTypeDB::bind_method(_MD("kill","pid"),&_OS::kill); - ObjectTypeDB::bind_method(_MD("shell_open","uri"),&_OS::shell_open); - ObjectTypeDB::bind_method(_MD("get_process_ID"),&_OS::get_process_ID); + ClassDB::bind_method(_MD("get_executable_path"),&_OS::get_executable_path); + ClassDB::bind_method(_MD("execute","path","arguments","blocking","output"),&_OS::execute,DEFVAL(Array())); + ClassDB::bind_method(_MD("kill","pid"),&_OS::kill); + ClassDB::bind_method(_MD("shell_open","uri"),&_OS::shell_open); + ClassDB::bind_method(_MD("get_process_ID"),&_OS::get_process_ID); - ObjectTypeDB::bind_method(_MD("get_environment","environment"),&_OS::get_environment); - ObjectTypeDB::bind_method(_MD("has_environment","environment"),&_OS::has_environment); + ClassDB::bind_method(_MD("get_environment","environment"),&_OS::get_environment); + ClassDB::bind_method(_MD("has_environment","environment"),&_OS::has_environment); - ObjectTypeDB::bind_method(_MD("get_name"),&_OS::get_name); - ObjectTypeDB::bind_method(_MD("get_cmdline_args"),&_OS::get_cmdline_args); - ObjectTypeDB::bind_method(_MD("get_main_loop"),&_OS::get_main_loop); + ClassDB::bind_method(_MD("get_name"),&_OS::get_name); + ClassDB::bind_method(_MD("get_cmdline_args"),&_OS::get_cmdline_args); + ClassDB::bind_method(_MD("get_main_loop"),&_OS::get_main_loop); - ObjectTypeDB::bind_method(_MD("get_datetime","utc"),&_OS::get_datetime,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("get_date","utc"),&_OS::get_date,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("get_time","utc"),&_OS::get_time,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("get_time_zone_info"),&_OS::get_time_zone_info); - ObjectTypeDB::bind_method(_MD("get_unix_time"),&_OS::get_unix_time); - ObjectTypeDB::bind_method(_MD("get_datetime_from_unix_time", "unix_time_val"), + ClassDB::bind_method(_MD("get_datetime","utc"),&_OS::get_datetime,DEFVAL(false)); + ClassDB::bind_method(_MD("get_date","utc"),&_OS::get_date,DEFVAL(false)); + ClassDB::bind_method(_MD("get_time","utc"),&_OS::get_time,DEFVAL(false)); + ClassDB::bind_method(_MD("get_time_zone_info"),&_OS::get_time_zone_info); + ClassDB::bind_method(_MD("get_unix_time"),&_OS::get_unix_time); + ClassDB::bind_method(_MD("get_datetime_from_unix_time", "unix_time_val"), &_OS::get_datetime_from_unix_time); - ObjectTypeDB::bind_method(_MD("get_unix_time_from_datetime", "datetime"), + ClassDB::bind_method(_MD("get_unix_time_from_datetime", "datetime"), &_OS::get_unix_time_from_datetime); - ObjectTypeDB::bind_method(_MD("get_system_time_secs"), &_OS::get_system_time_secs); + ClassDB::bind_method(_MD("get_system_time_secs"), &_OS::get_system_time_secs); - ObjectTypeDB::bind_method(_MD("set_icon","icon"),&_OS::set_icon); + ClassDB::bind_method(_MD("set_icon","icon"),&_OS::set_icon); - ObjectTypeDB::bind_method(_MD("delay_usec","usec"),&_OS::delay_usec); - ObjectTypeDB::bind_method(_MD("delay_msec","msec"),&_OS::delay_msec); - ObjectTypeDB::bind_method(_MD("get_ticks_msec"),&_OS::get_ticks_msec); - ObjectTypeDB::bind_method(_MD("get_splash_tick_msec"),&_OS::get_splash_tick_msec); - ObjectTypeDB::bind_method(_MD("get_locale"),&_OS::get_locale); - ObjectTypeDB::bind_method(_MD("get_latin_keyboard_variant"),&_OS::get_latin_keyboard_variant); - ObjectTypeDB::bind_method(_MD("get_model_name"),&_OS::get_model_name); + ClassDB::bind_method(_MD("delay_usec","usec"),&_OS::delay_usec); + ClassDB::bind_method(_MD("delay_msec","msec"),&_OS::delay_msec); + ClassDB::bind_method(_MD("get_ticks_msec"),&_OS::get_ticks_msec); + ClassDB::bind_method(_MD("get_splash_tick_msec"),&_OS::get_splash_tick_msec); + ClassDB::bind_method(_MD("get_locale"),&_OS::get_locale); + ClassDB::bind_method(_MD("get_latin_keyboard_variant"),&_OS::get_latin_keyboard_variant); + ClassDB::bind_method(_MD("get_model_name"),&_OS::get_model_name); - ObjectTypeDB::bind_method(_MD("get_custom_level"),&_OS::get_custom_level); + ClassDB::bind_method(_MD("get_custom_level"),&_OS::get_custom_level); - ObjectTypeDB::bind_method(_MD("can_draw"),&_OS::can_draw); - ObjectTypeDB::bind_method(_MD("get_frames_drawn"),&_OS::get_frames_drawn); - ObjectTypeDB::bind_method(_MD("is_stdout_verbose"),&_OS::is_stdout_verbose); + ClassDB::bind_method(_MD("can_draw"),&_OS::can_draw); + ClassDB::bind_method(_MD("get_frames_drawn"),&_OS::get_frames_drawn); + ClassDB::bind_method(_MD("is_stdout_verbose"),&_OS::is_stdout_verbose); - ObjectTypeDB::bind_method(_MD("can_use_threads"),&_OS::can_use_threads); + ClassDB::bind_method(_MD("can_use_threads"),&_OS::can_use_threads); - ObjectTypeDB::bind_method(_MD("is_debug_build"),&_OS::is_debug_build); + ClassDB::bind_method(_MD("is_debug_build"),&_OS::is_debug_build); - //ObjectTypeDB::bind_method(_MD("get_mouse_button_state"),&_OS::get_mouse_button_state); + //ClassDB::bind_method(_MD("get_mouse_button_state"),&_OS::get_mouse_button_state); - ObjectTypeDB::bind_method(_MD("dump_memory_to_file","file"),&_OS::dump_memory_to_file); - ObjectTypeDB::bind_method(_MD("dump_resources_to_file","file"),&_OS::dump_resources_to_file); - ObjectTypeDB::bind_method(_MD("has_virtual_keyboard"),&_OS::has_virtual_keyboard); - ObjectTypeDB::bind_method(_MD("show_virtual_keyboard", "existing_text"),&_OS::show_virtual_keyboard,DEFVAL("")); - ObjectTypeDB::bind_method(_MD("hide_virtual_keyboard"),&_OS::hide_virtual_keyboard); - ObjectTypeDB::bind_method(_MD("print_resources_in_use","short"),&_OS::print_resources_in_use,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("print_all_resources","tofile"),&_OS::print_all_resources,DEFVAL("")); + ClassDB::bind_method(_MD("dump_memory_to_file","file"),&_OS::dump_memory_to_file); + ClassDB::bind_method(_MD("dump_resources_to_file","file"),&_OS::dump_resources_to_file); + ClassDB::bind_method(_MD("has_virtual_keyboard"),&_OS::has_virtual_keyboard); + ClassDB::bind_method(_MD("show_virtual_keyboard", "existing_text"),&_OS::show_virtual_keyboard,DEFVAL("")); + ClassDB::bind_method(_MD("hide_virtual_keyboard"),&_OS::hide_virtual_keyboard); + ClassDB::bind_method(_MD("print_resources_in_use","short"),&_OS::print_resources_in_use,DEFVAL(false)); + ClassDB::bind_method(_MD("print_all_resources","tofile"),&_OS::print_all_resources,DEFVAL("")); - ObjectTypeDB::bind_method(_MD("get_static_memory_usage"),&_OS::get_static_memory_usage); - ObjectTypeDB::bind_method(_MD("get_static_memory_peak_usage"),&_OS::get_static_memory_peak_usage); - ObjectTypeDB::bind_method(_MD("get_dynamic_memory_usage"),&_OS::get_dynamic_memory_usage); + ClassDB::bind_method(_MD("get_static_memory_usage"),&_OS::get_static_memory_usage); + ClassDB::bind_method(_MD("get_static_memory_peak_usage"),&_OS::get_static_memory_peak_usage); + ClassDB::bind_method(_MD("get_dynamic_memory_usage"),&_OS::get_dynamic_memory_usage); - ObjectTypeDB::bind_method(_MD("get_data_dir"),&_OS::get_data_dir); - ObjectTypeDB::bind_method(_MD("get_system_dir","dir"),&_OS::get_system_dir); - ObjectTypeDB::bind_method(_MD("get_unique_ID"),&_OS::get_unique_ID); + ClassDB::bind_method(_MD("get_data_dir"),&_OS::get_data_dir); + ClassDB::bind_method(_MD("get_system_dir","dir"),&_OS::get_system_dir); + ClassDB::bind_method(_MD("get_unique_ID"),&_OS::get_unique_ID); - ObjectTypeDB::bind_method(_MD("is_ok_left_and_cancel_right"),&_OS::is_ok_left_and_cancel_right); + ClassDB::bind_method(_MD("is_ok_left_and_cancel_right"),&_OS::is_ok_left_and_cancel_right); - ObjectTypeDB::bind_method(_MD("get_frames_per_second"),&_OS::get_frames_per_second); + ClassDB::bind_method(_MD("get_frames_per_second"),&_OS::get_frames_per_second); - ObjectTypeDB::bind_method(_MD("print_all_textures_by_size"),&_OS::print_all_textures_by_size); - ObjectTypeDB::bind_method(_MD("print_resources_by_type","types"),&_OS::print_resources_by_type); + ClassDB::bind_method(_MD("print_all_textures_by_size"),&_OS::print_all_textures_by_size); + ClassDB::bind_method(_MD("print_resources_by_type","types"),&_OS::print_resources_by_type); - ObjectTypeDB::bind_method(_MD("native_video_play","path","volume","audio_track","subtitle_track"),&_OS::native_video_play); - ObjectTypeDB::bind_method(_MD("native_video_is_playing"),&_OS::native_video_is_playing); - ObjectTypeDB::bind_method(_MD("native_video_stop"),&_OS::native_video_stop); - ObjectTypeDB::bind_method(_MD("native_video_pause"),&_OS::native_video_pause); - ObjectTypeDB::bind_method(_MD("native_video_unpause"),&_OS::native_video_unpause); + ClassDB::bind_method(_MD("native_video_play","path","volume","audio_track","subtitle_track"),&_OS::native_video_play); + ClassDB::bind_method(_MD("native_video_is_playing"),&_OS::native_video_is_playing); + ClassDB::bind_method(_MD("native_video_stop"),&_OS::native_video_stop); + ClassDB::bind_method(_MD("native_video_pause"),&_OS::native_video_pause); + ClassDB::bind_method(_MD("native_video_unpause"),&_OS::native_video_unpause); - ObjectTypeDB::bind_method(_MD("get_scancode_string","code"),&_OS::get_scancode_string); - ObjectTypeDB::bind_method(_MD("is_scancode_unicode","code"),&_OS::is_scancode_unicode); - ObjectTypeDB::bind_method(_MD("find_scancode_from_string","string"),&_OS::find_scancode_from_string); + ClassDB::bind_method(_MD("get_scancode_string","code"),&_OS::get_scancode_string); + ClassDB::bind_method(_MD("is_scancode_unicode","code"),&_OS::is_scancode_unicode); + ClassDB::bind_method(_MD("find_scancode_from_string","string"),&_OS::find_scancode_from_string); - ObjectTypeDB::bind_method(_MD("set_use_file_access_save_and_swap","enabled"),&_OS::set_use_file_access_save_and_swap); + ClassDB::bind_method(_MD("set_use_file_access_save_and_swap","enabled"),&_OS::set_use_file_access_save_and_swap); - ObjectTypeDB::bind_method(_MD("alert","text","title"),&_OS::alert,DEFVAL("Alert!")); + ClassDB::bind_method(_MD("alert","text","title"),&_OS::alert,DEFVAL("Alert!")); - ObjectTypeDB::bind_method(_MD("set_thread_name","name"),&_OS::set_thread_name); + ClassDB::bind_method(_MD("set_thread_name","name"),&_OS::set_thread_name); - ObjectTypeDB::bind_method(_MD("set_use_vsync","enable"),&_OS::set_use_vsync); - ObjectTypeDB::bind_method(_MD("is_vsync_enabled"),&_OS::is_vsync_enabled); + ClassDB::bind_method(_MD("set_use_vsync","enable"),&_OS::set_use_vsync); + ClassDB::bind_method(_MD("is_vsync_enabled"),&_OS::is_vsync_enabled); - ObjectTypeDB::bind_method(_MD("get_engine_version"),&_OS::get_engine_version); + ClassDB::bind_method(_MD("get_engine_version"),&_OS::get_engine_version); BIND_CONSTANT( DAY_SUNDAY ); BIND_CONSTANT( DAY_MONDAY ); @@ -1396,29 +1396,29 @@ int _Geometry::get_uv84_normal_bit(const Vector3& p_vector) { void _Geometry::_bind_methods() { - ObjectTypeDB::bind_method(_MD("build_box_planes","extents"),&_Geometry::build_box_planes); - ObjectTypeDB::bind_method(_MD("build_cylinder_planes","radius","height","sides","axis"),&_Geometry::build_cylinder_planes,DEFVAL(Vector3::AXIS_Z)); - ObjectTypeDB::bind_method(_MD("build_capsule_planes","radius","height","sides","lats","axis"),&_Geometry::build_capsule_planes,DEFVAL(Vector3::AXIS_Z)); - ObjectTypeDB::bind_method(_MD("segment_intersects_circle","segment_from","segment_to","circle_pos","circle_radius"),&_Geometry::segment_intersects_circle); - ObjectTypeDB::bind_method(_MD("segment_intersects_segment_2d","from_a","to_a","from_b","to_b"),&_Geometry::segment_intersects_segment_2d); + ClassDB::bind_method(_MD("build_box_planes","extents"),&_Geometry::build_box_planes); + ClassDB::bind_method(_MD("build_cylinder_planes","radius","height","sides","axis"),&_Geometry::build_cylinder_planes,DEFVAL(Vector3::AXIS_Z)); + ClassDB::bind_method(_MD("build_capsule_planes","radius","height","sides","lats","axis"),&_Geometry::build_capsule_planes,DEFVAL(Vector3::AXIS_Z)); + ClassDB::bind_method(_MD("segment_intersects_circle","segment_from","segment_to","circle_pos","circle_radius"),&_Geometry::segment_intersects_circle); + ClassDB::bind_method(_MD("segment_intersects_segment_2d","from_a","to_a","from_b","to_b"),&_Geometry::segment_intersects_segment_2d); - ObjectTypeDB::bind_method(_MD("get_closest_points_between_segments_2d","p1","q1","p2","q2"),&_Geometry::get_closest_points_between_segments_2d); - ObjectTypeDB::bind_method(_MD("get_closest_points_between_segments","p1","p2","q1","q2"),&_Geometry::get_closest_points_between_segments); + ClassDB::bind_method(_MD("get_closest_points_between_segments_2d","p1","q1","p2","q2"),&_Geometry::get_closest_points_between_segments_2d); + ClassDB::bind_method(_MD("get_closest_points_between_segments","p1","p2","q1","q2"),&_Geometry::get_closest_points_between_segments); - ObjectTypeDB::bind_method(_MD("get_closest_point_to_segment","point","s1","s2"),&_Geometry::get_closest_point_to_segment); + ClassDB::bind_method(_MD("get_closest_point_to_segment","point","s1","s2"),&_Geometry::get_closest_point_to_segment); - ObjectTypeDB::bind_method(_MD("get_uv84_normal_bit","normal"),&_Geometry::get_uv84_normal_bit); + ClassDB::bind_method(_MD("get_uv84_normal_bit","normal"),&_Geometry::get_uv84_normal_bit); - ObjectTypeDB::bind_method(_MD("ray_intersects_triangle","from","dir","a","b","c"),&_Geometry::ray_intersects_triangle); - ObjectTypeDB::bind_method(_MD("segment_intersects_triangle","from","to","a","b","c"),&_Geometry::segment_intersects_triangle); - ObjectTypeDB::bind_method(_MD("segment_intersects_sphere","from","to","spos","sradius"),&_Geometry::segment_intersects_sphere); - ObjectTypeDB::bind_method(_MD("segment_intersects_cylinder","from","to","height","radius"),&_Geometry::segment_intersects_cylinder); - ObjectTypeDB::bind_method(_MD("segment_intersects_convex","from","to","planes"),&_Geometry::segment_intersects_convex); - ObjectTypeDB::bind_method(_MD("point_is_inside_triangle","point","a","b","c"),&_Geometry::point_is_inside_triangle); + ClassDB::bind_method(_MD("ray_intersects_triangle","from","dir","a","b","c"),&_Geometry::ray_intersects_triangle); + ClassDB::bind_method(_MD("segment_intersects_triangle","from","to","a","b","c"),&_Geometry::segment_intersects_triangle); + ClassDB::bind_method(_MD("segment_intersects_sphere","from","to","spos","sradius"),&_Geometry::segment_intersects_sphere); + ClassDB::bind_method(_MD("segment_intersects_cylinder","from","to","height","radius"),&_Geometry::segment_intersects_cylinder); + ClassDB::bind_method(_MD("segment_intersects_convex","from","to","planes"),&_Geometry::segment_intersects_convex); + ClassDB::bind_method(_MD("point_is_inside_triangle","point","a","b","c"),&_Geometry::point_is_inside_triangle); - ObjectTypeDB::bind_method(_MD("triangulate_polygon","polygon"),&_Geometry::triangulate_polygon); + ClassDB::bind_method(_MD("triangulate_polygon","polygon"),&_Geometry::triangulate_polygon); - ObjectTypeDB::bind_method(_MD("make_atlas","sizes"),&_Geometry::make_atlas); + ClassDB::bind_method(_MD("make_atlas","sizes"),&_Geometry::make_atlas); } @@ -1793,51 +1793,51 @@ Variant _File::get_var() const { void _File::_bind_methods() { - ObjectTypeDB::bind_method(_MD("open_encrypted","path","mode_flags","key"),&_File::open_encrypted); - ObjectTypeDB::bind_method(_MD("open_encrypted_with_pass","path","mode_flags","pass"),&_File::open_encrypted_pass); + ClassDB::bind_method(_MD("open_encrypted","path","mode_flags","key"),&_File::open_encrypted); + ClassDB::bind_method(_MD("open_encrypted_with_pass","path","mode_flags","pass"),&_File::open_encrypted_pass); - ObjectTypeDB::bind_method(_MD("open","path","flags"),&_File::open); - ObjectTypeDB::bind_method(_MD("close"),&_File::close); - ObjectTypeDB::bind_method(_MD("is_open"),&_File::is_open); - ObjectTypeDB::bind_method(_MD("seek","pos"),&_File::seek); - ObjectTypeDB::bind_method(_MD("seek_end","pos"),&_File::seek_end,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("get_pos"),&_File::get_pos); - ObjectTypeDB::bind_method(_MD("get_len"),&_File::get_len); - ObjectTypeDB::bind_method(_MD("eof_reached"),&_File::eof_reached); - ObjectTypeDB::bind_method(_MD("get_8"),&_File::get_8); - ObjectTypeDB::bind_method(_MD("get_16"),&_File::get_16); - ObjectTypeDB::bind_method(_MD("get_32"),&_File::get_32); - ObjectTypeDB::bind_method(_MD("get_64"),&_File::get_64); - ObjectTypeDB::bind_method(_MD("get_float"),&_File::get_float); - ObjectTypeDB::bind_method(_MD("get_double"),&_File::get_double); - ObjectTypeDB::bind_method(_MD("get_real"),&_File::get_real); - ObjectTypeDB::bind_method(_MD("get_buffer","len"),&_File::get_buffer); - ObjectTypeDB::bind_method(_MD("get_line"),&_File::get_line); - ObjectTypeDB::bind_method(_MD("get_as_text"),&_File::get_as_text); - ObjectTypeDB::bind_method(_MD("get_md5","path"),&_File::get_md5); - ObjectTypeDB::bind_method(_MD("get_sha256","path"),&_File::get_sha256); - ObjectTypeDB::bind_method(_MD("get_endian_swap"),&_File::get_endian_swap); - ObjectTypeDB::bind_method(_MD("set_endian_swap","enable"),&_File::set_endian_swap); - ObjectTypeDB::bind_method(_MD("get_error:Error"),&_File::get_error); - ObjectTypeDB::bind_method(_MD("get_var"),&_File::get_var); - ObjectTypeDB::bind_method(_MD("get_csv_line","delim"),&_File::get_csv_line,DEFVAL(",")); + ClassDB::bind_method(_MD("open","path","flags"),&_File::open); + ClassDB::bind_method(_MD("close"),&_File::close); + ClassDB::bind_method(_MD("is_open"),&_File::is_open); + ClassDB::bind_method(_MD("seek","pos"),&_File::seek); + ClassDB::bind_method(_MD("seek_end","pos"),&_File::seek_end,DEFVAL(0)); + ClassDB::bind_method(_MD("get_pos"),&_File::get_pos); + ClassDB::bind_method(_MD("get_len"),&_File::get_len); + ClassDB::bind_method(_MD("eof_reached"),&_File::eof_reached); + ClassDB::bind_method(_MD("get_8"),&_File::get_8); + ClassDB::bind_method(_MD("get_16"),&_File::get_16); + ClassDB::bind_method(_MD("get_32"),&_File::get_32); + ClassDB::bind_method(_MD("get_64"),&_File::get_64); + ClassDB::bind_method(_MD("get_float"),&_File::get_float); + ClassDB::bind_method(_MD("get_double"),&_File::get_double); + ClassDB::bind_method(_MD("get_real"),&_File::get_real); + ClassDB::bind_method(_MD("get_buffer","len"),&_File::get_buffer); + ClassDB::bind_method(_MD("get_line"),&_File::get_line); + ClassDB::bind_method(_MD("get_as_text"),&_File::get_as_text); + ClassDB::bind_method(_MD("get_md5","path"),&_File::get_md5); + ClassDB::bind_method(_MD("get_sha256","path"),&_File::get_sha256); + ClassDB::bind_method(_MD("get_endian_swap"),&_File::get_endian_swap); + ClassDB::bind_method(_MD("set_endian_swap","enable"),&_File::set_endian_swap); + ClassDB::bind_method(_MD("get_error:Error"),&_File::get_error); + ClassDB::bind_method(_MD("get_var"),&_File::get_var); + ClassDB::bind_method(_MD("get_csv_line","delim"),&_File::get_csv_line,DEFVAL(",")); - ObjectTypeDB::bind_method(_MD("store_8","value"),&_File::store_8); - ObjectTypeDB::bind_method(_MD("store_16","value"),&_File::store_16); - ObjectTypeDB::bind_method(_MD("store_32","value"),&_File::store_32); - ObjectTypeDB::bind_method(_MD("store_64","value"),&_File::store_64); - ObjectTypeDB::bind_method(_MD("store_float","value"),&_File::store_float); - ObjectTypeDB::bind_method(_MD("store_double","value"),&_File::store_double); - ObjectTypeDB::bind_method(_MD("store_real","value"),&_File::store_real); - ObjectTypeDB::bind_method(_MD("store_buffer","buffer"),&_File::store_buffer); - ObjectTypeDB::bind_method(_MD("store_line","line"),&_File::store_line); - ObjectTypeDB::bind_method(_MD("store_string","string"),&_File::store_string); - ObjectTypeDB::bind_method(_MD("store_var","value"),&_File::store_var); + ClassDB::bind_method(_MD("store_8","value"),&_File::store_8); + ClassDB::bind_method(_MD("store_16","value"),&_File::store_16); + ClassDB::bind_method(_MD("store_32","value"),&_File::store_32); + ClassDB::bind_method(_MD("store_64","value"),&_File::store_64); + ClassDB::bind_method(_MD("store_float","value"),&_File::store_float); + ClassDB::bind_method(_MD("store_double","value"),&_File::store_double); + ClassDB::bind_method(_MD("store_real","value"),&_File::store_real); + ClassDB::bind_method(_MD("store_buffer","buffer"),&_File::store_buffer); + ClassDB::bind_method(_MD("store_line","line"),&_File::store_line); + ClassDB::bind_method(_MD("store_string","string"),&_File::store_string); + ClassDB::bind_method(_MD("store_var","value"),&_File::store_var); - ObjectTypeDB::bind_method(_MD("store_pascal_string","string"),&_File::store_pascal_string); - ObjectTypeDB::bind_method(_MD("get_pascal_string"),&_File::get_pascal_string); + ClassDB::bind_method(_MD("store_pascal_string","string"),&_File::store_pascal_string); + ClassDB::bind_method(_MD("get_pascal_string"),&_File::get_pascal_string); - ObjectTypeDB::bind_method(_MD("file_exists","path"),&_File::file_exists); + ClassDB::bind_method(_MD("file_exists","path"),&_File::file_exists); BIND_CONSTANT( READ ); BIND_CONSTANT( WRITE ); @@ -2011,24 +2011,24 @@ Error _Directory::remove(String p_name){ void _Directory::_bind_methods() { - ObjectTypeDB::bind_method(_MD("open:Error","path"),&_Directory::open); - ObjectTypeDB::bind_method(_MD("list_dir_begin"),&_Directory::list_dir_begin); - ObjectTypeDB::bind_method(_MD("get_next"),&_Directory::get_next); - ObjectTypeDB::bind_method(_MD("current_is_dir"),&_Directory::current_is_dir); - ObjectTypeDB::bind_method(_MD("list_dir_end"),&_Directory::list_dir_end); - ObjectTypeDB::bind_method(_MD("get_drive_count"),&_Directory::get_drive_count); - ObjectTypeDB::bind_method(_MD("get_drive","idx"),&_Directory::get_drive); - ObjectTypeDB::bind_method(_MD("change_dir:Error","todir"),&_Directory::change_dir); - ObjectTypeDB::bind_method(_MD("get_current_dir"),&_Directory::get_current_dir); - ObjectTypeDB::bind_method(_MD("make_dir:Error","path"),&_Directory::make_dir); - ObjectTypeDB::bind_method(_MD("make_dir_recursive:Error","path"),&_Directory::make_dir_recursive); - ObjectTypeDB::bind_method(_MD("file_exists","path"),&_Directory::file_exists); - ObjectTypeDB::bind_method(_MD("dir_exists","path"),&_Directory::dir_exists); -// ObjectTypeDB::bind_method(_MD("get_modified_time","file"),&_Directory::get_modified_time); - ObjectTypeDB::bind_method(_MD("get_space_left"),&_Directory::get_space_left); - ObjectTypeDB::bind_method(_MD("copy:Error","from","to"),&_Directory::copy); - ObjectTypeDB::bind_method(_MD("rename:Error","from","to"),&_Directory::rename); - ObjectTypeDB::bind_method(_MD("remove:Error","path"),&_Directory::remove); + ClassDB::bind_method(_MD("open:Error","path"),&_Directory::open); + ClassDB::bind_method(_MD("list_dir_begin"),&_Directory::list_dir_begin); + ClassDB::bind_method(_MD("get_next"),&_Directory::get_next); + ClassDB::bind_method(_MD("current_is_dir"),&_Directory::current_is_dir); + ClassDB::bind_method(_MD("list_dir_end"),&_Directory::list_dir_end); + ClassDB::bind_method(_MD("get_drive_count"),&_Directory::get_drive_count); + ClassDB::bind_method(_MD("get_drive","idx"),&_Directory::get_drive); + ClassDB::bind_method(_MD("change_dir:Error","todir"),&_Directory::change_dir); + ClassDB::bind_method(_MD("get_current_dir"),&_Directory::get_current_dir); + ClassDB::bind_method(_MD("make_dir:Error","path"),&_Directory::make_dir); + ClassDB::bind_method(_MD("make_dir_recursive:Error","path"),&_Directory::make_dir_recursive); + ClassDB::bind_method(_MD("file_exists","path"),&_Directory::file_exists); + ClassDB::bind_method(_MD("dir_exists","path"),&_Directory::dir_exists); +// ClassDB::bind_method(_MD("get_modified_time","file"),&_Directory::get_modified_time); + ClassDB::bind_method(_MD("get_space_left"),&_Directory::get_space_left); + ClassDB::bind_method(_MD("copy:Error","from","to"),&_Directory::copy); + ClassDB::bind_method(_MD("rename:Error","from","to"),&_Directory::rename); + ClassDB::bind_method(_MD("remove:Error","path"),&_Directory::remove); } @@ -2168,14 +2168,14 @@ String _Marshalls::base64_to_utf8(const String& p_str) { void _Marshalls::_bind_methods() { - ObjectTypeDB::bind_method(_MD("variant_to_base64:String","variant"),&_Marshalls::variant_to_base64); - ObjectTypeDB::bind_method(_MD("base64_to_variant:Variant","base64_str"),&_Marshalls::base64_to_variant); + ClassDB::bind_method(_MD("variant_to_base64:String","variant"),&_Marshalls::variant_to_base64); + ClassDB::bind_method(_MD("base64_to_variant:Variant","base64_str"),&_Marshalls::base64_to_variant); - ObjectTypeDB::bind_method(_MD("raw_to_base64:String","array"),&_Marshalls::raw_to_base64); - ObjectTypeDB::bind_method(_MD("base64_to_raw:RawArray","base64_str"),&_Marshalls::base64_to_raw); + ClassDB::bind_method(_MD("raw_to_base64:String","array"),&_Marshalls::raw_to_base64); + ClassDB::bind_method(_MD("base64_to_raw:RawArray","base64_str"),&_Marshalls::base64_to_raw); - ObjectTypeDB::bind_method(_MD("utf8_to_base64:String","utf8_str"),&_Marshalls::utf8_to_base64); - ObjectTypeDB::bind_method(_MD("base64_to_utf8:String","base64_str"),&_Marshalls::base64_to_utf8); + ClassDB::bind_method(_MD("utf8_to_base64:String","utf8_str"),&_Marshalls::utf8_to_base64); + ClassDB::bind_method(_MD("base64_to_utf8:String","base64_str"),&_Marshalls::base64_to_utf8); }; @@ -2199,8 +2199,8 @@ Error _Semaphore::post() { void _Semaphore::_bind_methods() { - ObjectTypeDB::bind_method(_MD("wait:Error"),&_Semaphore::wait); - ObjectTypeDB::bind_method(_MD("post:Error"),&_Semaphore::post); + ClassDB::bind_method(_MD("wait:Error"),&_Semaphore::wait); + ClassDB::bind_method(_MD("post:Error"),&_Semaphore::post); } @@ -2236,9 +2236,9 @@ void _Mutex::unlock(){ void _Mutex::_bind_methods() { - ObjectTypeDB::bind_method(_MD("lock"),&_Mutex::lock); - ObjectTypeDB::bind_method(_MD("try_lock:Error"),&_Mutex::try_lock); - ObjectTypeDB::bind_method(_MD("unlock"),&_Mutex::unlock); + ClassDB::bind_method(_MD("lock"),&_Mutex::lock); + ClassDB::bind_method(_MD("try_lock:Error"),&_Mutex::try_lock); + ClassDB::bind_method(_MD("unlock"),&_Mutex::unlock); } @@ -2358,10 +2358,10 @@ Variant _Thread::wait_to_finish() { void _Thread::_bind_methods() { - ObjectTypeDB::bind_method(_MD("start:Error","instance","method","userdata","priority"),&_Thread::start,DEFVAL(Variant()),DEFVAL(PRIORITY_NORMAL)); - ObjectTypeDB::bind_method(_MD("get_id"),&_Thread::get_id); - ObjectTypeDB::bind_method(_MD("is_active"),&_Thread::is_active); - ObjectTypeDB::bind_method(_MD("wait_to_finish:Variant"),&_Thread::wait_to_finish); + ClassDB::bind_method(_MD("start:Error","instance","method","userdata","priority"),&_Thread::start,DEFVAL(Variant()),DEFVAL(PRIORITY_NORMAL)); + ClassDB::bind_method(_MD("get_id"),&_Thread::get_id); + ClassDB::bind_method(_MD("is_active"),&_Thread::is_active); + ClassDB::bind_method(_MD("wait_to_finish:Variant"),&_Thread::wait_to_finish); BIND_CONSTANT( PRIORITY_LOW ); BIND_CONSTANT( PRIORITY_NORMAL ); @@ -2382,3 +2382,204 @@ _Thread::~_Thread() { } ERR_FAIL_COND(active==true); } +///////////////////////////////////// + + +StringArray _ClassDB::get_class_list() const { + + List classes; + ClassDB::get_class_list(&classes); + + StringArray ret; + ret.resize(classes.size()); + int idx=0; + for (List::Element *E=classes.front();E;E=E->next()) { + ret.set(idx++,E->get()); + } + + return ret; + +} +StringArray _ClassDB::get_inheriters_from_class( const StringName& p_class) const { + + List classes; + ClassDB::get_inheriters_from_class(p_class,&classes); + + StringArray ret; + ret.resize(classes.size()); + int idx=0; + for (List::Element *E=classes.front();E;E=E->next()) { + ret.set(idx++,E->get()); + } + + return ret; +} +StringName _ClassDB::get_parent_class(const StringName& p_class) const { + + return ClassDB::get_parent_class(p_class); +} +bool _ClassDB::class_exists(const StringName &p_class) const { + + return ClassDB::class_exists(p_class); +} +bool _ClassDB::is_parent_class(const StringName &p_class,const StringName& p_inherits) const { + + return ClassDB::is_parent_class(p_class,p_inherits); +} +bool _ClassDB::can_instance(const StringName &p_class) const { + + return ClassDB::can_instance(p_class); +} +Variant _ClassDB::instance(const StringName &p_class) const { + + Object *obj = ClassDB::instance(p_class); + if (!obj) + return Variant(); + + Reference *r = obj->cast_to(); + if (r) { + return REF(r); + } else { + return obj; + } +} + +bool _ClassDB::has_signal(StringName p_class,StringName p_signal) const { + + return ClassDB::has_signal(p_class,p_signal); +} +Dictionary _ClassDB::get_signal(StringName p_class,StringName p_signal) const { + + MethodInfo signal; + if (ClassDB::get_signal(p_class,p_signal,&signal)) { + return signal.operator Dictionary(); + } else { + return Dictionary(); + } + +} +Array _ClassDB::get_signal_list(StringName p_class,bool p_no_inheritance) const { + + List signals; + ClassDB::get_signal_list(p_class,&signals,p_no_inheritance); + Array ret; + + for (List::Element *E=signals.front();E;E=E->next()) { + ret.push_back(E->get().operator Dictionary()); + } + + return ret; +} + +Array _ClassDB::get_property_list(StringName p_class, bool p_no_inheritance) const { + + List plist; + ClassDB::get_property_list(p_class,&plist,p_no_inheritance); + Array ret; + for (List::Element *E=plist.front();E;E=E->next()) { + ret.push_back(E->get().operator Dictionary()); + } + + return ret; + + +} + +bool _ClassDB::has_method(StringName p_class,StringName p_method,bool p_no_inheritance) const { + + return ClassDB::has_method(p_class,p_method,p_no_inheritance); +} + + +Array _ClassDB::get_method_list(StringName p_class,bool p_no_inheritance) const { + + List methods; + ClassDB::get_method_list(p_class,&methods,p_no_inheritance); + Array ret; + + for (List::Element *E=methods.front();E;E=E->next()) { + ret.push_back(E->get().operator Dictionary()); + } + + return ret; +} + +StringArray _ClassDB::get_integer_constant_list(const StringName& p_class, bool p_no_inheritance) const { + + List constants; + ClassDB::get_integer_constant_list(p_class,&constants,p_no_inheritance); + + StringArray ret; + ret.resize(constants.size()); + int idx=0; + for (List::Element *E=constants.front();E;E=E->next()) { + ret.set(idx++,E->get()); + } + + return ret; +} + +bool _ClassDB::has_integer_constant(const StringName& p_class, const StringName &p_name) const { + + bool success; + ClassDB::get_integer_constant(p_class,p_name,&success); + return success; +} + +int _ClassDB::get_integer_constant(const StringName& p_class, const StringName &p_name) const { + + bool found; + int c = ClassDB::get_integer_constant(p_class,p_name,&found); + ERR_FAIL_COND_V(!found,0); + return c; + +} +StringName _ClassDB::get_category(const StringName& p_node) const { + + return ClassDB::get_category(p_node); +} + +bool _ClassDB::is_class_enabled(StringName p_class) const { + + return ClassDB::is_class_enabled(p_class); +} + +void _ClassDB::_bind_methods() { + + ClassDB::bind_method(_MD("get_class_list"),&_ClassDB::get_class_list); + ClassDB::bind_method(_MD("get_inheriters_from_class","class"),&_ClassDB::get_inheriters_from_class); + ClassDB::bind_method(_MD("get_parent_class","class"),&_ClassDB::get_parent_class); + ClassDB::bind_method(_MD("class_exists","class"),&_ClassDB::class_exists); + ClassDB::bind_method(_MD("is_parent_class","class","inherits"),&_ClassDB::is_parent_class); + ClassDB::bind_method(_MD("can_instance","class"),&_ClassDB::can_instance); + ClassDB::bind_method(_MD("instance","class"),&_ClassDB::instance); + + ClassDB::bind_method(_MD("has_signal","class","signal"),&_ClassDB::has_signal); + ClassDB::bind_method(_MD("get_signal","class","signal"),&_ClassDB::get_signal); + ClassDB::bind_method(_MD("get_signal_list","class","no_inheritance"),&_ClassDB::get_signal_list,DEFVAL(false)); + + ClassDB::bind_method(_MD("get_property_list","class","no_inheritance"),&_ClassDB::get_property_list,DEFVAL(false)); + + ClassDB::bind_method(_MD("has_method","class","method","no_inheritance"),&_ClassDB::has_method,DEFVAL(false)); + + ClassDB::bind_method(_MD("get_method_list","class","no_inheritance"),&_ClassDB::get_method_list,DEFVAL(false)); + + ClassDB::bind_method(_MD("get_integer_constant_list","class","no_inheritance"),&_ClassDB::get_integer_constant_list,DEFVAL(false)); + + ClassDB::bind_method(_MD("has_integer_constant","class","name"),&_ClassDB::has_integer_constant); + ClassDB::bind_method(_MD("get_integer_constant","class","name"),&_ClassDB::get_integer_constant); + + ClassDB::bind_method(_MD("get_category","class"),&_ClassDB::get_category); + ClassDB::bind_method(_MD("is_class_enabled","class"),&_ClassDB::is_class_enabled); + + +} + +_ClassDB::_ClassDB(){ + + +} +_ClassDB::~_ClassDB(){ + + +} diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 968e7f92c78..9a4f26a12dc 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -38,7 +38,7 @@ class _ResourceLoader : public Object { - OBJ_TYPE(_ResourceLoader,Object); + GDCLASS(_ResourceLoader,Object); protected: @@ -60,7 +60,7 @@ public: }; class _ResourceSaver : public Object { - OBJ_TYPE(_ResourceSaver,Object); + GDCLASS(_ResourceSaver,Object); protected: @@ -90,7 +90,7 @@ public: class MainLoop; class _OS : public Object { - OBJ_TYPE(_OS,Object); + GDCLASS(_OS,Object); protected: @@ -333,7 +333,7 @@ VARIANT_ENUM_CAST(_OS::ScreenOrientation); class _Geometry : public Object { - OBJ_TYPE(_Geometry, Object); + GDCLASS(_Geometry, Object); static _Geometry *singleton; protected: @@ -371,7 +371,7 @@ public: class _File : public Reference { - OBJ_TYPE(_File,Reference); + GDCLASS(_File,Reference); FileAccess *f; bool eswap; protected: @@ -460,7 +460,7 @@ public: class _Directory : public Reference { - OBJ_TYPE(_Directory,Reference); + GDCLASS(_Directory,Reference); DirAccess *d; protected: @@ -501,7 +501,7 @@ public: class _Marshalls : public Reference { - OBJ_TYPE(_Marshalls,Reference); + GDCLASS(_Marshalls,Reference); static _Marshalls* singleton; @@ -530,7 +530,7 @@ public: class _Mutex : public Reference { - OBJ_TYPE(_Mutex,Reference); + GDCLASS(_Mutex,Reference); Mutex *mutex; static void _bind_methods(); @@ -546,7 +546,7 @@ public: class _Semaphore : public Reference { - OBJ_TYPE(_Semaphore,Reference); + GDCLASS(_Semaphore,Reference); Semaphore *semaphore; static void _bind_methods(); @@ -561,7 +561,7 @@ public: class _Thread : public Reference { - OBJ_TYPE(_Thread,Reference); + GDCLASS(_Thread,Reference); protected: @@ -591,4 +591,42 @@ public: ~_Thread(); }; +class _ClassDB : public Object { + + GDCLASS(_ClassDB,Object) + +protected: + static void _bind_methods(); +public: + + StringArray get_class_list() const; + StringArray get_inheriters_from_class( const StringName& p_class) const; + StringName get_parent_class(const StringName& p_class) const; + bool class_exists(const StringName &p_class) const; + bool is_parent_class(const StringName &p_class,const StringName& p_inherits) const; + bool can_instance(const StringName &p_class) const; + Variant instance(const StringName &p_class) const; + + bool has_signal(StringName p_class,StringName p_signal) const; + Dictionary get_signal(StringName p_class,StringName p_signal) const; + Array get_signal_list(StringName p_class,bool p_no_inheritance=false) const; + + Array get_property_list(StringName p_class, bool p_no_inheritance=false) const; + + bool has_method(StringName p_class,StringName p_method,bool p_no_inheritance=false) const; + + + Array get_method_list(StringName p_class,bool p_no_inheritance=false) const; + + StringArray get_integer_constant_list(const StringName& p_class, bool p_no_inheritance=false) const; + bool has_integer_constant(const StringName& p_class, const StringName &p_name) const; + int get_integer_constant(const StringName& p_class, const StringName &p_name) const; + StringName get_category(const StringName& p_node) const; + + bool is_class_enabled(StringName p_class) const; + + _ClassDB(); + ~_ClassDB(); +}; + #endif // CORE_BIND_H diff --git a/core/compressed_translation.cpp b/core/compressed_translation.cpp index 1725ce99466..9b39eeb2c16 100644 --- a/core/compressed_translation.cpp +++ b/core/compressed_translation.cpp @@ -526,7 +526,7 @@ void PHashTranslation::_get_property_list( List *p_list) const{ } void PHashTranslation::_bind_methods() { - ObjectTypeDB::bind_method(_MD("generate","from:Translation"),&PHashTranslation::generate); + ClassDB::bind_method(_MD("generate","from:Translation"),&PHashTranslation::generate); } PHashTranslation::PHashTranslation() diff --git a/core/compressed_translation.h b/core/compressed_translation.h index a7b539816a5..218a59c05df 100644 --- a/core/compressed_translation.h +++ b/core/compressed_translation.h @@ -33,7 +33,7 @@ class PHashTranslation : public Translation { - OBJ_TYPE(PHashTranslation,Translation); + GDCLASS(PHashTranslation,Translation); //this translation uses a sort of modified perfect hash algorithm diff --git a/core/func_ref.cpp b/core/func_ref.cpp index e6a87995e5f..1e8c2298109 100644 --- a/core/func_ref.cpp +++ b/core/func_ref.cpp @@ -61,12 +61,12 @@ void FuncRef::_bind_methods() { MethodInfo mi; mi.name="call_func"; Vector defargs; - ObjectTypeDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"call_func:Variant",&FuncRef::call_func,mi,defargs); + ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"call_func:Variant",&FuncRef::call_func,mi,defargs); } - ObjectTypeDB::bind_method(_MD("set_instance","instance"),&FuncRef::set_instance); - ObjectTypeDB::bind_method(_MD("set_function","name"),&FuncRef::set_function); + ClassDB::bind_method(_MD("set_instance","instance"),&FuncRef::set_instance); + ClassDB::bind_method(_MD("set_function","name"),&FuncRef::set_function); } diff --git a/core/func_ref.h b/core/func_ref.h index c3090631b24..0c9bca4680e 100644 --- a/core/func_ref.h +++ b/core/func_ref.h @@ -33,7 +33,7 @@ class FuncRef : public Reference{ - OBJ_TYPE(FuncRef,Reference); + GDCLASS(FuncRef,Reference); ObjectID id; StringName function; diff --git a/core/globals.cpp b/core/globals.cpp index 5f47bfef2d8..8b335b8a0de 100644 --- a/core/globals.cpp +++ b/core/globals.cpp @@ -1420,21 +1420,21 @@ bool Globals::is_using_datapack() const { void Globals::_bind_methods() { - ObjectTypeDB::bind_method(_MD("has","name"),&Globals::has); - ObjectTypeDB::bind_method(_MD("set_order","name","pos"),&Globals::set_order); - ObjectTypeDB::bind_method(_MD("get_order","name"),&Globals::get_order); - ObjectTypeDB::bind_method(_MD("set_persisting","name","enable"),&Globals::set_persisting); - ObjectTypeDB::bind_method(_MD("is_persisting","name"),&Globals::is_persisting); - ObjectTypeDB::bind_method(_MD("add_property_info", "hint"),&Globals::_add_property_info_bind); - ObjectTypeDB::bind_method(_MD("clear","name"),&Globals::clear); - ObjectTypeDB::bind_method(_MD("localize_path","path"),&Globals::localize_path); - ObjectTypeDB::bind_method(_MD("globalize_path","path"),&Globals::globalize_path); - ObjectTypeDB::bind_method(_MD("save"),&Globals::save); - ObjectTypeDB::bind_method(_MD("has_singleton","name"),&Globals::has_singleton); - ObjectTypeDB::bind_method(_MD("get_singleton","name"),&Globals::get_singleton_object); - ObjectTypeDB::bind_method(_MD("load_resource_pack","pack"),&Globals::_load_resource_pack); + ClassDB::bind_method(_MD("has","name"),&Globals::has); + ClassDB::bind_method(_MD("set_order","name","pos"),&Globals::set_order); + ClassDB::bind_method(_MD("get_order","name"),&Globals::get_order); + ClassDB::bind_method(_MD("set_persisting","name","enable"),&Globals::set_persisting); + ClassDB::bind_method(_MD("is_persisting","name"),&Globals::is_persisting); + ClassDB::bind_method(_MD("add_property_info", "hint"),&Globals::_add_property_info_bind); + ClassDB::bind_method(_MD("clear","name"),&Globals::clear); + ClassDB::bind_method(_MD("localize_path","path"),&Globals::localize_path); + ClassDB::bind_method(_MD("globalize_path","path"),&Globals::globalize_path); + ClassDB::bind_method(_MD("save"),&Globals::save); + ClassDB::bind_method(_MD("has_singleton","name"),&Globals::has_singleton); + ClassDB::bind_method(_MD("get_singleton","name"),&Globals::get_singleton_object); + ClassDB::bind_method(_MD("load_resource_pack","pack"),&Globals::_load_resource_pack); - ObjectTypeDB::bind_method(_MD("save_custom","file"),&Globals::_save_custom_bnd); + ClassDB::bind_method(_MD("save_custom","file"),&Globals::_save_custom_bnd); } diff --git a/core/globals.h b/core/globals.h index f9d732ef159..67937c56d84 100644 --- a/core/globals.h +++ b/core/globals.h @@ -39,7 +39,7 @@ class Globals : public Object { - OBJ_TYPE( Globals, Object ); + GDCLASS( Globals, Object ); _THREAD_SAFE_CLASS_ public: diff --git a/core/helper/value_evaluator.h b/core/helper/value_evaluator.h index 5d38bd4cb41..9ea03db4c6e 100644 --- a/core/helper/value_evaluator.h +++ b/core/helper/value_evaluator.h @@ -33,7 +33,7 @@ class ValueEvaluator : public Object { - OBJ_TYPE(ValueEvaluator, Object); + GDCLASS(ValueEvaluator, Object); public: virtual double eval(const String& p_text) { return p_text.to_double(); diff --git a/core/input_map.cpp b/core/input_map.cpp index 748e084a456..439bf4b7666 100644 --- a/core/input_map.cpp +++ b/core/input_map.cpp @@ -34,19 +34,19 @@ InputMap *InputMap::singleton=NULL; void InputMap::_bind_methods() { - ObjectTypeDB::bind_method(_MD("has_action","action"),&InputMap::has_action); - ObjectTypeDB::bind_method(_MD("get_action_id","action"),&InputMap::get_action_id); - ObjectTypeDB::bind_method(_MD("get_action_from_id","id"),&InputMap::get_action_from_id); - ObjectTypeDB::bind_method(_MD("get_actions"),&InputMap::_get_actions); - ObjectTypeDB::bind_method(_MD("add_action","action"),&InputMap::add_action); - ObjectTypeDB::bind_method(_MD("erase_action","action"),&InputMap::erase_action); + ClassDB::bind_method(_MD("has_action","action"),&InputMap::has_action); + ClassDB::bind_method(_MD("get_action_id","action"),&InputMap::get_action_id); + ClassDB::bind_method(_MD("get_action_from_id","id"),&InputMap::get_action_from_id); + ClassDB::bind_method(_MD("get_actions"),&InputMap::_get_actions); + ClassDB::bind_method(_MD("add_action","action"),&InputMap::add_action); + ClassDB::bind_method(_MD("erase_action","action"),&InputMap::erase_action); - ObjectTypeDB::bind_method(_MD("action_add_event","action","event"),&InputMap::action_add_event); - ObjectTypeDB::bind_method(_MD("action_has_event","action","event"),&InputMap::action_has_event); - ObjectTypeDB::bind_method(_MD("action_erase_event","action","event"),&InputMap::action_erase_event); - ObjectTypeDB::bind_method(_MD("get_action_list","action"),&InputMap::_get_action_list); - ObjectTypeDB::bind_method(_MD("event_is_action","event","action"),&InputMap::event_is_action); - ObjectTypeDB::bind_method(_MD("load_from_globals"),&InputMap::load_from_globals); + ClassDB::bind_method(_MD("action_add_event","action","event"),&InputMap::action_add_event); + ClassDB::bind_method(_MD("action_has_event","action","event"),&InputMap::action_has_event); + ClassDB::bind_method(_MD("action_erase_event","action","event"),&InputMap::action_erase_event); + ClassDB::bind_method(_MD("get_action_list","action"),&InputMap::_get_action_list); + ClassDB::bind_method(_MD("event_is_action","event","action"),&InputMap::event_is_action); + ClassDB::bind_method(_MD("load_from_globals"),&InputMap::load_from_globals); } diff --git a/core/input_map.h b/core/input_map.h index efc3a751aaf..306845fc89c 100644 --- a/core/input_map.h +++ b/core/input_map.h @@ -34,7 +34,7 @@ class InputMap : public Object { - OBJ_TYPE( InputMap, Object ); + GDCLASS( InputMap, Object ); public: struct Action { int id; diff --git a/core/io/config_file.cpp b/core/io/config_file.cpp index 1cf600a0cf9..6039a773379 100644 --- a/core/io/config_file.cpp +++ b/core/io/config_file.cpp @@ -206,17 +206,17 @@ Error ConfigFile::load(const String& p_path) { void ConfigFile::_bind_methods(){ - ObjectTypeDB::bind_method(_MD("set_value","section","key","value"),&ConfigFile::set_value); - ObjectTypeDB::bind_method(_MD("get_value:Variant","section","key","default"),&ConfigFile::get_value,DEFVAL(Variant())); + ClassDB::bind_method(_MD("set_value","section","key","value"),&ConfigFile::set_value); + ClassDB::bind_method(_MD("get_value:Variant","section","key","default"),&ConfigFile::get_value,DEFVAL(Variant())); - ObjectTypeDB::bind_method(_MD("has_section","section"),&ConfigFile::has_section); - ObjectTypeDB::bind_method(_MD("has_section_key","section","key"),&ConfigFile::has_section_key); + ClassDB::bind_method(_MD("has_section","section"),&ConfigFile::has_section); + ClassDB::bind_method(_MD("has_section_key","section","key"),&ConfigFile::has_section_key); - ObjectTypeDB::bind_method(_MD("get_sections"),&ConfigFile::_get_sections); - ObjectTypeDB::bind_method(_MD("get_section_keys","section"),&ConfigFile::_get_section_keys); + ClassDB::bind_method(_MD("get_sections"),&ConfigFile::_get_sections); + ClassDB::bind_method(_MD("get_section_keys","section"),&ConfigFile::_get_section_keys); - ObjectTypeDB::bind_method(_MD("load:Error","path"),&ConfigFile::load); - ObjectTypeDB::bind_method(_MD("save:Error","path"),&ConfigFile::save); + ClassDB::bind_method(_MD("load:Error","path"),&ConfigFile::load); + ClassDB::bind_method(_MD("save:Error","path"),&ConfigFile::save); } diff --git a/core/io/config_file.h b/core/io/config_file.h index 6481f05222a..bd71fa62c66 100644 --- a/core/io/config_file.h +++ b/core/io/config_file.h @@ -34,7 +34,7 @@ class ConfigFile : public Reference { - OBJ_TYPE(ConfigFile,Reference); + GDCLASS(ConfigFile,Reference); Map< String, Map > values; diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index 4f14a1fc4dc..4051ae302f3 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -639,32 +639,32 @@ Error HTTPClient::_get_http_data(uint8_t* p_buffer, int p_bytes,int &r_received) void HTTPClient::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_ip_type","ip_type"),&HTTPClient::set_ip_type); - ObjectTypeDB::bind_method(_MD("connect:Error","host","port","use_ssl","verify_host"),&HTTPClient::connect,DEFVAL(false),DEFVAL(true)); - ObjectTypeDB::bind_method(_MD("set_connection","connection:StreamPeer"),&HTTPClient::set_connection); - ObjectTypeDB::bind_method(_MD("get_connection:StreamPeer"),&HTTPClient::get_connection); - ObjectTypeDB::bind_method(_MD("request_raw","method","url","headers","body"),&HTTPClient::request_raw); - ObjectTypeDB::bind_method(_MD("request","method","url","headers","body"),&HTTPClient::request,DEFVAL(String())); - ObjectTypeDB::bind_method(_MD("send_body_text","body"),&HTTPClient::send_body_text); - ObjectTypeDB::bind_method(_MD("send_body_data","body"),&HTTPClient::send_body_data); - ObjectTypeDB::bind_method(_MD("close"),&HTTPClient::close); + ClassDB::bind_method(_MD("set_ip_type","ip_type"),&HTTPClient::set_ip_type); + ClassDB::bind_method(_MD("connect:Error","host","port","use_ssl","verify_host"),&HTTPClient::connect,DEFVAL(false),DEFVAL(true)); + ClassDB::bind_method(_MD("set_connection","connection:StreamPeer"),&HTTPClient::set_connection); + ClassDB::bind_method(_MD("get_connection:StreamPeer"),&HTTPClient::get_connection); + ClassDB::bind_method(_MD("request_raw","method","url","headers","body"),&HTTPClient::request_raw); + ClassDB::bind_method(_MD("request","method","url","headers","body"),&HTTPClient::request,DEFVAL(String())); + ClassDB::bind_method(_MD("send_body_text","body"),&HTTPClient::send_body_text); + ClassDB::bind_method(_MD("send_body_data","body"),&HTTPClient::send_body_data); + ClassDB::bind_method(_MD("close"),&HTTPClient::close); - ObjectTypeDB::bind_method(_MD("has_response"),&HTTPClient::has_response); - ObjectTypeDB::bind_method(_MD("is_response_chunked"),&HTTPClient::is_response_chunked); - ObjectTypeDB::bind_method(_MD("get_response_code"),&HTTPClient::get_response_code); - ObjectTypeDB::bind_method(_MD("get_response_headers"),&HTTPClient::_get_response_headers); - ObjectTypeDB::bind_method(_MD("get_response_headers_as_dictionary"),&HTTPClient::_get_response_headers_as_dictionary); - ObjectTypeDB::bind_method(_MD("get_response_body_length"),&HTTPClient::get_response_body_length); - ObjectTypeDB::bind_method(_MD("read_response_body_chunk"),&HTTPClient::read_response_body_chunk); - ObjectTypeDB::bind_method(_MD("set_read_chunk_size","bytes"),&HTTPClient::set_read_chunk_size); + ClassDB::bind_method(_MD("has_response"),&HTTPClient::has_response); + ClassDB::bind_method(_MD("is_response_chunked"),&HTTPClient::is_response_chunked); + ClassDB::bind_method(_MD("get_response_code"),&HTTPClient::get_response_code); + ClassDB::bind_method(_MD("get_response_headers"),&HTTPClient::_get_response_headers); + ClassDB::bind_method(_MD("get_response_headers_as_dictionary"),&HTTPClient::_get_response_headers_as_dictionary); + ClassDB::bind_method(_MD("get_response_body_length"),&HTTPClient::get_response_body_length); + ClassDB::bind_method(_MD("read_response_body_chunk"),&HTTPClient::read_response_body_chunk); + ClassDB::bind_method(_MD("set_read_chunk_size","bytes"),&HTTPClient::set_read_chunk_size); - ObjectTypeDB::bind_method(_MD("set_blocking_mode","enabled"),&HTTPClient::set_blocking_mode); - ObjectTypeDB::bind_method(_MD("is_blocking_mode_enabled"),&HTTPClient::is_blocking_mode_enabled); + ClassDB::bind_method(_MD("set_blocking_mode","enabled"),&HTTPClient::set_blocking_mode); + ClassDB::bind_method(_MD("is_blocking_mode_enabled"),&HTTPClient::is_blocking_mode_enabled); - ObjectTypeDB::bind_method(_MD("get_status"),&HTTPClient::get_status); - ObjectTypeDB::bind_method(_MD("poll:Error"),&HTTPClient::poll); + ClassDB::bind_method(_MD("get_status"),&HTTPClient::get_status); + ClassDB::bind_method(_MD("poll:Error"),&HTTPClient::poll); - ObjectTypeDB::bind_method(_MD("query_string_from_dict:String","fields"),&HTTPClient::query_string_from_dict); + ClassDB::bind_method(_MD("query_string_from_dict:String","fields"),&HTTPClient::query_string_from_dict); BIND_CONSTANT( METHOD_GET ); diff --git a/core/io/http_client.h b/core/io/http_client.h index ef0a687cddb..2e78882303e 100644 --- a/core/io/http_client.h +++ b/core/io/http_client.h @@ -37,7 +37,7 @@ class HTTPClient : public Reference { - OBJ_TYPE(HTTPClient,Reference); + GDCLASS(HTTPClient,Reference); public: enum ResponseCode { diff --git a/core/io/ip.cpp b/core/io/ip.cpp index b057d72e492..0eb1f221c9a 100644 --- a/core/io/ip.cpp +++ b/core/io/ip.cpp @@ -218,13 +218,13 @@ Array IP::_get_local_addresses() const { void IP::_bind_methods() { - ObjectTypeDB::bind_method(_MD("resolve_hostname","host","ip_type"),&IP::resolve_hostname,DEFVAL(IP::TYPE_ANY)); - ObjectTypeDB::bind_method(_MD("resolve_hostname_queue_item","host","ip_type"),&IP::resolve_hostname_queue_item,DEFVAL(IP::TYPE_ANY)); - ObjectTypeDB::bind_method(_MD("get_resolve_item_status","id"),&IP::get_resolve_item_status); - ObjectTypeDB::bind_method(_MD("get_resolve_item_address","id"),&IP::get_resolve_item_address); - ObjectTypeDB::bind_method(_MD("erase_resolve_item","id"),&IP::erase_resolve_item); - ObjectTypeDB::bind_method(_MD("get_local_addresses"),&IP::_get_local_addresses); - ObjectTypeDB::bind_method(_MD("clear_cache"),&IP::clear_cache, DEFVAL("")); + ClassDB::bind_method(_MD("resolve_hostname","host","ip_type"),&IP::resolve_hostname,DEFVAL(IP::TYPE_ANY)); + ClassDB::bind_method(_MD("resolve_hostname_queue_item","host","ip_type"),&IP::resolve_hostname_queue_item,DEFVAL(IP::TYPE_ANY)); + ClassDB::bind_method(_MD("get_resolve_item_status","id"),&IP::get_resolve_item_status); + ClassDB::bind_method(_MD("get_resolve_item_address","id"),&IP::get_resolve_item_address); + ClassDB::bind_method(_MD("erase_resolve_item","id"),&IP::erase_resolve_item); + ClassDB::bind_method(_MD("get_local_addresses"),&IP::_get_local_addresses); + ClassDB::bind_method(_MD("clear_cache"),&IP::clear_cache, DEFVAL("")); BIND_CONSTANT( RESOLVER_STATUS_NONE ); BIND_CONSTANT( RESOLVER_STATUS_WAITING ); diff --git a/core/io/ip.h b/core/io/ip.h index 0a0e75fe7b6..3e028f2613f 100644 --- a/core/io/ip.h +++ b/core/io/ip.h @@ -36,7 +36,7 @@ struct _IP_ResolverPrivate; class IP : public Object { - OBJ_TYPE( IP, Object ); + GDCLASS( IP, Object ); OBJ_CATEGORY("Networking"); public: diff --git a/core/io/networked_multiplayer_peer.cpp b/core/io/networked_multiplayer_peer.cpp index 47e5f3729cf..6133401a8c3 100644 --- a/core/io/networked_multiplayer_peer.cpp +++ b/core/io/networked_multiplayer_peer.cpp @@ -3,18 +3,18 @@ void NetworkedMultiplayerPeer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_transfer_mode","mode"), &NetworkedMultiplayerPeer::set_transfer_mode ); - ObjectTypeDB::bind_method(_MD("set_target_peer","id"), &NetworkedMultiplayerPeer::set_target_peer ); + ClassDB::bind_method(_MD("set_transfer_mode","mode"), &NetworkedMultiplayerPeer::set_transfer_mode ); + ClassDB::bind_method(_MD("set_target_peer","id"), &NetworkedMultiplayerPeer::set_target_peer ); - ObjectTypeDB::bind_method(_MD("get_packet_peer"), &NetworkedMultiplayerPeer::get_packet_peer ); + ClassDB::bind_method(_MD("get_packet_peer"), &NetworkedMultiplayerPeer::get_packet_peer ); - ObjectTypeDB::bind_method(_MD("poll"), &NetworkedMultiplayerPeer::poll ); + ClassDB::bind_method(_MD("poll"), &NetworkedMultiplayerPeer::poll ); - ObjectTypeDB::bind_method(_MD("get_connection_status"), &NetworkedMultiplayerPeer::get_connection_status ); - ObjectTypeDB::bind_method(_MD("get_unique_id"), &NetworkedMultiplayerPeer::get_unique_id ); + ClassDB::bind_method(_MD("get_connection_status"), &NetworkedMultiplayerPeer::get_connection_status ); + ClassDB::bind_method(_MD("get_unique_id"), &NetworkedMultiplayerPeer::get_unique_id ); - ObjectTypeDB::bind_method(_MD("set_refuse_new_connections","enable"), &NetworkedMultiplayerPeer::set_refuse_new_connections ); - ObjectTypeDB::bind_method(_MD("is_refusing_new_connections"), &NetworkedMultiplayerPeer::is_refusing_new_connections ); + ClassDB::bind_method(_MD("set_refuse_new_connections","enable"), &NetworkedMultiplayerPeer::set_refuse_new_connections ); + ClassDB::bind_method(_MD("is_refusing_new_connections"), &NetworkedMultiplayerPeer::is_refusing_new_connections ); BIND_CONSTANT( TRANSFER_MODE_UNRELIABLE ); BIND_CONSTANT( TRANSFER_MODE_UNRELIABLE_ORDERED ); diff --git a/core/io/networked_multiplayer_peer.h b/core/io/networked_multiplayer_peer.h index 485200a9a92..a59d9367d1c 100644 --- a/core/io/networked_multiplayer_peer.h +++ b/core/io/networked_multiplayer_peer.h @@ -5,7 +5,7 @@ class NetworkedMultiplayerPeer : public PacketPeer { - OBJ_TYPE(NetworkedMultiplayerPeer,PacketPeer); + GDCLASS(NetworkedMultiplayerPeer,PacketPeer); protected: static void _bind_methods(); diff --git a/core/io/packet_peer.cpp b/core/io/packet_peer.cpp index fc95aa0b1e1..1d05e95010b 100644 --- a/core/io/packet_peer.cpp +++ b/core/io/packet_peer.cpp @@ -126,12 +126,12 @@ Error PacketPeer::_get_packet_error() const { void PacketPeer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_var:Variant"),&PacketPeer::_bnd_get_var); - ObjectTypeDB::bind_method(_MD("put_var", "var:Variant"),&PacketPeer::put_var); - ObjectTypeDB::bind_method(_MD("get_packet"),&PacketPeer::_get_packet); - ObjectTypeDB::bind_method(_MD("put_packet:Error", "buffer"),&PacketPeer::_put_packet); - ObjectTypeDB::bind_method(_MD("get_packet_error:Error"),&PacketPeer::_get_packet_error); - ObjectTypeDB::bind_method(_MD("get_available_packet_count"),&PacketPeer::get_available_packet_count); + ClassDB::bind_method(_MD("get_var:Variant"),&PacketPeer::_bnd_get_var); + ClassDB::bind_method(_MD("put_var", "var:Variant"),&PacketPeer::put_var); + ClassDB::bind_method(_MD("get_packet"),&PacketPeer::_get_packet); + ClassDB::bind_method(_MD("put_packet:Error", "buffer"),&PacketPeer::_put_packet); + ClassDB::bind_method(_MD("get_packet_error:Error"),&PacketPeer::_get_packet_error); + ClassDB::bind_method(_MD("get_available_packet_count"),&PacketPeer::get_available_packet_count); }; /***************/ @@ -145,7 +145,7 @@ void PacketPeerStream::_set_stream_peer(REF p_peer) { void PacketPeerStream::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_stream_peer","peer:StreamPeer"),&PacketPeerStream::_set_stream_peer); + ClassDB::bind_method(_MD("set_stream_peer","peer:StreamPeer"),&PacketPeerStream::_set_stream_peer); } Error PacketPeerStream::_poll_buffer() const { diff --git a/core/io/packet_peer.h b/core/io/packet_peer.h index ec2f46b82d8..7aa8d8d4565 100644 --- a/core/io/packet_peer.h +++ b/core/io/packet_peer.h @@ -34,7 +34,7 @@ #include "ring_buffer.h" class PacketPeer : public Reference { - OBJ_TYPE( PacketPeer, Reference ); + GDCLASS( PacketPeer, Reference ); Variant _bnd_get_var() const; void _bnd_put_var(const Variant& p_var); @@ -71,7 +71,7 @@ public: class PacketPeerStream : public PacketPeer { - OBJ_TYPE(PacketPeerStream,PacketPeer); + GDCLASS(PacketPeerStream,PacketPeer); //the way the buffers work sucks, will change later diff --git a/core/io/packet_peer_udp.cpp b/core/io/packet_peer_udp.cpp index 6216176e772..91d1fc5f98a 100644 --- a/core/io/packet_peer_udp.cpp +++ b/core/io/packet_peer_udp.cpp @@ -58,15 +58,15 @@ void PacketPeerUDP::set_ip_type(IP::Type p_type) { void PacketPeerUDP::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_ip_type","ip_type"),&PacketPeerUDP::set_ip_type); - ObjectTypeDB::bind_method(_MD("listen:Error","port", "recv_buf_size"),&PacketPeerUDP::listen,DEFVAL(65536)); - ObjectTypeDB::bind_method(_MD("close"),&PacketPeerUDP::close); - ObjectTypeDB::bind_method(_MD("wait:Error"),&PacketPeerUDP::wait); - ObjectTypeDB::bind_method(_MD("is_listening"),&PacketPeerUDP::is_listening); - ObjectTypeDB::bind_method(_MD("get_packet_ip"),&PacketPeerUDP::_get_packet_ip); - //ObjectTypeDB::bind_method(_MD("get_packet_address"),&PacketPeerUDP::_get_packet_address); - ObjectTypeDB::bind_method(_MD("get_packet_port"),&PacketPeerUDP::get_packet_port); - ObjectTypeDB::bind_method(_MD("set_send_address","host","port"),&PacketPeerUDP::_set_send_address); + ClassDB::bind_method(_MD("set_ip_type","ip_type"),&PacketPeerUDP::set_ip_type); + ClassDB::bind_method(_MD("listen:Error","port", "recv_buf_size"),&PacketPeerUDP::listen,DEFVAL(65536)); + ClassDB::bind_method(_MD("close"),&PacketPeerUDP::close); + ClassDB::bind_method(_MD("wait:Error"),&PacketPeerUDP::wait); + ClassDB::bind_method(_MD("is_listening"),&PacketPeerUDP::is_listening); + ClassDB::bind_method(_MD("get_packet_ip"),&PacketPeerUDP::_get_packet_ip); + //ClassDB::bind_method(_MD("get_packet_address"),&PacketPeerUDP::_get_packet_address); + ClassDB::bind_method(_MD("get_packet_port"),&PacketPeerUDP::get_packet_port); + ClassDB::bind_method(_MD("set_send_address","host","port"),&PacketPeerUDP::_set_send_address); } diff --git a/core/io/packet_peer_udp.h b/core/io/packet_peer_udp.h index 5f80ea08fcd..17a2817f342 100644 --- a/core/io/packet_peer_udp.h +++ b/core/io/packet_peer_udp.h @@ -34,7 +34,7 @@ #include "io/packet_peer.h" class PacketPeerUDP : public PacketPeer { - OBJ_TYPE(PacketPeerUDP,PacketPeer); + GDCLASS(PacketPeerUDP,PacketPeer); protected: diff --git a/core/io/pck_packer.cpp b/core/io/pck_packer.cpp index 6d35acf1829..a9f357a7c8b 100644 --- a/core/io/pck_packer.cpp +++ b/core/io/pck_packer.cpp @@ -52,9 +52,9 @@ static void _pad(FileAccess* p_file, int p_bytes) { void PCKPacker::_bind_methods() { - ObjectTypeDB::bind_method(_MD("pck_start","pck_name","alignment"),&PCKPacker::pck_start); - ObjectTypeDB::bind_method(_MD("add_file","pck_path","source_path"),&PCKPacker::add_file); - ObjectTypeDB::bind_method(_MD("flush","verbose"),&PCKPacker::flush); + ClassDB::bind_method(_MD("pck_start","pck_name","alignment"),&PCKPacker::pck_start); + ClassDB::bind_method(_MD("add_file","pck_path","source_path"),&PCKPacker::add_file); + ClassDB::bind_method(_MD("flush","verbose"),&PCKPacker::flush); }; diff --git a/core/io/pck_packer.h b/core/io/pck_packer.h index 2ed5c050c6f..a4eba04f2d5 100644 --- a/core/io/pck_packer.h +++ b/core/io/pck_packer.h @@ -32,7 +32,7 @@ class FileAccess; class PCKPacker : public Reference { - OBJ_TYPE(PCKPacker, Reference); + GDCLASS(PCKPacker, Reference); FileAccess* file; int alignment; diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index 109d2d811e7..953192306f5 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -700,7 +700,7 @@ Error ResourceInteractiveLoaderBinary::poll(){ String t = get_unicode_string(); - Object *obj = ObjectTypeDB::instance(t); + Object *obj = ClassDB::instance(t); if (!obj) { error=ERR_FILE_CORRUPT; ERR_EXPLAIN(local_path+":Resource of unrecognized type in file: "+t); @@ -711,7 +711,7 @@ Error ResourceInteractiveLoaderBinary::poll(){ if (!r) { error=ERR_FILE_CORRUPT; memdelete(obj); //bye - ERR_EXPLAIN(local_path+":Resoucre type in resource field not a resource, type is: "+obj->get_type()); + ERR_EXPLAIN(local_path+":Resoucre type in resource field not a resource, type is: "+obj->get_class()); ERR_FAIL_COND_V(!r,ERR_FILE_CORRUPT); } @@ -1064,7 +1064,7 @@ void ResourceFormatLoaderBinary::get_recognized_extensions_for_type(const String } List extensions; - ObjectTypeDB::get_extensions_for_type(p_type,&extensions); + ClassDB::get_extensions_for_type(p_type,&extensions); extensions.sort(); @@ -1077,7 +1077,7 @@ void ResourceFormatLoaderBinary::get_recognized_extensions_for_type(const String void ResourceFormatLoaderBinary::get_recognized_extensions(List *p_extensions) const{ List extensions; - ObjectTypeDB::get_resource_base_extensions(&extensions); + ClassDB::get_resource_base_extensions(&extensions); extensions.sort(); for(List::Element *E=extensions.front();E;E=E->next()) { @@ -2002,7 +2002,7 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path,const RES& p_ } //f->store_32(saved_resources.size()+external_resources.size()); // load steps -not needed - save_unicode_string(p_resource->get_type()); + save_unicode_string(p_resource->get_class()); uint64_t md_at = f->get_pos(); f->store_64(0); //offset to impoty metadata for(int i=0;i<14;i++) @@ -2019,7 +2019,7 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path,const RES& p_ ResourceData &rd = resources.push_back(ResourceData())->get(); - rd.type=E->get()->get_type(); + rd.type=E->get()->get_class(); List property_list; E->get()->get_property_list( &property_list ); @@ -2064,7 +2064,7 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path,const RES& p_ for(int i=0;iget_save_type()); + save_unicode_string(save_order[i]->get_save_class()); String path = save_order[i]->get_path(); path=relative_paths?local_path.path_to_file(path):path; save_unicode_string(path); diff --git a/core/io/resource_format_xml.cpp b/core/io/resource_format_xml.cpp index 7174c40fdf0..c90adf4f57c 100644 --- a/core/io/resource_format_xml.cpp +++ b/core/io/resource_format_xml.cpp @@ -1518,7 +1518,7 @@ Error ResourceInteractiveLoaderXML::poll() { type=resource_type; } - Object *obj = ObjectTypeDB::instance(type); + Object *obj = ClassDB::instance(type); if (!obj) { error=ERR_FILE_CORRUPT; ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Object of unrecognized type in file: "+type); @@ -1529,7 +1529,7 @@ Error ResourceInteractiveLoaderXML::poll() { if (!r) { error=ERR_FILE_CORRUPT; memdelete(obj); //bye - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Object type in resource field not a resource, type is: "+obj->get_type()); + ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Object type in resource field not a resource, type is: "+obj->get_class()); ERR_FAIL_COND_V(!r,ERR_FILE_CORRUPT); } @@ -1940,7 +1940,7 @@ void ResourceFormatLoaderXML::get_recognized_extensions_for_type(const String& p } List extensions; - ObjectTypeDB::get_extensions_for_type(p_type,&extensions); + ClassDB::get_extensions_for_type(p_type,&extensions); extensions.sort(); @@ -1958,7 +1958,7 @@ void ResourceFormatLoaderXML::get_recognized_extensions_for_type(const String& p void ResourceFormatLoaderXML::get_recognized_extensions(List *p_extensions) const{ List extensions; - ObjectTypeDB::get_resource_base_extensions(&extensions); + ClassDB::get_resource_base_extensions(&extensions); extensions.sort(); for(List::Element *E=extensions.front();E;E=E->next()) { @@ -2225,7 +2225,7 @@ void ResourceFormatSaverXMLInstance::write_property(const String& p_name,const V params="external=\""+itos(external_resources[res])+"\""; } else { - params="resource_type=\""+res->get_save_type()+"\""; + params="resource_type=\""+res->get_save_class()+"\""; if (res->get_path().length() && res->get_path().find("::")==-1) { @@ -2734,7 +2734,7 @@ Error ResourceFormatSaverXMLInstance::save(const String &p_path,const RES& p_res write_string("",false); //no escape write_string("\n",false); - enter_tag("resource_file","type=\""+p_resource->get_type()+"\" subresource_count=\""+itos(saved_resources.size()+external_resources.size())+"\" version=\""+itos(VERSION_MAJOR)+"."+itos(VERSION_MINOR)+"\" version_name=\""+VERSION_FULL_NAME+"\""); + enter_tag("resource_file","type=\""+p_resource->get_class()+"\" subresource_count=\""+itos(saved_resources.size()+external_resources.size())+"\" version=\""+itos(VERSION_MAJOR)+"."+itos(VERSION_MINOR)+"\" version_name=\""+VERSION_FULL_NAME+"\""); write_string("\n",false); for(Map::Element *E=external_resources.front();E;E=E->next()) { @@ -2742,7 +2742,7 @@ Error ResourceFormatSaverXMLInstance::save(const String &p_path,const RES& p_res write_tabs(); String p = E->key()->get_path(); - enter_tag("ext_resource","path=\""+p+"\" type=\""+E->key()->get_save_type()+"\" index=\""+itos(E->get())+"\""); //bundled + enter_tag("ext_resource","path=\""+p+"\" type=\""+E->key()->get_save_class()+"\" index=\""+itos(E->get())+"\""); //bundled exit_tag("ext_resource"); //bundled write_string("\n",false); } @@ -2775,7 +2775,7 @@ Error ResourceFormatSaverXMLInstance::save(const String &p_path,const RES& p_res if (main) enter_tag("main_resource",""); //bundled else if (res->get_path().length() && res->get_path().find("::") == -1 ) - enter_tag("resource","type=\""+res->get_type()+"\" path=\""+res->get_path()+"\""); //bundled + enter_tag("resource","type=\""+res->get_class()+"\" path=\""+res->get_path()+"\""); //bundled else { if (res->get_subindex()==0) { @@ -2789,7 +2789,7 @@ Error ResourceFormatSaverXMLInstance::save(const String &p_path,const RES& p_res } int idx = res->get_subindex(); - enter_tag("resource","type=\""+res->get_type()+"\" path=\"local://"+itos(idx)+"\""); + enter_tag("resource","type=\""+res->get_class()+"\" path=\"local://"+itos(idx)+"\""); if (takeover_paths) { res->set_path(p_path+"::"+itos(idx),true); } diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 87e5d72a108..f299a75d855 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -78,16 +78,16 @@ void ResourceLoader::get_recognized_extensions_for_type(const String& p_type,Lis void ResourceInteractiveLoader::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_resource"),&ResourceInteractiveLoader::get_resource); - ObjectTypeDB::bind_method(_MD("poll"),&ResourceInteractiveLoader::poll); - ObjectTypeDB::bind_method(_MD("wait"),&ResourceInteractiveLoader::wait); - ObjectTypeDB::bind_method(_MD("get_stage"),&ResourceInteractiveLoader::get_stage); - ObjectTypeDB::bind_method(_MD("get_stage_count"),&ResourceInteractiveLoader::get_stage_count); + ClassDB::bind_method(_MD("get_resource"),&ResourceInteractiveLoader::get_resource); + ClassDB::bind_method(_MD("poll"),&ResourceInteractiveLoader::poll); + ClassDB::bind_method(_MD("wait"),&ResourceInteractiveLoader::wait); + ClassDB::bind_method(_MD("get_stage"),&ResourceInteractiveLoader::get_stage); + ClassDB::bind_method(_MD("get_stage_count"),&ResourceInteractiveLoader::get_stage_count); } class ResourceInteractiveLoaderDefault : public ResourceInteractiveLoader { - OBJ_TYPE( ResourceInteractiveLoaderDefault, ResourceInteractiveLoader ); + GDCLASS( ResourceInteractiveLoaderDefault, ResourceInteractiveLoader ); public: Ref resource; @@ -285,7 +285,7 @@ String ResourceLoader::find_complete_path(const String& p_path,const String& p_t for(List::Element *E=candidates.front();E;E=E->next()) { String rt = get_resource_type(E->get()); - if (ObjectTypeDB::is_type(rt,p_type)) { + if (ClassDB::is_parent_class(rt,p_type)) { return E->get(); } } diff --git a/core/io/resource_loader.h b/core/io/resource_loader.h index de54dbde66f..7979bd02a7a 100644 --- a/core/io/resource_loader.h +++ b/core/io/resource_loader.h @@ -37,7 +37,7 @@ class ResourceInteractiveLoader : public Reference { - OBJ_TYPE(ResourceInteractiveLoader,Reference); + GDCLASS(ResourceInteractiveLoader,Reference); protected: static void _bind_methods(); diff --git a/core/io/stream_peer.cpp b/core/io/stream_peer.cpp index bc519147d79..218e17278e3 100644 --- a/core/io/stream_peer.cpp +++ b/core/io/stream_peer.cpp @@ -389,57 +389,57 @@ Variant StreamPeer::get_var(){ void StreamPeer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("put_data","data"),&StreamPeer::_put_data); - ObjectTypeDB::bind_method(_MD("put_partial_data","data"),&StreamPeer::_put_partial_data); + ClassDB::bind_method(_MD("put_data","data"),&StreamPeer::_put_data); + ClassDB::bind_method(_MD("put_partial_data","data"),&StreamPeer::_put_partial_data); - ObjectTypeDB::bind_method(_MD("get_data","bytes"),&StreamPeer::_get_data); - ObjectTypeDB::bind_method(_MD("get_partial_data","bytes"),&StreamPeer::_get_partial_data); + ClassDB::bind_method(_MD("get_data","bytes"),&StreamPeer::_get_data); + ClassDB::bind_method(_MD("get_partial_data","bytes"),&StreamPeer::_get_partial_data); - ObjectTypeDB::bind_method(_MD("get_available_bytes"),&StreamPeer::get_available_bytes); + ClassDB::bind_method(_MD("get_available_bytes"),&StreamPeer::get_available_bytes); - ObjectTypeDB::bind_method(_MD("set_big_endian","enable"),&StreamPeer::set_big_endian); - ObjectTypeDB::bind_method(_MD("is_big_endian_enabled"),&StreamPeer::is_big_endian_enabled); + ClassDB::bind_method(_MD("set_big_endian","enable"),&StreamPeer::set_big_endian); + ClassDB::bind_method(_MD("is_big_endian_enabled"),&StreamPeer::is_big_endian_enabled); - ObjectTypeDB::bind_method(_MD("put_8","val"),&StreamPeer::put_8); - ObjectTypeDB::bind_method(_MD("put_u8","val"),&StreamPeer::put_u8); - ObjectTypeDB::bind_method(_MD("put_16","val"),&StreamPeer::put_16); - ObjectTypeDB::bind_method(_MD("put_u16","val"),&StreamPeer::put_u16); - ObjectTypeDB::bind_method(_MD("put_32","val"),&StreamPeer::put_32); - ObjectTypeDB::bind_method(_MD("put_u32","val"),&StreamPeer::put_u32); - ObjectTypeDB::bind_method(_MD("put_64","val"),&StreamPeer::put_64); - ObjectTypeDB::bind_method(_MD("put_u64","val"),&StreamPeer::put_u64); - ObjectTypeDB::bind_method(_MD("put_float","val"),&StreamPeer::put_float); - ObjectTypeDB::bind_method(_MD("put_double","val"),&StreamPeer::put_double); - ObjectTypeDB::bind_method(_MD("put_utf8_string","val"),&StreamPeer::put_utf8_string); - ObjectTypeDB::bind_method(_MD("put_var","val:Variant"),&StreamPeer::put_var); + ClassDB::bind_method(_MD("put_8","val"),&StreamPeer::put_8); + ClassDB::bind_method(_MD("put_u8","val"),&StreamPeer::put_u8); + ClassDB::bind_method(_MD("put_16","val"),&StreamPeer::put_16); + ClassDB::bind_method(_MD("put_u16","val"),&StreamPeer::put_u16); + ClassDB::bind_method(_MD("put_32","val"),&StreamPeer::put_32); + ClassDB::bind_method(_MD("put_u32","val"),&StreamPeer::put_u32); + ClassDB::bind_method(_MD("put_64","val"),&StreamPeer::put_64); + ClassDB::bind_method(_MD("put_u64","val"),&StreamPeer::put_u64); + ClassDB::bind_method(_MD("put_float","val"),&StreamPeer::put_float); + ClassDB::bind_method(_MD("put_double","val"),&StreamPeer::put_double); + ClassDB::bind_method(_MD("put_utf8_string","val"),&StreamPeer::put_utf8_string); + ClassDB::bind_method(_MD("put_var","val:Variant"),&StreamPeer::put_var); - ObjectTypeDB::bind_method(_MD("get_8"),&StreamPeer::get_8); - ObjectTypeDB::bind_method(_MD("get_u8"),&StreamPeer::get_u8); - ObjectTypeDB::bind_method(_MD("get_16"),&StreamPeer::get_16); - ObjectTypeDB::bind_method(_MD("get_u16"),&StreamPeer::get_u16); - ObjectTypeDB::bind_method(_MD("get_32"),&StreamPeer::get_32); - ObjectTypeDB::bind_method(_MD("get_u32"),&StreamPeer::get_u32); - ObjectTypeDB::bind_method(_MD("get_64"),&StreamPeer::get_64); - ObjectTypeDB::bind_method(_MD("get_u64"),&StreamPeer::get_u64); - ObjectTypeDB::bind_method(_MD("get_float"),&StreamPeer::get_float); - ObjectTypeDB::bind_method(_MD("get_double"),&StreamPeer::get_double); - ObjectTypeDB::bind_method(_MD("get_string","bytes"),&StreamPeer::get_string); - ObjectTypeDB::bind_method(_MD("get_utf8_string","bytes"),&StreamPeer::get_utf8_string); - ObjectTypeDB::bind_method(_MD("get_var:Variant"),&StreamPeer::get_var); + ClassDB::bind_method(_MD("get_8"),&StreamPeer::get_8); + ClassDB::bind_method(_MD("get_u8"),&StreamPeer::get_u8); + ClassDB::bind_method(_MD("get_16"),&StreamPeer::get_16); + ClassDB::bind_method(_MD("get_u16"),&StreamPeer::get_u16); + ClassDB::bind_method(_MD("get_32"),&StreamPeer::get_32); + ClassDB::bind_method(_MD("get_u32"),&StreamPeer::get_u32); + ClassDB::bind_method(_MD("get_64"),&StreamPeer::get_64); + ClassDB::bind_method(_MD("get_u64"),&StreamPeer::get_u64); + ClassDB::bind_method(_MD("get_float"),&StreamPeer::get_float); + ClassDB::bind_method(_MD("get_double"),&StreamPeer::get_double); + ClassDB::bind_method(_MD("get_string","bytes"),&StreamPeer::get_string); + ClassDB::bind_method(_MD("get_utf8_string","bytes"),&StreamPeer::get_utf8_string); + ClassDB::bind_method(_MD("get_var:Variant"),&StreamPeer::get_var); } //////////////////////////////// void StreamPeerBuffer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("seek","pos"),&StreamPeerBuffer::seek); - ObjectTypeDB::bind_method(_MD("get_size"),&StreamPeerBuffer::get_size); - ObjectTypeDB::bind_method(_MD("get_pos"),&StreamPeerBuffer::get_pos); - ObjectTypeDB::bind_method(_MD("resize","size"),&StreamPeerBuffer::resize); - ObjectTypeDB::bind_method(_MD("set_data_array","data"),&StreamPeerBuffer::set_data_array); - ObjectTypeDB::bind_method(_MD("get_data_array"),&StreamPeerBuffer::get_data_array); - ObjectTypeDB::bind_method(_MD("clear"),&StreamPeerBuffer::clear); - ObjectTypeDB::bind_method(_MD("duplicate:StreamPeerBuffer"),&StreamPeerBuffer::duplicate); + ClassDB::bind_method(_MD("seek","pos"),&StreamPeerBuffer::seek); + ClassDB::bind_method(_MD("get_size"),&StreamPeerBuffer::get_size); + ClassDB::bind_method(_MD("get_pos"),&StreamPeerBuffer::get_pos); + ClassDB::bind_method(_MD("resize","size"),&StreamPeerBuffer::resize); + ClassDB::bind_method(_MD("set_data_array","data"),&StreamPeerBuffer::set_data_array); + ClassDB::bind_method(_MD("get_data_array"),&StreamPeerBuffer::get_data_array); + ClassDB::bind_method(_MD("clear"),&StreamPeerBuffer::clear); + ClassDB::bind_method(_MD("duplicate:StreamPeerBuffer"),&StreamPeerBuffer::duplicate); } diff --git a/core/io/stream_peer.h b/core/io/stream_peer.h index 1c415ed5a92..232a908dd76 100644 --- a/core/io/stream_peer.h +++ b/core/io/stream_peer.h @@ -32,7 +32,7 @@ #include "reference.h" class StreamPeer : public Reference { - OBJ_TYPE( StreamPeer, Reference ); + GDCLASS( StreamPeer, Reference ); OBJ_CATEGORY("Networking"); protected: static void _bind_methods(); @@ -94,7 +94,7 @@ public: class StreamPeerBuffer : public StreamPeer { - OBJ_TYPE(StreamPeerBuffer,StreamPeer); + GDCLASS(StreamPeerBuffer,StreamPeer); DVector data; int pointer; diff --git a/core/io/stream_peer_ssl.cpp b/core/io/stream_peer_ssl.cpp index a9367915611..639d8481106 100644 --- a/core/io/stream_peer_ssl.cpp +++ b/core/io/stream_peer_ssl.cpp @@ -57,10 +57,10 @@ bool StreamPeerSSL::is_available() { void StreamPeerSSL::_bind_methods() { - ObjectTypeDB::bind_method(_MD("accept:Error","stream:StreamPeer"),&StreamPeerSSL::accept); - ObjectTypeDB::bind_method(_MD("connect:Error","stream:StreamPeer","validate_certs","for_hostname"),&StreamPeerSSL::connect,DEFVAL(false),DEFVAL(String())); - ObjectTypeDB::bind_method(_MD("get_status"),&StreamPeerSSL::get_status); - ObjectTypeDB::bind_method(_MD("disconnect"),&StreamPeerSSL::disconnect); + ClassDB::bind_method(_MD("accept:Error","stream:StreamPeer"),&StreamPeerSSL::accept); + ClassDB::bind_method(_MD("connect:Error","stream:StreamPeer","validate_certs","for_hostname"),&StreamPeerSSL::connect,DEFVAL(false),DEFVAL(String())); + ClassDB::bind_method(_MD("get_status"),&StreamPeerSSL::get_status); + ClassDB::bind_method(_MD("disconnect"),&StreamPeerSSL::disconnect); BIND_CONSTANT( STATUS_DISCONNECTED ); BIND_CONSTANT( STATUS_CONNECTED ); BIND_CONSTANT( STATUS_ERROR_NO_CERTIFICATE ); diff --git a/core/io/stream_peer_ssl.h b/core/io/stream_peer_ssl.h index 2e9ba526444..b36534fcfab 100644 --- a/core/io/stream_peer_ssl.h +++ b/core/io/stream_peer_ssl.h @@ -32,7 +32,7 @@ #include "io/stream_peer.h" class StreamPeerSSL : public StreamPeer { - OBJ_TYPE(StreamPeerSSL,StreamPeer); + GDCLASS(StreamPeerSSL,StreamPeer); public: typedef void (*LoadCertsFromMemory)(const ByteArray& p_certs); diff --git a/core/io/stream_peer_tcp.cpp b/core/io/stream_peer_tcp.cpp index 52cc11a4a47..2218057cf70 100644 --- a/core/io/stream_peer_tcp.cpp +++ b/core/io/stream_peer_tcp.cpp @@ -52,13 +52,13 @@ void StreamPeerTCP::set_ip_type(IP::Type p_type) { void StreamPeerTCP::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_ip_type","ip_type"),&StreamPeerTCP::set_ip_type); - ObjectTypeDB::bind_method(_MD("connect","host","port"),&StreamPeerTCP::_connect); - ObjectTypeDB::bind_method(_MD("is_connected"),&StreamPeerTCP::is_connected); - ObjectTypeDB::bind_method(_MD("get_status"),&StreamPeerTCP::get_status); - ObjectTypeDB::bind_method(_MD("get_connected_host"),&StreamPeerTCP::get_connected_host); - ObjectTypeDB::bind_method(_MD("get_connected_port"),&StreamPeerTCP::get_connected_port); - ObjectTypeDB::bind_method(_MD("disconnect"),&StreamPeerTCP::disconnect); + ClassDB::bind_method(_MD("set_ip_type","ip_type"),&StreamPeerTCP::set_ip_type); + ClassDB::bind_method(_MD("connect","host","port"),&StreamPeerTCP::_connect); + ClassDB::bind_method(_MD("is_connected"),&StreamPeerTCP::is_connected); + ClassDB::bind_method(_MD("get_status"),&StreamPeerTCP::get_status); + ClassDB::bind_method(_MD("get_connected_host"),&StreamPeerTCP::get_connected_host); + ClassDB::bind_method(_MD("get_connected_port"),&StreamPeerTCP::get_connected_port); + ClassDB::bind_method(_MD("disconnect"),&StreamPeerTCP::disconnect); BIND_CONSTANT( STATUS_NONE ); BIND_CONSTANT( STATUS_CONNECTING ); diff --git a/core/io/stream_peer_tcp.h b/core/io/stream_peer_tcp.h index abc5947fffe..8f6dfaf3f8e 100644 --- a/core/io/stream_peer_tcp.h +++ b/core/io/stream_peer_tcp.h @@ -36,7 +36,7 @@ class StreamPeerTCP : public StreamPeer { - OBJ_TYPE( StreamPeerTCP, StreamPeer ); + GDCLASS( StreamPeerTCP, StreamPeer ); OBJ_CATEGORY("Networking"); public: diff --git a/core/io/tcp_server.cpp b/core/io/tcp_server.cpp index 431b17321bd..751dfbadca6 100644 --- a/core/io/tcp_server.cpp +++ b/core/io/tcp_server.cpp @@ -61,11 +61,11 @@ void TCP_Server::set_ip_type(IP::Type p_type) { void TCP_Server::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_ip_type","ip_type"),&TCP_Server::set_ip_type); - ObjectTypeDB::bind_method(_MD("listen","port","accepted_hosts"),&TCP_Server::_listen,DEFVAL(DVector())); - ObjectTypeDB::bind_method(_MD("is_connection_available"),&TCP_Server::is_connection_available); - ObjectTypeDB::bind_method(_MD("take_connection"),&TCP_Server::take_connection); - ObjectTypeDB::bind_method(_MD("stop"),&TCP_Server::stop); + ClassDB::bind_method(_MD("set_ip_type","ip_type"),&TCP_Server::set_ip_type); + ClassDB::bind_method(_MD("listen","port","accepted_hosts"),&TCP_Server::_listen,DEFVAL(DVector())); + ClassDB::bind_method(_MD("is_connection_available"),&TCP_Server::is_connection_available); + ClassDB::bind_method(_MD("take_connection"),&TCP_Server::take_connection); + ClassDB::bind_method(_MD("stop"),&TCP_Server::stop); } diff --git a/core/io/tcp_server.h b/core/io/tcp_server.h index 14153a3324d..5fd65575f60 100644 --- a/core/io/tcp_server.h +++ b/core/io/tcp_server.h @@ -35,7 +35,7 @@ class TCP_Server : public Reference { - OBJ_TYPE( TCP_Server, Reference ); + GDCLASS( TCP_Server, Reference ); protected: IP::Type ip_type; diff --git a/core/io/xml_parser.cpp b/core/io/xml_parser.cpp index 9e194d10538..0322f230561 100644 --- a/core/io/xml_parser.cpp +++ b/core/io/xml_parser.cpp @@ -379,23 +379,23 @@ Error XMLParser::seek(uint64_t p_pos) { void XMLParser::_bind_methods() { - ObjectTypeDB::bind_method(_MD("read"),&XMLParser::read); - ObjectTypeDB::bind_method(_MD("get_node_type"),&XMLParser::get_node_type); - ObjectTypeDB::bind_method(_MD("get_node_name"),&XMLParser::get_node_name); - ObjectTypeDB::bind_method(_MD("get_node_data"),&XMLParser::get_node_data); - ObjectTypeDB::bind_method(_MD("get_node_offset"),&XMLParser::get_node_offset); - ObjectTypeDB::bind_method(_MD("get_attribute_count"),&XMLParser::get_attribute_count); - ObjectTypeDB::bind_method(_MD("get_attribute_name","idx"),&XMLParser::get_attribute_name); - ObjectTypeDB::bind_method(_MD("get_attribute_value","idx"),(String (XMLParser::*)(int) const) &XMLParser::get_attribute_value); - ObjectTypeDB::bind_method(_MD("has_attribute","name"),&XMLParser::has_attribute); - ObjectTypeDB::bind_method(_MD("get_named_attribute_value","name"), (String (XMLParser::*)(const String&) const) &XMLParser::get_attribute_value); - ObjectTypeDB::bind_method(_MD("get_named_attribute_value_safe","name"), &XMLParser::get_attribute_value_safe); - ObjectTypeDB::bind_method(_MD("is_empty"),&XMLParser::is_empty); - ObjectTypeDB::bind_method(_MD("get_current_line"),&XMLParser::get_current_line); - ObjectTypeDB::bind_method(_MD("skip_section"),&XMLParser::skip_section); - ObjectTypeDB::bind_method(_MD("seek","pos"),&XMLParser::seek); - ObjectTypeDB::bind_method(_MD("open","file"),&XMLParser::open); - ObjectTypeDB::bind_method(_MD("open_buffer","buffer"),&XMLParser::open_buffer); + ClassDB::bind_method(_MD("read"),&XMLParser::read); + ClassDB::bind_method(_MD("get_node_type"),&XMLParser::get_node_type); + ClassDB::bind_method(_MD("get_node_name"),&XMLParser::get_node_name); + ClassDB::bind_method(_MD("get_node_data"),&XMLParser::get_node_data); + ClassDB::bind_method(_MD("get_node_offset"),&XMLParser::get_node_offset); + ClassDB::bind_method(_MD("get_attribute_count"),&XMLParser::get_attribute_count); + ClassDB::bind_method(_MD("get_attribute_name","idx"),&XMLParser::get_attribute_name); + ClassDB::bind_method(_MD("get_attribute_value","idx"),(String (XMLParser::*)(int) const) &XMLParser::get_attribute_value); + ClassDB::bind_method(_MD("has_attribute","name"),&XMLParser::has_attribute); + ClassDB::bind_method(_MD("get_named_attribute_value","name"), (String (XMLParser::*)(const String&) const) &XMLParser::get_attribute_value); + ClassDB::bind_method(_MD("get_named_attribute_value_safe","name"), &XMLParser::get_attribute_value_safe); + ClassDB::bind_method(_MD("is_empty"),&XMLParser::is_empty); + ClassDB::bind_method(_MD("get_current_line"),&XMLParser::get_current_line); + ClassDB::bind_method(_MD("skip_section"),&XMLParser::skip_section); + ClassDB::bind_method(_MD("seek","pos"),&XMLParser::seek); + ClassDB::bind_method(_MD("open","file"),&XMLParser::open); + ClassDB::bind_method(_MD("open_buffer","buffer"),&XMLParser::open_buffer); BIND_CONSTANT( NODE_NONE ); BIND_CONSTANT( NODE_ELEMENT ); diff --git a/core/io/xml_parser.h b/core/io/xml_parser.h index e1f059bf8c6..7f807511560 100644 --- a/core/io/xml_parser.h +++ b/core/io/xml_parser.h @@ -40,7 +40,7 @@ class XMLParser : public Reference { - OBJ_TYPE( XMLParser, Reference ); + GDCLASS( XMLParser, Reference ); public: //! Enumeration of all supported source text file formats enum SourceFormat { diff --git a/core/make_binders.py b/core/make_binders.py index ef71c4264b8..74b5e9fda39 100644 --- a/core/make_binders.py +++ b/core/make_binders.py @@ -17,8 +17,8 @@ public: return Variant::NIL; } #endif - virtual String get_instance_type() const { - return T::get_type_static(); + virtual String get_instance_class() const { + return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { @@ -97,7 +97,7 @@ public: return Variant::NIL; } #endif - virtual String get_instance_type() const { + virtual String get_instance_class() const { return type_name; } @@ -159,7 +159,7 @@ MethodBind* create_method_bind($ifret R$ $ifnoret void$ (T::*p_method)($arg, P@$ } u; u.sm=p_method; a->method=u.dm; - a->type_name=T::get_type_static(); + a->type_name=T::get_class_static(); return a; } #endif diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp index 0b45577b584..29f61834b4a 100644 --- a/core/math/a_star.cpp +++ b/core/math/a_star.cpp @@ -407,23 +407,23 @@ DVector AStar::get_id_path(int p_from_id, int p_to_id) { void AStar::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_available_point_id"),&AStar::get_available_point_id); - ObjectTypeDB::bind_method(_MD("add_point","id","pos","weight_scale"),&AStar::add_point,DEFVAL(1.0)); - ObjectTypeDB::bind_method(_MD("get_point_pos","id"),&AStar::get_point_pos); - ObjectTypeDB::bind_method(_MD("get_point_weight_scale","id"),&AStar::get_point_weight_scale); - ObjectTypeDB::bind_method(_MD("remove_point","id"),&AStar::remove_point); + ClassDB::bind_method(_MD("get_available_point_id"),&AStar::get_available_point_id); + ClassDB::bind_method(_MD("add_point","id","pos","weight_scale"),&AStar::add_point,DEFVAL(1.0)); + ClassDB::bind_method(_MD("get_point_pos","id"),&AStar::get_point_pos); + ClassDB::bind_method(_MD("get_point_weight_scale","id"),&AStar::get_point_weight_scale); + ClassDB::bind_method(_MD("remove_point","id"),&AStar::remove_point); - ObjectTypeDB::bind_method(_MD("connect_points","id","to_id"),&AStar::connect_points); - ObjectTypeDB::bind_method(_MD("disconnect_points","id","to_id"),&AStar::disconnect_points); - ObjectTypeDB::bind_method(_MD("are_points_connected","id","to_id"),&AStar::are_points_connected); + ClassDB::bind_method(_MD("connect_points","id","to_id"),&AStar::connect_points); + ClassDB::bind_method(_MD("disconnect_points","id","to_id"),&AStar::disconnect_points); + ClassDB::bind_method(_MD("are_points_connected","id","to_id"),&AStar::are_points_connected); - ObjectTypeDB::bind_method(_MD("clear"),&AStar::clear); + ClassDB::bind_method(_MD("clear"),&AStar::clear); - ObjectTypeDB::bind_method(_MD("get_closest_point","to_pos"),&AStar::get_closest_point); - ObjectTypeDB::bind_method(_MD("get_closest_pos_in_segment","to_pos"),&AStar::get_closest_pos_in_segment); + ClassDB::bind_method(_MD("get_closest_point","to_pos"),&AStar::get_closest_point); + ClassDB::bind_method(_MD("get_closest_pos_in_segment","to_pos"),&AStar::get_closest_pos_in_segment); - ObjectTypeDB::bind_method(_MD("get_point_path","from_id","to_id"),&AStar::get_point_path); - ObjectTypeDB::bind_method(_MD("get_id_path","from_id","to_id"),&AStar::get_id_path); + ClassDB::bind_method(_MD("get_point_path","from_id","to_id"),&AStar::get_point_path); + ClassDB::bind_method(_MD("get_id_path","from_id","to_id"),&AStar::get_id_path); } diff --git a/core/math/a_star.h b/core/math/a_star.h index f9ffc477fc0..66a983a6cec 100644 --- a/core/math/a_star.h +++ b/core/math/a_star.h @@ -37,7 +37,7 @@ class AStar: public Reference { - OBJ_TYPE(AStar,Reference) + GDCLASS(AStar,Reference) uint64_t pass; diff --git a/core/math/triangle_mesh.h b/core/math/triangle_mesh.h index a310f7e32b4..d42f9c8dded 100644 --- a/core/math/triangle_mesh.h +++ b/core/math/triangle_mesh.h @@ -33,7 +33,7 @@ #include "face3.h" class TriangleMesh : public Reference { - OBJ_TYPE( TriangleMesh, Reference); + GDCLASS( TriangleMesh, Reference); struct Triangle { diff --git a/core/message_queue.cpp b/core/message_queue.cpp index d17321f0266..11fe2337f61 100644 --- a/core/message_queue.cpp +++ b/core/message_queue.cpp @@ -45,7 +45,7 @@ Error MessageQueue::push_call(ObjectID p_id,const StringName& p_method,const Var if ((buffer_end+room_needed) >= buffer_size) { String type; if (ObjectDB::get_instance(p_id)) - type=ObjectDB::get_instance(p_id)->get_type(); + type=ObjectDB::get_instance(p_id)->get_class(); print_line("failed method: "+type+":"+p_method+" target ID: "+itos(p_id)); statistics(); @@ -98,7 +98,7 @@ Error MessageQueue::push_set(ObjectID p_id, const StringName& p_prop, const Vari if ((buffer_end+room_needed) >= buffer_size) { String type; if (ObjectDB::get_instance(p_id)) - type=ObjectDB::get_instance(p_id)->get_type(); + type=ObjectDB::get_instance(p_id)->get_class(); print_line("failed set: "+type+":"+p_prop+" target ID: "+itos(p_id)); statistics(); @@ -133,7 +133,7 @@ Error MessageQueue::push_notification(ObjectID p_id, int p_notification) { if ((buffer_end+room_needed) >= buffer_size) { String type; if (ObjectDB::get_instance(p_id)) - type=ObjectDB::get_instance(p_id)->get_type(); + type=ObjectDB::get_instance(p_id)->get_class(); print_line("failed notification: "+itos(p_notification)+" target ID: "+itos(p_id)); statistics(); diff --git a/core/method_bind.h b/core/method_bind.h index 168b2e72a10..7b59e6a6b09 100644 --- a/core/method_bind.h +++ b/core/method_bind.h @@ -231,7 +231,7 @@ public: #endif void set_hint_flags(uint32_t p_hint) { hint_flags=p_hint; } uint32_t get_hint_flags() const { return hint_flags|(is_const()?METHOD_FLAG_CONST:0)|(is_vararg()?METHOD_FLAG_VARARG:0); } - virtual String get_instance_type() const=0; + virtual String get_instance_class() const=0; _FORCE_INLINE_ int get_argument_count() const { return argument_count; }; @@ -328,7 +328,7 @@ public: void set_method(NativeCall p_method) { call_method=p_method; } virtual bool is_const() const { return false; } - virtual String get_instance_type() const { return T::get_type_static(); } + virtual String get_instance_class() const { return T::get_class_static(); } virtual bool is_vararg() const { return true; } diff --git a/core/object.cpp b/core/object.cpp index a755a3abb11..82377013e1c 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -341,15 +341,15 @@ bool Object::_predelete() { _predelete_ok=1; notification(NOTIFICATION_PREDELETE,true); if (_predelete_ok) { - _type_ptr=NULL; //must restore so destructors can access type ptr correctly + _class_ptr=NULL; //must restore so destructors can access class ptr correctly } return _predelete_ok; } void Object::_postinitialize() { - _type_ptr=_get_type_namev(); - _initialize_typev(); + _class_ptr=_get_class_namev(); + _initialize_classv(); notification(NOTIFICATION_POSTINITIALIZE); } @@ -373,7 +373,7 @@ void Object::set(const String& p_name, const Variant& p_value) { // return; bool success; - ObjectTypeDB::set_property(this,p_name,p_value,success); + ClassDB::set_property(this,p_name,p_value,success); if (success) { return; } @@ -409,7 +409,7 @@ void Object::set(const StringName& p_name, const Variant& p_value, bool *r_valid //try built-in setgetter { - if (ObjectTypeDB::set_property(this,p_name,p_value,r_valid)) { + if (ClassDB::set_property(this,p_name,p_value,r_valid)) { //if (r_valid) // *r_valid=true; return; @@ -460,7 +460,7 @@ Variant Object::get(const StringName& p_name, bool *r_valid) const{ //try built-in setgetter { - if (ObjectTypeDB::get_property(const_cast(this),p_name,ret)) { + if (ClassDB::get_property(const_cast(this),p_name,ret)) { if (r_valid) *r_valid=true; return ret; @@ -504,7 +504,7 @@ Variant Object::get(const String& p_name) const { return ret; bool success; - ObjectTypeDB::get_property(const_cast(this),p_name,ret,success); + ClassDB::get_property(const_cast(this),p_name,ret,success); if (success) { return ret; } @@ -535,7 +535,7 @@ void Object::get_property_list(List *p_list,bool p_reversed) const if (!_use_builtin_script()) return; - if (!is_type("Script")) // can still be set, but this is for userfriendlyness + if (!is_class("Script")) // can still be set, but this is for userfriendlyness p_list->push_back( PropertyInfo( Variant::OBJECT, "script/script", PROPERTY_HINT_RESOURCE_TYPE, "Script",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_STORE_IF_NONZERO)); if (!metadata.empty()) p_list->push_back( PropertyInfo( Variant::DICTIONARY, "__meta__", PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR|PROPERTY_USAGE_STORE_IF_NONZERO)); @@ -552,7 +552,7 @@ void Object::_validate_property(PropertyInfo& property) const { void Object::get_method_list(List *p_list) const { - ObjectTypeDB::get_method_list(get_type_name(),p_list); + ClassDB::get_method_list(get_class_name(),p_list); if (script_instance) { script_instance->get_method_list(p_list); } @@ -697,7 +697,7 @@ void Object::call_multilevel(const StringName& p_method,const Variant** p_args,i } - MethodBind *method=ObjectTypeDB::get_method(get_type_name(),p_method); + MethodBind *method=ClassDB::get_method(get_class_name(),p_method); if (method) { @@ -710,7 +710,7 @@ void Object::call_multilevel(const StringName& p_method,const Variant** p_args,i void Object::call_multilevel_reversed(const StringName& p_method,const Variant** p_args,int p_argcount) { - MethodBind *method=ObjectTypeDB::get_method(get_type_name(),p_method); + MethodBind *method=ClassDB::get_method(get_class_name(),p_method); Variant::CallError error; OBJ_DEBUG_LOCK @@ -744,7 +744,7 @@ bool Object::has_method(const StringName& p_method) const { return true; } - MethodBind *method=ObjectTypeDB::get_method(get_type_name(),p_method); + MethodBind *method=ClassDB::get_method(get_class_name(),p_method); if (method) { return true; @@ -821,7 +821,7 @@ Variant Object::call(const StringName& p_name, VARIANT_ARG_DECLARE) { return ret; } - MethodBind *method=ObjectTypeDB::get_method(get_type_name(),p_name); + MethodBind *method=ClassDB::get_method(get_type_name(),p_name); if (method) { @@ -888,7 +888,7 @@ void Object::call_multilevel(const StringName& p_name, VARIANT_ARG_DECLARE) { } - MethodBind *method=ObjectTypeDB::get_method(get_type_name(),p_name); + MethodBind *method=ClassDB::get_method(get_type_name(),p_name); if (method) { @@ -971,7 +971,7 @@ Variant Object::call(const StringName& p_method,const Variant** p_args,int p_arg } } - MethodBind *method=ObjectTypeDB::get_method(get_type_name(),p_method); + MethodBind *method=ClassDB::get_method(get_class_name(),p_method); if (method) { @@ -1138,7 +1138,7 @@ void Object::get_meta_list(List *p_list) const { void Object::add_user_signal(const MethodInfo& p_signal) { ERR_FAIL_COND(p_signal.name==""); - ERR_FAIL_COND( ObjectTypeDB::has_signal(get_type_name(),p_signal.name ) ); + ERR_FAIL_COND( ClassDB::has_signal(get_class_name(),p_signal.name ) ); ERR_FAIL_COND(signal_map.has(p_signal.name)); Signal s; s.user=p_signal; @@ -1216,7 +1216,7 @@ void Object::emit_signal(const StringName& p_name,const Variant** p_args,int p_a Signal *s = signal_map.getptr(p_name); if (!s) { #ifdef DEBUG_ENABLED - bool signal_is_valid = ObjectTypeDB::has_signal(get_type_name(),p_name); + bool signal_is_valid = ClassDB::has_signal(get_class_name(),p_name); //check in script if (!signal_is_valid && !script.is_null() && !Ref