-
Notifications
You must be signed in to change notification settings - Fork 41
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
Preliminary cleanup of mapview_common #1169
Conversation
All this function was doing was calling repaint().
It wasn't doing anything useful.
It wasn't doing anything useful.
It always ended up calling update_map_canvas_visible, only after a roundtrip through the update_queue. Call directly instead.
It was the same as update_map_canvas_visible().
It was never used.
A simple bool is enough.
They do the exact same thing. Call the merged function update_map_canvas_visible because it's used a lot.
abe9e55
to
e978e66
Compare
Use QRectF instead of handling the geometry by hand. This makes the code easier to understand (that is, once you know what QRectF::operator|= does)
Declare variables where they're first used.
QRegion is equivalent to the manual bookeeping previously in use, but is easier to use.
Let's simplify the code slightly.
Simplifies the code a tiny bit. std::swap is magic.
Again std::swap helps.
It doesn't have anything to do with the map.
It was just a thin wrapper around find_city_or_settler_near_tile.
We can recalculate this on the fly whenever we need it, which is not very often.
I'm not sure since when this has been unused but I've only started seeing the warnings recently.
75518c3
to
ea9fe79
Compare
The Apple clang failure should be fixed, others look like glitches... |
Looks like the opposite to me, windows ones are linker errors which we need to fix. Apple one seems like a vcpkg issue. |
Anyways, the code refactor looks ok. We can merge if the builds dont break. |
Indeed, I thought they were identical to failures in other PRs but they're actually unique. I have no idea how my changes can trigger an undefined reference to |
Maybe we need to rebase this to master branch and let the CI run again? |
I'm waiting for Windows Update to complete then I can investigate. Probably tomorrow. |
It fails on my local Visual Studio too, i'm trying to find the error message. |
Builds for me without SDL and without updating my MSYS install.
|
After installing SDL, it fails with:
--> hints at an interaction between Qt and SDL |
f87d3d5 is the first bad commit |
The competition between Qt and SDL to redefine main() on Windows (for portability purposes and the WinMain entry point for GUI applications) ends up badly when Qt is included before SDL. Thus make sure to include SDL before any other header. See longturn#1169.
Windows build fixed in 2edf4ec |
This PR contains a collection of small commits that improve the quality of the
mapview_common
code that handles drawing the map and updating it when needed. The commits are mostly independent from each other and I'm happy to take out controversial ones and discuss them in another PR. No behavior change is expected.I strongly suggest to review this commit by commit. See individual commit messages for more context.