Vladimir Olteanu
79d24fa840
Use SDLWrap::CreateRGBSurfaceWithFormat in LoadArt
5 years ago
Anders Jenbo
3c246a5930
✨ Add TRN support to PCX loader
5 years ago
Vladimir Olteanu
2d4a205fef
Introduce SDL::CreateRGBSurfaceWithFormat
5 years ago
Gleb Mazovetskiy
3e5a593021
🐞 Fix reading PCX files with odd widths
...
PCX files always have an even number of bytes on each uncompressed source line, which means there is an unused byte of each compressed line if the width is odd.
References:
1. https://kaba.hilvi.org/pastel-1.5.0/pastel/gfx/image_file/pcx/pcx_file.htm
2. https://www.moon-soft.com/program/FORMAT/graphics/pcx.htm#decoding%20.pcx%20files
5 years ago
Anders Jenbo
0889780923
Remove more usage of miniwin types
5 years ago
Gleb Mazovetskiy
b76f7656f3
🧹 LoadArt: BYTE -> uint8_t
...
The change in include order necessitated a couple of other minor
cleanups, one in stubs.h and one in sdl2_to_1_2_backports.h
5 years ago
Anders Jenbo
a095bc0bf7
♻️ Migrate more code away from miniwin
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
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
Jmgr
1b7e0d2cb3
Migrate existing log entries
5 years ago
Anders Jenbo
191d98207b
🎨 readability-identifier-naming on DiabloUI
5 years ago
Anders Jenbo
bb4e1960e7
🎨 modernize-use-nullptr
5 years ago
Anders Jenbo
5fdb9ce459
🎨 Format code
5 years ago
Anders Jenbo
8c821e98d3
🚚 Restructure files
5 years ago
Anders Jenbo
6e1a106a38
🚚 Move header we implement into the project
5 years ago
Gleb Mazovetskiy
d966a1380e
Migrate DiabloUI/art to SDLSurfaceUniquePtr
5 years ago
Anders Jenbo
bfb3c11c2b
🎨 Change namespace to devilution
5 years ago
Anders Jenbo
cee6029da0
🔥 Rely less on storm.h
5 years ago
Anders Jenbo
47004ddd35
Add widescreen menus
5 years ago
Anders Jenbo
69ad34f58f
Consistently use NULL instead of nullptr
...
While nullptr does have extra checking, most of the code uses NULL and
nullptr makes it harder to port the code to some targets like the
original XBox
6 years ago
Gleb Mazovetskiy
803217538a
DiabloUI: Fix software scaling along the X axis
6 years ago
Gleb Mazovetskiy
1f129de0c3
DiabloUI: Scale surfaces at load/creation time
6 years ago
Anders Jenbo
913de17a56
Use SDL_Color nativly instead of converting betwen it and PALETTEENTRY
6 years ago
Gleb Mazovetskiy
426c246535
Simplify SDL1/2 palette handling
...
SDL 1 and 2 handle surface palettes very differently.
This adds a few compatibility functions that do the right thing
depending on the SDL version.
7 years ago
Gleb Mazovetskiy
52e4064fe5
art.cpp: Use `const_cast` instead of C-style cast
7 years ago
Anders Jenbo
ba9288c6cf
Unify error dialogs, for looks and portability
...
- Use UiOkDialog() to display all error messages
- Add SDL simple message, and console fallbacks to UiOkDialog()
- Boot graphics early on to facilitate most error messages with build in
gui
- Some more miniwin clean ups
7 years ago
Gleb Mazovetskiy
4ea3a4e941
Make Source/ dialogs call DiabloUI/dialogs.cpp
...
The diabdat.mpq absence error is handled by stubbing the art with solid
colors.
7 years ago
Gleb Mazovetskiy
850d09b0a5
Minor cleanup of internal error handling
...
1. TTF no longer crashes on exit.
2. Art failing to load simply isn't rendered instead of crashing in random places.
3. Fixes empty line rendering in ttf_render_wrapped.cpp
4. dx_cleanup is now idempotent.
7 years ago
Gleb Mazovetskiy
17b5011916
DiabloUI: Move art and text code out of diablo.cpp
7 years ago
Gleb Mazovetskiy
37936c6d15
DiabloUI: Refactor UI_Item to tagged unions
...
Makes the code easier to understand.
Also makes building lists easier.
Also fixes focus indicator in SELLOAD_DIALOG (this type of bug is
impossible with the new structs).
7 years ago