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

Incorrect rendering if the size of the screen is bigger than the size of the map #52

Open
abacabadabacaba opened this issue Oct 23, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@abacabadabacaba
Copy link

Globulation 2 - 0.9.4.4

If the screen is bigger than the map, then some parts of the map can appear on the screen multiple times. When this happens, the terrain is rendered correctly, but units and buildings are only drawn once.

Everything should be drawn as many times as it appears on the screen: terrain, units, buildings, target lines, etc.

@stephanemagnenat stephanemagnenat added the bug Something isn't working label Jan 2, 2022
@stephanemagnenat
Copy link
Contributor

Yes, this is a known bug, it happened because when Glob2 was originally developed, the screens were much smaller ;-)

@stephanemagnenat
Copy link
Contributor

stephanemagnenat commented Apr 24, 2023

This happens because as buildings and units can span multiple tiles on the map, they are first put to a set, and then drawn once. A fix to this issue would be to check whether the screen is bigger than the whole map, and then draw multiple times.

The locations to implement the corrections can be found from Game::drawMap which starts at src/Game.cpp:2807.

@stephanemagnenat
Copy link
Contributor

PR #88 is a first step towards solving this issue.

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

No branches or pull requests

2 participants