trigger-segfault / OpenLRR

An open source re-implementation of LEGO Rock Raiders 🪨⛏
65 stars 5 forks source link

Rewrite 2D drawing APIs #36

Open trigger-segfault opened 2 years ago

trigger-segfault commented 2 years ago

Describe the issue

Both the Draw and Fonts modules are very poorly optimized, and can cause a massive hit in performance when overused.

Examples

Draw module

Font module

trigger-segfault commented 1 year ago

With 9f9b9f6622444e6c946fe994d6b3dcb5e8349e00, there's now a significant performance improvement in rendering the radar map and Object UIs. All large groups of Draw calls have been combined into 4 different sessions for locking the drawing surface.

There's still a noticeable hit in the framerate when disabling the Draw module, but this is still a huge improvement. You can now play at above 60FPS with 9 units, the radar map open, and all Object UIs visible.