-
Notifications
You must be signed in to change notification settings - Fork 162
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: Support proper 32-bit color values #2501
AGS 4: Support proper 32-bit color values #2501
Conversation
b04f82a
to
9c3adae
Compare
373b64a
to
0097445
Compare
I've been wondering, would that make sense to handle existing duality of Color / ColorNumber properties by hiding one of this pair depending on the current game's color depth? That is - display ColorNumber if game is 8-bit and Color (rgb) if game is 32-bit. But then, it would also be nice to have color displayed on ColorNumber field. Maybe even add a [...] ColorNumber property which opens a palette for selecting a color. Alternatively, how feasible that would be to merge Color and ColorNumber properties together? |
46a98fc
to
e886ca4
Compare
The "Github Actions" are failing because of the test games. I suspect the DrawingSurface tests will have to be adjusted after this is merged. |
I managed to figure out how to make a property that may have two meanings and textual representation in a PropertyGrid, depending on game settings (see two commits above). This lets merge a pair of properties ColorNumber and Color (rgb) into a single one. I used "ColorNumber", since it's the one that was serialized, so to keep data format unmodified. The idea is that this property will now look like a "color number" if the game is 8-bit, and like a RGB string when the game is 32-bit. Internally it is always integer (either palette index, or encoded RGB). In 32-bit mode it opens color picker on pressing a button. In 8-bit mode button is removed, but in theory it might be possible to implement a "palette selector" in the future. Merged all existing color property pairs into a single property (in character, gui, etc), and even made "cursor hotspot colors" properties to work the same way, so you can have a colored rectangle and color picker there too, without adding more properties. |
If I understood right, @AlanDrake have tested this PR (he mentioned this on Discord). |
Yes. I've tested upgrading a 32bit project, a 8bit one, and some simple DynamicSprite drawings. |
Avoid any special numbers, etc. Alpha component is not applied yet (and there's no way to set it in the color picker).
This is necessary because we have default values of color properties set in palette indexes. But also because it's not possible to set two default values for 8-bit and 32-bit modes. So if we leave these defaults in 8-bit, we have to convert to 32-bit after an item is created and added in game.
This lets to have a single property which is displayed on a PropertyGrid in one of two ways: as a RGB color or as a palette index number. The mode is switched by the Editor on game load and on Game's ColorDepth setting change.
Have a single *Color property which meaning and textual representation changes with the Game's ColorDepth.
14b9520
to
57c328f
Compare
Alright, fingers crossed... |
Resolves #1980
What is done:
Additionally:
What is left:
int
touint
for this; alternatively they should use a custom editor attribute that displays unsigned numbers (or maybe in hex).