Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recent updateTransform optimisation causes glitch #1479

Closed
spayton opened this issue Dec 22, 2014 · 2 comments
Closed

Recent updateTransform optimisation causes glitch #1479

spayton opened this issue Dec 22, 2014 · 2 comments

Comments

@spayton
Copy link
Contributor

spayton commented Dec 22, 2014

I have tracked down a visual glitch to this update 028943b and may be relevant to this issue #1424

I was seeing sprites momentarily appear at the wrong position after setting visible=true despite also setting the correct xy at the same time. I noticed this was only happening on low power devices that had to skip frames to keep up. I also noticed that the wrong position was the last position the sprite had before visible was set to false.

The updateTransform optimisation added a _updateTransform bool, which gets set after the 1st update and this is then used to skip further transform updates within this update. the problem occurs on a slow device that is skipping frames on a subsequent state.update(), i made a sprite visible and set its position, the position transform is not updated but its visibility is picked up by the renderer - thus drawn at the wrong position.

As it is, this optimisation is unsafe, it needs some more work or removing.

@pnstickne
Copy link
Contributor

I can also reproduce. To reproduce this behavior on a desktop, use Chrome and run a Heap Allocation Profile.

(The Heap Allocation Profile is an extremely "expensive" operation that runs internal to Chrome so it can't be off-loaded of bypassed.)

@photonstorm
Copy link
Collaborator

Addressed in the latest merged changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants