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

Rotation of a sprite that has a SubRect renders incorrectly #1093

Closed
Ghabry opened this issue Jan 29, 2017 · 0 comments · Fixed by #1989
Closed

Rotation of a sprite that has a SubRect renders incorrectly #1093

Ghabry opened this issue Jan 29, 2017 · 0 comments · Fixed by #1989

Comments

@Ghabry
Copy link
Member

Ghabry commented Jan 29, 2017

That's a problem when spritesheets (cough New RPG2k3 version cough) are involved. During a rotation the parts of the sprite that are not in the rect are visible:

bug

And the following lines in game_picture.cpp are wrong when a SubRect is involved (the pivot is placed incorrectly)

sprite->SetOx((int)(sprite->GetBitmap()->GetWidth() / 2));
sprite->SetOy((int)(sprite->GetBitmap()->GetHeight() / 2));

Code to fix the pivot:

sprite->SetOx((int)(sprite->GetWidth() / 2 + sprite->GetSrcRect().x));
sprite->SetOy((int)(sprite->GetHeight() / 2 + sprite->GetSrcRect().y));
@Ghabry Ghabry added the Bitmaps label Jan 29, 2017
Ghabry added a commit to Ghabry/easyrpg-player that referenced this issue Feb 19, 2017
@carstene1ns carstene1ns added this to the 0.6.0 milestone Apr 17, 2017
@Ghabry Ghabry removed this from the 0.6.1 milestone May 5, 2019
@Ghabry Ghabry added this to the 0.6.2 milestone Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants