Commit Graph
69 Commits
Author SHA1 Message Date
Anders Jenbo ec9d1b5550 Rename _oLight to applyLighting 2023-04-19 19:41:10 +02:00
Gleb Mazovetskiy 8408743eed Draw item labels before the monster health bar
Fixes #5867
2023-03-26 11:57:49 +01:00
obligaron 36ecc50fcb Always use infravision in Arenas 2023-03-13 01:00:30 +01:00
KPhoenix a1fbf5253f enum talk_id -> enum class TalkID 2023-02-09 13:04:01 +01:00
Gleb Mazovetskiy 98294e0ad5 Optimize MissileData: 32 bytes -> 24
23 bytes used, 1 spare byte in the padding.
2023-02-07 08:08:04 +01:00
Gleb Mazovetskiy 0a6a8e8aa0 Clean up missile data access
Replace enum static casts with `GetMissile(Sprite)Data`.
2023-02-03 14:37:44 +00:00
KPhoenix 7947b99511 Implement new enum class 2023-02-03 05:05:12 +01:00
Gleb Mazovetskiy 1788d2f8ec Remove miniwin
Event handling code moved to `engine/events.{hpp,cpp}`.
2023-02-01 16:06:57 +00:00
staphen dd6ce177f7 Derive viewport geometry from player position 2023-01-30 04:22:33 +01:00
Gleb Mazovetskiy 527e876fff Disable item labels when in store
Also disable ground item outlines on hover when in store.
2023-01-22 15:58:12 +01:00
c99f7cf644 Floating numbers (#5639)
Co-authored-by: qndel <[email protected]>
Co-authored-by: Stephen C. Wills <[email protected]>
2023-01-22 07:20:10 +01:00
KPhoenix 8db521727d enum missile_id -> enum class MissileID
Changes `enum missile_id` to `enum class MissileID`
2023-01-18 17:17:25 +00:00
Anders Jenbo bb2463862c Use Position in AddItemToLabelQueue() 2023-01-12 09:56:47 +01:00
Anders Jenbo a29fc3a074 Correct casing for Player::isWalking() 2023-01-12 09:42:49 +01:00
Gleb Mazovetskiy e06ca9a016 dun_render: Remove unused argument from RenderTile
Now that we pass the mask into `RenderTile`, we no longer need to pass
`levelPieceId`.
2022-12-14 10:12:24 +01:00
Gleb Mazovetskiy aa2f88e5f6 Remove software cursor state for hardware cursor
Switching between software and hardware cursor could cause a glitch
as described in #5560.

Fixes #5560
2022-12-08 12:09:36 +01:00
Gleb Mazovetskiy 79b330825d dun_render: Avoid Invalid tile type
1. Do not call `RenderTile` with invalid values to begin with.
2. Move mask selection out of `RenderTile`.
2022-12-05 01:32:29 +01:00
Gleb Mazovetskiy 44ed0296d8 dun_render: Overhaul mask handling
We notice that masks can be described by 2 parameters:

1. Whether they have 0 or 1 as their high bits.
2. Whether they shift to the left or to the right on the next line.

Describing masks this way allows us to lift them to template variables and simplify the code.
We also avoid handling the mask in the `RenderLine` loop entirely.

Also fixes a foliage rendering bug: Transparent foliage pixels were previously blended but they should have been simply skipped.
2022-12-04 21:53:52 +01:00
Gleb Mazovetskiy 5024bc0f07 Show FPS up to 1 decimal point
If FPS < 100, print it with 1 decimal point.
Useful for measuring performance impact on low-end devices.
2022-12-03 21:42:18 +01:00
Gleb Mazovetskiy aca4aae3c1 dun_render: Remove the use of LightTableIndex
Replaces the global with an argument.
2022-11-25 15:00:04 +01:00
Gleb Mazovetskiy 3afef6299f Level renderer: Remove cel_transparency/foliage_active globals 2022-11-25 15:00:04 +01:00
Gleb Mazovetskiy 1293dfb86d Level renderer: Remove level_piece_id global
`DrawFloor` now passes the piece ID into RenderTile.
Previously, `DrawFloor` did not set `level_piece_id`.
2022-11-25 14:16:30 +01:00
Gleb Mazovetskiy c616e0d6d2 Level renderer: Remove arch_draw_type global 2022-11-25 14:16:30 +01:00
Gleb Mazovetskiy 69c429bb68 Level renderer: Remove level_cel_block global 2022-11-25 14:16:30 +01:00
Gleb Mazovetskiy a7324a15c0 Item labels: Clip to viewport
Instead of redrawing the panel to avoid item label clipping, clip the labels themselves.
2022-11-22 03:14:58 +00:00
Gleb Mazovetskiy 4c0b43508a DoBlitScreen: Fix update rects
Fixes chat input at 640x480.

Also fixes the other rects, they were slightly off.
2022-11-17 14:25:03 +01:00
obligaron dc3d797269 GetOffsetForWalking: use uint8_t for animation fraction 2022-11-11 13:29:00 +00:00
obligaron eca1a68bec AnimationInfo: Use fixed point math for fractions 2022-11-06 12:31:40 +00:00
Gleb Mazovetskiy 1da4be3839 Fix chat
Accidentally broken by #5453
2022-11-02 11:19:00 +00:00
Gleb Mazovetskiy 680ab5ec40 Overhaul backbuffer state handling
When rendering directly to the output buffer, we need to maintain the
state of what has been drawn and what needs redrawing per-buffer.

We previously tried to do it implicitly by checking `SDL_DOUBLEBUF` and
other flags. The previous implementation was broken in several
ways, resulting in rendering issues on devices that support 8-bit output
directly.

Changes this mechanism to explicitly maintain buffer state per output
buffer. The new mechanism doesn't require knowledge of the number of
buffers, and thus also works correctly with triple-buffering.

Fixes #5447
2022-11-01 02:43:24 +00:00
Gleb Mazovetskiy 0498d7d3a7 Fix compilation warnings 2022-10-29 13:41:23 +01:00
obligaron a2ec22667f Use AnimationInfo::isLastFrame in more places 2022-09-04 18:00:16 +02:00
obligaron deb0d6d9e1 Use missile helpers in MoveMissile/UpdateMissileRendererData (#5291) 2022-08-26 21:50:42 +02:00
Gleb Mazovetskiy 188dc79f6e Make Players a vector 2022-08-26 13:22:04 +09:00
obligaron 68891a8df1 Rename MissileMovementDistrubution => MissileMovementDistribution 2022-08-20 23:41:40 +02:00
Gleb Mazovetskiy 580d3cb6ee touch/renderers: Migrate away from Art 2022-08-08 14:29:45 +01:00
obligaron 2493f06116 ActorPosition: Remove offset, offset2 and velocity 2022-08-03 21:25:21 +02:00
obligaron a410e989bf Remove ScrollInfo 2022-08-03 21:25:21 +02: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
Andrew James 480ab945e7 Only draw towners on their base tile (#5171) 2022-08-01 21:02:59 +10:00
obligaron c5ce29106e Fix left sideways walking monsters draw order 2022-07-30 14:11:08 +02:00
ephphatha 0ce76a3f13 Add Object lookup method to mimic map::at() 2022-07-28 12:47:13 +02:00
ephphatha 9e76cd4ab7 Use object pointer for pcursobj 2022-07-19 13:20:24 +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 a4ac41cece Replace DVL_VK virtual key codes with SDLK 2022-07-17 10:00:06 +01:00
Gleb Mazovetskiy 70364013b0 Fix fmt v9 deprecation warnings
Version 9 of libfmt deprecates printing `enum` without casting it to an
integral type explicitly (consistent with `enum class`).
2022-07-16 12:55:18 +01:00
Mikołaj Piróg c38db60d0b Remove monster name member from monster struct (#4986) 2022-07-14 10:16:19 +02:00
Anders Jenbo ac2bf9aaac Limit what gets called in headless mode 2022-07-13 18:54:36 +02:00
ephphatha 1337ff6ea2 Add check if a monster potentially has leashed minions 2022-07-13 07:13:34 +02:00