Commit graph

52 commits

Author SHA1 Message Date
obligaron
61ba5009ac Convert to CelSprite 2021-05-24 20:12:43 +02:00
Anders Jenbo
6ce8f13751 Apply clang-tidy to more code and do some related cleanups 2021-05-24 05:27:06 +02:00
Gleb Mazovetskiy
b76f7656f3 🧹 LoadArt: BYTE -> uint8_t
The change in include order necessitated a couple of other minor
cleanups, one in stubs.h and one in sdl2_to_1_2_backports.h
2021-05-23 18:45:01 +02:00
qndel
69b903743a fix typos 2021-05-23 05:52:52 +02:00
qndel
faae9a65c7
fix typos (#2038) 2021-05-23 03:57:47 +02: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
Anders Jenbo
6acb49bea4 Render quest and menu text using common text rendering 2021-05-21 04:23:49 +02:00
obligaron
a295586636 Support changing animation data on-the-fly even if the number of frames differ 2021-05-19 21:16:19 +02:00
Anders Jenbo
4c6ddc79a1 Clean up text render 2021-05-19 14:09:33 +02:00
Anders Jenbo
a03a2c2634 Render chat panel using common text rendering 2021-05-19 14:09:33 +02:00
Anders Jenbo
d723ebce1a Render help text using common text rendering 2021-05-19 14:09:33 +02:00
obligaron
19615c6976 AnimationInfo: Add GetAnimationProgress() 2021-05-16 21:24:36 +02:00
thebigMuh
7fbcfeb35c Adding text rendering flag to adjust spacing to fit horizontally
Now also works for multiline strings
2021-05-16 00:55:20 +02:00
Anders Jenbo
18aa04fa4f ♻️Use common text rendering for store menus 2021-05-14 19:11:43 +02:00
qndel
610d5319bd
swap if in drawing inventory items (#1968) 2021-05-14 12:50:32 +02:00
qndel
89c40eaa7b
inventory items rendering cleanup (#1938) 2021-05-14 12:46:16 +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
Anders Jenbo
7667880de4 🐛 Implement letter spacing in new font rendering
Fixes #1950
2021-05-13 21:52:44 +02:00
Gleb Mazovetskiy
29a488738e 🔥 Mark core CL2 and CEL functions as inline hot 2021-05-13 02:22:38 +02:00
Gleb Mazovetskiy
f624b9788c 🔥 Mark dun_render functions as hot 2021-05-13 01:54:27 +02:00
Gleb Mazovetskiy
4d10642b3d 🧹 Add and use a DVL_ALWAYS_INLINE macro
Also moves attribute macros out of miniwin into a new header.
2021-05-13 01:54:27 +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
fb27ee3907 💨 dun_render.cpp: Faster RenderLine
Turns RenderLine line branches into template parameters, allowing the
compiler to eliminate the branches and also fully inline it.

Example FPS change

* In dungeon: 1450 -> 1530
* In town: 1655 -> 1700

Also splits RenderLine into 3 functions

Easier to read and also gives more useful profiling.
Apparently the most time is spent in `RenderLineOpaque`.

Also, mark them `inline` because that apparently hints GCC to inline
the function (in a later refactoring we can introduce attribute
always_inline instead where supported).
2021-05-12 08:17:14 +02:00
Gleb Mazovetskiy
64ad9aeacf 🎉 cl2_render.cpp: Clip the outline 2021-05-11 07:57:08 +02:00
Anders Jenbo
e3c0c0a216 Fix some compiler warnings 2021-05-10 23:17:43 +02:00
Gleb Mazovetskiy
99dc016ec1 🧹 cel_render: Move internal functions to anon ns 2021-05-10 12:35:55 +02:00
obligaron
b94e599f5e ADL: Advance skipped Frames in SetNewAnimation and remove logic from PM_XYZ 2021-05-09 09:53:53 +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
Gleb Mazovetskiy
ad18ecc21b 🎉 cel_render.cpp: Clip stippled transparency
Example FPS change: 1336 -> 1424
2021-05-09 05:31:41 +02:00
Gleb Mazovetskiy
be7880c4db 🎉 cel_render.cpp: Clip outline
Clips `CelBlitOutlineTo` to the output buffer.

The templated implementation means that this compiles to many
case-specific functions with near-branchless inner loops.

Increases binary size by 92 KiB.
2021-05-09 05:31:41 +02:00
Anders Jenbo
0b3d1c68fa Precompute font color tables 2021-05-08 18:48:19 +02:00
Anders Jenbo
68923c6c33 Generic game text render function
This should gradually replace all the direct rendering of game texts
throughout the code. The interface is made to closly mirror that of the
art fonts as that is what will eventually be used for rendering Unicode
fonts both in the menus and ingame.

fixup!  Generic game text render function
2021-05-08 18:48:19 +02:00
Anders Jenbo
bcbaeba2f0 📝 Correct file header 2021-05-08 18:48:19 +02:00
Anders Jenbo
c11945e62b 🎨 Fix line endings 2021-05-07 23:22:51 +02:00
obligaron
e3e3d02da7 Correct Doxygen comments 2021-05-07 23:21:01 +02:00
Gleb Mazovetskiy
710ddb9af6 ♻️ Make SetPixel a method 2021-05-07 01:02:03 +02:00
Gleb Mazovetskiy
9a9941efdd 🚚 Move CL2 rendering to engine/render/cl2_render.cpp 2021-05-07 01:02:03 +02:00
Gleb Mazovetskiy
0edfa3de66 🚚 Move CEL rendering to engine/render/cel_render.cpp 2021-05-07 00:16:40 +02:00
Gleb Mazovetskiy
59dd42692f 🚚 Move render.cpp to engine/render/dun_render.cpp 2021-05-06 21:30:06 +02:00
Anders Jenbo
f579b2f287 Handle cel/cl2 files as byte arrays 2021-05-06 13:17:54 +02:00
Gleb Mazovetskiy
6474dea0a9 ♻️ Move automap_render to engine/, rename 2->Steep
Also adds header file documentation.
2021-05-06 12:58:06 +02:00
obligaron
cb7819a75c Introduce AnimationDistributionFlags::RepeatedAction 2021-05-06 07:52:17 +02:00
obligaron
b5954eb34b Change AnimationDistributionParams to AnimationDistributionFlags 2021-05-06 07:52:17 +02:00
obligaron
b08e0c20dc In repeated Animations show skipped Frames from previous Animation (repeated Attack/RangeAttack/Spell) 2021-05-06 07:52:17 +02:00
obligaron
401a820998 Rename GameTick to Tick (for variables) 2021-04-29 04:33:51 +02:00
obligaron
26601c98dc Simplify GetFrameToUseForRendering (remove local variables and use member variables) 2021-04-29 04:33:51 +02:00
obligaron
ff995adc2b Move ProcessPlayerAnimation to AnimationInfo 2021-04-29 04:33:51 +02:00
obligaron
16b3b38908 Move NewPlrAnim logic to AnimationInfo
Adjust SetNewAnimation-Parameter Names to Class Member

Adjust NewPlrAnim-Parameter Names to SetNewAnimation-Parameter Names
2021-04-29 04:33:51 +02:00
obligaron
3b87433fc2 Move GetFrameToUseForPlayerRendering to AnimationInfo 2021-04-29 04:33:51 +02:00