• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ call_deferred函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中call_deferred函数的典型用法代码示例。如果您正苦于以下问题:C++ call_deferred函数的具体用法?C++ call_deferred怎么用?C++ call_deferred使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了call_deferred函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: call_deferred

void EditorFileDialog::_item_dc_selected(int p_item) {


	int current = p_item;
	if (current<0 || current>=item_list->get_item_count())
		return;

	Dictionary d=item_list->get_item_metadata(current);

	if (d["dir"]) {

		//print_line("change dir: "+String(d["name"]));
		dir_access->change_dir(d["name"]);
		if (mode==MODE_OPEN_FILE || mode==MODE_OPEN_FILES || mode==MODE_OPEN_DIR || MODE_OPEN_ANY)
			file->set_text("");
		call_deferred("_update_file_list");
		call_deferred("_update_dir");

		_push_history();


	} else {

		_action_pressed();
	}
}
开发者ID:AutonomicStudios,项目名称:godot,代码行数:26,代码来源:editor_file_dialog.cpp


示例2: memdelete

void EditorFileSystem::update_file(const String& p_file) {

    EditorFileSystemDirectory *fs=NULL;
    int cpos=-1;

    if (!_find_file(p_file,&fs,cpos)) {

	if (!fs)
		return;
    }

    if (!FileAccess::exists(p_file)) {
	    //was removed
	    memdelete( fs->files[cpos] );
	    fs->files.remove(cpos);
	    call_deferred("emit_signal","filesystem_changed"); //update later
	    return;

    }

    String type = ResourceLoader::get_resource_type(p_file);

    if (cpos==-1) {

	    int idx=0;

	    for(int i=0;i<fs->files.size();i++) {
		if (p_file<fs->files[i]->file)
		    break;
		idx++;
	    }

	    EditorFileSystemDirectory::FileInfo *fi = memnew( EditorFileSystemDirectory::FileInfo );
	    fi->file=p_file.get_file();

	    if (idx==fs->files.size()) {
		fs->files.push_back(fi);
	    } else {

		fs->files.insert(idx,fi);
	    }
	    cpos=idx;


    }

	//print_line("UPDATING: "+p_file);
	fs->files[cpos]->type=type;
	fs->files[cpos]->modified_time=FileAccess::get_modified_time(p_file);
	fs->files[cpos]->meta=_get_meta(p_file);

	EditorResourcePreview::get_singleton()->call_deferred("check_for_invalidation",p_file);
	call_deferred("emit_signal","filesystem_changed"); //update later

}
开发者ID:baekdahl,项目名称:godot,代码行数:55,代码来源:editor_file_system.cpp


示例3: call_deferred

void StreamPlayer::sp_update() {

	//_THREAD_SAFE_METHOD_
	if (!paused && resampler.is_ready() && playback.is_valid()) {

		if (!playback->is_playing()) {
			//stream depleted data, but there's still audio in the ringbuffer
			//check that all this audio has been flushed before stopping the stream
			int to_mix = resampler.get_total() - resampler.get_todo();
			if (to_mix==0) {
				if (!stop_request) {
					stop_request=true;
					call_deferred("stop");
				}
				return;
			}

			return;
		}

		int todo =resampler.get_todo();
		int wrote = playback->mix(resampler.get_write_buffer(),todo);
		resampler.write(wrote);
	}
}
开发者ID:hellaguy130,项目名称:godot,代码行数:25,代码来源:stream_player.cpp


示例4: Variant

Variant Object::_call_deferred_bind(const Variant** p_args, int p_argcount, Variant::CallError& r_error) {

	if (p_argcount<1) {
		r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
		r_error.argument=0;
		return Variant();
	}

	if (p_args[0]->get_type()!=Variant::STRING) {
		r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
		r_error.argument=0;
		r_error.expected=Variant::STRING;
		return Variant();
	}

	r_error.error=Variant::CallError::CALL_OK;

	StringName signal = *p_args[0];

	Variant v[VARIANT_ARG_MAX];


	for(int i=0;i<MIN(5,p_argcount-1);i++) {

		v[i]=*p_args[i+1];
	}

	call_deferred(signal,v[0],v[1],v[2],v[3],v[4]);
	return Variant();

}
开发者ID:AMG194,项目名称:godot,代码行数:31,代码来源:object.cpp


示例5: ERR_FAIL_COND_V

