You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
PoolVector is gone, replaced by Vector
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
This commit is contained in:
committed by
Juan Linietsky
parent
fb8c93c10b
commit
3205a92ad8
@@ -35,7 +35,7 @@
|
||||
#include "scene/3d/cpu_particles.h"
|
||||
#include "scene/resources/particles_material.h"
|
||||
|
||||
bool ParticlesEditorBase::_generate(PoolVector<Vector3> &points, PoolVector<Vector3> &normals) {
|
||||
bool ParticlesEditorBase::_generate(Vector<Vector3> &points, Vector<Vector3> &normals) {
|
||||
|
||||
bool use_normals = emission_fill->get_selected() == 1;
|
||||
|
||||
@@ -93,7 +93,7 @@ bool ParticlesEditorBase::_generate(PoolVector<Vector3> &points, PoolVector<Vect
|
||||
return false;
|
||||
}
|
||||
|
||||
PoolVector<Face3>::Read r = geometry.read();
|
||||
const Face3 *r = geometry.ptr();
|
||||
|
||||
AABB aabb;
|
||||
|
||||
@@ -191,7 +191,7 @@ void ParticlesEditorBase::_node_selected(const NodePath &p_path) {
|
||||
Transform geom_xform = base_node->get_global_transform().affine_inverse() * vi->get_global_transform();
|
||||
|
||||
int gc = geometry.size();
|
||||
PoolVector<Face3>::Write w = geometry.write();
|
||||
Face3 *w = geometry.ptrw();
|
||||
|
||||
for (int i = 0; i < gc; i++) {
|
||||
for (int j = 0; j < 3; j++) {
|
||||
@@ -199,8 +199,6 @@ void ParticlesEditorBase::_node_selected(const NodePath &p_path) {
|
||||
}
|
||||
}
|
||||
|
||||
w.release();
|
||||
|
||||
emission_dialog->popup_centered(Size2(300, 130));
|
||||
}
|
||||
|
||||
@@ -379,8 +377,8 @@ void ParticlesEditor::edit(Particles *p_particles) {
|
||||
void ParticlesEditor::_generate_emission_points() {
|
||||
|
||||
/// hacer codigo aca
|
||||
PoolVector<Vector3> points;
|
||||
PoolVector<Vector3> normals;
|
||||
Vector<Vector3> points;
|
||||
Vector<Vector3> normals;
|
||||
|
||||
if (!_generate(points, normals)) {
|
||||
return;
|
||||
@@ -391,14 +389,14 @@ void ParticlesEditor::_generate_emission_points() {
|
||||
int w = 2048;
|
||||
int h = (point_count / 2048) + 1;
|
||||
|
||||
PoolVector<uint8_t> point_img;
|
||||
Vector<uint8_t> point_img;
|
||||
point_img.resize(w * h * 3 * sizeof(float));
|
||||
|
||||
{
|
||||
PoolVector<uint8_t>::Write iw = point_img.write();
|
||||
zeromem(iw.ptr(), w * h * 3 * sizeof(float));
|
||||
PoolVector<Vector3>::Read r = points.read();
|
||||
float *wf = (float *)iw.ptr();
|
||||
uint8_t *iw = point_img.ptrw();
|
||||
zeromem(iw, w * h * 3 * sizeof(float));
|
||||
const Vector3 *r = points.ptr();
|
||||
float *wf = (float *)iw;
|
||||
for (int i = 0; i < point_count; i++) {
|
||||
wf[i * 3 + 0] = r[i].x;
|
||||
wf[i * 3 + 1] = r[i].y;
|
||||
@@ -420,14 +418,14 @@ void ParticlesEditor::_generate_emission_points() {
|
||||
material->set_emission_point_count(point_count);
|
||||
material->set_emission_point_texture(tex);
|
||||
|
||||
PoolVector<uint8_t> point_img2;
|
||||
Vector<uint8_t> point_img2;
|
||||
point_img2.resize(w * h * 3 * sizeof(float));
|
||||
|
||||
{
|
||||
PoolVector<uint8_t>::Write iw = point_img2.write();
|
||||
zeromem(iw.ptr(), w * h * 3 * sizeof(float));
|
||||
PoolVector<Vector3>::Read r = normals.read();
|
||||
float *wf = (float *)iw.ptr();
|
||||
uint8_t *iw = point_img2.ptrw();
|
||||
zeromem(iw, w * h * 3 * sizeof(float));
|
||||
const Vector3 *r = normals.ptr();
|
||||
float *wf = (float *)iw;
|
||||
for (int i = 0; i < point_count; i++) {
|
||||
wf[i * 3 + 0] = r[i].x;
|
||||
wf[i * 3 + 1] = r[i].y;
|
||||
|
||||
Reference in New Issue
Block a user