Gleb Mazovetskiy
3178dd5158
Replace most uses of `sprintf` with `fmt` ( #4837 )
4 years ago
Anders Jenbo
54598e2a8f
CreatePlayer by reference
4 years ago
obligaron
7a27fcd249
Fix pfile_compare_hero_demo: Close MpqWriter before reading (for comparsion)
4 years ago
obligaron
f0b3d9cb5b
pfile: remove savePrefix global
4 years ago
obligaron
7afe7d2a70
Save Methods in loadsave gets MpqWriter passed
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
obligaron
1608219b39
Timedemo: Create reference save game and allow comparing of reference save game with actual timedemo save game
4 years ago
qndel
354e329644
Players[MyPlayerId] -> MyPlayer
4 years ago
obligaron
9c0960589e
clearTables when closing stash mpq
4 years ago
Anders Jenbo
1409e604f5
Reduce string conversions
4 years ago
Anders Jenbo
a48f89007d
Implement stash
4 years ago
staphen
b85485b8f3
Resolve game crash when syncing Diablo items in Hellfire games
4 years ago
Anders Jenbo
799f1763af
Performce UTF8 aware limited string copies
4 years ago
Gleb Mazovetskiy
720d210d95
utils/mpq* -> mpq/*
4 years ago
Gleb Mazovetskiy
23406b6fc5
Replace mpqapi.h with the MpqWriter class
...
This is a cleanup, heading in the direction of allowing us to reuse
some of the code between reading and writing MPQs.
4 years ago
Gleb Mazovetskiy
3d308983a8
Migrate to libmpq
...
libmpq is a much simpler alternative to StormLib for reading MPQ archives.
We use our own fork of libmpq: https://github.com/diasurgical/libmpq
Impact:
* DevilutionX is now a lot more portable. Unlike StormLib, libmpq only
needs platform-specific code for Windows.
* Locks around file access **removed** (instead we duplicate the file descriptor for streamed audio only).
* RAM usage is **300 KiB** lower than StormLib.
* Stripped release linux_x86_64 binary is **32 KiB** smaller.
* Amiga build now hangs instead of crashing.
4 years ago
Anders Jenbo
b77686213a
🐛 Correctly wipe temp data from saves
...
Fixes #3167
4 years ago
Anders Jenbo
eb3012cc0d
Reset player object before unpacking hero data
4 years ago
Anders Jenbo
a56452eec3
Validate player sync
4 years ago
Juliano Leal Goncalves
28134d099c
🚚 Rename 'PkPlayerStruct' to 'PlayerPack'
5 years ago
Juliano Leal Goncalves
bbf529c65a
🚚 Rename 'PlayerStruct' to 'Player'
5 years ago
Anders Jenbo
4044fadeb5
Clean up some players references
5 years ago
qndel
30de22f026
fix displayed save number
5 years ago
Anders Jenbo
9c4e34f988
Player by reference
5 years ago
Jonathan Bergeron
33ad9fa187
renamed Source/mainmenu.cpp and .h to menu.cpp/.h
5 years ago
obligaron
f5b437dd9c
Use save number to load/save games (instead of hero name)
5 years ago
Anders Jenbo
96bf75b502
Rename player globals
5 years ago
Anders Jenbo
a7c7fa0030
Fully apply clang-tidy/format to all files
5 years ago
Anders Jenbo
ecea12fc15
Clang-tidy: ParameterCase
5 years ago
Anders Jenbo
fc353fc799
Clang-tidy: FunctionCase
5 years ago
Anders Jenbo
bf221f4322
Clang-tidy: readability-simplify-boolean-expr
5 years ago
Anders Jenbo
d8fa29c972
Clean up more implicit bool conversion
5 years ago
Anders Jenbo
22b632f04a
♻️ Clean up implicit bool conversions
5 years ago
Anders Jenbo
ee7b32d8f6
Player by reference part 3
5 years ago
Gleb Mazovetskiy
4ea7ba0f5f
🚚 engine.h: Extract `LoadLE32` and `LoadBE32`
5 years ago
Anders Jenbo
27591cc29f
Fix spawn save game compatability
5 years ago
Anders Jenbo
8a7ec56d3a
Player by reference part 2
...
This mostly change player to be by reference instead of by index.
But additionally it does stript checks for gold in the belt, move some
value types to the initialization and short circute a few functiongs.
5 years ago
Anders Jenbo
34744c068f
♻️ Consitantly use %i and not %d
5 years ago
Anders Jenbo
a095bc0bf7
♻️ Migrate more code away from miniwin
5 years ago
Anders Jenbo
0c2042fa52
♻️ Player by reference
...
Update Source/items.cpp
Update Source/lighting.cpp
Update Source/pack.cpp
asd
ads
as
5 years ago
Gleb Mazovetskiy
a3423cbc92
🧹 Move Storm code out of file_util
5 years ago
obligaron
60bfd5db34
Move SFileOpenArchive calls to new helper SFileOpenArchiveDiablo
5 years ago
staphen
3e5e5b2696
Synchronize SFileCloseFile() access
5 years ago
Gleb Mazovetskiy
987ab2533b
🐞 Synchronize SFileReadFile access
...
StormLib read function is not thread-safe: https://github.com/ladislav-zezula/StormLib/issues/175
5 years ago
Gleb Mazovetskiy
f33f7ae7eb
💨 Do not zero-initalize arrays we write to
...
`std::make_unique<T[]>(size)` always zero-initalizes the array.
C++20 has `std::make_unique_for_overwrite` to avoid that, while
older C++ versions can use the approach applied here.
5 years ago
Gleb Mazovetskiy
47c93c2f9c
🧹 Fix more `-Wformat` warnings
5 years ago
Vladimir Olteanu
a2cb1e5c59
Cleanup pfile_encode_hero
5 years ago
Vladimir Olteanu
c319344c50
Load/save cleanup ( #1766 )
5 years ago
Vladimir Olteanu
bea21a5e20
Replace LOAD_LE32 & LOAD_BE32 with signedness- and endian-agnostic equivalents
5 years ago
Gleb Mazovetskiy
83292c8e67
♻️ Fix -Wunused-variable in pfile.cpp
5 years ago