Anders Jenbo
68923c6c33
✨ Generic game text render function
...
This should gradually replace all the direct rendering of game texts
throughout the code. The interface is made to closly mirror that of the
art fonts as that is what will eventually be used for rendering Unicode
fonts both in the menus and ingame.
fixup! ✨ Generic game text render function
5 years ago
staphen
3e5e5b2696
Synchronize SFileCloseFile() access
5 years ago
Gleb Mazovetskiy
59dd42692f
🚚 Move render.cpp to engine/render/dun_render.cpp
5 years ago
Anders Jenbo
fa0b286693
♻️ Typed file loading
...
Tthis gives us the option to specify what type a file should be loaded
as, avoidng the need to case it and does some automatic checks on the
fitness of the data, while making the process simpler.
If no type is given then the type will be set to std::byte which limit
what operations can be performed on the data.
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
3d03990cb8
♻️ Replace `SBmpLoadImage` with a simpler method
...
The new approach only makes 2 read calls and does not do any seeks.
It is also less general and is internal to `art.cpp`, allowing us to
simplify it somewhat.
5 years ago
Gleb Mazovetskiy
052b4c12f5
♻️ LoadFileInMem: Remove `nullptr` at call sites
...
This is now the default argument, no need to provide it explicitly.
5 years ago
Gleb Mazovetskiy
1b8b62a8c2
♻️ Store CEL width with the sprite itself
...
Instead of passing the CEL sprite width when drawing, store the CEL
width at load time in the new `CelSprite` struct.
Implemented for most sprites except towners, missiles, or monsters.
5 years ago
Anders Jenbo
c66604c7ad
🐛 Do not render text as UTF8 for now
5 years ago
Anders Jenbo
2b7fad2a68
🐛 Do not render text as UTF8 for now
5 years ago
Anders Jenbo
3b04f67194
🔥 Remove a chunk of miniwin types
5 years ago
Anders Jenbo
e3526a5ff6
🌐 Convert all src to UTF8
5 years ago
Anders Jenbo
187d547fb8
🌐 Remove unused string from the translation list
5 years ago
Jmgr
d4f62870b8
Remove globals from paths.h
...
Fix for Vita
Update to use free functions
Use std::optional to allow setting empty paths
Change header inclusion order
Co-authored-by: Gleb Mazovetskiy <glex.spb@gmail.com>
Use std::optional to allow setting empty paths
Apply clang-format
Temporary commit
5 years ago
Anders Jenbo
b69d18f12d
🌐 Enable translation of all remaning strings
5 years ago
Anders Jenbo
dbfa9c27a5
✨ Enable translation for all menus
5 years ago
John Törnblom
b86743db25
add translation macros to the main menu
...
translate all strings in the main menu
5 years ago
John Törnblom
51e7a169a6
add initial language support using a simple MO parser
5 years ago
Jmgr
c33182d6de
Modernize deprecated headers
5 years ago
Jmgr
1b7e0d2cb3
Migrate existing log entries
5 years ago
Jmgr
ef0ca794bc
Use system libfmt by default if version >= 7.0.0
...
Allow non-strict ansi functions
Cleanup
5 years ago
Jmgr
f3a401b5f6
Add the fmt library as a dependency and add some examples
...
Attempt at fixing missing functions on some platforms
5 years ago
Anders Jenbo
7912e510f0
🎨 Clean up overuse of SDL types
5 years ago
Anders Jenbo
cc164985a3
🎨 Correct type checks in src sub-folder
5 years ago
Anders Jenbo
41f35840af
🐛 Fix size of m_game_data
5 years ago
Trihedraf
cfd63a9ad0
Fix SDL1 Builds
5 years ago
Anders Jenbo
2969b80163
🎨 Run readability-identifier-naming on all src sub-folders
5 years ago
Anders Jenbo
191d98207b
🎨 readability-identifier-naming on DiabloUI
5 years ago
Anders Jenbo
1e3ed903be
🎨 strip redundant else
5 years ago
Anders Jenbo
c9af65affe
🎨 Use empty instead of size to check for empty lists
5 years ago
Anders Jenbo
d392f70509
🎨 Do not pass item lists by value
5 years ago
Anders Jenbo
251dce6c89
🧹 Use empty to check if vector is empty
5 years ago
Anders Jenbo
f004c78824
🧹 performance-unnecessary-value-param
5 years ago
Anders Jenbo
d846a30157
🧹 acceptable parts of bugprone-*
5 years ago
Anders Jenbo
d024f79b0e
🧹 performance-unnecessary-value-param
5 years ago
Gleb Mazovetskiy
84122c5f07
🎨 DiabloUI: Replace `dynamic_cast` with `static_cast`
...
The type is known here so we do not need to pay the overhead of a `dynamic_cast`.
Follow-up to 94f385a46b
5 years ago
Anders Jenbo
373f28736f
🎨 Acceptable parts of modernize-*
5 years ago
Anders Jenbo
94f385a46b
🎨 cppcoreguidelines-pro-type-cstyle-cast
5 years ago
Anders Jenbo
b978d80119
🎨 llvm-include-order
5 years ago
Anders Jenbo
bb4e1960e7
🎨 modernize-use-nullptr
5 years ago
Gleb Mazovetskiy
295b5bce81
🧹 DiabloUI: Clean up text render cache
...
Cleans up the handling of text render cache for `UiText` and `UiButton`.
This also happens to fix a memory leak (`FreeCache` was never called).
5 years ago
Gleb Mazovetskiy
92485ed222
DiabloUI: Support non-doublebuf HW surfaces
...
If using a hardware surface without double-buffering, perform
rendering in a single blit to avoid flickering and tearing.
5 years ago
Anders Jenbo
5fdb9ce459
🎨 Format code
5 years ago
Gleb Mazovetskiy
5b29fe9476
🧹 DiabloUI/selhero.cpp: Move to anonymous namespace
...
Also removes the following unused globals:
char selhero_Description[256];
char selhero_Lable[32];
5 years ago
Gleb Mazovetskiy
e92cf9d7c8
🧹 DiabloUI/title.cpp: Move to anonymous namespace
5 years ago
Gleb Mazovetskiy
9468b1da58
🧹 DiabloUI/selyesno.cpp: Move to anonymous namespace
5 years ago
Gleb Mazovetskiy
f9ee3763e4
🧹 DiabloUI/selconn.cpp: Move to anonymous namespace
5 years ago
Gleb Mazovetskiy
e13f67f7af
🧹 DiabloUI/mainmenu.cpp: Move to anonymous namespace
5 years ago
Gleb Mazovetskiy
ff798a5e43
🧹 DiabloUI/progress.cpp: Move to anonymous namespace
...
Also removes the unused `char dialogText[256];`
5 years ago