7 Commits
Author SHA1 Message Date
Gleb Mazovetskiy b83637add8 Use a C array for transparency LUT for debug perf
In a debug build, `std::array` accesses are function calls.

Timedemo on my machine:
* Before: 45.39 seconds	141.3 FPS
* After:  40.20 seconds	159.5 FPS
2023-09-10 17:57:15 +01:00
qndel 731ad1ada5 use std::rotate (#6019) 2023-04-22 13:53:03 +02:00
Gleb Mazovetskiy 3f0d089928 Blitter: Minor optimization
`src < end - 3` is one more instruction than `src + 3 < end`.

Godbolt: https://godbolt.org/z/PPfhYYWG8

RG-99 binary becomes 224 bytes smaller.
2023-03-24 11:50:49 +00:00
Gleb Mazovetskiy 774993c6d0 dun_renderer: Avoid calling 0-width Blit*
A slight optimization to avoid calling blit functions entirely
when the width is zero.
2023-03-22 10:30:06 +00:00
Gleb Mazovetskiy 397529bf0f Rendering: Unify and optimize pixel blitters
1. Unifies the underlying CLX and dun_render blitters.
2. Optimizes them by unrolling loops and using pointer comparison rather
   than length comparison (saves a length decrement).
3. In `dun_render`, extracts `RenderLineTransparent/Opaque` branches into
   functions via explicit template specialization.

Example RG-99 FPS (non-PGO'd): 17.4->18.4
2023-03-21 13:42:23 +00:00
Gleb Mazovetskiy 961866e1c4 CLX: A new graphics format
The format is almost identical to CL2, except it uses the frame header
to store frame width and height instead of 5 32-line offsets.

This means we always have access to frame dimensions, so we can use it
as an on-disk format for our graphics as well.

Additionally, we may be able to optimize the rendering even more
in the future now that we have guaranteed knowledge of frame dimensions.
2022-08-03 02:38:55 +02:00
Gleb Mazovetskiy 6f01fb6b79 Unify CEL/PCX/CL2 render functions
Except for the outline rendering.
2022-07-17 20:28:29 +02:00