Error HTTPRequest::request(const String &p_url, const Vector<String> &p_custom_headers, bool p_ssl_validate_domain, HTTPClient::Method p_method, const String &p_request_data) {

	ERR_FAIL_COND_V(!is_inside_tree(), ERR_UNCONFIGURED);
	if (requesting) {
		ERR_EXPLAIN("HTTPRequest is processing a request. Wait for completion or cancel it before attempting a new one.");
		ERR_FAIL_V(ERR_BUSY);
	}

	method = p_method;

	Error err = _parse_url(p_url);
	if (err)
		return err;

	validate_ssl = p_ssl_validate_domain;

	bool has_user_agent = false;
	bool has_accept = false;
	headers = p_custom_headers;

	request_data = p_request_data;

	for (int i = 0; i < headers.size(); i++) {

		if (headers[i].findn("user-agent:") == 0)
			has_user_agent = true;
		if (headers[i].findn("Accept:") == 0)
			has_accept = true;
	}

	if (!has_user_agent) {
		headers.push_back("User-Agent: GodotEngine/" + String(VERSION_MKSTRING) + " (" + OS::get_singleton()->get_name() + ")");
	}

	if (!has_accept) {
		headers.push_back("Accept: */*");
	}

	requesting = true;

	if (use_threads) {

		thread_done = false;
		thread_request_quit = false;
		client->set_blocking_mode(true);
		thread = Thread::create(_thread_func, this);
	} else {
		client->set_blocking_mode(false);
		err = _request();
		if (err != OK) {
			call_deferred("_request_done", RESULT_CANT_CONNECT, 0, PoolStringArray(), PoolByteArray());
			return ERR_CANT_CONNECT;
		}

		set_process_internal(true);
	}

	return OK;
}
开发者ID:FateAce,项目名称:godot,代码行数:59,代码来源:http_request.cpp


示例6: call_deferred

void AnimationTree::_tree_changed() {
	if (properties_dirty) {
		return;
	}

	call_deferred("_update_properties");
	properties_dirty = true;
}
开发者ID:Valentactive,项目名称:godot,代码行数:8,代码来源:animation_tree.cpp


示例7: if

void SpriteBase3D::_queue_update(){

	if  (pending_update)
		return;

	pending_update=true;
	call_deferred(SceneStringNames::get_singleton()->_im_update);
}
开发者ID:AutonomicStudios,项目名称:godot,代码行数:8,代码来源:sprite_3d.cpp


示例8: call_deferred

void ProceduralSky::_queue_update() {

	if (update_queued)
		return;

	update_queued = true;
	call_deferred("_update_sky");
}
开发者ID:Max-Might,项目名称:godot,代码行数:8,代码来源:sky_box.cpp


示例9: call_deferred

void SpatialIndexer::_request_update() {

	if (pending_update)
		return;
	pending_update=true;
	call_deferred(SceneStringNames::get_singleton()->_update_pairs);

}
开发者ID:AMG194,项目名称:godot,代码行数:8,代码来源:spatial_indexer.cpp


示例10: call_deferred

void ProjectSettings::_translation_res_select() {

	if (updating_translations)
		return;


	call_deferred("_update_translations");
}
开发者ID:0871087123,项目名称:godot,代码行数:8,代码来源:project_settings.cpp


示例11: call_deferred

void NoiseTexture::_queue_update() {

	if (update_queued)
		return;

	update_queued = true;
	call_deferred("_update_texture");
}
开发者ID:DSeanLaw,项目名称:godot,代码行数:8,代码来源:noise_texture.cpp


示例12: ERR_FAIL_COND

void ResourcesDock::_delete(Object* p_item, int p_column, int p_id) {

	TreeItem *ti = p_item->cast_to<TreeItem>();
	ERR_FAIL_COND(!ti);


	call_deferred("remove_resource",ti->get_metadata(0));

}
开发者ID:03050903,项目名称:godot,代码行数:9,代码来源:resources_dock.cpp


示例13: call_deferred

void FileDialog::_tree_item_activated() {

	TreeItem *ti = tree->get_selected();
	if (!ti)
		return;

	Dictionary d = ti->get_metadata(0);

	if (d["dir"]) {

		dir_access->change_dir(d["name"]);
		if (mode == MODE_OPEN_FILE || mode == MODE_OPEN_FILES || mode == MODE_OPEN_DIR || mode == MODE_OPEN_ANY)
			file->set_text("");
		call_deferred("_update_file_list");
		call_deferred("_update_dir");
	} else {

		_action_pressed();
	}
}
开发者ID:Ranakhamis,项目名称:godot,代码行数:20,代码来源:file_dialog.cpp


