Gleb Mazovetskiy
010dda42cf
Remove PCX->CEL conversion
...
It is no longer used as we render all assets directly as PCX.
4 years ago
Gleb Mazovetskiy
0c7e36e81a
DiabloUI: Clean up portrait loading
...
1. Load portraits as PCX (~30% smaller).
2. Simplify the portrait override logic.
4 years ago
Gleb Mazovetskiy
3178dd5158
Replace most uses of `sprintf` with `fmt` ( #4837 )
4 years ago
Vladimir Olteanu
5a5111f1d8
Refactor CrawlTable ( #4833 )
4 years ago
Gleb Mazovetskiy
bd66e7d6d8
pcx_render: Fix line skipping for odd widths ( #4828 )
...
When line skipping PCX sprites with odd widths, skip the padding pixel
as well.
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
obligaron
0d2a23254e
Use binaryformat for demofile ( #4799 )
4 years ago
Anders Jenbo
72656b3011
Move path and palette to the engine folder
4 years ago
Anders Jenbo
99181fd709
Move more files to the engine folder
4 years ago
ephphatha
c68fcf3cb1
Apply MethodCase config to Rectangle::Contains
...
Also included Circle and VirtualButton classes due to the shared use.
4 years ago
ephphatha
de05ce6562
Use theme room attributes directly instead of recalculating
4 years ago
Gleb Mazovetskiy
8e9c9e0238
Reduced the size of `OwnedCelSprite*` by 8 bytes
...
`OwnedCelSpriteWithFrameHeight`: 40 -> 32
4 years ago
Andrew James
13a3424ff0
Add helpers for creating/using Rectangles in UI contexts ( #4734 )
...
* Add MakeRectangle helper to convert from SDL_Rect
* Add Rectangle::inset method for shrinking a rectangle
Turns out some of the other use cases I though this could apply to were actually doing something based on a fixed region
* Simplify initialisation of settings menu rects
4 years ago
Gleb Mazovetskiy
de10b96bfb
Fix PCX `LoadFrameOffsets`
4 years ago
Anders Jenbo
860bd1cebf
Operate directly on SOL data
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
Gleb Mazovetskiy
02d448267a
Render fonts as PCX (-420 KiB RAM)
...
Reduces peak memory consuption in game by ~420 KiB.
This is because the PCX renderer applies the palette on the fly while
rendering, meaning we do not need to duplicate the font for different
palettes.
This approach is also a bit slower than precomposed palettes (still
plenty fast).
4 years ago
ephphatha
8d0afac194
Don't preserve an unreachable vanilla bug
4 years ago
Gleb Mazovetskiy
1fc8ecb6f6
Add fmt::runtime annotations for C++20 support
...
`fmt` requires non-contexpr format string arguments to be wrapped in
`fmt::runtime` in C++20.
4 years ago
Gleb Mazovetskiy
c380c7fa61
PCX: Add transparency support
4 years ago
Gleb Mazovetskiy
220d38aa5c
Direct PCX rendering
4 years ago
Andrew James
4bd1e06336
Point mega <-> world conversion helpers
4 years ago
Anders Jenbo
98a10d262e
Unify PlaceMiniSet
4 years ago
ephphatha
606cc162a1
Use helpers when calculating missile velocity
...
eventually maybe we can move to fixed point approximations instead of using hypot and casts to double/float? probably way slower than using the FPU on modern systems though :D
4 years ago
obligaron
1608219b39
Timedemo: Create reference save game and allow comparing of reference save game with actual timedemo save game
4 years ago
ephphatha
01ee2ecefc
Pretty print Size values in test failure messages
4 years ago
ephphatha
d5622d5080
Add point constructor to allow comparison in test macros
4 years ago
qndel
f84c35d2dc
fix typos
4 years ago
Andrew James
1047e408bd
Simplify logic of UpdateMissilePos using helpers from 4620 ( #4621 )
4 years ago
Anders Jenbo
0508311959
Cleanup block_lvid checks
4 years ago
Dmitry Marakasov
04d0950c9e
Fix UB in random generator
...
abs(INT_MIN) is undefined behavior, so process this case without
calling abs()
4 years ago
Gleb Mazovetskiy
961e1b584b
Always load fonts as CEL
...
There appear to be no drawbacks, only advantages.
4 years ago
Gleb Mazovetskiy
c2917b1dc8
DiabloUi: Load animated PCX sprites as CEL
...
Reduces memory usage in menu (and thus the overall allocator pressure)
4 years ago
Gleb Mazovetskiy
978bae1a15
Add a helper for loading PCX as CEL from path
4 years ago
Gleb Mazovetskiy
2b161e5535
An option to convert fonts to CEL in-memory
...
Reduced RAM usage by 200 KiB with no performance drop, perhaps even an
improvement.
4 years ago
obligaron
b62cacd1d6
Demomode: Init ControlMode to KeyboardAndMouse
4 years ago
ephphatha
6a04d441c1
Expand hot area of stash cell to include bottom-right border
...
This matches the behaviour of inventory cell hit logic. Previously it was possible to click exactly on a border and be unable to put an item in the stash.
4 years ago
Gleb Mazovetskiy
a66ca44695
Zero-based frame indexing
...
Index frames starting at 0 instead of 1.
4 years ago
Gleb Mazovetskiy
ade8aba822
Fix some more warnings
4 years ago
Vladimir Olteanu
25d412d1ac
Remove duplicate code in DoLighting
4 years ago
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.
4 years ago
Gleb Mazovetskiy
4808d5c3ab
Reduce debug log output of OpenAsset
4 years ago
obligaron
c6c929a90c
Remove MpqDir and use PrefPath instead.
4 years ago
ephphatha
93068de918
Address type conversion warnings in WordWrapString
4 years ago
Gleb Mazovetskiy
2f22d94e0d
Remove `OwnedCelSprite::Unowned` method
...
Conversion is already provided by the `CelSprite(const OwnedCelSprite &)` constructor.
4 years ago
Gleb Mazovetskiy
e2dbbb3d95
CelSprite: Unify width storage
...
Reduces the size of a CelSprite by taking advantage of the fact that
16-bit pointers are aligned, so the last bit is always 0.
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
9ba64ad08b
TRN rewrite + bugfix ( #4056 )
...
* working new TRN system
* apply TRNs to all unique missiles
4 years ago