File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -99,8 +99,15 @@ ParticleSystem::draw(DrawingContext& context)
99
99
pos.x = fmodf (particle->pos .x - scrollx, virtual_width);
100
100
if ((pos.x + static_cast <float >(particle_width)) < 0 ) pos.x += virtual_width;
101
101
102
- pos.y = fmodf (particle->pos .y - scrolly, virtual_height);
103
- if (pos.y < 0 ) pos.y += virtual_height;
102
+
103
+ const float particle_height = static_cast <float >(particle->texture ->get_height ());
104
+ const float virtual_height_particle = virtual_height + particle_height;
105
+
106
+ pos.y = fmodf (particle->pos .y - scrolly, virtual_height_particle);
107
+ if (pos.y + particle_height < 0 )
108
+ {
109
+ pos.y += virtual_height_particle;
110
+ }
104
111
105
112
if (!region.contains (pos + Sector::get ().get_camera ().get_translation ()))
106
113
continue ;
You can’t perform that action at this time.
0 commit comments