Anders Jenbo
dbfa9c27a5
✨ Enable translation for all menus
5 years ago
Jmgr
1b7e0d2cb3
Migrate existing log entries
5 years ago
Anders Jenbo
cc164985a3
🎨 Correct type checks in src sub-folder
5 years ago
Anders Jenbo
191d98207b
🎨 readability-identifier-naming on DiabloUI
5 years ago
Anders Jenbo
b978d80119
🎨 llvm-include-order
5 years ago
Anders Jenbo
bb4e1960e7
🎨 modernize-use-nullptr
5 years ago
Anders Jenbo
8c821e98d3
🚚 Restructure files
5 years ago
Anders Jenbo
997c1dba55
🚚 Split up all.h in to proper header relations
5 years ago
Anders Jenbo
67a7ff98c5
🚨 Clean up compiler warnings
5 years ago
Gleb Mazovetskiy
8b7a183f39
Migrate credits.cpp to SDLSurfaceUniquePtr
5 years ago
Anders Jenbo
93d42b62b8
♻️ Change BOOL to bool
5 years ago
Anders Jenbo
bfb3c11c2b
🎨 Change namespace to devilution
5 years ago
Gleb Mazovetskiy
a6019f4e55
DiabloUI: Render to DiabloUiSurface()
...
Use that instead of using `GetOutputSurface()` directly.
For the rg99 port, we'll want to render this to the `pal_surface`
instead of output surface directly.
Might also be useful for 3ds, perhaps to render to the bottom screen.
5 years ago
Anders Jenbo
713f74e8d5
Implement Support menu
5 years ago
Anders Jenbo
47004ddd35
Add widescreen menus
5 years ago
Anders Jenbo
1b69f1f5eb
Implement Hellfire credit screen
6 years ago
Tyler
ecde1f647e
Adjust UI to any resoution
6 years ago
Anders Jenbo
86cd54a7ca
Fix compiler warning
6 years ago
Anders Jenbo
fa473e9e48
Fix memory leak in credits.cpp
...
Thanks to @Lundar
6 years ago
BDC
62de5f1600
Refactor DiabloUI to dynamic C++03 compatible code
...
This will help with porting the game to the original Xbox, and also make
it easier to implement dynamic resolutions and translations.
6 years ago
Anders Jenbo
c32f33f19f
Use safe ranges instead of decltype() for C++03 compatability
...
SDL2 uses int, but SDL1.2 uses Uint16 and Sint16.
6 years ago
Anders Jenbo
8726e80199
Make controller enums C++03 compatible
6 years ago
Anders Jenbo
dc8be6c0ab
C++03 compatibility ( #736 )
...
* Use C++03 compatible constructors
* Remove conflicting definitions
6 years ago
Anders Jenbo
7a90b9102a
When needed, clear buffer before rendering menu
6 years ago
Anders Jenbo
ca82f81582
Move menu elements to the center of the screen
...
Previously the rendering was just shifted which gave the mouse an odd
position and made it impossible to place new elements in the left side.
6 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
1f129de0c3
DiabloUI: Scale surfaces at load/creation time
6 years ago
Gleb Mazovetskiy
bbe22b3be7
Fix credits when using software scaling
6 years ago
Anders Jenbo
3ad7e21e71
Fix flashing menu transitions
...
Fixes #591
6 years ago
Gleb Mazovetskiy
041d540c6f
Fix credit lines pop-in
...
+1 should +2 (+1 for rounding-up and +1 for an extra line)
Fixes #585
6 years ago
Anders Jenbo
32d91cb446
Render menu directly to the output surface
...
Fixes fades not reset when switching to a new menu before fade had
ended.
Fixes incorrect start position for credits.
6 years ago
Anders Jenbo
08aa6a860a
Move generic helpers out of miniwin
6 years ago
Anders Jenbo
f9d4073620
Detect when gamepads are added or removed
6 years ago
Gleb Mazovetskiy
a2e821d241
Game controller support
...
Initial game controller support.
Actions are based on the Switch branch but the controller code itself is
implemented differently, allowing for easy remapping and minimizing
changes to the Source/ directory.
Many subtle and not so subtle controller bugs have been fixed
in this implementation, including:
1. Smoother & more responsive movement with the joysticks.
2. Consistent controls for all the menus in the game (stores, quest log,
etc).
3. Cursor appearance / disappearance at appropriate times.
Low-level controls are abstracted and 3 SDL interfaces are supported:
game controller, joystick, and keyboard. See SourceX/controls/ for more
details on this.
Wishlist for the future:
1. Primary button and use button should attack continously.
This is hard as it requires checking the cooldowns / attack speed.
2. Quick spell menu navigation is very buggy. It is also buggy in the
switch branch. I haven't had a change to investigate.
6 years ago
Anders Jenbo
a8e4db538f
Display SDL error messages in UI dialog
...
This will also end the application in most cases
7 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
356e276b0a
credits.cpp: Hard-code a safe mask color
...
palette->colors[50] was the same as palette->colors[224] for a few frames.
7 years ago
Gleb Mazovetskiy
e7d7cbe098
DiabloUI/credits: Use SDL_SetPaletteColors in SDL2
...
Internally, this increments the palette version, which we previously
didn't do.
7 years ago
Gleb Mazovetskiy
b80963f057
DiabloUI/credits: Remove BlitToViewport helper
7 years ago
Gleb Mazovetskiy
d76e577ee4
DiabloUI/credits: Render TTF only once
...
Re-use the same TTF surface for text and shadow.
This is significantly faster.
7 years ago
Gleb Mazovetskiy
89ff46a371
Remove SDL_Delay(1)
7 years ago
Gleb Mazovetskiy
f0a90f4717
DiabloUI: Credits improvements
...
1. Fix lines moving up and down on slower devices.
2. Cache rendered text surfaces (in a ring buffer).
3. SDL_Delay(1) between event polls to reduce CPU usage.
4. Move data to a separate compilation unit.
Refs #231
7 years ago
Gleb Mazovetskiy
17b5011916
DiabloUI: Move art and text code out of diablo.cpp
7 years ago
Gleb Mazovetskiy
7f61128d32
Fix more compilation warnings
...
```
SourceX/storm/storm.cpp:27:10: note: ‘snprintf’ output between 11 and 270 bytes into a destination of size 260
snprintf(file_path, DVL_MAX_PATH, "%sdiablo.ini", path);
```
SDL1 warnings:
```
devilutionX/SourceX/dx.cpp:199:24: warning: narrowing conversion of ‘(int)dwX’ from ‘int’ to ‘Sint16’ {aka ‘short int’} inside { } [-Wnarrowing]
SDL_Rect dst_rect = { (int)dwX, (int)dwY, w, h };
SourceS/sdl2_to_1_2_backports.h:616:18: warning: comparison is always false due to limited range of data type [-Wtype-limits]
if (final_dst.w < 0)
SourceS/sdl2_to_1_2_backports.h:777:24: warning: comparison of integer expressions of different signedness: ‘const int’ and ‘long unsigned int’ [-Wsign-compare]
if ((rc > 0) && (rc < sizeof(path))) {
~~~^~~~~~~~~~~~~~
SourceX/storm/storm.cpp:479:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
if (out_len <= item->len) {
SourceX/storm/storm.cpp:716:60: warning: narrowing conversion of ‘((640 - scaledW) / 2)’ from ‘int’ to ‘Sint16’ {aka ‘short int’} inside { } [-Wnarrowing]
SDL_Rect pal_surface_offset = { (SCREEN_WIDTH - scaledW) / 2, (SCREEN_HEIGHT - scaledH) / 2, scaledW, scaledH };
DiabloUI/credits.cpp:525:30: warning: narrowing conversion of ‘- y’ from ‘int’ to ‘Sint16’ {aka ‘short int’} inside { } [-Wnarrowing]
SDL_Rect src_rect = { 0, -y, text_surface->w, 251 };
```
7 years ago
Anders Jenbo
18532e7c9b
Format SourceX and SourceS
...
Fixes #262
7 years ago
Gleb Mazovetskiy
cf0f867ca0
DrawArt via SDL
7 years ago
Anders Jenbo
5cadee74c2
Fix a few compiler warnings
7 years ago
Bao Chi Tran Nguyen
c6d5dc48ff
Implemented text shadow at the credits.
7 years ago
Manuel K
32b0e99e90
Use SCREEN_Y (dX part)
7 years ago
Anders Jenbo
0f8545d3c4
Clean up SDL error logging
7 years ago