示例14: update_gizmo

void SpriteBase3D::_queue_update() {

	if (pending_update)
		return;

	triangle_mesh.unref();
	update_gizmo();

	pending_update = true;
	call_deferred(SceneStringNames::get_singleton()->_im_update);
}
开发者ID:SaracenOne,项目名称:godot,代码行数:11,代码来源:sprite_3d.cpp


示例15: call_deferred

void SoftBody::_draw_soft_mesh() {
	if (get_mesh().is_null())
		return;

	if (!visual_server_handler.is_ready()) {

		visual_server_handler.prepare(get_mesh()->get_rid(), 0);

		/// Necessary in order to render the mesh correctly (Soft body nodes are in global space)
		simulation_started = true;
		call_deferred("set_as_toplevel", true);
		call_deferred("set_transform", Transform());
	}

	visual_server_handler.open();
	PhysicsServer::get_singleton()->soft_body_update_visual_server(physics_rid, &visual_server_handler);
	visual_server_handler.close();

	visual_server_handler.commit_changes();
}
开发者ID:KellyThomas,项目名称:godot,代码行数:20,代码来源:soft_body.cpp


示例16: call_deferred

bool Tween::remove_all() {

	if(pending_update != 0) {
		call_deferred("remove_all");
		return true;
	}
	set_active(false);
	_set_process(false);
	interpolates.clear();
	return true;
}
开发者ID:03050903,项目名称:godot,代码行数:11,代码来源:tween.cpp


示例17: _update_nl

void EditorSelection::update() {

	_update_nl();

	if (!changed)
		return;
	changed = false;
	if (!emitted) {
		emitted = true;
		call_deferred("_emit_change");
	}
}
开发者ID:93i,项目名称:godot,代码行数:12,代码来源:editor_data.cpp


示例18: call_deferred

void EditorFileDialog::_item_dc_selected(int p_item) {

	int current = p_item;
	if (current < 0 || current >= item_list->get_item_count())
		return;

	Dictionary d = item_list->get_item_metadata(current);

	if (d["dir"]) {

		dir_access->change_dir(d["name"]);
		call_deferred("_update_file_list");
		call_deferred("_update_dir");

		_push_history();

	} else {

		_action_pressed();
	}
}
开发者ID:Zylann,项目名称:godot,代码行数:21,代码来源:editor_file_dialog.cpp


示例19: pr

bool GodotSharpEditor::_create_project_solution() {

	EditorProgress pr("create_csharp_solution", "Generating solution...", 2);

	pr.step("Generating C# project...");

	String path = OS::get_singleton()->get_resource_dir();
	String name = ProjectSettings::get_singleton()->get("application/config/name");
	if (name.empty()) {
		name = "UnnamedProject";
	}

	String guid = CSharpProject::generate_game_project(path, name);

	if (guid.length()) {

		NETSolution solution(name);

		if (!solution.set_path(path)) {
			show_error_dialog("Failed to create solution.");
			return false;
		}

		Vector<String> extra_configs;
		extra_configs.push_back("Tools");

		solution.add_new_project(name, guid, extra_configs);

		Error sln_error = solution.save();

		if (sln_error != OK) {
			show_error_dialog("Failed to save solution.");
			return false;
		}

		if (!GodotSharpBuilds::make_api_sln(GodotSharpBuilds::API_CORE))
			return false;

		if (!GodotSharpBuilds::make_api_sln(GodotSharpBuilds::API_EDITOR))
			return false;

		pr.step("Done");

		// Here, after all calls to progress_task_step
		call_deferred("_remove_create_sln_menu_option");

	} else {
		show_error_dialog("Failed to create C# project.");
	}

	return true;
}
开发者ID:KelinciFX,项目名称:godot,代码行数:52,代码来源:godotsharp_editor.cpp


示例20: call_deferred

void GraphEdit::_scroll_moved(double) {

	if (!awaiting_scroll_offset_update) {
		call_deferred("_update_scroll_offset");
		awaiting_scroll_offset_update = true;
	}
	top_layer->update();
	update();

	if (!setting_scroll_ofs) { //in godot, signals on change value are avoided as a convention
		emit_signal("scroll_offset_changed", get_scroll_ofs());
	}
}
开发者ID:UgisBrekis,项目名称:godot,代码行数:13,代码来源:graph_edit.cpp



注:本文中的call_deferred函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ call_dissector函数代码示例发布时间:2022-05-30
下一篇:
C++ call_binTM函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap