Skip to content

Conversation

@MackValentine
Copy link
Contributor

Quickfix for tone effect with bigger Pictures.
Instead of changing the color of the entire bitmap, if the sprite is a Sprite_Picture and the bitmap size is larger than the screen, we will render it in a smaller bitmap that will only contain the rendering displayed on the screen, then draw the resulting bitmap in the final sprite.
Should work with zoom, and wave effect, but not with rotation.
This requires calculating safety_w / safety_h according to the deformation related to rotation.

@carstene1ns
Copy link
Member

jenkins: ok to test

@BlisterB
Copy link
Member

BlisterB commented Jan 4, 2026

Here is a benchmark video of the first town of Aëdemphia, to evaluate the improvement of the commit 0ccd806 :
https://www.youtube.com/watch?v=cvxqvs5oV0w

Summary :

  • Average FPS : 30 to 57.8
  • 1% FPS : 8.6 to 30.4
  • 0.1% : 8.4 to 28.2

@Ghabry
Copy link
Member

Ghabry commented Jan 5, 2026

The idea sounds reasonable (havnt looked at the code yet) though imo the only good way to verify the correctness is writing unit tests.

If you don't know how to approach this you can suggest some test cases (especially of edge cases) here and I implement them myself to verify it:

Example (always assuming game has 320x240 window)

  • Input screen_x,screen_y,pic_w,pic_h
  • Output pic_rect_x,pic_rect_y,pic_rect_w,pic_rect_h
  1. 0,0,400,300 -> 0,0,320,240
  2. 100,200,400,300 -> 0,0,220,40
  3. -50,-100,400,300 -> 50,100,350,200

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

4 participants