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

AGS 4: Remove "has alpha channel" flag from sprites, and drawable objects #1808

Closed
ivan-mogilko opened this issue Oct 9, 2022 · 4 comments · Fixed by #1813
Closed

AGS 4: Remove "has alpha channel" flag from sprites, and drawable objects #1808

ivan-mogilko opened this issue Oct 9, 2022 · 4 comments · Fixed by #1813
Assignees
Labels
ags 4 related to the ags4 development context: graphics

Comments

@ivan-mogilko
Copy link
Contributor

In AGS sprites have a "has alpha channel" flag which tells whether the image's alpha channel should be used or not. Certain drawing operations depend on it; for instance a blending op or conversion from the sprite to texture may be performed in one or another way depending on the combination of source and destination surfaces' alpha flags.

My proposal is to remove this flag and those checks altogether, and imply that 32-bit images always have a valid alpha channel. This should somewhat simplify all the drawing operations.

If necessary, the flag may remain in sprite import settings; in such case removal of an alpha channel from a 32-bit source image would correspond to filling alpha bytes with 0xff (fully opaque).

@ericoporto
Copy link
Member

Hey, does this need some form of project upgrade to work, when loading an existing project, or nothing is necessary to change in the project part?

@ivan-mogilko
Copy link
Contributor Author

Hey, does this need some form of project upgrade to work, when loading an existing project, or nothing is necessary to change in the project part?

Possibly it might have to reimport 32-bit sprites "without alpha channel"; but I haven't double checked if that's necessary yet.

@ivan-mogilko
Copy link
Contributor Author

ivan-mogilko commented Oct 16, 2022

The consequences of this would be that the 32-bit images with "magic pink" color would have to be converted on import or load from custom files at runtime (right now this is done when converting to texture).

Actually, current behavior with "magic pink" had to be kept, because it's the only way to set transparent color in DrawingSurface even in 32-bit games. We'd need a proper 32-bit color value support in game data & script before we may get rid of it (see #1980)

@ivan-mogilko
Copy link
Contributor Author

Resolved by #1813

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ags 4 related to the ags4 development context: graphics
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants