ephphatha
0f1ac758d8
use a smaller buffer
...
fmt::memory_buffer uses 500 bytes by default, go back to a 12 byte char array to avoid all the cruft
4 years ago
ephphatha
d6120f05bc
Only call fmt::format_to when the FPS value updates
...
Don't even need to initialise the buffer since the last update time is set when DiabloInit is called, then as long as the loading screen takes more than a second the threshold gets hit to call format_to on the first frame of gameplay.
4 years ago
Gleb Mazovetskiy
72660d9189
Migrate snprintf to fmt ( #4845 )
...
* Migrate `app_fatal` from printf to libfmt
* Migrate snprintf to fmt
4 years ago
Mikołaj Piróg
2e7ff45fbf
Monster global constants cleanup ( #4827 )
...
* Change #defines to constexpr const, add constexpr where applicable, fix typos
4 years ago
Anders Jenbo
b3b5d16633
Clean up DrawPlayerIconHelper
4 years ago
Anders Jenbo
99181fd709
Move more files to the engine folder
4 years ago
Gleb Mazovetskiy
de3c9874c7
Migrate large bool arrays to `std::bitset`
...
E.g. `dRendered` size is reduced by 10 KiB
4 years ago
Gleb Mazovetskiy
8e9c9e0238
Reduced the size of `OwnedCelSprite*` by 8 bytes
...
`OwnedCelSpriteWithFrameHeight`: 40 -> 32
4 years ago
Anders Jenbo
4cc3a5264c
Make dPiece zero-indexed
4 years ago
Anders Jenbo
98e4310cad
Index Minis by tile instead of by coordinate
4 years ago
Anders Jenbo
860bd1cebf
Operate directly on SOL data
4 years ago
obligaron
19749420b5
Introduce Player::isOnActiveLevel
4 years ago
Andrew James
0add7a8af6
Define sizes using Size type in control.cpp/stash.cpp ( #4737 )
...
* Use appropriate types for size constants in control.cpp
* Declare constexpr value for iterating over the cells in a stash grid
* Use appropriate type for UIRectangle dimensions
4 years ago
Anders Jenbo
1203514383
Clean up use of currlevel
4 years ago
Andrew James
1047e408bd
Simplify logic of UpdateMissilePos using helpers from 4620 ( #4621 )
4 years ago
qndel
354e329644
Players[MyPlayerId] -> MyPlayer
4 years ago
obligaron
bc15bdf3a9
Remove PANEL_ defines and replace them with GetMainPanel()
4 years ago
obligaron
70c5cf6cad
Fix item label text with open stash ( #4595 )
...
* Item labels: check if stash is open in IsMouseOverGameArea
* Add IsLeft/RightPanelOpen
4 years ago
qndel
0e2d056a9a
fix refreshing/drawing bottom description part
4 years ago
qndel
0f0e2895fd
fix displacement on death
4 years ago
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.
4 years ago
Andrew James
8ed94ec365
Use zero-based arch indexes
...
fixes #4434
4 years ago
Gleb Mazovetskiy
a66ca44695
Zero-based frame indexing
...
Index frames starting at 0 instead of 1.
4 years ago
Gleb Mazovetskiy
7de6a25b41
Remove `(un)lock_buf`
...
We do not seem to render from multiple threads, so these calls are
unnecessary.
4 years ago
Anders Jenbo
a48f89007d
Implement stash
4 years ago
obligaron
973ce9d46e
Use original position for DrawPlayerIconHelper
4 years ago
Gleb Mazovetskiy
f4b43c478a
Fix reflect icon offset ( #4133 )
...
Regression introduced in f4bce38875
4 years ago
Gleb Mazovetskiy
f4bce38875
Use `uint16_t` for sprite widths
4 years ago
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.
4 years ago
qndel
48f102eff1
Chat log
4 years ago
qndel
9ba64ad08b
TRN rewrite + bugfix ( #4056 )
...
* working new TRN system
* apply TRNs to all unique missiles
4 years ago
Gleb Mazovetskiy
48ff656dc0
Load monster graphics into a single buffer
...
Follow-up to a5e1fa5bbe , which loaded
the missiles into a single buffer.
4 years ago
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.
4 years ago
qndel
9536927301
Display hp/mana values on life/mana orbs ( #4006 )
4 years ago
obligaron
234a053863
Change Missiles Array to std::list
4 years ago
obligaron
35dc64312e
Show preview CelSprite for player actions (Introduce PlayerStruct.pPreviewCelSprite and UpdatePreviewFrame)
4 years ago
obligaron
ac0bd7bb58
DrawPlayer: Calculate Width2 later
4 years ago
Gleb Mazovetskiy
e12adf689e
Fix windows build
4 years ago
Anders Jenbo
6b2481a76c
Touch support on all SDL2 platforms
4 years ago
Trihedraf
bb68c800bc
move FPS display down due to new display of difficulty
4 years ago
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
4 years ago
ephphatha
01ffc2c501
Use ObjectAtPosition helper in DrawObject
4 years ago
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.
4 years ago
Gleb Mazovetskiy
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 <anders@jenbo.dk>
4 years ago
obligaron
677303cba9
Reduce use of view globals in game menu
4 years ago
qndel
4072bd351f
fix debug display in town
4 years ago
Anders Jenbo
56170b3372
Clean up id normalization
4 years ago
qndel
53f89fb9d9
debug fps command ( #3418 )
4 years ago
Andrew James
796e2813cf
Use scoped enums for DungeonFlags/BFLAG ( #3135 )
4 years ago
qndel
46ed79ad42
add megatiles to tiledata ( #3211 )
4 years ago