Commit Graph
35 Commits
Author SHA1 Message Date
Anders Jenbo 9b1568cc08 Startup issues with shareware version 2021-01-17 16:04:13 +01:00
Anders Jenbo 88c85c54de [switch] Leave TextInput running
Text mode is on by default. Calling SDL_StartTextInput() will start the
virual keyboard, but does not allow for a default value. Calling it as
well as switch_start_text_input() will start the keyboard a secound
time.
We still turn TextInput off on other platforms when it's not needed as
it can require additional resources.
2020-10-09 03:02:14 +02:00
Tyler ecde1f647e Adjust UI to any resoution 2020-09-28 07:01:27 +02:00
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.
2020-09-09 05:14:30 +02:00
Anders Jenbo 0fddb655e3 Clean up var names 2020-05-20 02:19:35 +02:00
Anders Jenbo 8726e80199 Make controller enums C++03 compatible 2020-05-19 17:19:50 +02:00
Anders Jenbo dc8be6c0ab C++03 compatibility (#736)
* Use C++03 compatible constructors
* Remove conflicting definitions
2020-05-17 01:37:19 +02:00
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.
2020-05-15 19:12:03 +02:00
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
2020-05-14 11:44:15 +02:00
Anders Jenbo 25993b4043 Merge branch 'master' of github.com:diasurgical/devilution 2020-02-14 23:03:31 +01:00
Gleb Mazovetskiy 4a0e39c830 DiabloUI: Fix dialog rendering issues
1. The palette fade level wasn't set, resulting in black on Amiga.
2. Rendering cleared `pal_surface` instead of `GetOutputSurface()`,
   resulting in mouse trails.

Also improves performance by only loading the background / palette once.
2020-02-09 22:25:36 +01:00
Anders Jenbo 9092eb43e5 Test fatal functions in appfat.cpp 2020-02-07 15:04:06 +01:00
Anders Jenbo 913de17a56 Use SDL_Color nativly instead of converting betwen it and PALETTEENTRY 2020-01-31 01:20:10 +01:00
Anders Jenbo 961e7f58c4 Implement UI errors 2019-12-30 19:03:40 +01:00
Anders Jenbo e847108b78 Clean up event handeling 2019-12-03 01:59:13 +01:00
Anders Jenbo f9d4073620 Detect when gamepads are added or removed 2019-12-03 01:59:13 +01:00
Anders Jenbo bc88560b41 Disable rendering when minimized
This recovers the original use of gbActive
2019-11-17 01:55:07 +01:00
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.
2019-11-06 02:13:07 +01:00
Anders Jenbo feeae23076 Prevent infinit recursion in UiOkDialog 2019-10-13 14:48:28 +02:00
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
2019-10-06 01:27:11 +02:00
Gleb Mazovetskiy ea4358fdc7 Avoid console warnings on dialog init w/o diabdat 2019-10-03 21:17:08 +02:00
Gleb Mazovetskiy b536d0efa2 DiabloUI: Handle logo like all the other elements
Adds the `animated` flag to `UiImage`, allowing us to
remove special handling for the logo.
2019-10-03 21:17:08 +02:00
Gleb Mazovetskiy 4ea3a4e941 Make Source/ dialogs call DiabloUI/dialogs.cpp
The diabdat.mpq absence error is handled by stubbing the art with solid
colors.
2019-10-03 08:17:32 +02:00
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.
2019-10-03 08:07:51 +02:00
Gleb Mazovetskiy 5d7f6db2fc Wrapped text rendering for TTF
Does not do centering yet, but should be easy to add in the future
2019-10-02 22:44:44 +02:00
Gleb Mazovetskiy aa3a8fecd5 DiabloUI: Dialog positioning and other tweaks 2019-10-02 22:44:44 +02:00
Gleb Mazovetskiy 458fbcef88 DiabloUI: Implement some dialogs
Partially addresses #303
2019-10-02 22:44:44 +02:00
Gleb Mazovetskiy 0710d1c425 DiabloUI: Rename UiButton to UiArtTextButton 2019-10-02 22:44:44 +02:00
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).
2019-09-29 18:55:16 +02:00
Anders Jenbo 18532e7c9b Format SourceX and SourceS
Fixes #262
2019-09-26 01:28:27 +02:00
Anders Jenbo 689e91a425 Adjust font for delete message to match original 2019-07-21 22:50:56 +02:00
Xadhoom f00e427ed2 Remove pch.h 2019-03-17 18:28:37 +00:00
Xadhoom 5283a9ffd1 Put everything into namespace dvl 2019-03-11 20:10:23 +00:00
Xadhoom 4d557709e0 Clean headers for network code 2019-02-24 10:46:16 +00:00
Xadhoom af47577446 Begin restructuring headers 2019-02-23 07:49:22 +00:00