Commit Graph
528 Commits
Author SHA1 Message Date
Anders Jenbo 1203514383 Clean up use of currlevel 2022-06-07 21:35:01 +02:00
Andrew James 1047e408bd Simplify logic of UpdateMissilePos using helpers from 4620 (#4621) 2022-05-31 06:58:47 +02:00
qndel 354e329644 Players[MyPlayerId] -> MyPlayer 2022-05-31 05:35:52 +02:00
obligaron bc15bdf3a9 Remove PANEL_ defines and replace them with GetMainPanel() 2022-05-29 20:20:44 +02:00
obligaron 70c5cf6cad Fix item label text with open stash (#4595)
* Item labels: check if stash is open in IsMouseOverGameArea

* Add IsLeft/RightPanelOpen
2022-05-20 09:12:54 +02:00
qndel 0e2d056a9a fix refreshing/drawing bottom description part 2022-05-03 23:30:44 +02:00
qndel 0f0e2895fd fix displacement on death 2022-04-30 06:53:11 +02:00
Anders Jenbo dc706e8ed5 Use HoldItem for determining if an item is held
This cleans up a bit of code and solves a few edge cases where an item
could be lost, the game be unresponsive, or miss fire an event during
lag cause of the cursor not reflecting the currently held item.
2022-04-18 11:27:07 +02:00
Andrew James 8ed94ec365 Use zero-based arch indexes
fixes #4434
2022-04-15 01:38: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 7de6a25b41 Remove (un)lock_buf
We do not seem to render from multiple threads, so these calls are
unnecessary.
2022-03-26 22:27:54 +00:00
Anders Jenbo a48f89007d Implement stash 2022-03-18 06:01:53 +01:00
obligaron 973ce9d46e Use original position for DrawPlayerIconHelper 2022-03-07 21:38:27 +01:00
Gleb Mazovetskiy f4b43c478a Fix reflect icon offset (#4133)
Regression introduced in f4bce38875
2022-03-06 21:39:15 +01:00
Gleb Mazovetskiy f4bce38875 Use uint16_t for sprite widths 2022-03-06 04:49:13 +01: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 48f102eff1 Chat log 2022-03-06 01:02:55 +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
Gleb Mazovetskiy 48ff656dc0 Load monster graphics into a single buffer
Follow-up to a5e1fa5bbe, which loaded
the missiles into a single buffer.
2022-02-17 22:02:41 +00:00
Gleb Mazovetskiy a5e1fa5bbe Load missile frames into a single buffer
Previously, the memory for each frame was allocated separately.

Changes it to allocate a single buffer for all the frames.

This has the following advantages:

1. Less bookkeeping overhead in the allocator.
2. Less alignment overhead (allocator results are max-aligned by default).

We can follow this up with a similar treatment for other multi-file
animations.
2022-02-01 04:04:59 +00:00
qndel 9536927301 Display hp/mana values on life/mana orbs (#4006) 2022-01-27 12:19:32 +01:00
obligaron 234a053863 Change Missiles Array to std::list 2022-01-20 23:12:48 +01:00
obligaron 35dc64312e Show preview CelSprite for player actions (Introduce PlayerStruct.pPreviewCelSprite and UpdatePreviewFrame) 2022-01-12 12:26:39 +01:00
obligaron ac0bd7bb58 DrawPlayer: Calculate Width2 later 2022-01-12 12:26:39 +01:00
Gleb Mazovetskiy e12adf689e Fix windows build 2022-01-06 13:43:01 +00:00
Anders Jenbo 6b2481a76c Touch support on all SDL2 platforms 2022-01-02 11:37:38 +01:00
Trihedraf bb68c800bc move FPS display down due to new display of difficulty 2022-01-01 09:34:56 +01:00
ephphatha 279fbe32b3 Tidy up checks for missile collision with objects/tiles
This was repeated in multiple places with essentially identical logic. Can expose the existing missiles.cpp function to capture the use in scrollrt.cpp
2021-12-28 16:01:37 +01:00
ephphatha 01ffc2c501 Use ObjectAtPosition helper in DrawObject 2021-12-28 16:01:37 +01:00
Gleb Mazovetskiy c57644970f Move UiFlags and UiPanels into their own files
The first breaks circular dependency between `DiabloUI` and `text_render`.
The latter one moves `UiPanels` to a more appropriate place.
2021-11-25 12:22:27 +01:00
Gleb MazovetskiyandAnders Jenbo 7e1fea6f76 clang-format all files in {Source,test}/
Also includes a few manual tweaks to comments and newlines for better results.

Co-authored-by: Anders Jenbo <[email protected]>
2021-11-24 23:44:12 +01:00
obligaron 677303cba9 Reduce use of view globals in game menu 2021-11-20 21:57:32 +01:00
qndel 4072bd351f fix debug display in town 2021-11-14 19:49:31 +01:00
Anders Jenbo 56170b3372 Clean up id normalization 2021-11-07 23:15:10 +01:00
qndel 53f89fb9d9 debug fps command (#3418) 2021-11-07 11:23:31 +00:00
Andrew James 796e2813cf Use scoped enums for DungeonFlags/BFLAG (#3135) 2021-11-07 03:11:16 +01:00
qndel 46ed79ad42 add megatiles to tiledata (#3211) 2021-11-06 18:53:53 +01:00
ephphatha 782e07d967 Refactor DrawObject to avoid repeated Objects lookup
The check if the object position is offset is not strictly necessary as a displacement of {0, 0} remains the same after the world/screen transform.
2021-10-30 09:08:11 +02:00
Anders Jenbo 609414fd69 [touch] Indicate level up in a touch friendly way 2021-10-26 07:52:06 +02:00
qndel 0ccdf940f7 fix bounds checks (#3237) 2021-10-24 17:20:04 +02:00
Anders Jenbo 1ba7e07b29 Do not show the cursor when using a touch device 2021-10-20 05:08:45 +02:00
obligaron f9b306d24f Change EnableFrameCount() from toggle to enable only 2021-10-14 19:34:59 +02:00
qndel f8cda02456 apply bounds check function 2021-10-12 01:18:28 +02:00
staphen 1142d2ee7b Hardware rendering for the virtual gamepad 2021-09-22 00:32:17 +02:00
obligaron e62aaa562f Fix missiles don't hit horizontal walking players/monsters 2021-09-17 21:03:41 +02:00
staphen 599b29d825 Add renderer for displaying virtual gamepad on screen 2021-09-16 19:25:31 +02:00
obligaron 9678d002d3 Reduce exported functions in debug.h 2021-09-16 19:18:06 +02:00
Vladimir Olteanu d4d89077cd Don't free PalSurface when it was obtained from SDL_GetVideoSurface 2021-09-13 23:07:04 +02:00
qndel a0461bd1c0 stop displaying 0's in tiledata debug command 2021-09-12 18:15:45 +02:00
qndel d05316c67d tiledata debug command 2021-09-12 15:20:27 +02:00