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

Disable transform layer for images where it is not needed (to speed-up image processing) #7449

Merged

Conversation

Districh-ru
Copy link
Collaborator

@Districh-ru Districh-ru commented Jul 22, 2023

This PR is a part of #7233

This PR disables transform() layer for images that have no transparent (or shadow/bright transform) pixels:

  • during ICN load;
  • for battle arena fade effect (after the battle);
  • for spell effects:
    • Death Wave;
    • Holy Shout;
    • Earthquake;
    • Armageddon;
  • for Puzzle map.

Doing this will save some computation resources while processing these images: no operations with the transform layer would be performed.

This PR changes properties of many loaded images so to test it is good to check rendering of maps, in castles, battlefield, dialogs for possible transparency bugs (e.g. blacked image parts in place of transparency of sprites).
As the changes are the same for the same type of images the check may include viewing each type of render, e.g.:

  • check the render of the castle of one race with and without buildings, the animation of building, check the well, tavern and other objects;
  • check the battle with shooters, flyers, wide and non-wide creatures;
  • check render of mentioned above spells;
  • check the puzzle map, the View World;
  • check load, new game, campaign info, high score dialogs.

@Districh-ru Districh-ru added improvement New feature, request or improvement ui UI/GUI related stuff labels Jul 22, 2023
@Districh-ru Districh-ru added this to the 1.0.7 milestone Jul 22, 2023
@Districh-ru Districh-ru self-assigned this Jul 22, 2023
@Districh-ru Districh-ru added the low priority Low priority item which could be addressed in the future label Jul 22, 2023
@Districh-ru Districh-ru requested a review from ihhub July 22, 2023 14:34
Copy link
Owner

@ihhub ihhub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Districh-ru , I left few comments here. Could you please take a look at them?

src/engine/image_tool.cpp Outdated Show resolved Hide resolved
src/fheroes2/agg/agg_image.cpp Outdated Show resolved Hide resolved
src/fheroes2/agg/agg_image.cpp Outdated Show resolved Hide resolved
@Districh-ru Districh-ru requested a review from ihhub July 22, 2023 15:14
@ihhub
Copy link
Owner

ihhub commented Jul 22, 2023

Hi @Districh-ru , could you please update the description to specify the scope of testing? At least to verify that we don't break any rendering by these changes.

@Districh-ru
Copy link
Collaborator Author

Hi @Districh-ru , could you please update the description to specify the scope of testing? At least to verify that we don't break any rendering by these changes.

Hi, @ihhub, a short description is added.

@Districh-ru
Copy link
Collaborator Author

Hi, @drevoborod, could you please test this PR when you have time.

@drevoborod
Copy link
Contributor

Testing completed, didn't find any issues. All mentioned cases were checked plus several extra.

@ihhub ihhub merged commit 7f31600 into ihhub:master Jul 23, 2023
@ihhub
Copy link
Owner

ihhub commented Jul 23, 2023

@Districh-ru , thank you so much for this improvement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement New feature, request or improvement low priority Low priority item which could be addressed in the future ui UI/GUI related stuff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants