您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ ERR_CONTINUE函数代码示例

51自学网 2021-06-01 20:33:33
  C++
这篇教程C++ ERR_CONTINUE函数代码示例写得很实用,希望能帮到您。

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

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

示例1: while

void ScriptDebuggerRemote::_poll_events() {	while(packet_peer_stream->get_available_packet_count()>0) {		_get_output();		//send over output_strings		Variant var;		Error err = packet_peer_stream->get_var(var);		ERR_CONTINUE( err != OK);		ERR_CONTINUE( var.get_type()!=Variant::ARRAY );		Array cmd = var;		ERR_CONTINUE( cmd.size()==0);		ERR_CONTINUE( cmd[0].get_type()!=Variant::STRING );		String command = cmd[0];		//cmd.remove(0);		if (command=="break") {			if (get_break_language())				debug(get_break_language());		} else if (command=="request_scene_tree") {			if (request_scene_tree)				request_scene_tree(request_scene_tree_ud);		} else if (command=="request_video_mem") {			_send_video_memory();		} else if (command=="breakpoint") {			bool set = cmd[3];			if (set)				insert_breakpoint(cmd[2],cmd[1]);			else				remove_breakpoint(cmd[2],cmd[1]);		} else {			_parse_live_edit(cmd);		}	}}
开发者ID:a12n,项目名称:godot,代码行数:47,


示例2: add_bone

bool Skeleton::_set(const StringName& p_path, const Variant& p_value) {	String path = p_path;	if (!path.begins_with("bones/"))		return false;			int which=path.get_slice("/",1).to_int();	String what=path.get_slice("/",2);	if (which==bones.size() && what=="name") {			add_bone(p_value);		return true;	}		ERR_FAIL_INDEX_V( which, bones.size(), false );		if (what=="parent")		set_bone_parent(which, p_value );	else if (what=="rest")		set_bone_rest(which, p_value);	else if (what=="enabled")		set_bone_enabled(which, p_value);	else if (what=="pose")		set_bone_pose(which, p_value);	else if (what=="bound_childs") {		Array children=p_value;				bones[which].nodes_bound.clear();				for (int i=0;i<children.size();i++) {					NodePath path=children[i];			ERR_CONTINUE( path.operator String()=="" );			Node *node = get_node(path);			ERR_CONTINUE(!node);			bind_child_node_to_bone(which,node);		}	} else {		return false;	}	return true;}
开发者ID:NosicLin,项目名称:godot,代码行数:46,


示例3: memdelete

Object::~Object() {	if (script_instance)		memdelete(script_instance);	script_instance = NULL;	List<Connection> sconnections;	const StringName *S = NULL;	while ((S = signal_map.next(S))) {		Signal *s = &signal_map[*S];		ERR_EXPLAIN("Attempt to delete an object in the middle of a signal emission from it");		ERR_CONTINUE(s->lock > 0);		for (int i = 0; i < s->slot_map.size(); i++) {			sconnections.push_back(s->slot_map.getv(i).conn);		}	}	for (List<Connection>::Element *E = sconnections.front(); E; E = E->next()) {		Connection &c = E->get();		ERR_CONTINUE(c.source != this); //bug?		this->disconnect(c.signal, c.target, c.method);	}	while (connections.size()) {		Connection c = connections.front()->get();		c.source->disconnect(c.signal, c.target, c.method);	}	ObjectDB::remove_instance(this);	_instance_ID = 0;	_predelete_ok = 2;	for (int i = 0; i < MAX_SCRIPT_INSTANCE_BINDINGS; i++) {		if (_script_instance_bindings[i]) {			ScriptServer::get_language(i)->free_instance_binding_data(_script_instance_bindings[i]);		}	}}
开发者ID:Bonfi96,项目名称:godot,代码行数:46,


示例4: ERR_CONTINUE

void BitmapFont::_set_textures(const Vector<Variant> &p_textures) {	for (int i = 0; i < p_textures.size(); i++) {		Ref<Texture> tex = p_textures[i];		ERR_CONTINUE(!tex.is_valid());		add_texture(tex);	}}
开发者ID:GalanCM,项目名称:godot,代码行数:8,


示例5: print_line

void ResourceImporterTexture::update_imports() {	if (EditorFileSystem::get_singleton()->is_scanning() || EditorFileSystem::get_singleton()->is_importing()) {		return; // do nothing for noe	}	mutex->lock();	if (make_flags.empty()) {		mutex->unlock();		return;	}	Vector<String> to_reimport;	for (Map<StringName, int>::Element *E = make_flags.front(); E; E = E->next()) {		print_line("checking for reimport " + String(E->key()));		Ref<ConfigFile> cf;		cf.instance();		String src_path = String(E->key()) + ".import";		Error err = cf->load(src_path);		ERR_CONTINUE(err != OK);		bool changed = false;		if (E->get() & MAKE_SRGB_FLAG && int(cf->get_value("params", "flags/srgb")) == 2) {			cf->set_value("params", "flags/srgb", 1);			changed = true;		}		if (E->get() & MAKE_NORMAL_FLAG && int(cf->get_value("params", "compress/normal_map")) == 0) {			cf->set_value("params", "compress/normal_map", 1);			changed = true;		}		if (E->get() & MAKE_3D_FLAG && bool(cf->get_value("params", "detect_3d"))) {			cf->set_value("params", "detect_3d", false);			cf->set_value("params", "compress/mode", 2);			cf->set_value("params", "flags/repeat", true);			cf->set_value("params", "flags/filter", true);			cf->set_value("params", "flags/mipmaps", true);			changed = true;		}		if (changed) {			cf->save(src_path);			to_reimport.push_back(E->key());		}	}	make_flags.clear();	mutex->unlock();	if (to_reimport.size()) {		EditorFileSystem::get_singleton()->reimport_files(to_reimport);	}}
开发者ID:Max-Might,项目名称:godot,代码行数:58,


示例6: ERR_CONTINUE

void BakedLightBaker::_add_mesh(const Ref<Mesh>& p_mesh,const Ref<Material>& p_mat_override,const Transform& p_xform) {	for(int i=0;i<p_mesh->get_surface_count();i++) {		if (p_mesh->surface_get_primitive_type(i)!=Mesh::PRIMITIVE_TRIANGLES)			continue;		Ref<Material> mat = p_mat_override.is_valid()?p_mat_override:p_mesh->surface_get_material(i);		int facecount=0;		if (p_mesh->surface_get_format(i)&Mesh::ARRAY_FORMAT_INDEX) {			facecount=p_mesh->surface_get_array_index_len(i);		} else {			facecount=p_mesh->surface_get_array_len(i);		}		ERR_CONTINUE((facecount==0 || (facecount%3)!=0));		facecount/=3;		int tbase=triangles.size();		triangles.resize(facecount+tbase);		Array a = p_mesh->surface_get_arrays(i);		DVector<Vector3> vertices = a[Mesh::ARRAY_VERTEX];		DVector<Vector3>::Read vr=vertices.read();		if (p_mesh->surface_get_format(i)&Mesh::ARRAY_FORMAT_INDEX) {			DVector<int> indices = a[Mesh::ARRAY_INDEX];			DVector<int>::Read ir = indices.read();			for(int i=0;i<facecount;i++) {				Triangle &t=triangles[tbase+i];				t.vertices[0]=p_xform.xform(vr[ ir[i*3+0] ]);				t.vertices[1]=p_xform.xform(vr[ ir[i*3+1] ]);				t.vertices[2]=p_xform.xform(vr[ ir[i*3+2] ]);			}		} else {			for(int i=0;i<facecount;i++) {				Triangle &t=triangles[tbase+i];				t.vertices[0]=p_xform.xform(vr[ i*3+0 ]);				t.vertices[1]=p_xform.xform(vr[ i*3+1 ]);				t.vertices[2]=p_xform.xform(vr[ i*3+2 ]);			}		}	}}
开发者ID:Matinho,项目名称:godot,代码行数:57,


示例7: ERR_CONTINUE

void GDFunction::debug_get_stack_member_state(int p_line,List<Pair<StringName,int> > *r_stackvars) const {	int oc=0;	Map<StringName,_GDFKC> sdmap;	for( const List<StackDebug>::Element *E=stack_debug.front();E;E=E->next()) {		const StackDebug &sd=E->get();		if (sd.line>p_line)			break;		if (sd.added) {			if (!sdmap.has(sd.identifier)) {				_GDFKC d;				d.order=oc++;				d.pos.push_back(sd.pos);				sdmap[sd.identifier]=d;			} else {				sdmap[sd.identifier].pos.push_back(sd.pos);			}		} else {			ERR_CONTINUE(!sdmap.has(sd.identifier));			sdmap[sd.identifier].pos.pop_back();			if (sdmap[sd.identifier].pos.empty())				sdmap.erase(sd.identifier);		}	}	List<_GDFKCS> stackpositions;	for(Map<StringName,_GDFKC>::Element *E=sdmap.front();E;E=E->next() ) {		_GDFKCS spp;		spp.id=E->key();		spp.order=E->get().order;		spp.pos=E->get().pos.back()->get();		stackpositions.push_back(spp);	}	stackpositions.sort();	for(List<_GDFKCS>::Element *E=stackpositions.front();E;E=E->next()) {		Pair<StringName,int> p;		p.first=E->get().id;		p.second=E->get().pos;		r_stackvars->push_back(p);	}}
开发者ID:castlelore,项目名称:godot,代码行数:57,


示例8: ERR_CONTINUE

void FilterBankFR::mouse_motion(const GUI::Point& p_pos, const  GUI::Point& p_rel, int p_button_mask) {		if (drag.index==-1) {				/* no drag, find over */				int closest=-1;		int closest_dist=0;				for (int i=0;i<filters;i++) {					//just check			ERR_CONTINUE(filter[i].mode==NULL || filter[i].stages==NULL || filter[i].cutoff==NULL || filter[i].resonance==NULL || cutoff_offset==NULL);					if (filter[i].mode->get()==0)				continue;						int x=freq_2_pixel( filter[i].cutoff->get()*pow( 2 , cutoff_offset->get() ) ,MIN_FREQ,filter[i].cutoff->get_max(),get_size_cache().width);						int distance=fabsf(p_pos.x-x);			if (distance>10)				continue;						if (closest==-1 || closest_dist>distance)				closest=i;					}				if (closest!=drag.over) {						drag.over=closest;			update();		}			} else {			float freq= float_2_freq(  (float)p_pos.x/(float)get_size_cache().width ,MIN_FREQ,filter[drag.index].cutoff->get_max() );						freq/=pow( 2 , cutoff_offset->get() );		//filter[drag.index].cutoff->set(freq);		filter[drag.index].cutoff->set(freq);		float reso=(float)(get_size_cache().height-p_pos.y)/get_size_cache().height;		if (reso<0)			reso=0;		if (reso>1)			reso=1;				reso*=filter[drag.index].resonance->get_max();				filter[drag.index].resonance->set(reso);		update();		}	}
开发者ID:BackupTheBerlios,项目名称:reshaked-svn,代码行数:56,


示例9: ERR_FAIL_INDEX_V

bool Skeleton::_get(const StringName& p_name,Variant &r_ret) const {	String path=p_name;	if (!path.begins_with("bones/"))		return false;	int which=path.get_slicec('/',1).to_int();	String what=path.get_slicec('/',2);	ERR_FAIL_INDEX_V( which, bones.size(), false );	if (what=="name")		r_ret=get_bone_name(which);	else if (what=="parent")		r_ret=get_bone_parent(which);	else if (what=="rest")		r_ret=get_bone_rest(which);	else if (what=="enabled")		r_ret=is_bone_enabled(which);	else if (what=="pose")		r_ret=get_bone_pose(which);	else if (what=="bound_childs") {		Array children;		for (const List<uint32_t>::Element *E=bones[which].nodes_bound.front();E;E=E->next()) {			Object *obj=ObjectDB::get_instance(E->get());			ERR_CONTINUE(!obj);			Node *node=obj->cast_to<Node>();			ERR_CONTINUE(!node);			NodePath path=get_path_to(node);			children.push_back(path);		}		r_ret=children;	} else		return false;	return true;}
开发者ID:03050903,项目名称:godot,代码行数:43,


示例10: get_script_instance

void AnimationNode::get_parameter_list(List<PropertyInfo> *r_list) const {	if (get_script_instance()) {		Array parameters = get_script_instance()->call("get_parameter_list");		for (int i = 0; i < parameters.size(); i++) {			Dictionary d = parameters[i];			ERR_CONTINUE(d.empty());			r_list->push_back(PropertyInfo::from_dict(d));		}	}}
开发者ID:Valentactive,项目名称:godot,代码行数:10,


示例11: ERR_EXPLAIN

void Resource::notify_change_to_owners() {	for (Set<ObjectID>::Element *E = owners.front(); E; E = E->next()) {		Object *obj = ObjectDB::get_instance(E->get());		ERR_EXPLAIN("Object was deleted, while still owning a resource");		ERR_CONTINUE(!obj); //wtf		//TODO store string		obj->call("resource_changed", RES(this));	}}
开发者ID:allkhor,项目名称:godot,代码行数:11,


示例12: ERR_FAIL_INDEX

void Skeleton::get_bound_child_nodes_to_bone(int p_bone, List<Node *> *p_bound) const {	ERR_FAIL_INDEX(p_bone, bones.size());	for (const List<uint32_t>::Element *E = bones[p_bone].nodes_bound.front(); E; E = E->next()) {		Object *obj = ObjectDB::get_instance(E->get());		ERR_CONTINUE(!obj);		p_bound->push_back(Object::cast_to<Node>(obj));	}}
开发者ID:dataxerik,项目名称:godot,代码行数:11,


示例13: ep

void EditorReImportDialog::ok_pressed() {	if (EditorFileSystem::get_singleton()->is_scanning()) {		error->set_text(TTR("Please wait for scan to complete"));		error->popup_centered_minsize();		return;	}	EditorProgress ep("reimport",TTR("Re-Importing"),items.size());	String reload_fname;	if (scene_must_save && EditorNode::get_singleton()->get_edited_scene()) {		reload_fname = EditorNode::get_singleton()->get_edited_scene()->get_filename();		EditorNode::get_singleton()->save_scene(reload_fname);		EditorNode::get_singleton()->clear_scene();	}	for(int i=0;i<items.size();i++) {		String it = items[i]->get_metadata(0);		ep.step(items[i]->get_text(0),i);		print_line("reload import from: "+it);		Ref<ResourceImportMetadata> rimd = ResourceLoader::load_import_metadata(it);		ERR_CONTINUE(rimd.is_null());		String editor = rimd->get_editor();		Ref<EditorImportPlugin> eip = EditorImportExport::get_singleton()->get_import_plugin_by_name(editor);		ERR_CONTINUE(eip.is_null());		Error err = eip->import(it,rimd);		if (err!=OK) {			EditorNode::add_io_error("Error Importing:/n  "+it);		}	}	if (reload_fname!="") {		EditorNode::get_singleton()->load_scene(reload_fname);	}	EditorFileSystem::get_singleton()->scan_sources();}
开发者ID:AutonomicStudios,项目名称:godot,代码行数:40,


示例14: ERR_FAIL_COND

void BakedLightmap::_assign_lightmaps() {	ERR_FAIL_COND(!light_data.is_valid());	for (int i = 0; i < light_data->get_user_count(); i++) {		Ref<Texture> lightmap = light_data->get_user_lightmap(i);		ERR_CONTINUE(!lightmap.is_valid());		Node *node = get_node(light_data->get_user_path(i));		int instance_idx = light_data->get_user_instance(i);		if (instance_idx >= 0) {			RID instance = node->call("get_bake_mesh_instance", instance_idx);			if (instance.is_valid()) {				VS::get_singleton()->instance_set_use_lightmap(instance, get_instance(), lightmap->get_rid());			}		} else {			VisualInstance *vi = Object::cast_to<VisualInstance>(node);			ERR_CONTINUE(!vi);			VS::get_singleton()->instance_set_use_lightmap(vi->get_instance(), get_instance(), lightmap->get_rid());		}	}}
开发者ID:DSeanLaw,项目名称:godot,代码行数:22,


示例15: ERR_FAIL_COND

void Navigation::_navmesh_unlink(int p_id) {	ERR_FAIL_COND(!navmesh_map.has(p_id));	NavMesh &nm=navmesh_map[p_id];	ERR_FAIL_COND(!nm.linked);	print_line("UNLINK");	for (List<Polygon>::Element *E=nm.polygons.front();E;E=E->next()) {		Polygon &p=E->get();		int ec = p.edges.size();		Polygon::Edge *edges=p.edges.ptr();		for(int i=0;i<ec;i++) {			int next = (i+1)%ec;			EdgeKey ek(edges[i].point,edges[next].point);			Map<EdgeKey,Connection>::Element *C=connections.find(ek);			ERR_CONTINUE(!C);			if (C->get().B) {				//disconnect				C->get().B->edges[C->get().B_edge].C=NULL;				C->get().B->edges[C->get().B_edge].C_edge=-1;				C->get().A->edges[C->get().A_edge].C=NULL;				C->get().A->edges[C->get().A_edge].C_edge=-1;				if (C->get().A==&E->get()) {					C->get().A=C->get().B;					C->get().A_edge=C->get().B_edge;				}				C->get().B=NULL;				C->get().B_edge=-1;			} else {				connections.erase(C);				//erase			}		}	}	nm.polygons.clear();	nm.linked=false;}
开发者ID:MarTinazzI,项目名称:godot,代码行数:51,


示例16: _initialize_java_modules

static void _initialize_java_modules() {	String modules = Globals::get_singleton()->get("android/modules");	Vector<String> mods = modules.split(",",false);	__android_log_print(ANDROID_LOG_INFO,"godot","mod count: %i",mods.size());	if (mods.size()) {		JNIEnv *env = ThreadAndroid::get_env();		jclass activityClass = env->FindClass("com/android/godot/Godot");		jmethodID getClassLoader = env->GetMethodID(activityClass,"getClassLoader", "()Ljava/lang/ClassLoader;");		jobject cls = env->CallObjectMethod(_godot_instance, getClassLoader);		jclass classLoader = env->FindClass("java/lang/ClassLoader");		jmethodID findClass = env->GetMethodID(classLoader, "loadClass", "(Ljava/lang/String;)Ljava/lang/Class;");		for (int i=0;i<mods.size();i++) {			String m = mods[i];			//jclass singletonClass = env->FindClass(m.utf8().get_data());			print_line("LOADING MODULE: "+m);			jstring strClassName = env->NewStringUTF(m.utf8().get_data());			jclass singletonClass = (jclass)env->CallObjectMethod(cls, findClass, strClassName);			if (!singletonClass) {				ERR_EXPLAIN("Couldn't find singleton for class: "+m);				ERR_CONTINUE(!singletonClass);			}			__android_log_print(ANDROID_LOG_INFO,"godot","****^*^*?^*^*class data %x",singletonClass);			jmethodID initialize = env->GetStaticMethodID(singletonClass, "initialize", "(Landroid/app/Activity;)Lcom/android/godot/Godot$SingletonBase;");			jobject obj = env->CallStaticObjectMethod(singletonClass,initialize,_godot_instance);			__android_log_print(ANDROID_LOG_INFO,"godot","****^*^*?^*^*class instance %x",obj);			jobject gob = env->NewGlobalRef(obj);		}	}}
开发者ID:0871087123,项目名称:godot,代码行数:49,


示例17: BAND_LOG

void EQ::recalculate_band_coefficients() {#define BAND_LOG(m_f) (log((m_f)) / log(2.))	for (int i = 0; i < band.size(); i++) {		double octave_size;		double frq = band[i].freq;		if (i == 0) {			octave_size = BAND_LOG(band[1].freq) - BAND_LOG(frq);		} else if (i == (band.size() - 1)) {			octave_size = BAND_LOG(frq) - BAND_LOG(band[i - 1].freq);		} else {			double next = BAND_LOG(band[i + 1].freq) - BAND_LOG(frq);			double prev = BAND_LOG(frq) - BAND_LOG(band[i - 1].freq);			octave_size = (next + prev) / 2.0;		}		double frq_l = round(frq / pow(2.0, octave_size / 2.0));		double side_gain2 = POW2(Math_SQRT12);		double th = 2.0 * Math_PI * frq / mix_rate;		double th_l = 2.0 * Math_PI * frq_l / mix_rate;		double c2a = side_gain2 * POW2(cos(th)) - 2.0 * side_gain2 * cos(th_l) * cos(th) + side_gain2 - POW2(sin(th_l));		double c2b = 2.0 * side_gain2 * POW2(cos(th_l)) + side_gain2 * POW2(cos(th)) - 2.0 * side_gain2 * cos(th_l) * cos(th) - side_gain2 + POW2(sin(th_l));		double c2c = 0.25 * side_gain2 * POW2(cos(th)) - 0.5 * side_gain2 * cos(th_l) * cos(th) + 0.25 * side_gain2 - 0.25 * POW2(sin(th_l));		//printf("band %i, precoefs = %f,%f,%f/n",i,c2a,c2b,c2c);		double r1, r2; //roots		int roots = solve_quadratic(c2a, c2b, c2c, &r1, &r2);		ERR_CONTINUE(roots == 0);		band[i].c1 = 2.0 * ((0.5 - r1) / 2.0);		band[i].c2 = 2.0 * r1;		band[i].c3 = 2.0 * (0.5 + r1) * cos(th);		//printf("band %i, coefs = %f,%f,%f/n",i,(float)bands[i].c1,(float)bands[i].c2,(float)bands[i].c3);	}}
开发者ID:Ranakhamis,项目名称:godot,代码行数:48,


示例18: ERR_CONTINUE

void ResourcePreloaderEditor::_update_library() {	tree->clear();	tree->set_hide_root(true);	TreeItem *root = tree->create_item(NULL);	List<StringName> rnames;	preloader->get_resource_list(&rnames);	List<String> names;	for (List<StringName>::Element *E = rnames.front(); E; E = E->next()) {		names.push_back(E->get());	}	names.sort();	for (List<String>::Element *E = names.front(); E; E = E->next()) {		TreeItem *ti = tree->create_item(root);		ti->set_cell_mode(0, TreeItem::CELL_MODE_STRING);		ti->set_editable(0, true);		ti->set_selectable(0, true);		ti->set_text(0, E->get());		ti->set_metadata(0, E->get());		RES r = preloader->get_resource(E->get());		ERR_CONTINUE(r.is_null());		String type = r->get_class();		ti->set_icon(0, EditorNode::get_singleton()->get_class_icon(type, "Object"));		ti->set_tooltip(0, TTR("Instance:") + " " + r->get_path() + "/n" + TTR("Type:") + " " + type);		ti->set_text(1, r->get_path());		ti->set_editable(1, false);		ti->set_selectable(1, false);		if (type == "PackedScene") {			ti->add_button(1, get_icon("InstanceOptions", "EditorIcons"), BUTTON_OPEN_SCENE, false, TTR("Open in Editor"));		} else {			ti->add_button(1, get_icon("Load", "EditorIcons"), BUTTON_EDIT_RESOURCE, false, TTR("Open in Editor"));		}		ti->add_button(1, get_icon("Remove", "EditorIcons"), BUTTON_REMOVE, false, TTR("Remove"));	}	//player->add_resource("default",resource);}
开发者ID:Paulloz,项目名称:godot,代码行数:47,


示例19: print_line

void ExportTemplateManager::_http_download_mirror_completed(int p_status, int p_code, const PoolStringArray &headers, const PoolByteArray &p_data) {	if (p_status != HTTPRequest::RESULT_SUCCESS || p_code != 200) {		EditorNode::get_singleton()->show_warning("Error getting the list of mirrors.");		return;	}	String mirror_str;	{		PoolByteArray::Read r = p_data.read();		mirror_str.parse_utf8((const char *)r.ptr(), p_data.size());	}	template_list_state->hide();	template_download_progress->hide();	Variant r;	String errs;	int errline;	Error err = JSON::parse(mirror_str, r, errs, errline);	if (err != OK) {		EditorNode::get_singleton()->show_warning("Error parsing JSON of mirror list. Please report this issue!");		return;	}	bool mirrors_found = false;	Dictionary d = r;	print_line(r);	if (d.has("mirrors")) {		Array mirrors = d["mirrors"];		for (int i = 0; i < mirrors.size(); i++) {			Dictionary m = mirrors[i];			ERR_CONTINUE(!m.has("url") || !m.has("name"));			LinkButton *lb = memnew(LinkButton);			lb->set_text(m["name"]);			lb->connect("pressed", this, "_begin_template_download", varray(m["url"]));			template_list->add_child(lb);			mirrors_found = true;		}	}	if (!mirrors_found) {		EditorNode::get_singleton()->show_warning(TTR("No download links found for this version. Direct download is only available for official releases."));		return;	}}
开发者ID:kubecz3k,项目名称:godot,代码行数:47,


示例20: ERR_FAIL_COND

void TileSet::_tile_set_shapes(int p_id, const Array &p_shapes) {	ERR_FAIL_COND(!tile_map.has(p_id));	Vector<ShapeData> shapes_data;	Transform2D default_transform = tile_get_shape_transform(p_id, 0);	bool default_one_way = tile_get_shape_one_way(p_id, 0);	for (int i = 0; i < p_shapes.size(); i++) {		ShapeData s = ShapeData();		if (p_shapes[i].get_type() == Variant::OBJECT) {			Ref<Shape2D> shape = p_shapes[i];			if (shape.is_null()) continue;			s.shape = shape;			s.shape_transform = default_transform;			s.one_way_collision = default_one_way;		} else if (p_shapes[i].get_type() == Variant::DICTIONARY) {			Dictionary d = p_shapes[i];			if (d.has("shape") && d["shape"].get_type() == Variant::OBJECT)				s.shape = d["shape"];			else				continue;			if (d.has("shape_transform") && d["shape_transform"].get_type() == Variant::TRANSFORM2D)				s.shape_transform = d["shape_transform"];			else if (d.has("shape_offset") && d["shape_offset"].get_type() == Variant::VECTOR2)				s.shape_transform = Transform2D(0, (Vector2)d["shape_offset"]);			else				s.shape_transform = default_transform;			if (d.has("one_way") && d["one_way"].get_type() == Variant::BOOL)				s.one_way_collision = d["one_way"];			else				s.one_way_collision = default_one_way;		} else {			ERR_EXPLAIN("Expected an array of objects or dictionaries for tile_set_shapes");			ERR_CONTINUE(true);		}		shapes_data.push_back(s);	}	tile_map[p_id].shapes_data = shapes_data;}
开发者ID:rrrfffrrr,项目名称:godot,代码行数:46,


示例21: ERR_FAIL_COND

void GridMap::_octant_enter_tree(const OctantKey &p_key) {	ERR_FAIL_COND(!octant_map.has(p_key));	if (navigation) {		Octant &g = *octant_map[p_key];		Vector3 ofs(cell_size * 0.5 * int(center_x), cell_size * 0.5 * int(center_y), cell_size * 0.5 * int(center_z));		_octant_clear_navmesh(p_key);		for (Map<int, Octant::ItemInstances>::Element *E = g.items.front(); E; E = E->next()) {			Octant::ItemInstances &ii = E->get();			for (Set<IndexKey>::Element *F = ii.cells.front(); F; F = F->next()) {				IndexKey ik = F->get();				Map<IndexKey, Cell>::Element *C = cell_map.find(ik);				ERR_CONTINUE(!C);				Vector3 cellpos = Vector3(ik.x, ik.y, ik.z);				Transform xform;				if (clip && ((clip_above && cellpos[clip_axis] > clip_floor) || (!clip_above && cellpos[clip_axis] < clip_floor))) {					xform.basis.set_zero();				} else {					xform.basis.set_orthogonal_index(C->get().rot);				}				xform.set_origin(cellpos * cell_size + ofs);				xform.basis.scale(Vector3(cell_scale, cell_scale, cell_scale));				// add the item's navmesh at given xform to GridMap's Navigation ancestor				if (ii.navmesh.is_valid()) {					int nm_id = navigation->navmesh_create(ii.navmesh, xform, this);					Octant::NavMesh nm;					nm.id = nm_id;					nm.xform = xform;					g.navmesh_ids[ik] = nm;				}			}		}	}}
开发者ID:MattUV,项目名称:godot,代码行数:44,


示例22: ERR_CONTINUE

void ResourcePreloaderEditor::_update_library() {	tree->clear();	tree->set_hide_root(true);	TreeItem *root = tree->create_item(NULL);	List<StringName> rnames;	preloader->get_resource_list(&rnames);	List<String> names;	for(List<StringName>::Element *E=rnames.front();E;E=E->next()) {		names.push_back(E->get());	}	names.sort();	for(List<String>::Element *E=names.front();E;E=E->next()) {		TreeItem *ti = tree->create_item(root);		ti->set_cell_mode(0,TreeItem::CELL_MODE_STRING);		ti->set_editable(0,true);		ti->set_selectable(0,true);		ti->set_text(0,E->get());		ti->set_metadata(0,E->get());		RES r = preloader->get_resource(E->get());		ERR_CONTINUE(r.is_null());		ti->set_tooltip(0,r->get_path());		String type = r->get_type();		ti->set_text(1,type);		ti->set_selectable(1,false);		if (has_icon(type,"EditorIcons"))			ti->set_icon( 1, get_icon(type,"EditorIcons") );	}	//player->add_resource("default",resource);}
开发者ID:3miu,项目名称:godot,代码行数:43,


示例23: ERR_FAIL_COND

void ResourcePreloader::_set_resources(const Array& p_data) {	resources.clear();	ERR_FAIL_COND(p_data.size()!=2);	DVector<String> names=p_data[0];	Array resdata=p_data[1];	ERR_FAIL_COND(names.size()!=resdata.size());	for(int i=0;i<resdata.size();i++) {		String name=names[i];		RES resource = resdata[i];		ERR_CONTINUE( !resource.is_valid() );		resources[name]=resource;		//add_resource(name,resource);	}}
开发者ID:0871087123,项目名称:godot,代码行数:21,


示例24: ERR_CONTINUE

void ImportDock::_reimport() {	for (int i = 0; i < params->paths.size(); i++) {		Ref<ConfigFile> config;		config.instance();		Error err = config->load(params->paths[i] + ".import");		ERR_CONTINUE(err != OK);		config->erase_section("params");		for (List<PropertyInfo>::Element *E = params->properties.front(); E; E = E->next()) {			config->set_value("params", E->get().name, params->values[E->get().name]);		}		config->save(params->paths[i] + ".import");	}	EditorFileSystem::get_singleton()->reimport_files(params->paths);	EditorFileSystem::get_singleton()->emit_signal("filesystem_changed"); //it changed, so force emitting the signal}
开发者ID:MattUV,项目名称:godot,代码行数:21,


示例25: ERR_CONTINUE

void ScriptEditor::get_breakpoints(List<String> *p_breakpoints) {	for(int i=0;i<tab_container->get_child_count();i++) {		ScriptTextEditor *ste = tab_container->get_child(i)->cast_to<ScriptTextEditor>();		if (!ste)			continue;		List<int> bpoints;		ste->get_text_edit()->get_breakpoints(&bpoints);		Ref<Script> script = ste->get_edited_script();		String base = script->get_path();		ERR_CONTINUE( base.begins_with("local://") || base=="" );		for(List<int>::Element *E=bpoints.front();E;E=E->next()) {			p_breakpoints->push_back(base+":"+itos(E->get()+1));		}	}}
开发者ID:madmagi,项目名称:godot,代码行数:22,


示例26: get_tree

void ScriptEditor::_update_modified_scripts_for_external_editor(Ref<Script> p_for_script) {	if (!bool(EditorSettings::get_singleton()->get("external_editor/use_external_editor")))		return;	Set<Ref<Script> > scripts;	Node *base = get_tree()->get_edited_scene_root();	if (base) {		_find_changed_scripts_for_external_editor(base,base,scripts);	}	for (Set<Ref<Script> >::Element *E=scripts.front();E;E=E->next()) {		Ref<Script> script = E->get();		if (p_for_script.is_valid() && p_for_script!=script)			continue;		if (script->get_path()=="" || script->get_path().find("local://")!=-1 || script->get_path().find("::")!=-1) {			continue; //internal script, who cares, though weird		}		uint64_t last_date = script->get_last_modified_time();		uint64_t date = FileAccess::get_modified_time(script->get_path());		if (last_date!=date) {			Ref<Script> rel_script = ResourceLoader::load(script->get_path(),script->get_type(),true);			ERR_CONTINUE(!rel_script.is_valid());			script->set_source_code( rel_script->get_source_code() );			script->set_last_modified_time( rel_script->get_last_modified_time() );			script->update_exports();		}	}}
开发者ID:Blake-Hudson,项目名称:godot,代码行数:38,


示例27: GLOBAL_GET

void VisualServerViewport::draw_viewports() {	//sort viewports	//draw viewports	clear_color = GLOBAL_GET("rendering/viewport/default_clear_color");	active_viewports.sort_custom<ViewportSort>();	for (int i = 0; i < active_viewports.size(); i++) {		Viewport *vp = active_viewports[i];		if (vp->update_mode == VS::VIEWPORT_UPDATE_DISABLED)			continue;		ERR_CONTINUE(!vp->render_target.is_valid());		bool visible = vp->viewport_to_screen_rect != Rect2() || vp->update_mode == VS::VIEWPORT_UPDATE_ALWAYS || vp->update_mode == VS::VIEWPORT_UPDATE_ONCE;		if (!visible)			continue;		VSG::rasterizer->set_current_render_target(vp->render_target);		_draw_viewport(vp);		if (vp->viewport_to_screen_rect != Rect2()) {			//copy to screen if set as such			VSG::rasterizer->set_current_render_target(RID());			VSG::rasterizer->blit_render_target_to_screen(vp->render_target, vp->viewport_to_screen_rect, vp->viewport_to_screen);		}		if (vp->update_mode == VS::VIEWPORT_UPDATE_ONCE) {			vp->update_mode = VS::VIEWPORT_UPDATE_DISABLED;		}	}}
开发者ID:Alex-doc,项目名称:godot,代码行数:38,


示例28: zipio_create_io_from_file

//.........这里部分代码省略.........			String data_str;			data_str.parse_utf8((const char *)data.ptr(), data.size());			data_str = data_str.strip_edges();			// Version number should be of the form major.minor[.patch].status[.module_config]			// so it can in theory have 3 or more slices.			if (data_str.get_slice_count(".") < 3) {				EditorNode::get_singleton()->show_warning(vformat(TTR("Invalid version.txt format inside templates: %s."), data_str));				unzClose(pkg);				return;			}			version = data_str;		}		if (file.get_file().size() != 0) {			fc++;		}		ret = unzGoToNextFile(pkg);	}	if (version == String()) {		EditorNode::get_singleton()->show_warning(TTR("No version.txt found inside templates."));		unzClose(pkg);		return;	}	String template_path = EditorSettings::get_singleton()->get_templates_dir().plus_file(version);	DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);	Error err = d->make_dir_recursive(template_path);	if (err != OK) {		EditorNode::get_singleton()->show_warning(TTR("Error creating path for templates:") + "/n" + template_path);		unzClose(pkg);		return;	}	memdelete(d);	ret = unzGoToFirstFile(pkg);	EditorProgress *p = NULL;	if (p_use_progress) {		p = memnew(EditorProgress("ltask", TTR("Extracting Export Templates"), fc));	}	fc = 0;	while (ret == UNZ_OK) {		//get filename		unz_file_info info;		char fname[16384];		unzGetCurrentFileInfo(pkg, &info, fname, 16384, NULL, 0, NULL, 0);		String file = String(fname).get_file();		if (file.size() == 0) {			ret = unzGoToNextFile(pkg);			continue;		}		Vector<uint8_t> data;		data.resize(info.uncompressed_size);		//read		unzOpenCurrentFile(pkg);		unzReadCurrentFile(pkg, data.ptrw(), data.size());		unzCloseCurrentFile(pkg);		if (p) {			p->step(TTR("Importing:") + " " + file, fc);		}		FileAccess *f = FileAccess::open(template_path.plus_file(file), FileAccess::WRITE);		if (!f) {			ret = unzGoToNextFile(pkg);			fc++;			ERR_CONTINUE(!f);		}		f->store_buffer(data.ptr(), data.size());		memdelete(f);		ret = unzGoToNextFile(pkg);		fc++;	}	if (p) {		memdelete(p);	}	unzClose(pkg);	_update_template_list();}
开发者ID:RandomShaper,项目名称:godot,代码行数:101,


示例29: ERR_FAIL_INDEX

//.........这里部分代码省略.........				p_char_count++;				ADVANCE( img->image->get_width() );				CHECK_HEIGHT( (img->image->get_height()+font->get_descent()) );			} break;			case ITEM_NEWLINE: {				lh=0;				if (p_mode!=PROCESS_CACHE)					lh = line<l.height_caches.size()?l.height_caches[line]:1;			} break;			case ITEM_TABLE: {				lh=0;				ItemTable *table = static_cast<ItemTable*>(it);				int hseparation=get_constant("table_hseparation");				int vseparation=get_constant("table_vseparation");				Color ccolor = _find_color(table,p_base_color);				Vector2 draw_ofs = Point2(wofs,y);				if (p_mode==PROCESS_CACHE) {					int idx=0;					//set minimums to zero					for(int i=0;i<table->columns.size();i++) {						table->columns[i].min_width=0;						table->columns[i].width=0;					}					//compute minimum width for each cell					for (List<Item*>::Element *E=table->subitems.front();E;E=E->next()) {						ERR_CONTINUE(E->get()->type!=ITEM_FRAME); //children should all be frames						ItemFrame *frame = static_cast<ItemFrame*>(E->get());						int column = idx % table->columns.size();						int ly=0;						for(int i=0;i<frame->lines.size();i++) {							_process_line(frame,Point2(),ly,p_width,i,PROCESS_CACHE,cfont,Color());							table->columns[column].min_width=MAX( table->columns[i].min_width, frame->lines[i].minimum_width );						}						idx++;					}					//compute available width and total radio (for expanders)					int total_ratio=0;					int available_width=p_width - hseparation * (table->columns.size() -1);					table->total_width=hseparation;					for(int i=0;i<table->columns.size();i++) {						available_width-=table->columns[i].min_width;						if (table->columns[i].expand)							total_ratio+=table->columns[i].expand_ratio;					}					//assign actual widths					for(int i=0;i<table->columns.size();i++) {						table->columns[i].width = table->columns[i].min_width;
开发者ID:icarito,项目名称:godot,代码行数:67,


示例30: while

void ScriptDebuggerRemote::_poll_events() {	//this si called from ::idle_poll, happens only when running the game,	//does not get called while on debug break	while (packet_peer_stream->get_available_packet_count() > 0) {		_get_output();		//send over output_strings		Variant var;		Error err = packet_peer_stream->get_var(var);		ERR_CONTINUE(err != OK);		ERR_CONTINUE(var.get_type() != Variant::ARRAY);		Array cmd = var;		ERR_CONTINUE(cmd.size() == 0);		ERR_CONTINUE(cmd[0].get_type() != Variant::STRING);		String command = cmd[0];		//cmd.remove(0);		if (command == "break") {			if (get_break_language())				debug(get_break_language());		} else if (command == "request_scene_tree") {			if (request_scene_tree)				request_scene_tree(request_scene_tree_ud);		} else if (command == "request_video_mem") {			_send_video_memory();		} else if (command == "inspect_object") {			ObjectID id = cmd[1];			_send_object_id(id);		} else if (command == "set_object_property") {			_set_object_property(cmd[1], cmd[2], cmd[3]);		} else if (command == "start_profiling") {			for (int i = 0; i < ScriptServer::get_language_count(); i++) {				ScriptServer::get_language(i)->profiling_start();			}			max_frame_functions = cmd[1];			profiler_function_signature_map.clear();			profiling = true;			frame_time = 0;			idle_time = 0;			fixed_time = 0;			fixed_frame_time = 0;			print_line("PROFILING ALRIGHT!");		} else if (command == "stop_profiling") {			for (int i = 0; i < ScriptServer::get_language_count(); i++) {				ScriptServer::get_language(i)->profiling_stop();			}			profiling = false;			_send_profiling_data(false);			print_line("PROFILING END!");		} else if (command == "reload_scripts") {			reload_all_scripts = true;		} else if (command == "breakpoint") {			bool set = cmd[3];			if (set)				insert_breakpoint(cmd[2], cmd[1]);			else				remove_breakpoint(cmd[2], cmd[1]);		} else {			_parse_live_edit(cmd);		}	}}
开发者ID:jejung,项目名称:godot,代码行数:82,



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


C++ ERR_COPY_FROM_USER函数代码示例
C++ ERR_CAST函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。