feat: modules moved and engine moved to submodule
This commit is contained in:
parent
dfb5e645cd
commit
c33d2130cc
5136 changed files with 225275 additions and 64485 deletions
|
|
@ -513,7 +513,7 @@ void ParticlesStorage::_particles_process(Particles *p_particles, double p_delta
|
|||
GLES3::TextureStorage *texture_storage = GLES3::TextureStorage::get_singleton();
|
||||
GLES3::MaterialStorage *material_storage = GLES3::MaterialStorage::get_singleton();
|
||||
|
||||
double new_phase = Math::fmod(p_particles->phase + (p_delta / p_particles->lifetime) * p_particles->speed_scale, 1.0);
|
||||
double new_phase = Math::fmod(p_particles->phase + (p_delta / p_particles->lifetime), 1.0);
|
||||
|
||||
//update current frame
|
||||
ParticlesFrameParams frame_params;
|
||||
|
|
@ -534,7 +534,7 @@ void ParticlesStorage::_particles_process(Particles *p_particles, double p_delta
|
|||
p_particles->phase = new_phase;
|
||||
|
||||
frame_params.time = RSG::rasterizer->get_total_time();
|
||||
frame_params.delta = p_delta * p_particles->speed_scale;
|
||||
frame_params.delta = p_delta;
|
||||
frame_params.random_seed = p_particles->random_seed;
|
||||
frame_params.explosiveness = p_particles->explosiveness;
|
||||
frame_params.randomness = p_particles->randomness;
|
||||
|
|
@ -1097,8 +1097,6 @@ void ParticlesStorage::update_particles() {
|
|||
fixed_fps = particles->fixed_fps;
|
||||
}
|
||||
|
||||
bool zero_time_scale = Engine::get_singleton()->get_time_scale() <= 0.0;
|
||||
|
||||
if (particles->clear && particles->pre_process_time > 0.0) {
|
||||
double frame_time;
|
||||
if (fixed_fps > 0) {
|
||||
|
|
@ -1115,37 +1113,27 @@ void ParticlesStorage::update_particles() {
|
|||
}
|
||||
}
|
||||
|
||||
double time_scale = MAX(particles->speed_scale, 0.0);
|
||||
|
||||
if (fixed_fps > 0) {
|
||||
double frame_time;
|
||||
double decr;
|
||||
if (zero_time_scale) {
|
||||
frame_time = 0.0;
|
||||
decr = 1.0 / fixed_fps;
|
||||
} else {
|
||||
frame_time = 1.0 / fixed_fps;
|
||||
decr = frame_time;
|
||||
}
|
||||
double frame_time = 1.0 / fixed_fps;
|
||||
double delta = RSG::rasterizer->get_frame_delta_time();
|
||||
if (delta > 0.1) { //avoid recursive stalls if fps goes below 10
|
||||
delta = 0.1;
|
||||
} else if (delta <= 0.0) { //unlikely but..
|
||||
delta = 0.001;
|
||||
}
|
||||
double todo = particles->frame_remainder + delta;
|
||||
double todo = particles->frame_remainder + delta * time_scale;
|
||||
|
||||
while (todo >= frame_time) {
|
||||
_particles_process(particles, frame_time);
|
||||
todo -= decr;
|
||||
todo -= frame_time;
|
||||
}
|
||||
|
||||
particles->frame_remainder = todo;
|
||||
|
||||
} else {
|
||||
if (zero_time_scale) {
|
||||
_particles_process(particles, 0.0);
|
||||
} else {
|
||||
_particles_process(particles, RSG::rasterizer->get_frame_delta_time());
|
||||
}
|
||||
_particles_process(particles, RSG::rasterizer->get_frame_delta_time() * time_scale);
|
||||
}
|
||||
|
||||
if (particles->request_process_time > 0.0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue