-
Notifications
You must be signed in to change notification settings - Fork 0
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
Optimize map rendering #3
Comments
Did some testing to see how viable this is: this does in fact bring large performance benefits for scrolling, but it also makes map loading and tile placement way more expensive. A hybrid approach might be necessary, where the map is rendered on the fly in 8x8 or so chunks; i'd imagine we could also use these chunks to speed up event-based calculations. |
Progress will be contained in the |
Update: all of this except for copying on scroll is done. Maybe it could be wiser to switch to a bespoke map widget? That would give us access to the native scroll redraw functions, and it'd make implementing the "transfer player" command easier. |
Right now, the map is always fully redrawn every time something as minute as placing a tile happens. It also doesn't store information between scroll states, opting to fully redraw the map. It would be wise to draw the entire map to a full pixmap and keep it in memory, only redrawing the parts that need to be redrawn. QGraphicsViews should already have built-in scrollbars, there's no need to reimplement scrolling...
Down the line, it could be interesting to provide an alternative QRhi backend. Right now the API is fairly experimental, but we could stand to gain a lot of performance improvements from hardware rendering.
The text was updated successfully, but these errors were encountered: