Issues with the scaling of icons

Discussion among members of the development team.

Moderator: Forum Moderators

Post Reply
User avatar
Jetrel
Posts: 7242
Joined: February 23rd, 2004, 3:36 am
Location: Midwest US

Issues with the scaling of icons

Post by Jetrel »

The addition of our bilinear filter has made it evident that there are certain problems that have been present in our interface code for a long time.

Simply, those special icons used for income and such should never, ever, be scaled. Period. They should be a fixed-size part of the ui; though perhaps larger and smaller variants could be drawn to be used on disparate screen sizes (I can happily make these, btw, in one night. It's a piece of cake).

I don't know where the problem is in the code, but somehow the icons are being scaled no matter what resolution the game window is sized to. This was never a good thing to have had in our old nearest-neighbor scaling system, but it looks particularly bad when scaled with any better algorithm. Don't get me wrong - the bilinear scaling code is awesome, it's just that no scaling whatsoever should be applied to icons like this:


I noticed this as I was playing 1.1svn, and discovered just what was going on when I attempted to make some new graphics to fix the problem - turns out the old ones were a lot better than they looked in-game, and that the images themselves were not the culprits.

I've attached a multi-screenshot that should show what's up.
Attachments
scalingIssues.png
scalingIssues.png (46.19 KiB) Viewed 5003 times
Boucman
Inactive Developer
Posts: 2119
Joined: March 31st, 2004, 1:04 pm

Post by Boucman »

Ok, I'll look into it
Fight key loggers: write some perl using vim
Boucman
Inactive Developer
Posts: 2119
Joined: March 31st, 2004, 1:04 pm

Post by Boucman »

Ok, partly done...

I have a patch that prevent scaling images up. i.e interpolating when the available size is bigger than the image size...

I can make it work both way, but I'm not sure that's what you want... I'll wait for feedback from you before commiting....

we can also discuss it on IRC if you're around...
Fight key loggers: write some perl using vim
Darth Fool
Retired Developer
Posts: 2633
Joined: March 22nd, 2004, 11:22 pm
Location: An Earl's Roadstead

Post by Darth Fool »

Boucman wrote:Ok, partly done...

I have a patch that prevent scaling images up. i.e interpolating when the available size is bigger than the image size...

I can make it work both way, but I'm not sure that's what you want... I'll wait for feedback from you before commiting....

we can also discuss it on IRC if you're around...
Be careful, there may be places where scaling up is what is wanted. Perhaps what is needed is a flag in the theme definition or internally in the report that can be set to define how/whether an image gets rescaled.

Also, I think it might be possible to avoid the rescaling problem by purely setting the theme definition for the various status-icons properly so that the theme does not change the size of the window in which the image is placed when the resolution is changed. I am not sure about it, and I can't test this for a few days, but it is something to consider.
User avatar
Eleazar
Retired Terrain Art Director
Posts: 2481
Joined: July 16th, 2004, 1:47 am
Location: US Midwest
Contact:

Post by Eleazar »

good eye, jetryl. :shock:
Feel free to PM me if you start a new terrain oriented thread. It's easy for me to miss them among all the other art threads.
-> What i might be working on
Attempting Lucidity
Boucman
Inactive Developer
Posts: 2119
Joined: March 31st, 2004, 1:04 pm

Post by Boucman »

well, what I did was the most I can do without huge changes in the theme engine that I won't do anyway (DarthFool, you're the one that knows that part well...)

yes, having a flag in the theme is probably the best way to do it...
Fight key loggers: write some perl using vim
Darth Fool
Retired Developer
Posts: 2633
Joined: March 22nd, 2004, 11:22 pm
Location: An Earl's Roadstead

Post by Darth Fool »

Boucman wrote:well, what I did was the most I can do without huge changes in the theme engine that I won't do anyway (DarthFool, you're the one that knows that part well...)

yes, having a flag in the theme is probably the best way to do it...
Once I am back from vacation and have a chance to wesnoth* again, I will take a look at what you've done and see if there really is a need to make a more drastic change to the theme engine.

*Yes, I've verbed the noun wesnoth.
Boucman
Inactive Developer
Posts: 2119
Joined: March 31st, 2004, 1:04 pm

Post by Boucman »

I've changed a "!=" into a ">"

:D
Fight key loggers: write some perl using vim
User avatar
Jetrel
Posts: 7242
Joined: February 23rd, 2004, 3:36 am
Location: Midwest US

Post by Jetrel »

Basically, the themes should allow for certain items never to change in size no matter what the resolution. The themes need to flow around these.

For example, in the case of these icons, which are at current time 15 pixels tall, and 30 pixels wide, the theme engine should always allot exactly that space for the icon.

The space for the numbers after the icon can change completely, but the icon itself should never change. It should never be bigger, or smaller, than its native size, because it will look bad.

If things desperately need to shift in size, a different icon, designed to look good at that different size, should be used. Not to be a nitpicker, but this little point is significant since this is a graphical element that is visible literally all the time while playing wesnoth.



As has been said, the easiest way to do it is possibly to be able to flag certain interface elements in a theme as having a fixed and unadjustable size.
Play Frogatto & Friends - a finished, open-source adventure game!
Boucman
Inactive Developer
Posts: 2119
Joined: March 31st, 2004, 1:04 pm

Post by Boucman »

ok, I'll commit my change, and leave the big change in the theme engine to someone else....
Fight key loggers: write some perl using vim
Post Reply