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

Optimize map rendering #3

Open
lumiscosity opened this issue Aug 30, 2024 · 2 comments
Open

Optimize map rendering #3

lumiscosity opened this issue Aug 30, 2024 · 2 comments

Comments

@lumiscosity
Copy link
Owner

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.

@lumiscosity
Copy link
Owner Author

lumiscosity commented Aug 30, 2024

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.

@lumiscosity
Copy link
Owner Author

Progress will be contained in the render_improvements branch for now; we're still focusing on the roadmap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant