Commit Graph
21 Commits
Author SHA1 Message Date
Gleb Mazovetskiy 43a5d91074 Remove CEL rendering code
We no longer render CEL
2022-07-19 10:59:35 +02:00
Gleb Mazovetskiy 8ca71272b8 Load all CEL as CL2
Convert CEL files to CL2 at load time. CL2 format is more efficient and is about as fast to render.

CEL vs CL2 sizes, on dLvl 5: https://gist.github.com/glebm/9bbdd76962abcd4fd2405ecd3379af97

Memory:

* Peak memory (while loading): -300 KiB
* Memory in-game (dLvl5): -700 KiB
* RG99 binary size: -15 KiB (1333096 -> 1317192)

Performance on rg99:

* On average, -1 FPS in town.
* Same FPS in dungeon (20 FPS on dLvl 1).
2022-07-19 10:59:35 +02:00
Gleb Mazovetskiy f9b9a7de9d CL2 render: Point position argument
Bring the CL2 API closer to CEL and PCX.
2022-07-18 09:25:12 +02:00
Gleb Mazovetskiy 6f01fb6b79 Unify CEL/PCX/CL2 render functions
Except for the outline rendering.
2022-07-17 20:28:29 +02:00
Anders Jenbo 99181fd709 Move more files to the engine folder 2022-06-24 11:08:15 +02:00
Gleb Mazovetskiy a66ca44695 Zero-based frame indexing
Index frames starting at 0 instead of 1.
2022-04-14 04:39:26 +01:00
Gleb Mazovetskiy 12de70550b Fix an OOB in CEL/CL2 outline rendering
This OOB happened when rendering a sprite so that it is exactly
off-screen (touching the border but not visible) on top/bottom
while also being only partly off-screen on the left or right.
2022-04-12 01:52:53 +02:00
Gleb Mazovetskiy 7fede6c4cb Clean up owned/unowned CelSprite ambiguity
Makes `CelSprite` unowned and adds a new `OwnedCelSprite` class for
owned sprites.

This clarifies ownership and makes the code cleaner in a number of
places.

Additionally, because the `CelSprite` class is now tiny (1 less
pointer), we can pass it by-value instead of by-reference, removing a
pointer indirection in the rendering functions.
2022-03-06 04:49:13 +01:00
qndel 9ba64ad08b TRN rewrite + bugfix (#4056)
* working new TRN system
* apply TRNs to all unique missiles
2022-02-20 14:28:51 +01:00
Anders Jenbo dce78dde62 Rename lighting globals 2021-07-08 02:01:14 -07:00
Gleb Mazovetskiy cb0dae8590 🚚 Rename CelOutputBuf to Surface and extract 2021-07-03 05:33:32 -07:00
Gleb Mazovetskiy 14218080b6 🚚 engine.h: Extract CelGetFrame and friends 2021-06-21 02:34:28 -07:00
Gleb Mazovetskiy bb95e0c337 cl2_render: Use memset when rendering outline
A minor cleanup that replaces the for-loop rendering for a fill run
with memsets.
2021-05-22 15:55:51 +02:00
Gleb Mazovetskiy 8ac9047b4f 🧹 Clean up CEL outline clipping
A simpler structure based on the CL2 implementation.
2021-05-13 23:41:50 +02:00
Gleb Mazovetskiy 29a488738e 🔥 Mark core CL2 and CEL functions as inline hot 2021-05-13 02:22:38 +02:00
Gleb Mazovetskiy e53a79259d 🐞 CL2 outline: Fix left clip 2021-05-13 01:01:45 +02:00
Gleb Mazovetskiy 537e056111 🐞 CL2 outline: Skip color index 0
Fixes a regression introduced in #1934
2021-05-12 08:19:19 +02:00
Gleb Mazovetskiy 64ad9aeacf 🎉 cl2_render.cpp: Clip the outline 2021-05-11 07:57:08 +02:00
Gleb Mazovetskiy 1838eb43f2 🎉 cl2_render.cpp: Clip the drawing functions
Clips all the drawing functions except the outline one.

Example FPS gain in a dungeon: 1454 -> 1488
2021-05-09 05:48:48 +02:00
Anders Jenbo bcbaeba2f0 📝 Correct file header 2021-05-08 18:48:19 +02:00
Gleb Mazovetskiy 9a9941efdd 🚚 Move CL2 rendering to engine/render/cl2_render.cpp 2021-05-07 01:02:03 +02:00