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

GUI sprites incorrectly affected by setting to limit NewGRF sprite resolution #8873

2TallTyler opened this issue Mar 18, 2021 · 2 comments
bug Something isn't working


Copy link

Version of OpenTTD

1.11.0-RC1 (probably introduced in #8604, 902bfa9)

Expected result

Background: When using Options > Interface size at Double or Quad size, GUI sprites in OpenGFX use a 2x zoom sprite.

Expected behavior: Settings > Highest resolution sprites to use should not affect these GUI sprites, only NewGRF additions to the game world — vehicles, houses, roads, etc.


Actual result

The setting Highest resolution sprites to use affects the resolution of GUI sprites.


Interestingly, this doesn't happen with original TTD graphics — just OpenGFX. I have not tried aBase, zBase, or NightGFX, but I presume they will be affected similarly.

Steps to reproduce

  1. Use OpenGFX base graphics
  2. Set Options > Interface size to Double size or Quad size
  3. Change Settings > Highest resolution sprites to use to 1x
  4. Observe that the main toolbar GUI icons are changed to a lower resolution sprite
Copy link

LordAro commented Mar 20, 2021

This is not going to be easy to fix. As far as the game is concerned (as far as I can tell), there's nothing differentiating GUI/cursor sprites from any other sprite. In general they're named SPR_IMG_* or SPR_CURSOR_*, but obviously we can't use those. They're not in any sort of sequential order either.

I suppose we could have a data structure that lists all the GUI sprites, and use that to check if a sprite is a gui sprite ...but that's awful.

(The original TTD graphics don't have extra zoom levels, of course, hence why they are not affected)

Copy link

There are also a few button sprites which are used both in viewport and in the GUI.
Vehicles also use the same sprites in both.
So, separating the sprites into GUI and viewport won't work. Instead you would have to store the sprites separately per scaling algorithm, as if GUI and viewport zoom levels were different things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
bug Something isn't working
None yet

No branches or pull requests

4 participants