(Disclaimer: None of this is in nightlies)
I've
posted teases of sprite rotozooming in the past, but let's skip that this time because nothing became of it.
In fact last year I threw away most of the code for that and started over, because the rotozooming library I'd used was buggy, and other issues. Instead I switched to the unused software (drawn on the CPU, not graphics card) triangle/quadrilateral rasterizer we already had in the codebase. Huh?
(Aside)
Let's revisit 2011. Jay Tennant, the capable programmer and pianist who wrote gfx_directx, wanted to rewrite the rest of the engine's graphics handling too, to allow hardware acceleration, true color, blending, shader effects, and transforming (rotating/scaling/shearing) any slice with view matrices. I didn't want to drop gfx_sdl or "2D-only graphics libraries", and James didn't want to do all those things at once. The way I remember it, I was trying to talk Jay into focusing on adding OpenGL support to gfx_sdl (and gfx_fb?) instead of starting with gfx_directx, but instead I
accidentally talked him into writing a software rasterizer so OpenGL/Direct3D would be optional.
Jay in 2011 wrote:Why isn't [transformed sprite rendering] at least implemented in SDL? Oh well... we'll have to implement our own.
TMC in 2011 wrote:Because it's very difficult to write such an (efficient) general purpose polygon rendering in software, and anyway it's way outside of SDL's purpose of providing the highest-common-denominator. If you want to attempt an implementation, best of luck.
Jay in 2011 wrote:Heh, it is challenging, [...] Actually, I'm quite intrigued in doing this.... dang it Ralph! Enticing me! :P
TMC in 2011 wrote:I've always wanted to code such a thing myself -- so I can't help but become totally distracted by this discussion. :)
Unfortunately Jay's grand plan wasn't realised despite all the work he did, for which I feel a lot of guilt for not lending more assistance: it required probably as much or more work to convert the engine to the new system, and is still only half done. I've been slowly chipping away ever since. The rasterizer was never used because it wasn't really finished (it had tricky unsolved graphical glitches and was slow -- apparently I volunteered to optimise it). We couldn't even use it because it only supported 24-bit color mode, but the OHR remained 8-bit until... Hróðvitnir. I wrote about that project
just up this page.
Yikes, looking back, it turns out Jay
did implement 8-bit support, but the last thing he did was to delete it after I remarked I'd assumed that he wouldn't... so he figured it wasn't needed. We didn't know the engine conversion to 24-bit color wouldn't happen.
In February 2022 I finally revived the rasterizer. Unexpectedly it was a
lot of work to get it complete, bugfree (?) and relatively fast (more can be done). I even added 32-bit texture to 8-bit display rendering.
(End aside)
So then I immediately rewrote sprite slice rotozooming using the rasterizer and... did too much at once. You could scale or rotate (around an origin or not) *or* do any other transform (shear, etc) by setting vertex positions manually, but if you scale a rotation you get a shear, and many other complications I'll gloss over, and the code became so complex that I was defeated. I had another go earlier this year and got much of it working, but I had to find a better solution.
Finally, attempt three: a lot more deleted code. Now Sprite slices can be rotated or scaled only. Everything else the rasterizer can do is done by the new
Polygon slice. Polygons will do everything Sprites can including dissolves, and in future, animations.
Polygons can be textured, have a gradient between the vertices, or both (per-vertex color modulation, including opacity). Plus shared opacity/blending/modulation settings.

- 41_polygon_vertex_colors.png (76.54 KiB) Viewed 12428 times
You can set position and texture coords of each vertex, but the easiest way to set up a polygon is to convert a sprite slice into one. However, they should generally either be parallelograms or else treat the image as a texture UV-mapped in the right way, or you get distortions because they're split into two or four triangles:

- 41_polygon_uv.gif (281.01 KiB) Viewed 12428 times
Here's a nice article showing you can't stretch a sprite across a non-parallelogram quad well using 2D transforms. Despite knowing that I wasted time trying different triangulations, it didn't help:
(Image created by screenshotting a grid, importing as a backdrop, rotating 45° and scaling 141.4%, overlaying and screenshotting again).

- 0 & 1: two triangles. 2-5: four triangles, 6 & 7: three triangles
- 41_polygon_triangulation.gif (158.35 KiB) Viewed 12428 times
What's surprising is that it's possible to always make all the diagonal lines straight and parallel, as I managed here, but not horizontal or vertical lines: they shouldn't stay parallel between opposing sides of different lengths, but any affine transformation keeps them parallel locally, always forcing a seam:

- 41_polygon_diagonals.png (11.15 KiB) Viewed 12428 times
"Triangulation:" was mostly for testing, but I'll probably allow some control over it. For textured parallelograms two triangles is fine, but for gradients you need four to look correct:

- 41_polygon_color_interpolation.gif (89.58 KiB) Viewed 12428 times
Not done yet: polygons with 3 or 5+ sides.
A lot else isn't done either, I'm still far from getting either polygons or sprite transforms into nightly builds. I want rotozooming of sprites, polygons, lines, ellipses and ultimately rectangles and text to be consistent, but I already told you you can't scale a rotated sprite. I need to
clean up the code and add script commands.
Are sprite rotozooming and polygons going to make it into ichorescent? Are they stable enough, and how much would it delay release? Maybe just rotozooming? I don't know yet. Waiting until afterwards may be better.
Footnote: I was reminded that recorded .gifs looked really bad in 24-bit color mode:

- 41_flickering_32bit.gif (108.39 KiB) Viewed 12428 times
Fixed, and they're now much smaller too.