当前位置: 首页>>代码示例>>C++>>正文


C++ ERR_CONTINUE函数代码示例

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


在下文中一共展示了ERR_CONTINUE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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,代码来源:script_debugger_remote.cpp

示例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,代码来源:skeleton.cpp

示例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,代码来源:object.cpp

示例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,代码来源:font.cpp

示例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,代码来源:resource_importer_texture.cpp

示例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,代码来源:baked_light_editor_plugin.cpp

示例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,代码来源:gd_function.cpp

示例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,代码来源:filter_bank_fr.cpp

示例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,代码来源:skeleton.cpp

示例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,代码来源:animation_tree.cpp

示例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,代码来源:resource.cpp

示例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,代码来源:skeleton.cpp

示例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,代码来源:editor_reimport_dialog.cpp

示例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,代码来源:baked_lightmap.cpp

示例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,代码来源:navigation.cpp


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