diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-01-07 18:25:37 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-01-07 18:26:38 -0300 |
commit | 2ab83e1abbf5ee6d00e16056a9e9394114026f28 (patch) | |
tree | 7efbb375cc4d00d8e8589fcf1b6a1303bec5df2d /scene | |
parent | 2a38a5eaa844043b846e03d6655f84caf8a31e74 (diff) | |
download | redot-engine-2ab83e1abbf5ee6d00e16056a9e9394114026f28.tar.gz |
Memory pool vectors (DVector) have been enormously simplified in code, and renamed to PoolVector
Diffstat (limited to 'scene')
91 files changed, 525 insertions, 525 deletions
diff --git a/scene/2d/collision_polygon_2d.cpp b/scene/2d/collision_polygon_2d.cpp index 4b7a918023..46baa7c184 100644 --- a/scene/2d/collision_polygon_2d.cpp +++ b/scene/2d/collision_polygon_2d.cpp @@ -68,16 +68,16 @@ void CollisionPolygon2D::_add_to_collision_object(Object *p_obj) { Ref<ConcavePolygonShape2D> concave = memnew( ConcavePolygonShape2D ); - DVector<Vector2> segments; + PoolVector<Vector2> segments; segments.resize(polygon.size()*2); - DVector<Vector2>::Write w=segments.write(); + PoolVector<Vector2>::Write w=segments.write(); for(int i=0;i<polygon.size();i++) { w[(i<<1)+0]=polygon[i]; w[(i<<1)+1]=polygon[(i+1)%polygon.size()]; } - w=DVector<Vector2>::Write(); + w=PoolVector<Vector2>::Write(); concave->set_segments(segments); co->add_shape(concave,get_transform()); diff --git a/scene/2d/light_occluder_2d.cpp b/scene/2d/light_occluder_2d.cpp index ac1fb16d78..ac2a8d4dc5 100644 --- a/scene/2d/light_occluder_2d.cpp +++ b/scene/2d/light_occluder_2d.cpp @@ -29,14 +29,14 @@ #include "light_occluder_2d.h" -void OccluderPolygon2D::set_polygon(const DVector<Vector2>& p_polygon) { +void OccluderPolygon2D::set_polygon(const PoolVector<Vector2>& p_polygon) { polygon=p_polygon; VS::get_singleton()->canvas_occluder_polygon_set_shape(occ_polygon,p_polygon,closed); emit_changed(); } -DVector<Vector2> OccluderPolygon2D::get_polygon() const{ +PoolVector<Vector2> OccluderPolygon2D::get_polygon() const{ return polygon; } @@ -141,7 +141,7 @@ void LightOccluder2D::_notification(int p_what) { if (occluder_polygon.is_valid()) { - DVector<Vector2> poly = occluder_polygon->get_polygon(); + PoolVector<Vector2> poly = occluder_polygon->get_polygon(); if (poly.size()) { if (occluder_polygon->is_closed()) { @@ -151,7 +151,7 @@ void LightOccluder2D::_notification(int p_what) { } else { int ps=poly.size(); - DVector<Vector2>::Read r = poly.read(); + PoolVector<Vector2>::Read r = poly.read(); for(int i=0;i<ps-1;i++) { draw_line(r[i],r[i+1],Color(0,0,0,0.6),3); diff --git a/scene/2d/light_occluder_2d.h b/scene/2d/light_occluder_2d.h index 1d7430689f..777785cd1d 100644 --- a/scene/2d/light_occluder_2d.h +++ b/scene/2d/light_occluder_2d.h @@ -45,7 +45,7 @@ private: RID occ_polygon; - DVector<Vector2> polygon; + PoolVector<Vector2> polygon; bool closed; CullMode cull; @@ -54,8 +54,8 @@ protected: static void _bind_methods(); public: - void set_polygon(const DVector<Vector2>& p_polygon); - DVector<Vector2> get_polygon() const; + void set_polygon(const PoolVector<Vector2>& p_polygon); + PoolVector<Vector2> get_polygon() const; void set_closed(bool p_closed); bool is_closed() const; diff --git a/scene/2d/navigation2d.cpp b/scene/2d/navigation2d.cpp index 1a7d01c762..be68c61bd8 100644 --- a/scene/2d/navigation2d.cpp +++ b/scene/2d/navigation2d.cpp @@ -36,12 +36,12 @@ void Navigation2D::_navpoly_link(int p_id) { NavMesh &nm=navpoly_map[p_id]; ERR_FAIL_COND(nm.linked); - DVector<Vector2> vertices=nm.navpoly->get_vertices(); + PoolVector<Vector2> vertices=nm.navpoly->get_vertices(); int len = vertices.size(); if (len==0) return; - DVector<Vector2>::Read r=vertices.read(); + PoolVector<Vector2>::Read r=vertices.read(); for(int i=0;i<nm.navpoly->get_polygon_count();i++) { diff --git a/scene/2d/navigation_polygon.cpp b/scene/2d/navigation_polygon.cpp index a11f2240f9..add3a183ef 100644 --- a/scene/2d/navigation_polygon.cpp +++ b/scene/2d/navigation_polygon.cpp @@ -31,12 +31,12 @@ #include "triangulator.h" #include "core_string_names.h" -void NavigationPolygon::set_vertices(const DVector<Vector2>& p_vertices) { +void NavigationPolygon::set_vertices(const PoolVector<Vector2>& p_vertices) { vertices=p_vertices; } -DVector<Vector2> NavigationPolygon::get_vertices() const{ +PoolVector<Vector2> NavigationPolygon::get_vertices() const{ return vertices; } @@ -89,7 +89,7 @@ void NavigationPolygon::add_polygon(const Vector<int>& p_polygon){ } -void NavigationPolygon::add_outline_at_index(const DVector<Vector2>& p_outline,int p_index) { +void NavigationPolygon::add_outline_at_index(const PoolVector<Vector2>& p_outline,int p_index) { outlines.insert(p_index,p_outline); } @@ -108,7 +108,7 @@ void NavigationPolygon::clear_polygons(){ polygons.clear(); } -void NavigationPolygon::add_outline(const DVector<Vector2>& p_outline) { +void NavigationPolygon::add_outline(const PoolVector<Vector2>& p_outline) { outlines.push_back(p_outline); } @@ -118,7 +118,7 @@ int NavigationPolygon::get_outline_count() const{ return outlines.size(); } -void NavigationPolygon::set_outline(int p_idx,const DVector<Vector2>& p_outline) { +void NavigationPolygon::set_outline(int p_idx,const PoolVector<Vector2>& p_outline) { ERR_FAIL_INDEX(p_idx,outlines.size()); outlines[p_idx]=p_outline; } @@ -130,8 +130,8 @@ void NavigationPolygon::remove_outline(int p_idx) { } -DVector<Vector2> NavigationPolygon::get_outline(int p_idx) const { - ERR_FAIL_INDEX_V(p_idx,outlines.size(),DVector<Vector2>()); +PoolVector<Vector2> NavigationPolygon::get_outline(int p_idx) const { + ERR_FAIL_INDEX_V(p_idx,outlines.size(),PoolVector<Vector2>()); return outlines[p_idx]; } @@ -147,11 +147,11 @@ void NavigationPolygon::make_polygons_from_outlines(){ for(int i=0;i<outlines.size();i++) { - DVector<Vector2> ol = outlines[i]; + PoolVector<Vector2> ol = outlines[i]; int olsize = ol.size(); if (olsize<3) continue; - DVector<Vector2>::Read r=ol.read(); + PoolVector<Vector2>::Read r=ol.read(); for(int j=0;j<olsize;j++) { outside_point.x = MAX( r[j].x, outside_point.x ); outside_point.y = MAX( r[j].y, outside_point.y ); @@ -165,11 +165,11 @@ void NavigationPolygon::make_polygons_from_outlines(){ for(int i=0;i<outlines.size();i++) { - DVector<Vector2> ol = outlines[i]; + PoolVector<Vector2> ol = outlines[i]; int olsize = ol.size(); if (olsize<3) continue; - DVector<Vector2>::Read r=ol.read(); + PoolVector<Vector2>::Read r=ol.read(); int interscount=0; //test if this is an outer outline @@ -178,11 +178,11 @@ void NavigationPolygon::make_polygons_from_outlines(){ if (i==k) continue; //no self intersect - DVector<Vector2> ol2 = outlines[k]; + PoolVector<Vector2> ol2 = outlines[k]; int olsize2 = ol2.size(); if (olsize2<3) continue; - DVector<Vector2>::Read r2=ol2.read(); + PoolVector<Vector2>::Read r2=ol2.read(); for(int l=0;l<olsize2;l++) { @@ -368,7 +368,7 @@ void NavigationPolygonInstance::_notification(int p_what) { if (is_inside_tree() && (get_tree()->is_editor_hint() || get_tree()->is_debugging_navigation_hint()) && navpoly.is_valid()) { - DVector<Vector2> verts=navpoly->get_vertices(); + PoolVector<Vector2> verts=navpoly->get_vertices(); int vsize = verts.size(); if (vsize<3) return; @@ -385,7 +385,7 @@ void NavigationPolygonInstance::_notification(int p_what) { vertices.resize(vsize); colors.resize(vsize); { - DVector<Vector2>::Read vr = verts.read(); + PoolVector<Vector2>::Read vr = verts.read(); for(int i=0;i<vsize;i++) { vertices[i]=vr[i]; colors[i]=color; diff --git a/scene/2d/navigation_polygon.h b/scene/2d/navigation_polygon.h index edf3dcadc3..7f1762b6f5 100644 --- a/scene/2d/navigation_polygon.h +++ b/scene/2d/navigation_polygon.h @@ -36,12 +36,12 @@ class NavigationPolygon : public Resource { GDCLASS( NavigationPolygon, Resource ); - DVector<Vector2> vertices; + PoolVector<Vector2> vertices; struct Polygon { Vector<int> indices; }; Vector<Polygon> polygons; - Vector< DVector<Vector2> > outlines; + Vector< PoolVector<Vector2> > outlines; protected: @@ -57,16 +57,16 @@ public: - void set_vertices(const DVector<Vector2>& p_vertices); - DVector<Vector2> get_vertices() const; + void set_vertices(const PoolVector<Vector2>& p_vertices); + PoolVector<Vector2> get_vertices() const; void add_polygon(const Vector<int>& p_polygon); int get_polygon_count() const; - void add_outline(const DVector<Vector2>& p_outline); - void add_outline_at_index(const DVector<Vector2>& p_outline,int p_index); - void set_outline(int p_idx,const DVector<Vector2>& p_outline); - DVector<Vector2> get_outline(int p_idx) const; + void add_outline(const PoolVector<Vector2>& p_outline); + void add_outline_at_index(const PoolVector<Vector2>& p_outline,int p_index); + void set_outline(int p_idx,const PoolVector<Vector2>& p_outline); + PoolVector<Vector2> get_outline(int p_idx) const; void remove_outline(int p_idx); int get_outline_count() const; diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp index 168bd1b289..f8747d54b7 100644 --- a/scene/2d/particles_2d.cpp +++ b/scene/2d/particles_2d.cpp @@ -276,7 +276,7 @@ void Particles2D::_process_particles(float p_delta) { active_count=0; - DVector<Point2>::Read r; + PoolVector<Point2>::Read r; int emission_point_count=0; if (emission_points.size()) { @@ -992,12 +992,12 @@ int Particles2D::get_v_frames() const{ -void Particles2D::set_emission_points(const DVector<Vector2>& p_points) { +void Particles2D::set_emission_points(const PoolVector<Vector2>& p_points) { emission_points=p_points; } -DVector<Vector2> Particles2D::get_emission_points() const{ +PoolVector<Vector2> Particles2D::get_emission_points() const{ return emission_points; } diff --git a/scene/2d/particles_2d.h b/scene/2d/particles_2d.h index 9b740dad7d..91f42c5222 100644 --- a/scene/2d/particles_2d.h +++ b/scene/2d/particles_2d.h @@ -151,7 +151,7 @@ private: Point2 emissor_offset; Vector2 initial_velocity; Vector2 extents; - DVector<Vector2> emission_points; + PoolVector<Vector2> emission_points; float time; int active_count; @@ -245,8 +245,8 @@ public: void set_initial_velocity(const Vector2& p_velocity); Vector2 get_initial_velocity() const; - void set_emission_points(const DVector<Vector2>& p_points); - DVector<Vector2> get_emission_points() const; + void set_emission_points(const PoolVector<Vector2>& p_points); + PoolVector<Vector2> get_emission_points() const; void pre_process(float p_delta); void reset(); diff --git a/scene/2d/polygon_2d.cpp b/scene/2d/polygon_2d.cpp index 179e71fa90..948c8b0818 100644 --- a/scene/2d/polygon_2d.cpp +++ b/scene/2d/polygon_2d.cpp @@ -33,7 +33,7 @@ Rect2 Polygon2D::get_item_rect() const { if (rect_cache_dirty){ int l =polygon.size(); - DVector<Vector2>::Read r = polygon.read(); + PoolVector<Vector2>::Read r = polygon.read(); item_rect=Rect2(); for(int i=0;i<l;i++) { Vector2 pos = r[i] + offset; @@ -84,7 +84,7 @@ void Polygon2D::_notification(int p_what) { int len = points.size(); { - DVector<Vector2>::Read polyr =polygon.read(); + PoolVector<Vector2>::Read polyr =polygon.read(); for(int i=0;i<len;i++) { points[i]=polyr[i]+offset; } @@ -157,7 +157,7 @@ void Polygon2D::_notification(int p_what) { if (points.size()==uv.size()) { - DVector<Vector2>::Read uvr = uv.read(); + PoolVector<Vector2>::Read uvr = uv.read(); for(int i=0;i<len;i++) { uvs[i]=texmat.xform(uvr[i])/tex_size; @@ -176,7 +176,7 @@ void Polygon2D::_notification(int p_what) { int color_len=vertex_colors.size(); colors.resize(len); { - DVector<Color>::Read color_r=vertex_colors.read(); + PoolVector<Color>::Read color_r=vertex_colors.read(); for(int i=0;i<color_len && i<len;i++){ colors[i]=color_r[i]; } @@ -194,25 +194,25 @@ void Polygon2D::_notification(int p_what) { } -void Polygon2D::set_polygon(const DVector<Vector2>& p_polygon) { +void Polygon2D::set_polygon(const PoolVector<Vector2>& p_polygon) { polygon=p_polygon; rect_cache_dirty=true; update(); } -DVector<Vector2> Polygon2D::get_polygon() const{ +PoolVector<Vector2> Polygon2D::get_polygon() const{ return polygon; } -void Polygon2D::set_uv(const DVector<Vector2>& p_uv) { +void Polygon2D::set_uv(const PoolVector<Vector2>& p_uv) { uv=p_uv; update(); } -DVector<Vector2> Polygon2D::get_uv() const{ +PoolVector<Vector2> Polygon2D::get_uv() const{ return uv; } @@ -227,12 +227,12 @@ Color Polygon2D::get_color() const{ return color; } -void Polygon2D::set_vertex_colors(const DVector<Color>& p_colors){ +void Polygon2D::set_vertex_colors(const PoolVector<Color>& p_colors){ vertex_colors=p_colors; update(); } -DVector<Color> Polygon2D::get_vertex_colors() const{ +PoolVector<Color> Polygon2D::get_vertex_colors() const{ return vertex_colors; } diff --git a/scene/2d/polygon_2d.h b/scene/2d/polygon_2d.h index 6327021295..8434dae40c 100644 --- a/scene/2d/polygon_2d.h +++ b/scene/2d/polygon_2d.h @@ -35,9 +35,9 @@ class Polygon2D : public Node2D { GDCLASS(Polygon2D,Node2D); - DVector<Vector2> polygon; - DVector<Vector2> uv; - DVector<Color> vertex_colors; + PoolVector<Vector2> polygon; + PoolVector<Vector2> uv; + PoolVector<Color> vertex_colors; Color color; Ref<Texture> texture; Size2 tex_scale; @@ -60,17 +60,17 @@ protected: static void _bind_methods(); public: - void set_polygon(const DVector<Vector2>& p_polygon); - DVector<Vector2> get_polygon() const; + void set_polygon(const PoolVector<Vector2>& p_polygon); + PoolVector<Vector2> get_polygon() const; - void set_uv(const DVector<Vector2>& p_uv); - DVector<Vector2> get_uv() const; + void set_uv(const PoolVector<Vector2>& p_uv); + PoolVector<Vector2> get_uv() const; void set_color(const Color& p_color); Color get_color() const; - void set_vertex_colors(const DVector<Color>& p_colors); - DVector<Color> get_vertex_colors() const; + void set_vertex_colors(const PoolVector<Color>& p_colors); + PoolVector<Color> get_vertex_colors() const; void set_texture(const Ref<Texture>& p_texture); Ref<Texture> get_texture() const; diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 54d3f9f5dd..04b0379a1c 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -819,10 +819,10 @@ void TileMap::clear() { tile_map.clear(); } -void TileMap::_set_tile_data(const DVector<int>& p_data) { +void TileMap::_set_tile_data(const PoolVector<int>& p_data) { int c=p_data.size(); - DVector<int>::Read r = p_data.read(); + PoolVector<int>::Read r = p_data.read(); for(int i=0;i<c;i+=2) { @@ -857,11 +857,11 @@ void TileMap::_set_tile_data(const DVector<int>& p_data) { } -DVector<int> TileMap::_get_tile_data() const { +PoolVector<int> TileMap::_get_tile_data() const { - DVector<int> data; + PoolVector<int> data; data.resize(tile_map.size()*2); - DVector<int>::Write w = data.write(); + PoolVector<int>::Write w = data.write(); int idx=0; for(const Map<PosKey,Cell>::Element *E=tile_map.front();E;E=E->next()) { @@ -882,7 +882,7 @@ DVector<int> TileMap::_get_tile_data() const { } - w = DVector<int>::Write(); + w = PoolVector<int>::Write(); return data; diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h index 8cc144b74d..f863c0b2ea 100644 --- a/scene/2d/tile_map.h +++ b/scene/2d/tile_map.h @@ -168,8 +168,8 @@ private: _FORCE_INLINE_ int _get_quadrant_size() const; - void _set_tile_data(const DVector<int>& p_data); - DVector<int> _get_tile_data() const; + void _set_tile_data(const PoolVector<int>& p_data); + PoolVector<int> _get_tile_data() const; void _set_old_cell_size(int p_size) { set_cell_size(Size2(p_size,p_size)); } int _get_old_cell_size() const { return cell_size.x; } diff --git a/scene/3d/baked_light_instance.cpp b/scene/3d/baked_light_instance.cpp index b5cc451835..f85dfea80e 100644 --- a/scene/3d/baked_light_instance.cpp +++ b/scene/3d/baked_light_instance.cpp @@ -204,7 +204,7 @@ Vector<Color> BakedLight::_get_bake_texture(Image &p_image,const Color& p_color) p_image.resize(bake_texture_size,bake_texture_size,Image::INTERPOLATE_CUBIC); - DVector<uint8_t>::Read r = p_image.get_data().read(); + PoolVector<uint8_t>::Read r = p_image.get_data().read(); ret.resize(bake_texture_size*bake_texture_size); for(int i=0;i<bake_texture_size*bake_texture_size;i++) { @@ -506,7 +506,7 @@ void BakedLight::_plot_face(int p_idx, int p_level, const Vector3 *p_vtx, const if (bake_cells_used==(1<<bake_cells_alloc)) { //exhausted cells, creating more space bake_cells_alloc++; - bake_cells_write=DVector<BakeCell>::Write(); + bake_cells_write=PoolVector<BakeCell>::Write(); bake_cells.resize(1<<bake_cells_alloc); bake_cells_write=bake_cells.write(); } @@ -670,11 +670,11 @@ void BakedLight::_bake_add_mesh(const Transform& p_xform,Ref<Mesh>& p_mesh) { Array a = p_mesh->surface_get_arrays(i); - DVector<Vector3> vertices = a[Mesh::ARRAY_VERTEX]; - DVector<Vector3>::Read vr=vertices.read(); - DVector<Vector2> uv = a[Mesh::ARRAY_TEX_UV]; - DVector<Vector2>::Read uvr; - DVector<int> index = a[Mesh::ARRAY_INDEX]; + PoolVector<Vector3> vertices = a[Mesh::ARRAY_VERTEX]; + PoolVector<Vector3>::Read vr=vertices.read(); + PoolVector<Vector2> uv = a[Mesh::ARRAY_TEX_UV]; + PoolVector<Vector2>::Read uvr; + PoolVector<int> index = a[Mesh::ARRAY_INDEX]; bool read_uv=false; @@ -687,7 +687,7 @@ void BakedLight::_bake_add_mesh(const Transform& p_xform,Ref<Mesh>& p_mesh) { if (index.size()) { int facecount = index.size()/3; - DVector<int>::Read ir=index.read(); + PoolVector<int>::Read ir=index.read(); for(int j=0;j<facecount;j++) { @@ -747,9 +747,9 @@ void BakedLight::_bake_add_to_aabb(const Transform& p_xform,Ref<Mesh>& p_mesh,bo continue; //only triangles Array a = p_mesh->surface_get_arrays(i); - DVector<Vector3> vertices = a[Mesh::ARRAY_VERTEX]; + PoolVector<Vector3> vertices = a[Mesh::ARRAY_VERTEX]; int vc = vertices.size(); - DVector<Vector3>::Read vr=vertices.read(); + PoolVector<Vector3>::Read vr=vertices.read(); if (first) { bounds.pos=p_xform.xform(vr[0]); @@ -827,7 +827,7 @@ void BakedLight::bake() { _fixup_plot(0, 0,0,0,0); - bake_cells_write=DVector<BakeCell>::Write(); + bake_cells_write=PoolVector<BakeCell>::Write(); bake_cells.resize(bake_cells_used); @@ -1005,7 +1005,7 @@ void BakedLight::bake_lights() { _upscale_light(0,0); - bake_cells_write=DVector<BakeCell>::Write(); + bake_cells_write=PoolVector<BakeCell>::Write(); } @@ -1371,7 +1371,7 @@ void BakedLight::bake_radiance() { _bake_radiance(0,0,0,0,0); - bake_cells_write=DVector<BakeCell>::Write(); + bake_cells_write=PoolVector<BakeCell>::Write(); } int BakedLight::_find_cell(int x,int y, int z) { @@ -1538,9 +1538,9 @@ AABB BakedLight::get_aabb() const { return AABB(Vector3(0,0,0),Vector3(1,1,1)); } -DVector<Face3> BakedLight::get_faces(uint32_t p_usage_flags) const { +PoolVector<Face3> BakedLight::get_faces(uint32_t p_usage_flags) const { - return DVector<Face3>(); + return PoolVector<Face3>(); } @@ -1621,8 +1621,8 @@ void BakedLight::create_debug_mesh(DebugMode p_mode) { Array arr; arr.resize(Mesh::ARRAY_MAX); - DVector<Vector3> vertices; - DVector<Color> colors; + PoolVector<Vector3> vertices; + PoolVector<Color> colors; int vtx_idx=0; #define ADD_VTX(m_idx);\ diff --git a/scene/3d/baked_light_instance.h b/scene/3d/baked_light_instance.h index d097a9af60..461b3adeff 100644 --- a/scene/3d/baked_light_instance.h +++ b/scene/3d/baked_light_instance.h @@ -107,8 +107,8 @@ private: int bake_cells_used; int zero_alphas; Vector<int> bake_cells_level_used; - DVector<BakeCell> bake_cells; - DVector<BakeCell>::Write bake_cells_write; + PoolVector<BakeCell> bake_cells; + PoolVector<BakeCell>::Write bake_cells_write; @@ -157,7 +157,7 @@ public: void create_debug_mesh(DebugMode p_mode); virtual AABB get_aabb() const; - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; String get_configuration_warning() const; @@ -192,7 +192,7 @@ protected: public: virtual AABB get_aabb() const; - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; void set_param(Param p_param,float p_value); float get_param(Param p_param) const; diff --git a/scene/3d/body_shape.cpp b/scene/3d/body_shape.cpp index 0f71933388..ff8b0f15bf 100644 --- a/scene/3d/body_shape.cpp +++ b/scene/3d/body_shape.cpp @@ -83,8 +83,8 @@ void CollisionShape::_update_indicator() { if (shape.is_null()) return; - DVector<Vector3> points; - DVector<Vector3> normals; + PoolVector<Vector3> points; + PoolVector<Vector3> normals; VS::PrimitiveType pt = VS::PRIMITIVE_TRIANGLES; @@ -235,7 +235,7 @@ void CollisionShape::_update_indicator() { CapsuleShape *shapeptr=shape->cast_to<CapsuleShape>(); - DVector<Plane> planes = Geometry::build_capsule_planes(shapeptr->get_radius(), shapeptr->get_height()/2.0, 12, Vector3::AXIS_Z); + PoolVector<Plane> planes = Geometry::build_capsule_planes(shapeptr->get_radius(), shapeptr->get_height()/2.0, 12, Vector3::AXIS_Z); Geometry::MeshData md = Geometry::build_convex_mesh(planes); for(int i=0;i<md.faces.size();i++) { @@ -840,7 +840,7 @@ void CollisionShapeCylinder::update_indicator(RID p_indicator) { vs->poly_clear(p_indicator); Color col(0.4,1.0,1.0,0.5); - DVector<Plane> planes = Geometry::build_cylinder_planes(radius, height, 12, Vector3::AXIS_Z); + PoolVector<Plane> planes = Geometry::build_cylinder_planes(radius, height, 12, Vector3::AXIS_Z); Geometry::MeshData md = Geometry::build_convex_mesh(planes); for(int i=0;i<md.faces.size();i++) { @@ -906,7 +906,7 @@ void CollisionShapeCapsule::update_indicator(RID p_indicator) { vs->poly_clear(p_indicator); Color col(0.4,1.0,1.0,0.5); - DVector<Plane> planes = Geometry::build_capsule_planes(radius, height, 12, 3, Vector3::AXIS_Z); + PoolVector<Plane> planes = Geometry::build_capsule_planes(radius, height, 12, 3, Vector3::AXIS_Z); Geometry::MeshData md = Geometry::build_convex_mesh(planes); for(int i=0;i<md.faces.size();i++) { diff --git a/scene/3d/collision_polygon.cpp b/scene/3d/collision_polygon.cpp index 8c34748191..6cc0291707 100644 --- a/scene/3d/collision_polygon.cpp +++ b/scene/3d/collision_polygon.cpp @@ -56,11 +56,11 @@ void CollisionPolygon::_add_to_collision_object(Object *p_obj) { shape_from=co->get_shape_count(); for(int i=0;i<decomp.size();i++) { Ref<ConvexPolygonShape> convex = memnew( ConvexPolygonShape ); - DVector<Vector3> cp; + PoolVector<Vector3> cp; int cs = decomp[i].size(); cp.resize(cs*2); { - DVector<Vector3>::Write w = cp.write(); + PoolVector<Vector3>::Write w = cp.write(); int idx=0; for(int j=0;j<cs;j++) { @@ -84,16 +84,16 @@ void CollisionPolygon::_add_to_collision_object(Object *p_obj) { #if 0 Ref<ConcavePolygonShape> concave = memnew( ConcavePolygonShape ); - DVector<Vector2> segments; + PoolVector<Vector2> segments; segments.resize(polygon.size()*2); - DVector<Vector2>::Write w=segments.write(); + PoolVector<Vector2>::Write w=segments.write(); for(int i=0;i<polygon.size();i++) { w[(i<<1)+0]=polygon[i]; w[(i<<1)+1]=polygon[(i+1)%polygon.size()]; } - w=DVector<Vector2>::Write(); + w=PoolVector<Vector2>::Write(); concave->set_segments(segments); co->add_shape(concave,get_transform()); diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp index 19c67faa39..5b51273d0e 100644 --- a/scene/3d/gi_probe.cpp +++ b/scene/3d/gi_probe.cpp @@ -37,12 +37,12 @@ Transform GIProbeData::get_to_cell_xform() const { } -void GIProbeData::set_dynamic_data(const DVector<int>& p_data){ +void GIProbeData::set_dynamic_data(const PoolVector<int>& p_data){ VS::get_singleton()->gi_probe_set_dynamic_data(probe,p_data); } -DVector<int> GIProbeData::get_dynamic_data() const{ +PoolVector<int> GIProbeData::get_dynamic_data() const{ return VS::get_singleton()->gi_probe_get_dynamic_data(probe); } @@ -832,7 +832,7 @@ Vector<Color> GIProbe::_get_bake_texture(Image &p_image,const Color& p_color) { p_image.resize(bake_texture_size,bake_texture_size,Image::INTERPOLATE_CUBIC); - DVector<uint8_t>::Read r = p_image.get_data().read(); + PoolVector<uint8_t>::Read r = p_image.get_data().read(); ret.resize(bake_texture_size*bake_texture_size); for(int i=0;i<bake_texture_size*bake_texture_size;i++) { @@ -919,11 +919,11 @@ void GIProbe::_plot_mesh(const Transform& p_xform, Ref<Mesh>& p_mesh, Baker *p_b Array a = p_mesh->surface_get_arrays(i); - DVector<Vector3> vertices = a[Mesh::ARRAY_VERTEX]; - DVector<Vector3>::Read vr=vertices.read(); - DVector<Vector2> uv = a[Mesh::ARRAY_TEX_UV]; - DVector<Vector2>::Read uvr; - DVector<int> index = a[Mesh::ARRAY_INDEX]; + PoolVector<Vector3> vertices = a[Mesh::ARRAY_VERTEX]; + PoolVector<Vector3>::Read vr=vertices.read(); + PoolVector<Vector2> uv = a[Mesh::ARRAY_TEX_UV]; + PoolVector<Vector2>::Read uvr; + PoolVector<int> index = a[Mesh::ARRAY_INDEX]; bool read_uv=false; @@ -936,7 +936,7 @@ void GIProbe::_plot_mesh(const Transform& p_xform, Ref<Mesh>& p_mesh, Baker *p_b if (index.size()) { int facecount = index.size()/3; - DVector<int>::Read ir=index.read(); + PoolVector<int>::Read ir=index.read(); for(int j=0;j<facecount;j++) { @@ -1090,12 +1090,12 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug){ //create the data for visual server - DVector<int> data; + PoolVector<int> data; data.resize( 16+(8+1+1+1+1)*baker.bake_cells.size() ); //4 for header, rest for rest. { - DVector<int>::Write w = data.write(); + PoolVector<int>::Write w = data.write(); uint32_t * w32 = (uint32_t*)w.ptr(); @@ -1247,8 +1247,8 @@ void GIProbe::_create_debug_mesh(Baker *p_baker) { Array arr; arr.resize(Mesh::ARRAY_MAX); - DVector<Vector3> vertices; - DVector<Color> colors; + PoolVector<Vector3> vertices; + PoolVector<Color> colors; int vtx_idx=0; #define ADD_VTX(m_idx);\ @@ -1333,9 +1333,9 @@ AABB GIProbe::get_aabb() const { return AABB(-extents,extents*2); } -DVector<Face3> GIProbe::get_faces(uint32_t p_usage_flags) const { +PoolVector<Face3> GIProbe::get_faces(uint32_t p_usage_flags) const { - return DVector<Face3>(); + return PoolVector<Face3>(); } void GIProbe::_bind_methods() { diff --git a/scene/3d/gi_probe.h b/scene/3d/gi_probe.h index 4b06c13268..55cde2960a 100644 --- a/scene/3d/gi_probe.h +++ b/scene/3d/gi_probe.h @@ -26,8 +26,8 @@ public: void set_to_cell_xform(const Transform& p_xform); Transform get_to_cell_xform() const; - void set_dynamic_data(const DVector<int>& p_data); - DVector<int> get_dynamic_data() const; + void set_dynamic_data(const PoolVector<int>& p_data); + PoolVector<int> get_dynamic_data() const; void set_dynamic_range(int p_range); int get_dynamic_range() const; @@ -179,7 +179,7 @@ public: void bake(Node *p_from_node=NULL,bool p_create_visual_debug=false); virtual AABB get_aabb() const; - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; GIProbe(); ~GIProbe(); diff --git a/scene/3d/immediate_geometry.cpp b/scene/3d/immediate_geometry.cpp index 4ee2e646e6..ee200cb3ea 100644 --- a/scene/3d/immediate_geometry.cpp +++ b/scene/3d/immediate_geometry.cpp @@ -96,9 +96,9 @@ AABB ImmediateGeometry::get_aabb() const { return aabb; } -DVector<Face3> ImmediateGeometry::get_faces(uint32_t p_usage_flags) const { +PoolVector<Face3> ImmediateGeometry::get_faces(uint32_t p_usage_flags) const { - return DVector<Face3>(); + return PoolVector<Face3>(); } diff --git a/scene/3d/immediate_geometry.h b/scene/3d/immediate_geometry.h index 3c8a76fbc7..bf624e67fd 100644 --- a/scene/3d/immediate_geometry.h +++ b/scene/3d/immediate_geometry.h @@ -67,7 +67,7 @@ public: virtual AABB get_aabb() const; - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; ImmediateGeometry(); ~ImmediateGeometry(); diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp index 84a6fecf5e..ba3c63c403 100644 --- a/scene/3d/light.cpp +++ b/scene/3d/light.cpp @@ -135,9 +135,9 @@ AABB Light::get_aabb() const { return AABB(); } -DVector<Face3> Light::get_faces(uint32_t p_usage_flags) const { +PoolVector<Face3> Light::get_faces(uint32_t p_usage_flags) const { - return DVector<Face3>(); + return PoolVector<Face3>(); } diff --git a/scene/3d/light.h b/scene/3d/light.h index d3585b5cf2..3481d0229c 100644 --- a/scene/3d/light.h +++ b/scene/3d/light.h @@ -118,7 +118,7 @@ public: virtual AABB get_aabb() const; - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; Light(); ~Light(); diff --git a/scene/3d/mesh_instance.cpp b/scene/3d/mesh_instance.cpp index ef633ac301..5b12f80d5c 100644 --- a/scene/3d/mesh_instance.cpp +++ b/scene/3d/mesh_instance.cpp @@ -177,13 +177,13 @@ AABB MeshInstance::get_aabb() const { return AABB(); } -DVector<Face3> MeshInstance::get_faces(uint32_t p_usage_flags) const { +PoolVector<Face3> MeshInstance::get_faces(uint32_t p_usage_flags) const { if (!(p_usage_flags&(FACES_SOLID|FACES_ENCLOSING))) - return DVector<Face3>(); + return PoolVector<Face3>(); if (mesh.is_null()) - return DVector<Face3>(); + return PoolVector<Face3>(); return mesh->get_faces(); } diff --git a/scene/3d/mesh_instance.h b/scene/3d/mesh_instance.h index 92f181c24e..1291d6b12f 100644 --- a/scene/3d/mesh_instance.h +++ b/scene/3d/mesh_instance.h @@ -81,7 +81,7 @@ public: void create_convex_collision(); virtual AABB get_aabb() const; - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; MeshInstance(); ~MeshInstance(); diff --git a/scene/3d/multimesh_instance.cpp b/scene/3d/multimesh_instance.cpp index 44cd7485ca..a9d1de1cfa 100644 --- a/scene/3d/multimesh_instance.cpp +++ b/scene/3d/multimesh_instance.cpp @@ -58,9 +58,9 @@ Ref<MultiMesh> MultiMeshInstance::get_multimesh() const { -DVector<Face3> MultiMeshInstance::get_faces(uint32_t p_usage_flags) const { +PoolVector<Face3> MultiMeshInstance::get_faces(uint32_t p_usage_flags) const { - return DVector<Face3>(); + return PoolVector<Face3>(); } AABB MultiMeshInstance::get_aabb() const { diff --git a/scene/3d/multimesh_instance.h b/scene/3d/multimesh_instance.h index 503f5e75fc..ef2403a44a 100644 --- a/scene/3d/multimesh_instance.h +++ b/scene/3d/multimesh_instance.h @@ -49,7 +49,7 @@ protected: public: - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; void set_multimesh(const Ref<MultiMesh>& p_multimesh); Ref<MultiMesh> get_multimesh() const; diff --git a/scene/3d/navigation.cpp b/scene/3d/navigation.cpp index 598a935e4b..40666a60dc 100644 --- a/scene/3d/navigation.cpp +++ b/scene/3d/navigation.cpp @@ -36,12 +36,12 @@ void Navigation::_navmesh_link(int p_id) { print_line("LINK"); - DVector<Vector3> vertices=nm.navmesh->get_vertices(); + PoolVector<Vector3> vertices=nm.navmesh->get_vertices(); int len = vertices.size(); if (len==0) return; - DVector<Vector3>::Read r=vertices.read(); + PoolVector<Vector3>::Read r=vertices.read(); for(int i=0;i<nm.navmesh->get_polygon_count();i++) { diff --git a/scene/3d/navigation_mesh.cpp b/scene/3d/navigation_mesh.cpp index 9ed3b4147a..7ec9085e30 100644 --- a/scene/3d/navigation_mesh.cpp +++ b/scene/3d/navigation_mesh.cpp @@ -33,7 +33,7 @@ void NavigationMesh::create_from_mesh(const Ref<Mesh>& p_mesh) { - vertices=DVector<Vector3>(); + vertices=PoolVector<Vector3>(); clear_polygons(); for(int i=0;i<p_mesh->get_surface_count();i++) { @@ -41,15 +41,15 @@ void NavigationMesh::create_from_mesh(const Ref<Mesh>& p_mesh) { if (p_mesh->surface_get_primitive_type(i)!=Mesh::PRIMITIVE_TRIANGLES) continue; Array arr = p_mesh->surface_get_arrays(i); - DVector<Vector3> varr = arr[Mesh::ARRAY_VERTEX]; - DVector<int> iarr = arr[Mesh::ARRAY_INDEX]; + PoolVector<Vector3> varr = arr[Mesh::ARRAY_VERTEX]; + PoolVector<int> iarr = arr[Mesh::ARRAY_INDEX]; if (varr.size()==0 || iarr.size()==0) continue; int from = vertices.size(); vertices.append_array(varr); int rlen = iarr.size(); - DVector<int>::Read r = iarr.read(); + PoolVector<int>::Read r = iarr.read(); for(int j=0;j<rlen;j+=3) { Vector<int> vi; @@ -63,12 +63,12 @@ void NavigationMesh::create_from_mesh(const Ref<Mesh>& p_mesh) { } } -void NavigationMesh::set_vertices(const DVector<Vector3>& p_vertices) { +void NavigationMesh::set_vertices(const PoolVector<Vector3>& p_vertices) { vertices=p_vertices; } -DVector<Vector3> NavigationMesh::get_vertices() const{ +PoolVector<Vector3> NavigationMesh::get_vertices() const{ return vertices; } @@ -122,8 +122,8 @@ Ref<Mesh> NavigationMesh::get_debug_mesh() { - DVector<Vector3> vertices = get_vertices(); - DVector<Vector3>::Read vr=vertices.read(); + PoolVector<Vector3> vertices = get_vertices(); + PoolVector<Vector3>::Read vr=vertices.read(); List<Face3> faces; for(int i=0;i<get_polygon_count();i++) { Vector<int> p = get_polygon(i); @@ -140,11 +140,11 @@ Ref<Mesh> NavigationMesh::get_debug_mesh() { Map<_EdgeKey,bool> edge_map; - DVector<Vector3> tmeshfaces; + PoolVector<Vector3> tmeshfaces; tmeshfaces.resize(faces.size()*3); { - DVector<Vector3>::Write tw=tmeshfaces.write(); + PoolVector<Vector3>::Write tw=tmeshfaces.write(); int tidx=0; @@ -185,10 +185,10 @@ Ref<Mesh> NavigationMesh::get_debug_mesh() { } } - DVector<Vector3> varr; + PoolVector<Vector3> varr; varr.resize(lines.size()); { - DVector<Vector3>::Write w = varr.write(); + PoolVector<Vector3>::Write w = varr.write(); int idx=0; for(List<Vector3>::Element *E=lines.front();E;E=E->next()) { w[idx++]=E->get(); diff --git a/scene/3d/navigation_mesh.h b/scene/3d/navigation_mesh.h index a0bdc5a516..e025b7ce8b 100644 --- a/scene/3d/navigation_mesh.h +++ b/scene/3d/navigation_mesh.h @@ -38,7 +38,7 @@ class NavigationMesh : public Resource { GDCLASS( NavigationMesh, Resource ); - DVector<Vector3> vertices; + PoolVector<Vector3> vertices; struct Polygon { Vector<int> indices; }; @@ -65,8 +65,8 @@ public: void create_from_mesh(const Ref<Mesh>& p_mesh); - void set_vertices(const DVector<Vector3>& p_vertices); - DVector<Vector3> get_vertices() const; + void set_vertices(const PoolVector<Vector3>& p_vertices); + PoolVector<Vector3> get_vertices() const; void add_polygon(const Vector<int>& p_polygon); int get_polygon_count() const; diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index 09be49d7d6..9e37658cd9 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -88,9 +88,9 @@ AABB Particles::get_aabb() const { return AABB( Vector3(-1,-1,-1), Vector3(2, 2, 2 ) ); } -DVector<Face3> Particles::get_faces(uint32_t p_usage_flags) const { +PoolVector<Face3> Particles::get_faces(uint32_t p_usage_flags) const { - return DVector<Face3>(); + return PoolVector<Face3>(); } @@ -130,16 +130,16 @@ AABB Particles::get_visibility_aabb() const { } -void Particles::set_emission_points(const DVector<Vector3>& p_points) { +void Particles::set_emission_points(const PoolVector<Vector3>& p_points) { using_points = p_points.size(); VisualServer::get_singleton()->particles_set_emission_points(particles,p_points); } -DVector<Vector3> Particles::get_emission_points() const { +PoolVector<Vector3> Particles::get_emission_points() const { if (!using_points) - return DVector<Vector3>(); + return PoolVector<Vector3>(); return VisualServer::get_singleton()->particles_get_emission_points(particles); diff --git a/scene/3d/particles.h b/scene/3d/particles.h index 95cf44a033..b96bd4e69e 100644 --- a/scene/3d/particles.h +++ b/scene/3d/particles.h @@ -103,7 +103,7 @@ public: AABB get_aabb() const; - DVector<Face3> get_faces(uint32_t p_usage_flags) const; + PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; void set_amount(int p_amount); int get_amount() const; @@ -120,8 +120,8 @@ public: void set_emission_base_velocity(const Vector3& p_base_velocity); Vector3 get_emission_base_velocity() const; - void set_emission_points(const DVector<Vector3>& p_points); - DVector<Vector3> get_emission_points() const; + void set_emission_points(const PoolVector<Vector3>& p_points); + PoolVector<Vector3> get_emission_points() const; void set_gravity_normal(const Vector3& p_normal); Vector3 get_gravity_normal() const; diff --git a/scene/3d/portal.cpp b/scene/3d/portal.cpp index 1de9188e82..e4c03a78ee 100644 --- a/scene/3d/portal.cpp +++ b/scene/3d/portal.cpp @@ -34,7 +34,7 @@ bool Portal::_set(const StringName& p_name, const Variant& p_value) { if (p_name=="shape") { - DVector<float> src_coords=p_value; + PoolVector<float> src_coords=p_value; Vector<Point2> points; int src_coords_size = src_coords.size(); ERR_FAIL_COND_V(src_coords_size%2,false); @@ -63,7 +63,7 @@ bool Portal::_get(const StringName& p_name,Variant &r_ret) const { if (p_name=="shape") { Vector<Point2> points=get_shape(); - DVector<float> dst_coords; + PoolVector<float> dst_coords; dst_coords.resize(points.size()*2); for (int i=0;i<points.size();i++) { @@ -102,14 +102,14 @@ AABB Portal::get_aabb() const { return aabb; } -DVector<Face3> Portal::get_faces(uint32_t p_usage_flags) const { +PoolVector<Face3> Portal::get_faces(uint32_t p_usage_flags) const { if (!(p_usage_flags&FACES_ENCLOSING)) - return DVector<Face3>(); + return PoolVector<Face3>(); Vector<Point2> shape = get_shape(); if (shape.size()==0) - return DVector<Face3>(); + return PoolVector<Face3>(); Vector2 center; for (int i=0;i<shape.size();i++) { @@ -118,7 +118,7 @@ DVector<Face3> Portal::get_faces(uint32_t p_usage_flags) const { } - DVector<Face3> ret; + PoolVector<Face3> ret; center/=shape.size(); for (int i=0;i<shape.size();i++) { diff --git a/scene/3d/portal.h b/scene/3d/portal.h index d154c18b3d..8464a628f9 100644 --- a/scene/3d/portal.h +++ b/scene/3d/portal.h @@ -68,7 +68,7 @@ protected: public: virtual AABB get_aabb() const; - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; void set_enabled(bool p_enabled); bool is_enabled() const; diff --git a/scene/3d/quad.cpp b/scene/3d/quad.cpp index 4ba828f927..f1c59860af 100644 --- a/scene/3d/quad.cpp +++ b/scene/3d/quad.cpp @@ -44,9 +44,9 @@ void Quad::_update() { - DVector<Vector3> points; + PoolVector<Vector3> points; points.resize(4); - DVector<Vector3>::Write pointsw = points.write(); + PoolVector<Vector3>::Write pointsw = points.write(); Vector2 s2 = size*0.5; Vector2 o = offset; @@ -70,34 +70,34 @@ void Quad::_update() { for(int i=1;i<4;i++) aabb.expand_to(pointsw[i]); - pointsw = DVector<Vector3>::Write(); + pointsw = PoolVector<Vector3>::Write(); - DVector<Vector3> normals; + PoolVector<Vector3> normals; normals.resize(4); - DVector<Vector3>::Write normalsw = normals.write(); + PoolVector<Vector3>::Write normalsw = normals.write(); for(int i=0;i<4;i++) normalsw[i]=normal; - normalsw=DVector<Vector3>::Write(); + normalsw=PoolVector<Vector3>::Write(); - DVector<Vector2> uvs; + PoolVector<Vector2> uvs; uvs.resize(4); - DVector<Vector2>::Write uvsw = uvs.write(); + PoolVector<Vector2>::Write uvsw = uvs.write(); uvsw[0]=Vector2(0,0); uvsw[1]=Vector2(1,0); uvsw[2]=Vector2(1,1); uvsw[3]=Vector2(0,1); - uvsw = DVector<Vector2>::Write(); + uvsw = PoolVector<Vector2>::Write(); - DVector<int> indices; + PoolVector<int> indices; indices.resize(6); - DVector<int>::Write indicesw = indices.write(); + PoolVector<int>::Write indicesw = indices.write(); indicesw[0]=0; indicesw[1]=1; indicesw[2]=2; @@ -105,7 +105,7 @@ void Quad::_update() { indicesw[4]=3; indicesw[5]=0; - indicesw=DVector<int>::Write(); + indicesw=PoolVector<int>::Write(); Array arr; arr.resize(VS::ARRAY_MAX); @@ -187,9 +187,9 @@ void Quad::_notification(int p_what) { } } -DVector<Face3> Quad::get_faces(uint32_t p_usage_flags) const { +PoolVector<Face3> Quad::get_faces(uint32_t p_usage_flags) const { - return DVector<Face3>(); + return PoolVector<Face3>(); } AABB Quad::get_aabb() const { diff --git a/scene/3d/quad.h b/scene/3d/quad.h index bdb2cb3088..94b438c548 100644 --- a/scene/3d/quad.h +++ b/scene/3d/quad.h @@ -67,7 +67,7 @@ public: void set_centered(bool p_enabled); bool is_centered() const; - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; virtual AABB get_aabb() const; Quad(); diff --git a/scene/3d/reflection_probe.cpp b/scene/3d/reflection_probe.cpp index 63855b7e98..0235a063ea 100644 --- a/scene/3d/reflection_probe.cpp +++ b/scene/3d/reflection_probe.cpp @@ -169,9 +169,9 @@ AABB ReflectionProbe::get_aabb() const { aabb.size=origin_offset+extents; return aabb; } -DVector<Face3> ReflectionProbe::get_faces(uint32_t p_usage_flags) const { +PoolVector<Face3> ReflectionProbe::get_faces(uint32_t p_usage_flags) const { - return DVector<Face3>(); + return PoolVector<Face3>(); } void ReflectionProbe::_validate_property(PropertyInfo& property) const { diff --git a/scene/3d/reflection_probe.h b/scene/3d/reflection_probe.h index 2de02ebbfa..789e5837b0 100644 --- a/scene/3d/reflection_probe.h +++ b/scene/3d/reflection_probe.h @@ -78,7 +78,7 @@ public: UpdateMode get_update_mode() const; virtual AABB get_aabb() const; - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; diff --git a/scene/3d/room_instance.cpp b/scene/3d/room_instance.cpp index 1423f56786..137a16490d 100644 --- a/scene/3d/room_instance.cpp +++ b/scene/3d/room_instance.cpp @@ -86,9 +86,9 @@ AABB Room::get_aabb() const { return AABB(); } -DVector<Face3> Room::get_faces(uint32_t p_usage_flags) const { +PoolVector<Face3> Room::get_faces(uint32_t p_usage_flags) const { - return DVector<Face3>(); + return PoolVector<Face3>(); } @@ -119,21 +119,21 @@ Ref<RoomBounds> Room::get_room() const { return room; } -void Room::_parse_node_faces(DVector<Face3> &all_faces,const Node *p_node) const { +void Room::_parse_node_faces(PoolVector<Face3> &all_faces,const Node *p_node) const { const VisualInstance *vi=p_node->cast_to<VisualInstance>(); if (vi) { - DVector<Face3> faces=vi->get_faces(FACES_ENCLOSING); + PoolVector<Face3> faces=vi->get_faces(FACES_ENCLOSING); if (faces.size()) { int old_len=all_faces.size(); all_faces.resize( all_faces.size() + faces.size() ); int new_len=all_faces.size(); - DVector<Face3>::Write all_facesw=all_faces.write(); + PoolVector<Face3>::Write all_facesw=all_faces.write(); Face3 * all_facesptr=all_facesw.ptr(); - DVector<Face3>::Read facesr=faces.read(); + PoolVector<Face3>::Read facesr=faces.read(); const Face3 * facesptr=facesr.ptr(); Transform tr=vi->get_relative_transform(this); diff --git a/scene/3d/room_instance.h b/scene/3d/room_instance.h index 8c2bb76a38..8cdc908ceb 100644 --- a/scene/3d/room_instance.h +++ b/scene/3d/room_instance.h @@ -63,7 +63,7 @@ private: bool sound_enabled; int level; - void _parse_node_faces(DVector<Face3> &all_faces,const Node *p_node) const; + void _parse_node_faces(PoolVector<Face3> &all_faces,const Node *p_node) const; void _bounds_changed(); @@ -83,7 +83,7 @@ public: }; virtual AABB get_aabb() const; - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; void set_room( const Ref<RoomBounds>& p_room ); Ref<RoomBounds> get_room() const; diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index 576f085120..5d686e8715 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -211,9 +211,9 @@ AABB SpriteBase3D::get_aabb() const { return aabb; } -DVector<Face3> SpriteBase3D::get_faces(uint32_t p_usage_flags) const { +PoolVector<Face3> SpriteBase3D::get_faces(uint32_t p_usage_flags) const { - return DVector<Face3>(); + return PoolVector<Face3>(); } diff --git a/scene/3d/sprite_3d.h b/scene/3d/sprite_3d.h index 58d70fa2f7..f82a391038 100644 --- a/scene/3d/sprite_3d.h +++ b/scene/3d/sprite_3d.h @@ -135,7 +135,7 @@ public: virtual Rect2 get_item_rect() const=0; virtual AABB get_aabb() const; - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; SpriteBase3D(); ~SpriteBase3D(); diff --git a/scene/3d/test_cube.cpp b/scene/3d/test_cube.cpp index bd99de417e..c2ebe63e21 100644 --- a/scene/3d/test_cube.cpp +++ b/scene/3d/test_cube.cpp @@ -35,9 +35,9 @@ AABB TestCube::get_aabb() const { return AABB( Vector3(-1,-1,-1), Vector3(2, 2, 2 ) ); } -DVector<Face3> TestCube::get_faces(uint32_t p_usage_flags) const { +PoolVector<Face3> TestCube::get_faces(uint32_t p_usage_flags) const { - return DVector<Face3>(); + return PoolVector<Face3>(); } diff --git a/scene/3d/test_cube.h b/scene/3d/test_cube.h index cbd9918b13..c62999c34b 100644 --- a/scene/3d/test_cube.h +++ b/scene/3d/test_cube.h @@ -47,7 +47,7 @@ class TestCube : public GeometryInstance { public: virtual AABB get_aabb() const; - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; TestCube(); ~TestCube(); diff --git a/scene/3d/visual_instance.h b/scene/3d/visual_instance.h index 7b76cd299e..f59ec3a7e6 100644 --- a/scene/3d/visual_instance.h +++ b/scene/3d/visual_instance.h @@ -66,7 +66,7 @@ public: RID get_instance() const; virtual AABB get_aabb() const=0; - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const=0; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const=0; virtual AABB get_transformed_aabb() const; // helper diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h index c03762549b..94955bec60 100644 --- a/scene/animation/animation_player.h +++ b/scene/animation/animation_player.h @@ -208,11 +208,11 @@ private: void _node_removed(Node *p_node); // bind helpers - DVector<String> _get_animation_list() const { + PoolVector<String> _get_animation_list() const { List<StringName> animations; get_animation_list(&animations); - DVector<String> ret; + PoolVector<String> ret; while(animations.size()) { ret.push_back( animations.front()->get()); diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp index 2ed8e52615..4df37af7a1 100644 --- a/scene/animation/animation_tree_player.cpp +++ b/scene/animation/animation_tree_player.cpp @@ -1740,11 +1740,11 @@ NodePath AnimationTreePlayer::get_master_player() const{ return master; } -DVector<String> AnimationTreePlayer::_get_node_list() { +PoolVector<String> AnimationTreePlayer::_get_node_list() { List<StringName> nl; get_node_list(&nl); - DVector<String> ret; + PoolVector<String> ret; ret.resize(nl.size()); int idx=0; for(List<StringName>::Element *E=nl.front();E;E=E->next()) { diff --git a/scene/animation/animation_tree_player.h b/scene/animation/animation_tree_player.h index 6d9db5dc63..ae2fe8c2bb 100644 --- a/scene/animation/animation_tree_player.h +++ b/scene/animation/animation_tree_player.h @@ -282,7 +282,7 @@ private: Track* _find_track(const NodePath& p_path); void _recompute_caches(); void _recompute_caches(const StringName& p_node); - DVector<String> _get_node_list(); + PoolVector<String> _get_node_list(); void _compute_weights(float *p_fallback_weight, HashMap<NodePath,float> *p_weights, float p_coeff, const HashMap<NodePath,bool> *p_filter = NULL, float p_filtered_coeff = 0); diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index ceb3b69f2f..10f4ae9fec 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -170,11 +170,11 @@ void ColorPicker::_update_presets() Size2 size=bt_add_preset->get_size(); preset->set_custom_minimum_size(Size2(size.width*presets.size(),size.height)); - DVector<uint8_t> img; + PoolVector<uint8_t> img; img.resize(size.x*presets.size()*size.y*3); { - DVector<uint8_t>::Write w=img.write(); + PoolVector<uint8_t>::Write w=img.write(); for (int y=0;y<size.y;y++) { for (int x=0;x<size.x*presets.size();x++) { int ofs = (y*(size.x*presets.size())+x)*3; @@ -421,7 +421,7 @@ void ColorPicker::_screen_input(const InputEvent &ev) int pw = last_capture.get_format()==Image::FORMAT_RGBA8?4:3; int ofs = (mev.global_y*last_capture.get_width()+mev.global_x)*pw; - DVector<uint8_t>::Read r = last_capture.get_data().read(); + PoolVector<uint8_t>::Read r = last_capture.get_data().read(); Color c( r[ofs+0]/255.0, r[ofs+1]/255.0, r[ofs+2]/255.0 ); diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 4fe65fad75..6828ae3980 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -164,7 +164,7 @@ void FileDialog::_action_pressed() { TreeItem *ti=tree->get_next_selected(NULL); String fbase=dir_access->get_current_dir(); - DVector<String> files; + PoolVector<String> files; while(ti) { files.push_back( fbase.plus_file(ti->get_text(0)) ); diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 397edbf3b6..4ea44a6ead 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -3794,11 +3794,11 @@ int TextEdit::_get_column_pos_of_word(const String &p_key, const String &p_searc return col; } -DVector<int> TextEdit::_search_bind(const String &p_key,uint32_t p_search_flags, int p_from_line,int p_from_column) const { +PoolVector<int> TextEdit::_search_bind(const String &p_key,uint32_t p_search_flags, int p_from_line,int p_from_column) const { int col,line; if (search(p_key,p_search_flags,p_from_line,p_from_column,col,line)) { - DVector<int> result; + PoolVector<int> result; result.resize(2); result.set(0,line); result.set(1,col); @@ -3806,7 +3806,7 @@ DVector<int> TextEdit::_search_bind(const String &p_key,uint32_t p_search_flags, } else { - return DVector<int>(); + return PoolVector<int>(); } } diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index c674c859e6..2cb3d71386 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -316,7 +316,7 @@ class TextEdit : public Control { int _get_column_pos_of_word(const String &p_key, const String &p_search, uint32_t p_search_flags, int p_from_column); - DVector<int> _search_bind(const String &p_key,uint32_t p_search_flags, int p_from_line,int p_from_column) const; + PoolVector<int> _search_bind(const String &p_key,uint32_t p_search_flags, int p_from_line,int p_from_column) const; PopupMenu *menu; diff --git a/scene/io/resource_format_wav.cpp b/scene/io/resource_format_wav.cpp index 3720aa13fd..f75836d2df 100644 --- a/scene/io/resource_format_wav.cpp +++ b/scene/io/resource_format_wav.cpp @@ -171,9 +171,9 @@ RES ResourceFormatLoaderWAV::load(const String &p_path, const String& p_original if (format_bits>8) len*=2; - DVector<uint8_t> data; + PoolVector<uint8_t> data; data.resize(len); - DVector<uint8_t>::Write dataw = data.write(); + PoolVector<uint8_t>::Write dataw = data.write(); void * data_ptr = dataw.ptr(); for (int i=0;i<frames;i++) { @@ -215,7 +215,7 @@ RES ResourceFormatLoaderWAV::load(const String &p_path, const String& p_original } - dataw=DVector<uint8_t>::Write(); + dataw=PoolVector<uint8_t>::Write(); sample->set_data(data); diff --git a/scene/main/http_request.h b/scene/main/http_request.h index d4adaa16d4..59be980077 100644 --- a/scene/main/http_request.h +++ b/scene/main/http_request.h @@ -76,7 +76,7 @@ private: bool got_response; int response_code; - DVector<String> response_headers; + PoolVector<String> response_headers; String download_to_file; diff --git a/scene/main/resource_preloader.cpp b/scene/main/resource_preloader.cpp index 57bda91494..93a836a2eb 100644 --- a/scene/main/resource_preloader.cpp +++ b/scene/main/resource_preloader.cpp @@ -33,7 +33,7 @@ void ResourcePreloader::_set_resources(const Array& p_data) { resources.clear(); ERR_FAIL_COND(p_data.size()!=2); - DVector<String> names=p_data[0]; + PoolVector<String> names=p_data[0]; Array resdata=p_data[1]; ERR_FAIL_COND(names.size()!=resdata.size()); @@ -52,7 +52,7 @@ void ResourcePreloader::_set_resources(const Array& p_data) { Array ResourcePreloader::_get_resources() const { - DVector<String> names; + PoolVector<String> names; Array arr; arr.resize(resources.size()); names.resize(resources.size()); @@ -139,9 +139,9 @@ RES ResourcePreloader::get_resource(const StringName& p_name) const { return resources[p_name]; } -DVector<String> ResourcePreloader::_get_resource_list() const { +PoolVector<String> ResourcePreloader::_get_resource_list() const { - DVector<String> res; + PoolVector<String> res; res.resize(resources.size()); int i=0; for(Map<StringName,RES >::Element *E=resources.front();E;E=E->next(),i++) { diff --git a/scene/main/resource_preloader.h b/scene/main/resource_preloader.h index 8f4f997cee..4e585d1751 100644 --- a/scene/main/resource_preloader.h +++ b/scene/main/resource_preloader.h @@ -41,7 +41,7 @@ class ResourcePreloader : public Node { void _set_resources(const Array& p_data); Array _get_resources() const; - DVector<String> _get_resource_list() const; + PoolVector<String> _get_resource_list() const; protected: diff --git a/scene/main/scene_main_loop.cpp b/scene/main/scene_main_loop.cpp index af6d6b18db..a6ef136b84 100644 --- a/scene/main/scene_main_loop.cpp +++ b/scene/main/scene_main_loop.cpp @@ -831,11 +831,11 @@ Ref<Mesh> SceneTree::get_debug_contact_mesh() { 1,3,5, }; - DVector<int> indices; + PoolVector<int> indices; for(int i=0;i<8*3;i++) indices.push_back(diamond_faces[i]); - DVector<Vector3> vertices; + PoolVector<Vector3> vertices; for(int i=0;i<6;i++) vertices.push_back(diamond[i]*0.1); diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index b5c438d953..76c6f29bcb 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -79,14 +79,14 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) { if (track_get_type(track)==TYPE_TRANSFORM) { TransformTrack *tt = static_cast<TransformTrack*>(tracks[track]); - DVector<float> values=p_value; + PoolVector<float> values=p_value; int vcount=values.size(); #if 0 // old compatibility hack if ((vcount%11) == 0) { - DVector<float>::Read r = values.read(); + PoolVector<float>::Read r = values.read(); tt->transforms.resize(vcount/11); @@ -121,7 +121,7 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) { #endif ERR_FAIL_COND_V(vcount%12,false); // shuld be multiple of 11 - DVector<float>::Read r = values.read(); + PoolVector<float>::Read r = values.read(); tt->transforms.resize(vcount/12); @@ -172,7 +172,7 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) { - DVector<float> times=d["times"]; + PoolVector<float> times=d["times"]; Array values=d["values"]; ERR_FAIL_COND_V(times.size()!=values.size(),false); @@ -181,7 +181,7 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) { int valcount=times.size(); - DVector<float>::Read rt = times.read(); + PoolVector<float>::Read rt = times.read(); vt->values.resize(valcount); @@ -193,10 +193,10 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) { if (d.has("transitions")) { - DVector<float> transitions = d["transitions"]; + PoolVector<float> transitions = d["transitions"]; ERR_FAIL_COND_V(transitions.size()!=valcount,false); - DVector<float>::Read rtr = transitions.read(); + PoolVector<float>::Read rtr = transitions.read(); for(int i=0;i<valcount;i++) { @@ -218,7 +218,7 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) { ERR_FAIL_COND_V(!d.has("times"),false); ERR_FAIL_COND_V(!d.has("values"),false); - DVector<float> times=d["times"]; + PoolVector<float> times=d["times"]; Array values=d["values"]; ERR_FAIL_COND_V(times.size()!=values.size(),false); @@ -227,7 +227,7 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) { int valcount=times.size(); - DVector<float>::Read rt = times.read(); + PoolVector<float>::Read rt = times.read(); for(int i=0;i<valcount;i++) { @@ -236,10 +236,10 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) { if (d.has("transitions")) { - DVector<float> transitions = d["transitions"]; + PoolVector<float> transitions = d["transitions"]; ERR_FAIL_COND_V(transitions.size()!=valcount,false); - DVector<float>::Read rtr = transitions.read(); + PoolVector<float>::Read rtr = transitions.read(); for(int i=0;i<valcount;i++) { @@ -297,11 +297,11 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const { if (track_get_type(track)==TYPE_TRANSFORM) { - DVector<real_t> keys; + PoolVector<real_t> keys; int kk=track_get_key_count(track); keys.resize(kk*12); - DVector<real_t>::Write w = keys.write(); + PoolVector<real_t>::Write w = keys.write(); int idx=0; for(int i=0;i<track_get_key_count(track);i++) { @@ -327,7 +327,7 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const { w[idx++]=scale.z; } - w = DVector<real_t>::Write(); + w = PoolVector<real_t>::Write(); r_ret=keys; return true; @@ -338,8 +338,8 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const { Dictionary d; - DVector<float> key_times; - DVector<float> key_transitions; + PoolVector<float> key_times; + PoolVector<float> key_transitions; Array key_values; int kk=vt->values.size(); @@ -348,8 +348,8 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const { key_transitions.resize(kk); key_values.resize(kk); - DVector<float>::Write wti=key_times.write(); - DVector<float>::Write wtr=key_transitions.write(); + PoolVector<float>::Write wti=key_times.write(); + PoolVector<float>::Write wtr=key_transitions.write(); int idx=0; @@ -363,8 +363,8 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const { idx++; } - wti=DVector<float>::Write(); - wtr=DVector<float>::Write(); + wti=PoolVector<float>::Write(); + wtr=PoolVector<float>::Write(); d["times"]=key_times; d["transitions"]=key_transitions; @@ -382,8 +382,8 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const { Dictionary d; - DVector<float> key_times; - DVector<float> key_transitions; + PoolVector<float> key_times; + PoolVector<float> key_transitions; Array key_values; int kk=track_get_key_count(track); @@ -392,8 +392,8 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const { key_transitions.resize(kk); key_values.resize(kk); - DVector<float>::Write wti=key_times.write(); - DVector<float>::Write wtr=key_transitions.write(); + PoolVector<float>::Write wti=key_times.write(); + PoolVector<float>::Write wtr=key_transitions.write(); int idx=0; for(int i=0;i<track_get_key_count(track);i++) { @@ -404,8 +404,8 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const { idx++; } - wti=DVector<float>::Write(); - wtr=DVector<float>::Write(); + wti=PoolVector<float>::Write(); + wtr=PoolVector<float>::Write(); d["times"]=key_times; d["transitions"]=key_transitions; diff --git a/scene/resources/animation.h b/scene/resources/animation.h index 90824d8c7b..c236b3ef37 100644 --- a/scene/resources/animation.h +++ b/scene/resources/animation.h @@ -188,11 +188,11 @@ private: return ret; } - DVector<int> _value_track_get_key_indices(int p_track, float p_time, float p_delta) const { + PoolVector<int> _value_track_get_key_indices(int p_track, float p_time, float p_delta) const { List<int> idxs; value_track_get_key_indices(p_track,p_time,p_delta,&idxs); - DVector<int> idxr; + PoolVector<int> idxr; for (List<int>::Element *E=idxs.front();E;E=E->next()) { @@ -200,11 +200,11 @@ private: } return idxr; } - DVector<int> _method_track_get_key_indices(int p_track, float p_time, float p_delta) const { + PoolVector<int> _method_track_get_key_indices(int p_track, float p_time, float p_delta) const { List<int> idxs; method_track_get_key_indices(p_track,p_time,p_delta,&idxs); - DVector<int> idxr; + PoolVector<int> idxr; for (List<int>::Element *E=idxs.front();E;E=E->next()) { diff --git a/scene/resources/bit_mask.cpp b/scene/resources/bit_mask.cpp index 81ba28fd26..d669ab771c 100644 --- a/scene/resources/bit_mask.cpp +++ b/scene/resources/bit_mask.cpp @@ -51,7 +51,7 @@ void BitMap::create_from_image_alpha(const Image& p_image){ create(Size2(img.get_width(),img.get_height())); - DVector<uint8_t>::Read r = img.get_data().read(); + PoolVector<uint8_t>::Read r = img.get_data().read(); uint8_t *w = bitmask.ptr(); for(int i=0;i<width*height;i++) { diff --git a/scene/resources/concave_polygon_shape.cpp b/scene/resources/concave_polygon_shape.cpp index fc1a3a9961..5190bba6a5 100644 --- a/scene/resources/concave_polygon_shape.cpp +++ b/scene/resources/concave_polygon_shape.cpp @@ -34,11 +34,11 @@ Vector<Vector3> ConcavePolygonShape::_gen_debug_mesh_lines() { Set<DrawEdge> edges; - DVector<Vector3> data=get_faces(); + PoolVector<Vector3> data=get_faces(); int datalen=data.size(); ERR_FAIL_COND_V( (datalen%3)!=0,Vector<Vector3>() ); - DVector<Vector3>::Read r=data.read(); + PoolVector<Vector3>::Read r=data.read(); for(int i=0;i<datalen;i+=3) { @@ -94,13 +94,13 @@ void ConcavePolygonShape::_update_shape() { } -void ConcavePolygonShape::set_faces(const DVector<Vector3>& p_faces) { +void ConcavePolygonShape::set_faces(const PoolVector<Vector3>& p_faces) { PhysicsServer::get_singleton()->shape_set_data(get_shape(),p_faces); notify_change_to_owners(); } -DVector<Vector3> ConcavePolygonShape::get_faces() const { +PoolVector<Vector3> ConcavePolygonShape::get_faces() const { return PhysicsServer::get_singleton()->shape_get_data(get_shape()); diff --git a/scene/resources/concave_polygon_shape.h b/scene/resources/concave_polygon_shape.h index 08d95da0ac..36e806d37a 100644 --- a/scene/resources/concave_polygon_shape.h +++ b/scene/resources/concave_polygon_shape.h @@ -67,8 +67,8 @@ protected: virtual Vector<Vector3> _gen_debug_mesh_lines(); public: - void set_faces(const DVector<Vector3>& p_faces); - DVector<Vector3> get_faces() const; + void set_faces(const PoolVector<Vector3>& p_faces); + PoolVector<Vector3> get_faces() const; ConcavePolygonShape(); diff --git a/scene/resources/concave_polygon_shape_2d.cpp b/scene/resources/concave_polygon_shape_2d.cpp index 4be95cb26d..e794643132 100644 --- a/scene/resources/concave_polygon_shape_2d.cpp +++ b/scene/resources/concave_polygon_shape_2d.cpp @@ -31,13 +31,13 @@ #include "servers/physics_2d_server.h" #include "servers/visual_server.h" -void ConcavePolygonShape2D::set_segments(const DVector<Vector2>& p_segments) { +void ConcavePolygonShape2D::set_segments(const PoolVector<Vector2>& p_segments) { Physics2DServer::get_singleton()->shape_set_data(get_rid(),p_segments); emit_changed(); } -DVector<Vector2> ConcavePolygonShape2D::get_segments() const { +PoolVector<Vector2> ConcavePolygonShape2D::get_segments() const { return Physics2DServer::get_singleton()->shape_get_data(get_rid()); } @@ -45,12 +45,12 @@ DVector<Vector2> ConcavePolygonShape2D::get_segments() const { void ConcavePolygonShape2D::draw(const RID& p_to_rid,const Color& p_color) { - DVector<Vector2> s = get_segments(); + PoolVector<Vector2> s = get_segments(); int len=s.size(); if (len==0 || (len%2)==1) return; - DVector<Vector2>::Read r = s.read(); + PoolVector<Vector2>::Read r = s.read(); for(int i=0;i<len;i+=2) { VisualServer::get_singleton()->canvas_item_add_line(p_to_rid,r[i],r[i+1],p_color,2); } @@ -60,14 +60,14 @@ void ConcavePolygonShape2D::draw(const RID& p_to_rid,const Color& p_color) { Rect2 ConcavePolygonShape2D::get_rect() const { - DVector<Vector2> s = get_segments(); + PoolVector<Vector2> s = get_segments(); int len=s.size(); if (len==0) return Rect2(); Rect2 rect; - DVector<Vector2>::Read r = s.read(); + PoolVector<Vector2>::Read r = s.read(); for(int i=0;i<len;i++) { if (i==0) rect.pos=r[i]; diff --git a/scene/resources/concave_polygon_shape_2d.h b/scene/resources/concave_polygon_shape_2d.h index 36c67254f3..309fb4a7b3 100644 --- a/scene/resources/concave_polygon_shape_2d.h +++ b/scene/resources/concave_polygon_shape_2d.h @@ -38,8 +38,8 @@ protected: static void _bind_methods(); public: - void set_segments(const DVector<Vector2>& p_segments); - DVector<Vector2> get_segments() const; + void set_segments(const PoolVector<Vector2>& p_segments); + PoolVector<Vector2> get_segments() const; virtual void draw(const RID& p_to_rid,const Color& p_color); virtual Rect2 get_rect() const ; diff --git a/scene/resources/convex_polygon_shape.cpp b/scene/resources/convex_polygon_shape.cpp index 21e93e4b5c..ca9897bf97 100644 --- a/scene/resources/convex_polygon_shape.cpp +++ b/scene/resources/convex_polygon_shape.cpp @@ -32,7 +32,7 @@ Vector<Vector3> ConvexPolygonShape::_gen_debug_mesh_lines() { - DVector<Vector3> points = get_points(); + PoolVector<Vector3> points = get_points(); if (points.size()>3) { @@ -64,14 +64,14 @@ void ConvexPolygonShape::_update_shape() { emit_changed(); } -void ConvexPolygonShape::set_points(const DVector<Vector3>& p_points) { +void ConvexPolygonShape::set_points(const PoolVector<Vector3>& p_points) { points=p_points; _update_shape(); notify_change_to_owners(); } -DVector<Vector3> ConvexPolygonShape::get_points() const { +PoolVector<Vector3> ConvexPolygonShape::get_points() const { return points; } diff --git a/scene/resources/convex_polygon_shape.h b/scene/resources/convex_polygon_shape.h index 296a0ce4ca..215de941c6 100644 --- a/scene/resources/convex_polygon_shape.h +++ b/scene/resources/convex_polygon_shape.h @@ -34,7 +34,7 @@ class ConvexPolygonShape : public Shape { GDCLASS(ConvexPolygonShape,Shape); - DVector<Vector3> points; + PoolVector<Vector3> points; protected: @@ -45,8 +45,8 @@ protected: virtual Vector<Vector3> _gen_debug_mesh_lines(); public: - void set_points(const DVector<Vector3>& p_points); - DVector<Vector3> get_points() const; + void set_points(const PoolVector<Vector3>& p_points); + PoolVector<Vector3> get_points() const; ConvexPolygonShape(); }; diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp index fd0e9be304..50c546b855 100644 --- a/scene/resources/curve.cpp +++ b/scene/resources/curve.cpp @@ -143,17 +143,17 @@ Vector2 Curve2D::interpolatef(real_t p_findex) const { } -DVector<Point2> Curve2D::bake(int p_subdivs) const { +PoolVector<Point2> Curve2D::bake(int p_subdivs) const { int pc = points.size(); - DVector<Point2> ret; + PoolVector<Point2> ret; if (pc<2) return ret; ret.resize((pc-1)*p_subdivs+1); - DVector<Point2>::Write w = ret.write(); + PoolVector<Point2>::Write w = ret.write(); const Point *r = points.ptr(); for(int i=0;i<pc;i++) { @@ -175,7 +175,7 @@ DVector<Point2> Curve2D::bake(int p_subdivs) const { } } - w = DVector<Point2>::Write(); + w = PoolVector<Point2>::Write(); return ret; } diff --git a/scene/resources/curve.h b/scene/resources/curve.h index 289de50444..670232c9b2 100644 --- a/scene/resources/curve.h +++ b/scene/resources/curve.h @@ -72,7 +72,7 @@ public: Vector2 interpolate(int p_index, float p_offset) const; Vector2 interpolatef(real_t p_findex) const; - DVector<Point2> bake(int p_subdivs=10) const; + PoolVector<Point2> bake(int p_subdivs=10) const; void advance(real_t p_distance,int &r_index, real_t &r_pos) const; void get_approx_position_from_offset(real_t p_offset,int &r_index, real_t &r_pos,int p_subdivs=16) const; diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp index 7ab7cc74e5..3aadbdbe19 100644 --- a/scene/resources/dynamic_font.cpp +++ b/scene/resources/dynamic_font.cpp @@ -535,7 +535,7 @@ void DynamicFontAtSize::_update_char(CharType p_char) { { //zero texture - DVector<uint8_t>::Write w = tex.imgdata.write(); + PoolVector<uint8_t>::Write w = tex.imgdata.write(); ERR_FAIL_COND(texsize*texsize*2 > tex.imgdata.size()); for(int i=0;i<texsize*texsize*2;i++) { w[i]=0; @@ -556,7 +556,7 @@ void DynamicFontAtSize::_update_char(CharType p_char) { CharTexture &tex=textures[tex_index]; { - DVector<uint8_t>::Write wr = tex.imgdata.write(); + PoolVector<uint8_t>::Write wr = tex.imgdata.write(); for(int i=0;i<h;i++) { diff --git a/scene/resources/dynamic_font.h b/scene/resources/dynamic_font.h index 133d48bdea..321ec7e332 100644 --- a/scene/resources/dynamic_font.h +++ b/scene/resources/dynamic_font.h @@ -107,7 +107,7 @@ class DynamicFontAtSize : public Reference { struct CharTexture { - DVector<uint8_t> imgdata; + PoolVector<uint8_t> imgdata; int texture_size; Vector<int> offsets; Ref<ImageTexture> texture; diff --git a/scene/resources/dynamic_font_stb.cpp b/scene/resources/dynamic_font_stb.cpp index c931b4d6c8..a25667d85a 100644 --- a/scene/resources/dynamic_font_stb.cpp +++ b/scene/resources/dynamic_font_stb.cpp @@ -26,10 +26,10 @@ void DynamicFontData::lock() { void DynamicFontData::unlock() { - fr = DVector<uint8_t>::Read(); + fr = PoolVector<uint8_t>::Read(); } -void DynamicFontData::set_font_data(const DVector<uint8_t>& p_font) { +void DynamicFontData::set_font_data(const PoolVector<uint8_t>& p_font) { //clear caches and stuff ERR_FAIL_COND(font_data.size()) ; font_data=p_font; @@ -284,7 +284,7 @@ void DynamicFontAtSize::_update_char(CharType p_char) { { //zero texture - DVector<uint8_t>::Write w = tex.imgdata.write(); + PoolVector<uint8_t>::Write w = tex.imgdata.write(); ERR_FAIL_COND(texsize*texsize*2 > tex.imgdata.size()); for(int i=0;i<texsize*texsize*2;i++) { w[i]=0; @@ -305,7 +305,7 @@ void DynamicFontAtSize::_update_char(CharType p_char) { CharTexture &tex=textures[tex_index]; { - DVector<uint8_t>::Write wr = tex.imgdata.write(); + PoolVector<uint8_t>::Write wr = tex.imgdata.write(); for(int i=0;i<h;i++) { for(int j=0;j<w;j++) { @@ -485,14 +485,14 @@ RES ResourceFormatLoaderDynamicFont::load(const String &p_path, const String& p_ FileAccess *f = FileAccess::open(p_path,FileAccess::READ); ERR_FAIL_COND_V(!f,RES()); - DVector<uint8_t> data; + PoolVector<uint8_t> data; data.resize(f->get_len()); ERR_FAIL_COND_V(data.size()==0,RES()); { - DVector<uint8_t>::Write w = data.write(); + PoolVector<uint8_t>::Write w = data.write(); f->get_buffer(w.ptr(),data.size()); } diff --git a/scene/resources/dynamic_font_stb.h b/scene/resources/dynamic_font_stb.h index ad7ca0009d..07a3e5ee6c 100644 --- a/scene/resources/dynamic_font_stb.h +++ b/scene/resources/dynamic_font_stb.h @@ -18,8 +18,8 @@ class DynamicFontData : public Resource { bool valid; - DVector<uint8_t> font_data; - DVector<uint8_t>::Read fr; + PoolVector<uint8_t> font_data; + PoolVector<uint8_t>::Read fr; const uint8_t* last_data_ptr; struct KerningPairKey { @@ -56,7 +56,7 @@ friend class DynamicFont; Ref<DynamicFontAtSize> _get_dynamic_font_at_size(int p_size); public: - void set_font_data(const DVector<uint8_t>& p_font); + void set_font_data(const PoolVector<uint8_t>& p_font); DynamicFontData(); ~DynamicFontData(); }; @@ -71,7 +71,7 @@ class DynamicFontAtSize : public Reference { struct CharTexture { - DVector<uint8_t> imgdata; + PoolVector<uint8_t> imgdata; int texture_size; Vector<int> offsets; Ref<ImageTexture> texture; diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index d4e18c58b8..0464a64031 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -97,7 +97,7 @@ Font::Font() { ///////////////////////////////////////////////////////////////// -void BitmapFont::_set_chars(const DVector<int>& p_chars) { +void BitmapFont::_set_chars(const PoolVector<int>& p_chars) { int len = p_chars.size(); //char 1 charsize 1 texture, 4 rect, 2 align, advance 1 @@ -107,7 +107,7 @@ void BitmapFont::_set_chars(const DVector<int>& p_chars) { int chars = len/9; - DVector<int>::Read r=p_chars.read(); + PoolVector<int>::Read r=p_chars.read(); for(int i=0;i<chars;i++) { const int* data = &r[i*9]; @@ -116,9 +116,9 @@ void BitmapFont::_set_chars(const DVector<int>& p_chars) { } -DVector<int> BitmapFont::_get_chars() const { +PoolVector<int> BitmapFont::_get_chars() const { - DVector<int> chars; + PoolVector<int> chars; const CharType* key=NULL; @@ -140,13 +140,13 @@ DVector<int> BitmapFont::_get_chars() const { return chars; } -void BitmapFont::_set_kernings(const DVector<int>& p_kernings) { +void BitmapFont::_set_kernings(const PoolVector<int>& p_kernings) { int len=p_kernings.size(); ERR_FAIL_COND(len%3); if (!len) return; - DVector<int>::Read r=p_kernings.read(); + PoolVector<int>::Read r=p_kernings.read(); for(int i=0;i<len/3;i++) { @@ -155,9 +155,9 @@ void BitmapFont::_set_kernings(const DVector<int>& p_kernings) { } } -DVector<int> BitmapFont::_get_kernings() const { +PoolVector<int> BitmapFont::_get_kernings() const { - DVector<int> kernings; + PoolVector<int> kernings; for(Map<KerningPairKey,int>::Element *E=kerning_map.front();E;E=E->next()) { diff --git a/scene/resources/font.h b/scene/resources/font.h index 397d48cbb0..ad0f0176db 100644 --- a/scene/resources/font.h +++ b/scene/resources/font.h @@ -109,10 +109,10 @@ private: float ascent; bool distance_field_hint; - void _set_chars(const DVector<int>& p_chars); - DVector<int> _get_chars() const; - void _set_kernings(const DVector<int>& p_kernings); - DVector<int> _get_kernings() const; + void _set_chars(const PoolVector<int>& p_chars); + PoolVector<int> _get_chars() const; + void _set_kernings(const PoolVector<int>& p_kernings); + PoolVector<int> _get_kernings() const; void _set_textures(const Vector<Variant> & p_textures); Vector<Variant> _get_textures() const; diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index ed35eb0216..bad87910ff 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -79,9 +79,9 @@ bool Mesh::_set(const StringName& p_name, const Variant& p_value) { if (p_name=="morph_target/names") { - DVector<String> sk=p_value; + PoolVector<String> sk=p_value; int sz = sk.size(); - DVector<String>::Read r = sk.read(); + PoolVector<String>::Read r = sk.read(); for(int i=0;i<sz;i++) add_morph_target(r[i]); return true; @@ -133,8 +133,8 @@ bool Mesh::_set(const StringName& p_name, const Variant& p_value) { } else if (d.has("array_data")) { - DVector<uint8_t> array_data = d["array_data"]; - DVector<uint8_t> array_index_data; + PoolVector<uint8_t> array_data = d["array_data"]; + PoolVector<uint8_t> array_index_data; if (d.has("array_index_data")) array_index_data=d["array_index_data"]; @@ -151,12 +151,12 @@ bool Mesh::_set(const StringName& p_name, const Variant& p_value) { if (d.has("index_count")) index_count=d["index_count"]; - Vector< DVector<uint8_t> > morphs; + Vector< PoolVector<uint8_t> > morphs; if (d.has("morph_data")) { Array morph_data=d["morph_data"]; for(int i=0;i<morph_data.size();i++) { - DVector<uint8_t> morph = morph_data[i]; + PoolVector<uint8_t> morph = morph_data[i]; morphs.push_back(morph_data[i]); } } @@ -201,7 +201,7 @@ bool Mesh::_get(const StringName& p_name,Variant &r_ret) const { if (p_name=="morph_target/names") { - DVector<String> sk; + PoolVector<String> sk; for(int i=0;i<morph_targets.size();i++) sk.push_back(morph_targets[i]); r_ret=sk; @@ -251,7 +251,7 @@ bool Mesh::_get(const StringName& p_name,Variant &r_ret) const { } d["skeleton_aabb"]=arr; - Vector< DVector<uint8_t> > morph_data = VS::get_singleton()->mesh_surface_get_blend_shapes(mesh,idx); + Vector< PoolVector<uint8_t> > morph_data = VS::get_singleton()->mesh_surface_get_blend_shapes(mesh,idx); Array md; for(int i=0;i<morph_data.size();i++) { @@ -306,7 +306,7 @@ void Mesh::_recompute_aabb() { } -void Mesh::add_surface(uint32_t p_format,PrimitiveType p_primitive,const DVector<uint8_t>& p_array,int p_vertex_count,const DVector<uint8_t>& p_index_array,int p_index_count,const AABB& p_aabb,const Vector<DVector<uint8_t> >& p_blend_shapes,const Vector<AABB>& p_bone_aabbs) { +void Mesh::add_surface(uint32_t p_format,PrimitiveType p_primitive,const PoolVector<uint8_t>& p_array,int p_vertex_count,const PoolVector<uint8_t>& p_index_array,int p_index_count,const AABB& p_aabb,const Vector<PoolVector<uint8_t> >& p_blend_shapes,const Vector<AABB>& p_bone_aabbs) { Surface s; s.aabb=p_aabb; @@ -330,10 +330,10 @@ void Mesh::add_surface_from_arrays(PrimitiveType p_primitive,const Array& p_arra /* make aABB? */ { - DVector<Vector3> vertices=p_arrays[ARRAY_VERTEX]; + PoolVector<Vector3> vertices=p_arrays[ARRAY_VERTEX]; int len=vertices.size(); ERR_FAIL_COND(len==0); - DVector<Vector3>::Read r=vertices.read(); + PoolVector<Vector3>::Read r=vertices.read(); const Vector3 *vtx=r.ptr(); // check AABB @@ -569,21 +569,21 @@ AABB Mesh::get_custom_aabb() const { } -DVector<Face3> Mesh::get_faces() const { +PoolVector<Face3> Mesh::get_faces() const { Ref<TriangleMesh> tm = generate_triangle_mesh(); if (tm.is_valid()) return tm->get_faces(); - return DVector<Face3>(); + return PoolVector<Face3>(); /* for (int i=0;i<surfaces.size();i++) { if (VisualServer::get_singleton()->mesh_surface_get_primitive_type( mesh, i ) != VisualServer::PRIMITIVE_TRIANGLES ) continue; - DVector<int> indices; - DVector<Vector3> vertices; + PoolVector<int> indices; + PoolVector<Vector3> vertices; vertices=VisualServer::get_singleton()->mesh_surface_get_array(mesh, i,VisualServer::ARRAY_VERTEX); @@ -604,10 +604,10 @@ DVector<Face3> Mesh::get_faces() const { if (len<=0) continue; - DVector<int>::Read indicesr = indices.read(); + PoolVector<int>::Read indicesr = indices.read(); const int *indicesptr = indicesr.ptr(); - DVector<Vector3>::Read verticesr = vertices.read(); + PoolVector<Vector3>::Read verticesr = vertices.read(); const Vector3 *verticesptr = verticesr.ptr(); int old_faces=faces.size(); @@ -615,7 +615,7 @@ DVector<Face3> Mesh::get_faces() const { faces.resize(new_faces); - DVector<Face3>::Write facesw = faces.write(); + PoolVector<Face3>::Write facesw = faces.write(); Face3 *facesptr=facesw.ptr(); @@ -639,12 +639,12 @@ DVector<Face3> Mesh::get_faces() const { Ref<Shape> Mesh::create_convex_shape() const { - DVector<Vector3> vertices; + PoolVector<Vector3> vertices; for(int i=0;i<get_surface_count();i++) { Array a = surface_get_arrays(i); - DVector<Vector3> v=a[ARRAY_VERTEX]; + PoolVector<Vector3> v=a[ARRAY_VERTEX]; vertices.append_array(v); } @@ -656,11 +656,11 @@ Ref<Shape> Mesh::create_convex_shape() const { Ref<Shape> Mesh::create_trimesh_shape() const { - DVector<Face3> faces = get_faces(); + PoolVector<Face3> faces = get_faces(); if (faces.size()==0) return Ref<Shape>(); - DVector<Vector3> face_points; + PoolVector<Vector3> face_points; face_points.resize( faces.size()*3 ); for (int i=0;i<face_points.size();i++) { @@ -681,9 +681,9 @@ void Mesh::center_geometry() { for(int i=0;i<get_surface_count();i++) { - DVector<Vector3> geom = surface_get_array(i,ARRAY_VERTEX); + PoolVector<Vector3> geom = surface_get_array(i,ARRAY_VERTEX); int gc =geom.size(); - DVector<Vector3>::Write w = geom.write(); + PoolVector<Vector3>::Write w = geom.write(); surfaces[i].aabb.pos-=ofs; for(int i=0;i<gc;i++) { @@ -691,7 +691,7 @@ void Mesh::center_geometry() { w[i]-=ofs; } - w = DVector<Vector3>::Write(); + w = PoolVector<Vector3>::Write(); surface_set_array(i,ARRAY_VERTEX,geom); @@ -752,9 +752,9 @@ Ref<TriangleMesh> Mesh::generate_triangle_mesh() const { if (facecount==0 || (facecount%3)!=0) return triangle_mesh; - DVector<Vector3> faces; + PoolVector<Vector3> faces; faces.resize(facecount); - DVector<Vector3>::Write facesw=faces.write(); + PoolVector<Vector3>::Write facesw=faces.write(); int widx=0; @@ -766,14 +766,14 @@ Ref<TriangleMesh> Mesh::generate_triangle_mesh() const { Array a = surface_get_arrays(i); int vc = surface_get_array_len(i); - DVector<Vector3> vertices = a[ARRAY_VERTEX]; - DVector<Vector3>::Read vr=vertices.read(); + PoolVector<Vector3> vertices = a[ARRAY_VERTEX]; + PoolVector<Vector3>::Read vr=vertices.read(); if (surface_get_format(i)&ARRAY_FORMAT_INDEX) { int ic=surface_get_array_index_len(i); - DVector<int> indices = a[ARRAY_INDEX]; - DVector<int>::Read ir = indices.read(); + PoolVector<int> indices = a[ARRAY_INDEX]; + PoolVector<int>::Read ir = indices.read(); for(int i=0;i<ic;i++) { int index = ir[i]; @@ -788,7 +788,7 @@ Ref<TriangleMesh> Mesh::generate_triangle_mesh() const { } - facesw=DVector<Vector3>::Write(); + facesw=PoolVector<Vector3>::Write(); triangle_mesh = Ref<TriangleMesh>( memnew( TriangleMesh )); @@ -814,7 +814,7 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const { if (i==0) { arrays=a; - DVector<Vector3> v=a[ARRAY_VERTEX]; + PoolVector<Vector3> v=a[ARRAY_VERTEX]; index_accum+=v.size(); } else { @@ -831,8 +831,8 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const { case ARRAY_VERTEX: case ARRAY_NORMAL: { - DVector<Vector3> dst = arrays[j]; - DVector<Vector3> src = a[j]; + PoolVector<Vector3> dst = arrays[j]; + PoolVector<Vector3> src = a[j]; if (j==ARRAY_VERTEX) vcount=src.size(); if (dst.size()==0 || src.size()==0) { @@ -846,8 +846,8 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const { case ARRAY_BONES: case ARRAY_WEIGHTS: { - DVector<real_t> dst = arrays[j]; - DVector<real_t> src = a[j]; + PoolVector<real_t> dst = arrays[j]; + PoolVector<real_t> src = a[j]; if (dst.size()==0 || src.size()==0) { arrays[j]=Variant(); continue; @@ -857,8 +857,8 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const { } break; case ARRAY_COLOR: { - DVector<Color> dst = arrays[j]; - DVector<Color> src = a[j]; + PoolVector<Color> dst = arrays[j]; + PoolVector<Color> src = a[j]; if (dst.size()==0 || src.size()==0) { arrays[j]=Variant(); continue; @@ -869,8 +869,8 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const { } break; case ARRAY_TEX_UV: case ARRAY_TEX_UV2: { - DVector<Vector2> dst = arrays[j]; - DVector<Vector2> src = a[j]; + PoolVector<Vector2> dst = arrays[j]; + PoolVector<Vector2> src = a[j]; if (dst.size()==0 || src.size()==0) { arrays[j]=Variant(); continue; @@ -880,15 +880,15 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const { } break; case ARRAY_INDEX: { - DVector<int> dst = arrays[j]; - DVector<int> src = a[j]; + PoolVector<int> dst = arrays[j]; + PoolVector<int> src = a[j]; if (dst.size()==0 || src.size()==0) { arrays[j]=Variant(); continue; } { int ss = src.size(); - DVector<int>::Write w = src.write(); + PoolVector<int>::Write w = src.write(); for(int k=0;k<ss;k++) { w[k]+=index_accum; } @@ -906,13 +906,13 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const { } { - DVector<int>::Write ir; - DVector<int> indices =arrays[ARRAY_INDEX]; + PoolVector<int>::Write ir; + PoolVector<int> indices =arrays[ARRAY_INDEX]; bool has_indices=false; - DVector<Vector3> vertices =arrays[ARRAY_VERTEX]; + PoolVector<Vector3> vertices =arrays[ARRAY_VERTEX]; int vc = vertices.size(); ERR_FAIL_COND_V(!vc,Ref<Mesh>()); - DVector<Vector3>::Write r=vertices.write(); + PoolVector<Vector3>::Write r=vertices.write(); if (indices.size()) { @@ -977,14 +977,14 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const { r[i]=t; } - r = DVector<Vector3>::Write(); + r = PoolVector<Vector3>::Write(); arrays[ARRAY_VERTEX]=vertices; if (!has_indices) { - DVector<int> new_indices; + PoolVector<int> new_indices; new_indices.resize(vertices.size()); - DVector<int>::Write iw = new_indices.write(); + PoolVector<int>::Write iw = new_indices.write(); for(int j=0;j<vc2;j+=3) { @@ -993,7 +993,7 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const { iw[j+2]=j+1; } - iw=DVector<int>::Write(); + iw=PoolVector<int>::Write(); arrays[ARRAY_INDEX]=new_indices; } else { @@ -1002,7 +1002,7 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const { SWAP(ir[j+1],ir[j+2]); } - ir=DVector<int>::Write(); + ir=PoolVector<int>::Write(); arrays[ARRAY_INDEX]=indices; } diff --git a/scene/resources/mesh.h b/scene/resources/mesh.h index 9be90b6436..f92db837ea 100644 --- a/scene/resources/mesh.h +++ b/scene/resources/mesh.h @@ -139,7 +139,7 @@ protected: public: void add_surface_from_arrays(PrimitiveType p_primitive, const Array& p_arrays, const Array& p_blend_shapes=Array(), uint32_t p_flags=ARRAY_COMPRESS_DEFAULT); - void add_surface(uint32_t p_format,PrimitiveType p_primitive,const DVector<uint8_t>& p_array,int p_vertex_count,const DVector<uint8_t>& p_index_array,int p_index_count,const AABB& p_aabb,const Vector<DVector<uint8_t> >& p_blend_shapes=Vector<DVector<uint8_t> >(),const Vector<AABB>& p_bone_aabbs=Vector<AABB>()); + void add_surface(uint32_t p_format,PrimitiveType p_primitive,const PoolVector<uint8_t>& p_array,int p_vertex_count,const PoolVector<uint8_t>& p_index_array,int p_index_count,const AABB& p_aabb,const Vector<PoolVector<uint8_t> >& p_blend_shapes=Vector<PoolVector<uint8_t> >(),const Vector<AABB>& p_bone_aabbs=Vector<AABB>()); Array surface_get_arrays(int p_surface) const; virtual Array surface_get_morph_arrays(int p_surface) const; @@ -186,7 +186,7 @@ public: void center_geometry(); void regen_normalmaps(); - DVector<Face3> get_faces() const; + PoolVector<Face3> get_faces() const; Ref<TriangleMesh> generate_triangle_mesh() const; Mesh(); diff --git a/scene/resources/mesh_data_tool.cpp b/scene/resources/mesh_data_tool.cpp index 4a753e6c09..ec699ee8e3 100644 --- a/scene/resources/mesh_data_tool.cpp +++ b/scene/resources/mesh_data_tool.cpp @@ -51,7 +51,7 @@ Error MeshDataTool::create_from_surface(const Ref<Mesh>& p_mesh,int p_surface) { Array arrays = p_mesh->surface_get_arrays(p_surface); ERR_FAIL_COND_V( arrays.empty(), ERR_INVALID_PARAMETER ); - DVector<Vector3> varray = arrays[Mesh::ARRAY_VERTEX]; + PoolVector<Vector3> varray = arrays[Mesh::ARRAY_VERTEX]; int vcount = varray.size(); ERR_FAIL_COND_V( vcount == 0, ERR_INVALID_PARAMETER); @@ -60,34 +60,34 @@ Error MeshDataTool::create_from_surface(const Ref<Mesh>& p_mesh,int p_surface) { format = p_mesh->surface_get_format(p_surface); material=p_mesh->surface_get_material(p_surface); - DVector<Vector3>::Read vr = varray.read(); + PoolVector<Vector3>::Read vr = varray.read(); - DVector<Vector3>::Read nr; + PoolVector<Vector3>::Read nr; if (arrays[Mesh::ARRAY_NORMAL].get_type()!=Variant::NIL) - nr = arrays[Mesh::ARRAY_NORMAL].operator DVector<Vector3>().read(); + nr = arrays[Mesh::ARRAY_NORMAL].operator PoolVector<Vector3>().read(); - DVector<real_t>::Read ta; + PoolVector<real_t>::Read ta; if (arrays[Mesh::ARRAY_TANGENT].get_type()!=Variant::NIL) - ta = arrays[Mesh::ARRAY_TANGENT].operator DVector<real_t>().read(); + ta = arrays[Mesh::ARRAY_TANGENT].operator PoolVector<real_t>().read(); - DVector<Vector2>::Read uv; + PoolVector<Vector2>::Read uv; if (arrays[Mesh::ARRAY_TEX_UV].get_type()!=Variant::NIL) - uv = arrays[Mesh::ARRAY_TEX_UV].operator DVector<Vector2>().read(); - DVector<Vector2>::Read uv2; + uv = arrays[Mesh::ARRAY_TEX_UV].operator PoolVector<Vector2>().read(); + PoolVector<Vector2>::Read uv2; if (arrays[Mesh::ARRAY_TEX_UV2].get_type()!=Variant::NIL) - uv2 = arrays[Mesh::ARRAY_TEX_UV2].operator DVector<Vector2>().read(); + uv2 = arrays[Mesh::ARRAY_TEX_UV2].operator PoolVector<Vector2>().read(); - DVector<Color>::Read col; + PoolVector<Color>::Read col; if (arrays[Mesh::ARRAY_COLOR].get_type()!=Variant::NIL) - col = arrays[Mesh::ARRAY_COLOR].operator DVector<Color>().read(); + col = arrays[Mesh::ARRAY_COLOR].operator PoolVector<Color>().read(); - DVector<real_t>::Read bo; + PoolVector<real_t>::Read bo; if (arrays[Mesh::ARRAY_BONES].get_type()!=Variant::NIL) - bo = arrays[Mesh::ARRAY_BONES].operator DVector<real_t>().read(); + bo = arrays[Mesh::ARRAY_BONES].operator PoolVector<real_t>().read(); - DVector<real_t>::Read we; + PoolVector<real_t>::Read we; if (arrays[Mesh::ARRAY_WEIGHTS].get_type()!=Variant::NIL) - we = arrays[Mesh::ARRAY_WEIGHTS].operator DVector<real_t>().read(); + we = arrays[Mesh::ARRAY_WEIGHTS].operator PoolVector<real_t>().read(); vertices.resize(vcount); @@ -129,7 +129,7 @@ Error MeshDataTool::create_from_surface(const Ref<Mesh>& p_mesh,int p_surface) { } - DVector<int> indices; + PoolVector<int> indices; if (arrays[Mesh::ARRAY_INDEX].get_type()!=Variant::NIL) { @@ -137,14 +137,14 @@ Error MeshDataTool::create_from_surface(const Ref<Mesh>& p_mesh,int p_surface) { } else { //make code simpler indices.resize(vcount); - DVector<int>::Write iw=indices.write(); + PoolVector<int>::Write iw=indices.write(); for(int i=0;i<vcount;i++) iw[i]=i; } int icount=indices.size(); - DVector<int>::Read r = indices.read(); + PoolVector<int>::Read r = indices.read(); Map<Point2i,int> edge_indices; @@ -199,59 +199,59 @@ Error MeshDataTool::commit_to_surface(const Ref<Mesh>& p_mesh) { int vcount=vertices.size(); - DVector<Vector3> v; - DVector<Vector3> n; - DVector<real_t> t; - DVector<Vector2> u; - DVector<Vector2> u2; - DVector<Color> c; - DVector<real_t> b; - DVector<real_t> w; - DVector<int> in; + PoolVector<Vector3> v; + PoolVector<Vector3> n; + PoolVector<real_t> t; + PoolVector<Vector2> u; + PoolVector<Vector2> u2; + PoolVector<Color> c; + PoolVector<real_t> b; + PoolVector<real_t> w; + PoolVector<int> in; { v.resize(vcount); - DVector<Vector3>::Write vr=v.write(); + PoolVector<Vector3>::Write vr=v.write(); - DVector<Vector3>::Write nr; + PoolVector<Vector3>::Write nr; if (format&Mesh::ARRAY_FORMAT_NORMAL) { n.resize(vcount); nr = n.write(); } - DVector<real_t>::Write ta; + PoolVector<real_t>::Write ta; if (format&Mesh::ARRAY_FORMAT_TANGENT) { t.resize(vcount*4); ta = t.write(); } - DVector<Vector2>::Write uv; + PoolVector<Vector2>::Write uv; if (format&Mesh::ARRAY_FORMAT_TEX_UV) { u.resize(vcount); uv = u.write(); } - DVector<Vector2>::Write uv2; + PoolVector<Vector2>::Write uv2; if (format&Mesh::ARRAY_FORMAT_TEX_UV2) { u2.resize(vcount); uv2 = u2.write(); } - DVector<Color>::Write col; + PoolVector<Color>::Write col; if (format&Mesh::ARRAY_FORMAT_COLOR) { c.resize(vcount); col = c.write(); } - DVector<real_t>::Write bo; + PoolVector<real_t>::Write bo; if (format&Mesh::ARRAY_FORMAT_BONES) { b.resize(vcount*4); bo = b.write(); } - DVector<real_t>::Write we; + PoolVector<real_t>::Write we; if (format&Mesh::ARRAY_FORMAT_WEIGHTS) { w.resize(vcount*4); we = w.write(); @@ -299,7 +299,7 @@ Error MeshDataTool::commit_to_surface(const Ref<Mesh>& p_mesh) { int fc = faces.size(); in.resize(fc*3); - DVector<int>::Write iw=in.write(); + PoolVector<int>::Write iw=in.write(); for(int i=0;i<fc;i++) { iw[i*3+0]=faces[i].v[0]; diff --git a/scene/resources/multimesh.cpp b/scene/resources/multimesh.cpp index 802f58e8ca..143870c920 100644 --- a/scene/resources/multimesh.cpp +++ b/scene/resources/multimesh.cpp @@ -31,17 +31,17 @@ -void MultiMesh::_set_transform_array(const DVector<Vector3>& p_array) { +void MultiMesh::_set_transform_array(const PoolVector<Vector3>& p_array) { int instance_count = get_instance_count(); - DVector<Vector3> xforms = p_array; + PoolVector<Vector3> xforms = p_array; int len=xforms.size(); ERR_FAIL_COND((len/4) != instance_count); if (len==0) return; - DVector<Vector3>::Read r = xforms.read(); + PoolVector<Vector3>::Read r = xforms.read(); for(int i=0;i<len/4;i++) { @@ -56,17 +56,17 @@ void MultiMesh::_set_transform_array(const DVector<Vector3>& p_array) { } -DVector<Vector3> MultiMesh::_get_transform_array() const { +PoolVector<Vector3> MultiMesh::_get_transform_array() const { int instance_count = get_instance_count(); if (instance_count==0) - return DVector<Vector3>(); + return PoolVector<Vector3>(); - DVector<Vector3> xforms; + PoolVector<Vector3> xforms; xforms.resize(instance_count*4); - DVector<Vector3>::Write w = xforms.write(); + PoolVector<Vector3>::Write w = xforms.write(); for(int i=0;i<instance_count;i++) { @@ -82,17 +82,17 @@ DVector<Vector3> MultiMesh::_get_transform_array() const { } -void MultiMesh::_set_color_array(const DVector<Color>& p_array) { +void MultiMesh::_set_color_array(const PoolVector<Color>& p_array) { int instance_count = get_instance_count(); - DVector<Color> colors = p_array; + PoolVector<Color> colors = p_array; int len=colors.size(); ERR_FAIL_COND(len != instance_count); if (len==0) return; - DVector<Color>::Read r = colors.read(); + PoolVector<Color>::Read r = colors.read(); for(int i=0;i<len;i++) { @@ -101,14 +101,14 @@ void MultiMesh::_set_color_array(const DVector<Color>& p_array) { } -DVector<Color> MultiMesh::_get_color_array() const { +PoolVector<Color> MultiMesh::_get_color_array() const { int instance_count = get_instance_count(); if (instance_count==0) - return DVector<Color>(); + return PoolVector<Color>(); - DVector<Color> colors; + PoolVector<Color> colors; colors.resize(instance_count); for(int i=0;i<instance_count;i++) { diff --git a/scene/resources/multimesh.h b/scene/resources/multimesh.h index ab2ef59214..3ba109a087 100644 --- a/scene/resources/multimesh.h +++ b/scene/resources/multimesh.h @@ -59,11 +59,11 @@ protected: static void _bind_methods(); - void _set_transform_array(const DVector<Vector3>& p_array); - DVector<Vector3> _get_transform_array() const; + void _set_transform_array(const PoolVector<Vector3>& p_array); + PoolVector<Vector3> _get_transform_array() const; - void _set_color_array(const DVector<Color>& p_array); - DVector<Color> _get_color_array() const; + void _set_color_array(const PoolVector<Color>& p_array); + PoolVector<Color> _get_color_array() const; public: diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index 7d86513c51..c3b98af811 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -1139,12 +1139,12 @@ void SceneState::set_bundled_scene(const Dictionary& d) { ERR_FAIL(); } - DVector<String> snames = d["names"]; + PoolVector<String> snames = d["names"]; if (snames.size()) { int namecount = snames.size(); names.resize(namecount); - DVector<String>::Read r =snames.read(); + PoolVector<String>::Read r =snames.read(); for(int i=0;i<names.size();i++) names[i]=r[i]; } @@ -1166,8 +1166,8 @@ void SceneState::set_bundled_scene(const Dictionary& d) { nodes.resize(d["node_count"]); int nc=nodes.size(); if (nc) { - DVector<int> snodes = d["nodes"]; - DVector<int>::Read r = snodes.read(); + PoolVector<int> snodes = d["nodes"]; + PoolVector<int>::Read r = snodes.read(); int idx=0; for(int i=0;i<nc;i++) { NodeData &nd = nodes[i]; @@ -1196,8 +1196,8 @@ void SceneState::set_bundled_scene(const Dictionary& d) { if (cc) { - DVector<int> sconns = d["conns"]; - DVector<int>::Read r = sconns.read(); + PoolVector<int> sconns = d["conns"]; + PoolVector<int>::Read r = sconns.read(); int idx=0; for(int i=0;i<cc;i++) { ConnectionData &cd = connections[i]; @@ -1245,12 +1245,12 @@ void SceneState::set_bundled_scene(const Dictionary& d) { Dictionary SceneState::get_bundled_scene() const { - DVector<String> rnames; + PoolVector<String> rnames; rnames.resize(names.size()); if (names.size()) { - DVector<String>::Write r=rnames.write(); + PoolVector<String>::Write r=rnames.write(); for(int i=0;i<names.size();i++) r[i]=names[i]; @@ -1659,10 +1659,10 @@ void SceneState::add_editable_instance(const NodePath& p_path){ editable_instances.push_back(p_path); } -DVector<String> SceneState::_get_node_groups(int p_idx) const { +PoolVector<String> SceneState::_get_node_groups(int p_idx) const { Vector<StringName> groups = get_node_groups(p_idx); - DVector<String> ret; + PoolVector<String> ret; for(int i=0;i<groups.size();i++) ret.push_back(groups[i]); diff --git a/scene/resources/packed_scene.h b/scene/resources/packed_scene.h index 2eda624dc3..fd4ed106df 100644 --- a/scene/resources/packed_scene.h +++ b/scene/resources/packed_scene.h @@ -102,7 +102,7 @@ class SceneState : public Reference { static bool disable_placeholders; - DVector<String> _get_node_groups(int p_idx) const; + PoolVector<String> _get_node_groups(int p_idx) const; protected: diff --git a/scene/resources/polygon_path_finder.cpp b/scene/resources/polygon_path_finder.cpp index 3dc3e6005a..2156487407 100644 --- a/scene/resources/polygon_path_finder.cpp +++ b/scene/resources/polygon_path_finder.cpp @@ -448,7 +448,7 @@ void PolygonPathFinder::_set_data(const Dictionary& p_data) { ERR_FAIL_COND(!p_data.has("segments")); ERR_FAIL_COND(!p_data.has("bounds")); - DVector<Vector2> p=p_data["points"]; + PoolVector<Vector2> p=p_data["points"]; Array c=p_data["connections"]; ERR_FAIL_COND(c.size()!=p.size()); @@ -458,11 +458,11 @@ void PolygonPathFinder::_set_data(const Dictionary& p_data) { int pc = p.size(); points.resize(pc+2); - DVector<Vector2>::Read pr=p.read(); + PoolVector<Vector2>::Read pr=p.read(); for(int i=0;i<pc;i++) { points[i].pos=pr[i]; - DVector<int> con=c[i]; - DVector<int>::Read cr=con.read(); + PoolVector<int> con=c[i]; + PoolVector<int>::Read cr=con.read(); int cc=con.size(); for(int j=0;j<cc;j++) { @@ -473,19 +473,19 @@ void PolygonPathFinder::_set_data(const Dictionary& p_data) { if (p_data.has("penalties")) { - DVector<float> penalties=p_data["penalties"]; + PoolVector<float> penalties=p_data["penalties"]; if (penalties.size()==pc) { - DVector<float>::Read pr = penalties.read(); + PoolVector<float>::Read pr = penalties.read(); for(int i=0;i<pc;i++) { points[i].penalty=pr[i]; } } } - DVector<int> segs=p_data["segments"]; + PoolVector<int> segs=p_data["segments"]; int sc=segs.size(); ERR_FAIL_COND(sc&1); - DVector<int>::Read sr = segs.read(); + PoolVector<int>::Read sr = segs.read(); for(int i=0;i<sc;i+=2) { Edge e(sr[i],sr[i+1]); @@ -498,25 +498,25 @@ void PolygonPathFinder::_set_data(const Dictionary& p_data) { Dictionary PolygonPathFinder::_get_data() const{ Dictionary d; - DVector<Vector2> p; - DVector<int> ind; + PoolVector<Vector2> p; + PoolVector<int> ind; Array connections; p.resize(points.size()-2); connections.resize(points.size()-2); ind.resize(edges.size()*2); - DVector<float> penalties; + PoolVector<float> penalties; penalties.resize(points.size()-2); { - DVector<Vector2>::Write wp=p.write(); - DVector<float>::Write pw=penalties.write(); + PoolVector<Vector2>::Write wp=p.write(); + PoolVector<float>::Write pw=penalties.write(); for(int i=0;i<points.size()-2;i++) { wp[i]=points[i].pos; pw[i]=points[i].penalty; - DVector<int> c; + PoolVector<int> c; c.resize(points[i].connections.size()); { - DVector<int>::Write cw=c.write(); + PoolVector<int>::Write cw=c.write(); int idx=0; for (Set<int>::Element *E=points[i].connections.front();E;E=E->next()) { cw[idx++]=E->get(); @@ -527,7 +527,7 @@ Dictionary PolygonPathFinder::_get_data() const{ } { - DVector<int>::Write iw=ind.write(); + PoolVector<int>::Write iw=ind.write(); int idx=0; for (Set<Edge>::Element *E=edges.front();E;E=E->next()) { iw[idx++]=E->get().points[0]; diff --git a/scene/resources/room.cpp b/scene/resources/room.cpp index c4d11b94d1..88648272be 100644 --- a/scene/resources/room.cpp +++ b/scene/resources/room.cpp @@ -37,12 +37,12 @@ RID RoomBounds::get_rid() const { } -void RoomBounds::set_geometry_hint(const DVector<Face3>& p_geometry_hint) { +void RoomBounds::set_geometry_hint(const PoolVector<Face3>& p_geometry_hint) { geometry_hint=p_geometry_hint; } -DVector<Face3> RoomBounds::get_geometry_hint() const { +PoolVector<Face3> RoomBounds::get_geometry_hint() const { return geometry_hint; } diff --git a/scene/resources/room.h b/scene/resources/room.h index 6a8deac8b3..84d68e5718 100644 --- a/scene/resources/room.h +++ b/scene/resources/room.h @@ -41,7 +41,7 @@ class RoomBounds : public Resource { RES_BASE_EXTENSION("room"); RID area; - DVector<Face3> geometry_hint; + PoolVector<Face3> geometry_hint; protected: @@ -53,8 +53,8 @@ public: virtual RID get_rid() const; - void set_geometry_hint(const DVector<Face3>& geometry_hint); - DVector<Face3> get_geometry_hint() const; + void set_geometry_hint(const PoolVector<Face3>& geometry_hint); + PoolVector<Face3> get_geometry_hint() const; RoomBounds(); ~RoomBounds(); diff --git a/scene/resources/sample.cpp b/scene/resources/sample.cpp index 8ea02ac943..e07e4d3767 100644 --- a/scene/resources/sample.cpp +++ b/scene/resources/sample.cpp @@ -119,18 +119,18 @@ int Sample::get_length() const { return length; } -void Sample::set_data(const DVector<uint8_t>& p_buffer) { +void Sample::set_data(const PoolVector<uint8_t>& p_buffer) { if (sample.is_valid()) AudioServer::get_singleton()->sample_set_data(sample,p_buffer); } -DVector<uint8_t> Sample::get_data() const { +PoolVector<uint8_t> Sample::get_data() const { if (sample.is_valid()) return AudioServer::get_singleton()->sample_get_data(sample); - return DVector<uint8_t>(); + return PoolVector<uint8_t>(); } diff --git a/scene/resources/sample.h b/scene/resources/sample.h index c011f63144..be2cf67954 100644 --- a/scene/resources/sample.h +++ b/scene/resources/sample.h @@ -82,8 +82,8 @@ public: bool is_stereo() const; int get_length() const; - void set_data(const DVector<uint8_t>& p_buffer); - DVector<uint8_t> get_data() const; + void set_data(const PoolVector<uint8_t>& p_buffer); + PoolVector<uint8_t> get_data() const; void set_mix_rate(int p_rate); int get_mix_rate() const; diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp index 0c31e1406f..37b019e369 100644 --- a/scene/resources/shader_graph.cpp +++ b/scene/resources/shader_graph.cpp @@ -554,8 +554,8 @@ void ShaderGraph::node_add(ShaderType p_type, NodeType p_node_type,int p_id) { case NODE_XFORM_TO_VEC: {} break; // 3 scalar input: {} break; 1 vec3 output case NODE_SCALAR_INTERP: {} break; // scalar interpolation (with optional curve) case NODE_VEC_INTERP: {} break; // vec3 interpolation (with optional curve) - case NODE_COLOR_RAMP: { node.param1=DVector<Color>(); node.param2=DVector<real_t>();} break; // vec3 interpolation (with optional curve) - case NODE_CURVE_MAP: { node.param1=DVector<Vector2>();} break; // vec3 interpolation (with optional curve) + case NODE_COLOR_RAMP: { node.param1=PoolVector<Color>(); node.param2=PoolVector<real_t>();} break; // vec3 interpolation (with optional curve) + case NODE_CURVE_MAP: { node.param1=PoolVector<Vector2>();} break; // vec3 interpolation (with optional curve) case NODE_SCALAR_INPUT: {node.param1=_find_unique_name("Scalar"); node.param2=0;} break; // scalar uniform (assignable in material) case NODE_VEC_INPUT: {node.param1=_find_unique_name("Vec3");node.param2=Vector3();} break; // vec3 uniform (assignable in material) case NODE_RGB_INPUT: {node.param1=_find_unique_name("Color");node.param2=Color();} break; // color uniform (assignable in material) @@ -1082,7 +1082,7 @@ ShaderGraph::VecFunc ShaderGraph::vec_func_node_get_function(ShaderType p_type, return VecFunc(func); } -void ShaderGraph::color_ramp_node_set_ramp(ShaderType p_type,int p_id,const DVector<Color>& p_colors, const DVector<real_t>& p_offsets){ +void ShaderGraph::color_ramp_node_set_ramp(ShaderType p_type,int p_id,const PoolVector<Color>& p_colors, const PoolVector<real_t>& p_offsets){ ERR_FAIL_INDEX(p_type,3); ERR_FAIL_COND(!shader[p_type].node_map.has(p_id)); @@ -1094,27 +1094,27 @@ void ShaderGraph::color_ramp_node_set_ramp(ShaderType p_type,int p_id,const DVec } -DVector<Color> ShaderGraph::color_ramp_node_get_colors(ShaderType p_type,int p_id) const{ +PoolVector<Color> ShaderGraph::color_ramp_node_get_colors(ShaderType p_type,int p_id) const{ - ERR_FAIL_INDEX_V(p_type,3,DVector<Color>()); - ERR_FAIL_COND_V(!shader[p_type].node_map.has(p_id),DVector<Color>()); + ERR_FAIL_INDEX_V(p_type,3,PoolVector<Color>()); + ERR_FAIL_COND_V(!shader[p_type].node_map.has(p_id),PoolVector<Color>()); const Node& n = shader[p_type].node_map[p_id]; return n.param1; } -DVector<real_t> ShaderGraph::color_ramp_node_get_offsets(ShaderType p_type,int p_id) const{ +PoolVector<real_t> ShaderGraph::color_ramp_node_get_offsets(ShaderType p_type,int p_id) const{ - ERR_FAIL_INDEX_V(p_type,3,DVector<real_t>()); - ERR_FAIL_COND_V(!shader[p_type].node_map.has(p_id),DVector<real_t>()); + ERR_FAIL_INDEX_V(p_type,3,PoolVector<real_t>()); + ERR_FAIL_COND_V(!shader[p_type].node_map.has(p_id),PoolVector<real_t>()); const Node& n = shader[p_type].node_map[p_id]; return n.param2; } -void ShaderGraph::curve_map_node_set_points(ShaderType p_type,int p_id,const DVector<Vector2>& p_points) { +void ShaderGraph::curve_map_node_set_points(ShaderType p_type,int p_id,const PoolVector<Vector2>& p_points) { ERR_FAIL_INDEX(p_type,3); ERR_FAIL_COND(!shader[p_type].node_map.has(p_id)); @@ -1124,10 +1124,10 @@ void ShaderGraph::curve_map_node_set_points(ShaderType p_type,int p_id,const DVe } -DVector<Vector2> ShaderGraph::curve_map_node_get_points(ShaderType p_type,int p_id) const{ +PoolVector<Vector2> ShaderGraph::curve_map_node_get_points(ShaderType p_type,int p_id) const{ - ERR_FAIL_INDEX_V(p_type,3,DVector<Vector2>()); - ERR_FAIL_COND_V(!shader[p_type].node_map.has(p_id),DVector<Vector2>()); + ERR_FAIL_INDEX_V(p_type,3,PoolVector<Vector2>()); + ERR_FAIL_COND_V(!shader[p_type].node_map.has(p_id),PoolVector<Vector2>()); const Node& n = shader[p_type].node_map[p_id]; return n.param1; @@ -2450,16 +2450,16 @@ void ShaderGraph::_add_node_code(ShaderType p_type,Node *p_node,const Vector<Str DEF_SCALAR(0); static const int color_ramp_len=512; - DVector<uint8_t> cramp; + PoolVector<uint8_t> cramp; cramp.resize(color_ramp_len*4); { - DVector<Color> colors=p_node->param1; - DVector<real_t> offsets=p_node->param2; + PoolVector<Color> colors=p_node->param1; + PoolVector<real_t> offsets=p_node->param2; int cc =colors.size(); - DVector<uint8_t>::Write crw = cramp.write(); - DVector<Color>::Read cr = colors.read(); - DVector<real_t>::Read ofr = offsets.read(); + PoolVector<uint8_t>::Write crw = cramp.write(); + PoolVector<Color>::Read cr = colors.read(); + PoolVector<real_t>::Read ofr = offsets.read(); int at=0; Color color_at(0,0,0,1); @@ -2508,14 +2508,14 @@ void ShaderGraph::_add_node_code(ShaderType p_type,Node *p_node,const Vector<Str static const int curve_map_len=256; bool mapped[256]; zeromem(mapped,sizeof(mapped)); - DVector<uint8_t> cmap; + PoolVector<uint8_t> cmap; cmap.resize(curve_map_len); { - DVector<Point2> points=p_node->param1; + PoolVector<Point2> points=p_node->param1; int pc =points.size(); - DVector<uint8_t>::Write cmw = cmap.write(); - DVector<Point2>::Read pr = points.read(); + PoolVector<uint8_t>::Write cmw = cmap.write(); + PoolVector<Point2>::Read pr = points.read(); Vector2 prev=Vector2(0,0); Vector2 prev2=Vector2(0,0); diff --git a/scene/resources/shader_graph.h b/scene/resources/shader_graph.h index 57893f27c0..f4e24dbe78 100644 --- a/scene/resources/shader_graph.h +++ b/scene/resources/shader_graph.h @@ -326,12 +326,12 @@ public: void vec_func_node_set_function(ShaderType p_which,int p_id,VecFunc p_func); VecFunc vec_func_node_get_function(ShaderType p_which,int p_id) const; - void color_ramp_node_set_ramp(ShaderType p_which,int p_id,const DVector<Color>& p_colors, const DVector<real_t>& p_offsets); - DVector<Color> color_ramp_node_get_colors(ShaderType p_which,int p_id) const; - DVector<real_t> color_ramp_node_get_offsets(ShaderType p_which,int p_id) const; + void color_ramp_node_set_ramp(ShaderType p_which,int p_id,const PoolVector<Color>& p_colors, const PoolVector<real_t>& p_offsets); + PoolVector<Color> color_ramp_node_get_colors(ShaderType p_which,int p_id) const; + PoolVector<real_t> color_ramp_node_get_offsets(ShaderType p_which,int p_id) const; - void curve_map_node_set_points(ShaderType p_which, int p_id, const DVector<Vector2>& p_points); - DVector<Vector2> curve_map_node_get_points(ShaderType p_which,int p_id) const; + void curve_map_node_set_points(ShaderType p_which, int p_id, const PoolVector<Vector2>& p_points); + PoolVector<Vector2> curve_map_node_get_points(ShaderType p_which,int p_id) const; void input_node_set_name(ShaderType p_which,int p_id,const String& p_name); String input_node_get_name(ShaderType p_which,int p_id); diff --git a/scene/resources/shape.cpp b/scene/resources/shape.cpp index f00443276f..a90c3b47a9 100644 --- a/scene/resources/shape.cpp +++ b/scene/resources/shape.cpp @@ -34,7 +34,7 @@ #include "scene/main/scene_main_loop.h" -void Shape::add_vertices_to_array(DVector<Vector3> &array, const Transform& p_xform) { +void Shape::add_vertices_to_array(PoolVector<Vector3> &array, const Transform& p_xform) { Vector<Vector3> toadd = _gen_debug_mesh_lines(); @@ -42,7 +42,7 @@ void Shape::add_vertices_to_array(DVector<Vector3> &array, const Transform& p_xf int base=array.size(); array.resize(base+toadd.size()); - DVector<Vector3>::Write w = array.write(); + PoolVector<Vector3>::Write w = array.write(); for(int i=0;i<toadd.size();i++) { w[i+base]=p_xform.xform(toadd[i]); } @@ -61,11 +61,11 @@ Ref<Mesh> Shape::get_debug_mesh() { if (!lines.empty()) { //make mesh - DVector<Vector3> array; + PoolVector<Vector3> array; array.resize(lines.size()); { - DVector<Vector3>::Write w=array.write(); + PoolVector<Vector3>::Write w=array.write(); for(int i=0;i<lines.size();i++) { w[i]=lines[i]; } diff --git a/scene/resources/shape.h b/scene/resources/shape.h index 94a8ec7075..29a93b642c 100644 --- a/scene/resources/shape.h +++ b/scene/resources/shape.h @@ -53,7 +53,7 @@ public: Ref<Mesh> get_debug_mesh(); - void add_vertices_to_array(DVector<Vector3> &array, const Transform& p_xform); + void add_vertices_to_array(PoolVector<Vector3> &array, const Transform& p_xform); Shape(); ~Shape(); diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp index 2ed620c097..cc13c0ff11 100644 --- a/scene/resources/surface_tool.cpp +++ b/scene/resources/surface_tool.cpp @@ -262,9 +262,9 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh>& p_existing) { case Mesh::ARRAY_FORMAT_VERTEX: case Mesh::ARRAY_FORMAT_NORMAL: { - DVector<Vector3> array; + PoolVector<Vector3> array; array.resize(varr_len); - DVector<Vector3>::Write w = array.write(); + PoolVector<Vector3>::Write w = array.write(); int idx=0; for(List< Vertex >::Element *E=vertex_array.front();E;E=E->next(),idx++) { @@ -282,7 +282,7 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh>& p_existing) { } - w=DVector<Vector3>::Write(); + w=PoolVector<Vector3>::Write(); a[i]=array; } break; @@ -290,9 +290,9 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh>& p_existing) { case Mesh::ARRAY_FORMAT_TEX_UV: case Mesh::ARRAY_FORMAT_TEX_UV2: { - DVector<Vector2> array; + PoolVector<Vector2> array; array.resize(varr_len); - DVector<Vector2>::Write w = array.write(); + PoolVector<Vector2>::Write w = array.write(); int idx=0; for(List< Vertex >::Element *E=vertex_array.front();E;E=E->next(),idx++) { @@ -311,15 +311,15 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh>& p_existing) { } - w=DVector<Vector2>::Write(); + w=PoolVector<Vector2>::Write(); a[i]=array; } break; case Mesh::ARRAY_FORMAT_TANGENT: { - DVector<float> array; + PoolVector<float> array; array.resize(varr_len*4); - DVector<float>::Write w = array.write(); + PoolVector<float>::Write w = array.write(); int idx=0; for(List< Vertex >::Element *E=vertex_array.front();E;E=E->next(),idx+=4) { @@ -335,15 +335,15 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh>& p_existing) { w[idx+3]=d<0 ? -1 : 1; } - w=DVector<float>::Write(); + w=PoolVector<float>::Write(); a[i]=array; } break; case Mesh::ARRAY_FORMAT_COLOR: { - DVector<Color> array; + PoolVector<Color> array; array.resize(varr_len); - DVector<Color>::Write w = array.write(); + PoolVector<Color>::Write w = array.write(); int idx=0; for(List< Vertex >::Element *E=vertex_array.front();E;E=E->next(),idx++) { @@ -352,15 +352,15 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh>& p_existing) { w[idx]=v.color; } - w=DVector<Color>::Write(); + w=PoolVector<Color>::Write(); a[i]=array; } break; case Mesh::ARRAY_FORMAT_BONES: { - DVector<int> array; + PoolVector<int> array; array.resize(varr_len*4); - DVector<int>::Write w = array.write(); + PoolVector<int>::Write w = array.write(); int idx=0; for(List< Vertex >::Element *E=vertex_array.front();E;E=E->next(),idx+=4) { @@ -375,16 +375,16 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh>& p_existing) { } - w=DVector<int>::Write(); + w=PoolVector<int>::Write(); a[i]=array; } break; case Mesh::ARRAY_FORMAT_WEIGHTS: { - DVector<float> array; + PoolVector<float> array; array.resize(varr_len*4); - DVector<float>::Write w = array.write(); + PoolVector<float>::Write w = array.write(); int idx=0; for(List< Vertex >::Element *E=vertex_array.front();E;E=E->next(),idx+=4) { @@ -399,7 +399,7 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh>& p_existing) { } - w=DVector<float>::Write(); + w=PoolVector<float>::Write(); a[i]=array; } break; @@ -407,9 +407,9 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh>& p_existing) { ERR_CONTINUE( index_array.size() ==0 ); - DVector<int> array; + PoolVector<int> array; array.resize(index_array.size()); - DVector<int>::Write w = array.write(); + PoolVector<int>::Write w = array.write(); int idx=0; for(List< int>::Element *E=index_array.front();E;E=E->next(),idx++) { @@ -417,7 +417,7 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh>& p_existing) { w[idx]=E->get(); } - w=DVector<int>::Write(); + w=PoolVector<int>::Write(); a[i]=array; } break; @@ -490,14 +490,14 @@ void SurfaceTool::_create_list(const Ref<Mesh>& p_existing, int p_surface, List< Array arr = p_existing->surface_get_arrays(p_surface); ERR_FAIL_COND( arr.size() !=VS::ARRAY_MAX ); - DVector<Vector3> varr = arr[VS::ARRAY_VERTEX]; - DVector<Vector3> narr = arr[VS::ARRAY_NORMAL]; - DVector<float> tarr = arr[VS::ARRAY_TANGENT]; - DVector<Color> carr = arr[VS::ARRAY_COLOR]; - DVector<Vector2> uvarr = arr[VS::ARRAY_TEX_UV]; - DVector<Vector2> uv2arr = arr[VS::ARRAY_TEX_UV2]; - DVector<int> barr = arr[VS::ARRAY_BONES]; - DVector<float> warr = arr[VS::ARRAY_WEIGHTS]; + PoolVector<Vector3> varr = arr[VS::ARRAY_VERTEX]; + PoolVector<Vector3> narr = arr[VS::ARRAY_NORMAL]; + PoolVector<float> tarr = arr[VS::ARRAY_TANGENT]; + PoolVector<Color> carr = arr[VS::ARRAY_COLOR]; + PoolVector<Vector2> uvarr = arr[VS::ARRAY_TEX_UV]; + PoolVector<Vector2> uv2arr = arr[VS::ARRAY_TEX_UV2]; + PoolVector<int> barr = arr[VS::ARRAY_BONES]; + PoolVector<float> warr = arr[VS::ARRAY_WEIGHTS]; int vc = varr.size(); @@ -505,46 +505,46 @@ void SurfaceTool::_create_list(const Ref<Mesh>& p_existing, int p_surface, List< return; lformat=0; - DVector<Vector3>::Read rv; + PoolVector<Vector3>::Read rv; if (varr.size()) { lformat|=VS::ARRAY_FORMAT_VERTEX; rv=varr.read(); } - DVector<Vector3>::Read rn; + PoolVector<Vector3>::Read rn; if (narr.size()) { lformat|=VS::ARRAY_FORMAT_NORMAL; rn=narr.read(); } - DVector<float>::Read rt; + PoolVector<float>::Read rt; if (tarr.size()) { lformat|=VS::ARRAY_FORMAT_TANGENT; rt=tarr.read(); } - DVector<Color>::Read rc; + PoolVector<Color>::Read rc; if (carr.size()) { lformat|=VS::ARRAY_FORMAT_COLOR; rc=carr.read(); } - DVector<Vector2>::Read ruv; + PoolVector<Vector2>::Read ruv; if (uvarr.size()) { lformat|=VS::ARRAY_FORMAT_TEX_UV; ruv=uvarr.read(); } - DVector<Vector2>::Read ruv2; + PoolVector<Vector2>::Read ruv2; if (uv2arr.size()) { lformat|=VS::ARRAY_FORMAT_TEX_UV2; ruv2=uv2arr.read(); } - DVector<int>::Read rb; + PoolVector<int>::Read rb; if (barr.size()) { lformat|=VS::ARRAY_FORMAT_BONES; rb=barr.read(); } - DVector<float>::Read rw; + PoolVector<float>::Read rw; if (warr.size()) { lformat|=VS::ARRAY_FORMAT_WEIGHTS; rw=warr.read(); @@ -592,12 +592,12 @@ void SurfaceTool::_create_list(const Ref<Mesh>& p_existing, int p_surface, List< //indices - DVector<int> idx= arr[VS::ARRAY_INDEX]; + PoolVector<int> idx= arr[VS::ARRAY_INDEX]; int is = idx.size(); if (is) { lformat|=VS::ARRAY_FORMAT_INDEX; - DVector<int>::Read iarr=idx.read(); + PoolVector<int>::Read iarr=idx.read(); for(int i=0;i<is;i++) { r_index->push_back(iarr[i]); } diff --git a/scene/resources/theme.h b/scene/resources/theme.h index 94ac910e9f..e9d890cf97 100644 --- a/scene/resources/theme.h +++ b/scene/resources/theme.h @@ -72,13 +72,13 @@ protected: Ref<Font> default_theme_font; - DVector<String> _get_icon_list(const String& p_type) const { DVector<String> ilret; List<StringName> il; get_icon_list(p_type,&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } - DVector<String> _get_stylebox_list(const String& p_type) const { DVector<String> ilret; List<StringName> il; get_stylebox_list(p_type,&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } - DVector<String> _get_stylebox_types(void) const { DVector<String> ilret; List<StringName> il; get_stylebox_types(&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } - DVector<String> _get_font_list(const String& p_type) const { DVector<String> ilret; List<StringName> il; get_font_list(p_type,&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } - DVector<String> _get_color_list(const String& p_type) const { DVector<String> ilret; List<StringName> il; get_color_list(p_type,&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } - DVector<String> _get_constant_list(const String& p_type) const { DVector<String> ilret; List<StringName> il; get_constant_list(p_type,&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } - DVector<String> _get_type_list(const String& p_type) const { DVector<String> ilret; List<StringName> il; get_type_list(&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } + PoolVector<String> _get_icon_list(const String& p_type) const { PoolVector<String> ilret; List<StringName> il; get_icon_list(p_type,&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } + PoolVector<String> _get_stylebox_list(const String& p_type) const { PoolVector<String> ilret; List<StringName> il; get_stylebox_list(p_type,&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } + PoolVector<String> _get_stylebox_types(void) const { PoolVector<String> ilret; List<StringName> il; get_stylebox_types(&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } + PoolVector<String> _get_font_list(const String& p_type) const { PoolVector<String> ilret; List<StringName> il; get_font_list(p_type,&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } + PoolVector<String> _get_color_list(const String& p_type) const { PoolVector<String> ilret; List<StringName> il; get_color_list(p_type,&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } + PoolVector<String> _get_constant_list(const String& p_type) const { PoolVector<String> ilret; List<StringName> il; get_constant_list(p_type,&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } + PoolVector<String> _get_type_list(const String& p_type) const { PoolVector<String> ilret; List<StringName> il; get_type_list(&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } static void _bind_methods(); public: |