Gleb Mazovetskiy
de3c9874c7
Migrate large bool arrays to `std::bitset`
...
E.g. `dRendered` size is reduced by 10 KiB
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
Andrew James
60b835214b
Address warnings in Utf8 functions ( #4748 )
...
* Use explicit typecasts to force signed char comparisons
Avoids warnings about tautological comparisons (either the >= 0 comparison for ARM/PowerPC or the <= 127 comparison for x86*)
* Remove unused function
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
b7404af9c7
Fix build with NONET and no exceptions
...
Fixes the build with `-fno-rtti` and `-fno-exceptions`.
Building with these flags reduces the binary size by more than 200 KiB.
4 years ago
ephphatha
e246ac78db
Simplify character test in UiValidPlayerName
4 years ago
ephphatha
34b7d85263
Add IsLeadUtf8CodeUnit to complement trail byte detection
4 years ago
ephphatha
3c173df83b
Update comment on IsTrailUtf8CodeUnit
...
Also use char literals instead of int literals.
4 years ago
Gleb Mazovetskiy
563ee3af7c
Optimize `FormatInteger`
4 years ago
Vladimir Olteanu
2cc9d70fa6
Use decimal separators for gold and XP ( #4722 )
4 years ago
Gleb Mazovetskiy
f22d1d0149
Remove uses of deprecated codecvt
...
codecvt is deprecated in C++17 and we don't really need all of its heavy
machinery for simply converting to UTF-8.
4 years ago
Gleb Mazovetskiy
9d2948c782
Loading screen: Free the background early
...
Frees the background after blitting it once in the loading screen.
This gives the game more RAM for the actual loading.
4 years ago
Gleb Mazovetskiy
ede7eab7e8
Fix `-wnarrowing` from `SDL_Rect` construction
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
779ccaca17
Overhaul translation fetching
...
1. Do not modify the map after loading. Instead, return string views
(guaranteed to be null-terminated) from look up functions and return
the key directly if not found.
2. Use an `unorded_map` instead of `map` where available (C++20).
Saves a bit of RAM (~50 KiB) and improves lookup performance.
4 years ago
staphen
421a7772b4
Fix error that produces broken character at end of UTF8 string
4 years ago
staphen
695851666e
Fix crash when switching to English
4 years ago
Gleb Mazovetskiy
99d490180c
Settings: Add Resampler
...
Makes the resampler algorithm configurable from the settings menu.
4 years ago
obligaron
d86c4e5d84
Introduce GetUIRectangle() to distinguish between UI and main panel
4 years ago
obligaron
5337bf1f6a
Initialize Viewport in CalculatePanelAreas
4 years ago
Gleb Mazovetskiy
85f0802f01
printInConsole: Add string_view support
...
Also print `\r\n` instead of `\n` on Windows.
4 years ago
ephphatha
7f15aa730d
Move definition of ghMainWnd to utils/display.cpp
...
This variable is controlled/set by the code in that file, this also lets other files have more specific/relevant includes instead of the monolith that is diablo.h
4 years ago
Gleb Mazovetskiy
978bae1a15
Add a helper for loading PCX as CEL from path
4 years ago
Gleb Mazovetskiy
7b98735878
Revert "An option to RLE-compress masked art"
...
This reverts commit c884f1a354 .
Superceded by `DEVILUTIONX_CONVERT_FONTS_TO_CEL`, which offers the same
RAM reduction but without slowdown.
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
Gleb Mazovetskiy
5eeaa76a75
Move PCX code to utils/pcx.cpp
4 years ago
widelec-BB
9fdebdce7a
Fix loading tranlations on big endian platforms
4 years ago
DakkJaniels
dad46e1905
Item special effect enum ( #4129 )
4 years ago
ephphatha
adba5c4441
Add hint to avoid bugprone-use-after-move warnings
...
Makes clang (and GCC) consider item.Clear() a reinitialisation of a moved variable - see https://clang.llvm.org/extra/clang-tidy/checks/bugprone-use-after-move.html#reinitialization
4 years ago
Gleb Mazovetskiy
4cdbd358dd
Audio: Use SDL resampler where available
4 years ago
Gleb Mazovetskiy
127615c33f
Fix conversion of C-string literal to `char*`
4 years ago
Gleb Mazovetskiy
7f695c2835
Use SoundSample for music
...
Unifies audio handling between sound effects and music.
4 years ago
Anders Jenbo
34201c7881
Do not set scaling hint with out a render
4 years ago
Anders Jenbo
ce5bd1df74
Show failing line in error messages
4 years ago
Anders Jenbo
122ec0ac9d
Fix crash when switching to English
4 years ago
Gleb Mazovetskiy
1d4a7fa3a2
Fix `SoundSample::DuplicateFrom` mp3
...
Fixes #4392
4 years ago
staphen
84475f29ae
[Windows] Recreate the whole window if the renderer would otherwise freeze
4 years ago
obligaron
c6c929a90c
Remove MpqDir and use PrefPath instead.
4 years ago
Gleb Mazovetskiy
5645456537
Support MP3 playback
4 years ago
Gleb Mazovetskiy
8138121e39
Fix endianness handling in language.cpp
4 years ago
ephphatha
93068de918
Address type conversion warnings in WordWrapString
4 years ago
Bubio
57d5fd0e62
Fix #4251 macOS mouse grab issue ( #4298 )
4 years ago
ephphatha
bdf075355c
Address c4244 warning in PointerOrValue
...
This triggers a bunch of warnings in MSVC because the conversion is potentially truncating, despite never being an issue in practice...
4 years ago
Gleb Mazovetskiy
a5a8aae368
Fix underflow in `BilinearScale32`
...
Fixes funky hardware cursor colors during fade transitions.
Refs #4206
4 years ago
Bubio
036171d7ca
Fixed issue #4217
...
DPI Scale is now included in the calculation.
4 years ago
Gleb Mazovetskiy
e627fc8f10
Fix alpha blending in `BilinearScale32`
...
Fixes #4206
4 years ago
Gleb Mazovetskiy
c884f1a354
An option to RLE-compress masked art
...
Saves about 200 KiB RAM in dungeon at a large performance cost.
Almost never a good idea, except for severely RAM-constrained devices (e.g. RG99).
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
Anders Jenbo
1409e604f5
Reduce string conversions
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