From 2c0375a974633cd231504e23475db3f9074a02ba Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Mon, 9 Mar 2020 05:03:49 +0100 Subject: [PATCH 01/35] DevilutionX 1.0.1 --- docs/CHANGELOG.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 918feeb58..3fedb9b08 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -4,6 +4,38 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## DevilutionX 1.0.1 +### Features +- Toggle fullscreen at any point by hitting alt+enter (mouse grab can be disabled in diablo.ini) +- Controller: B button closes the currently active panel. +- Added a navigation menu for controllers +- Focus on the exit item before quitting. +- Minor performance improvements (save/load time and main menu). +- Add a list of [known mods](https://github.com/diasurgical/devilutionX/blob/master/docs/mods.md) + +### Platforms +- Added support for 32bit PowerPc +- Added support for Amiga +- Added support Clockwork PI GameShell +- Added support for GKD350h +- Switch to OPK for RetroFW (requires 2.0) +- Update OpendDingus/RetroFW build root + +### Bugfixes +- Game crashing on systems that do not report monitor refresh rate. +- Fixed belt not working correctly when holding shift on us keyboard layouts +- Always keep track of the latest hero level when selecting difficulty. +- Correct screenshot path +- Turn the screen red for 200ms when taking screenshots. +- Fix town load screen missing on the first load. +- Fix minor HOM issue at some houses in town. +- Allow for space as text input +- Fixed a couple of typos in error messages + +### Original Diablo bugs +- Fix belt not working correctly when holding shift on *non-*us keyboard layouts +- Fix one more rare crash. + ## DevilutionX 1.0.0 ### Features - FPS no longer capped at 20hz; smoother mouse and transitions From 611f7f109e0f2096ad05aee9138417837a0fd6d7 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Tue, 10 Mar 2020 09:20:56 +0000 Subject: [PATCH 02/35] Map Start + L1/R1 to char/inventory (#655) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's common to access char and inventory and this is easier to press than Start + ←/→ on devices that have shoulder buttons --- Packaging/OpenDingux/gkd350h-manual.txt | 23 +++++++++++------------ Packaging/OpenDingux/retrofw-manual.txt | 17 ++++++++--------- Packaging/OpenDingux/rg350-manual.txt | 18 ++++++++---------- README.md | 20 +++++++++----------- SourceX/controls/game_controls.cpp | 8 ++++++++ 5 files changed, 44 insertions(+), 42 deletions(-) diff --git a/Packaging/OpenDingux/gkd350h-manual.txt b/Packaging/OpenDingux/gkd350h-manual.txt index 742b1e644..ce9c72771 100644 --- a/Packaging/OpenDingux/gkd350h-manual.txt +++ b/Packaging/OpenDingux/gkd350h-manual.txt @@ -9,20 +9,19 @@ Game saves and diablo.ini are located at: Controls: - Joystick / D-Pad: move hero -- Right analog: simulate mouse -- **○** circle: attack nearby enemies, talk to townspeople and merchants, pickup/place items in the inventory, OK while in main menu -- **×** cross: select spell, back while in menus -- **△** triangle: pickup items, open nearby chests and doors, use item in the inventory -- **□** square: cast spell, delete character while in main menu +- ○: attack nearby enemies, talk to townspeople and merchants, pickup/place items in the inventory, OK while in main menu +- ×: select spell, back while in menus +- △: pickup items, open nearby chests and doors, use item in the inventory +- □: cast spell, delete character while in main menu - L: use health item from belt - R: use mana potion from belt -- Select + ↑ up: game menu -- Select + ← left: character info -- Select + → right: inventory -- Select + ↓ down: map -- Select + **□** square: Quest log -- Select + **×** cross: Spell book -- Start + **△○×□**: Quick spell hotkeys +- Select + ↑: game menu +- Select + L or ←: character info +- Select + R or →: inventory +- Select + ↓: map +- Select + □: Quest log +- Select + ×: Spell book +- Start + △○×□: Quick spell hotkeys Known issues/quirks: diff --git a/Packaging/OpenDingux/retrofw-manual.txt b/Packaging/OpenDingux/retrofw-manual.txt index 4419cd0ac..862ff9bd6 100644 --- a/Packaging/OpenDingux/retrofw-manual.txt +++ b/Packaging/OpenDingux/retrofw-manual.txt @@ -12,17 +12,16 @@ Controls: - B: select spell, back while in menus - X: pickup items, open nearby chests and doors, use item in the inventory - Y: cast spell, delete character while in main menu -- R1: use mana potion from belt -- L1: use health item from belt -- Start + Up: game menu -- Start + Left: character info -- Start + Right: inventory -- Start + Down: map +- R: use mana potion from belt +- L: use health item from belt +- Start + Select: game menu (alt: Start + ↑) +- Start + L or ←: character info +- Start + R or →: inventory +- Start + ↓: map - Start + Y: Quest log - Start + B: Spell book - Select + A/B/X/Y: hot spell - Select + D-pad: move map/cursor -- Select + L1: left mouse click -- Select + R1: right mouse click -- Start + Select: game menu +- Select + L: left mouse click +- Select + R: right mouse click - Suspend: map diff --git a/Packaging/OpenDingux/rg350-manual.txt b/Packaging/OpenDingux/rg350-manual.txt index 336be84ba..3ffaa14bf 100644 --- a/Packaging/OpenDingux/rg350-manual.txt +++ b/Packaging/OpenDingux/rg350-manual.txt @@ -15,17 +15,15 @@ Controls: - Y: cast spell, delete character while in main menu - L1: use health item from belt - R1: use mana potion from belt -- L2 or Start + Left: character sheet -- R2 or Start + Right: inventory -- Left analog click or Start + Down: toggle automap -- Start + Up or Start + Select: game menu -- Start + Left: character info -- Start + Right: inventory +- L2: character sheet (alt: Start + L1 or ←) +- R2: inventory (alt: Start + L2 or →) +- Left analog click: toggle automap (alt: Start + ↓) +- Start + Select: game menu (alt: Start + ↑) - Select + A/B/X/Y: Spell hotkeys - Right analog: move automap or simulate mouse -- Right analog click or Select + L1: left mouse click -- Select + Right analog click or Select + R1: right mouse click -- Select + L2 or Start + Y: quest log -- Select + R2 or Start + B: spell book +- Right analog click: left mouse click (alt: Select + L1) +- Select + Right analog click: right mouse click (alt: Select + R1) +- Select + L2: quest log (alt: Start + Y) +- Select + R2: spell book (alt: Start + B) Source: https://github.com/diasurgical/devilutionX/ diff --git a/README.md b/README.md index b58ca1aac..5a8ff37e4 100644 --- a/README.md +++ b/README.md @@ -282,7 +282,7 @@ All games are encrypted and password protected. DevilutionX supports gamepad controls. -Default controller mappings (A/B/X/Y as in Nintendo layout, so the rightmost button is attack): +Default controller mappings (A/B/X/Y as in Nintendo layout, so the rightmost button is attack; A ○, B ×, X △, Y □): - Left analog or D-Pad: move hero - A: attack nearby enemies, talk to townspeople and merchants, pickup/place items in the inventory, OK while in main menu @@ -291,18 +291,16 @@ Default controller mappings (A/B/X/Y as in Nintendo layout, so the rightmost but - Y: cast spell, delete character while in main menu - L1: use health item from belt - R1: use mana potion from belt -- L2 or Start + Left: character sheet -- R2 or Start + Right: inventory -- Left analog click or Start + Down: toggle automap -- Start + Up or Start + Select: game menu -- Start + Left: character info -- Start + Right: inventory +- L2: character sheet (alt: Start + L1 or ←) +- R2: inventory (alt: Start + L2 or →) +- Left analog click: toggle automap (alt: Start + ↓) +- Start + Select: game menu (alt: Start + ↑) - Select + A/B/X/Y: Spell hotkeys - Right analog: move automap or simulate mouse -- Right analog click or Select + L1: left mouse click -- Select + Right analog click or Select + R1: right mouse click -- Select + L2 or Start + Y: quest log -- Select + R2 or Start + B: spell book +- Right analog click: left mouse click (alt: Select + L1) +- Select + Right analog click: right mouse click (alt: Select + R1) +- Select + L2: quest log (alt: Start + Y) +- Select + R2: spell book (alt: Start + B) For now, they can be re-mapped by changing `SourceX/controls` or by setting the `SDL_GAMECONTROLLERCONFIG` environment variable (see diff --git a/SourceX/controls/game_controls.cpp b/SourceX/controls/game_controls.cpp index f245ebbb4..ae99b6763 100644 --- a/SourceX/controls/game_controls.cpp +++ b/SourceX/controls/game_controls.cpp @@ -148,6 +148,14 @@ bool GetGameAction(const SDL_Event &event, GameAction *action) if (!ctrl_event.up) *action = GameAction(GameActionType::TOGGLE_QUEST_LOG); return true; + case ControllerButton::BUTTON_LEFTSHOULDER: + if (!ctrl_event.up) + *action = GameAction(GameActionType::TOGGLE_CHARACTER_INFO); + return true; + case ControllerButton::BUTTON_RIGHTSHOULDER: + if (!ctrl_event.up) + *action = GameAction(GameActionType::TOGGLE_INVENTORY); + return true; default: return true; } From ac1e6811acfce1283f17c8d83f01450ff94025ec Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Tue, 10 Mar 2020 07:15:40 +0000 Subject: [PATCH 03/35] Add user manuals for OD, RetroFW, and Switch --- Packaging/switch/readme.txt | 47 -------------------------- README.md | 8 +++++ docs/manual/platforms/gkd350h.md | 42 +++++++++++++++++++++++ docs/manual/platforms/retrofw.md | 54 +++++++++++++++++++++++++++++ docs/manual/platforms/rg350.md | 58 ++++++++++++++++++++++++++++++++ docs/manual/platforms/switch.md | 46 +++++++++++++++++++++++++ 6 files changed, 208 insertions(+), 47 deletions(-) delete mode 100644 Packaging/switch/readme.txt create mode 100644 docs/manual/platforms/gkd350h.md create mode 100644 docs/manual/platforms/retrofw.md create mode 100644 docs/manual/platforms/rg350.md create mode 100644 docs/manual/platforms/switch.md diff --git a/Packaging/switch/readme.txt b/Packaging/switch/readme.txt deleted file mode 100644 index 8c1766fee..000000000 --- a/Packaging/switch/readme.txt +++ /dev/null @@ -1,47 +0,0 @@ -# Nintendo Switch Port of DevilutionX (Diablo) - -# How To Install: - - Put `devilutionx.nro` and `CharisSILB.ttf` in into `/switch/devilutionx` - - Copy diabdat.mpq from your CD (or GoG install folder) to `/switch/devilutionx`. Make sure it is all lowercase. - - Launch `devilutionx.nro`. (Do not use album to launch; see the note below.) - - *Note:* Hold R on any installed game and launch it. Do not use album to launch. If you use album, the homebrew will only have a small amount memory available, and the touch keyboard won't work. This is true for all homebrew, not just DevilutionX. - -# Joycon Controls -- Left analog or D-Pad: move hero -- A: attack nearby enemies, talk to townspeople and merchants, pickup/place items in the inventory, OK while in main menu -- B: select spell, back while in menus -- X: pickup items, open nearby chests and doors, use item in the inventory -- Y: cast spell, delete character while in main menu -- L: use health item from belt -- R: use mana potion from belt -- ZL or Start + Left: character sheet -- ZR or Start + Right: inventory -- Left analog click or Start + Down: toggle automap -- Start + Up or Start + Select: game menu -- Start + Left: character info -- Start + Right: inventory -- Select + A/B/X/Y: Spell hotkeys -- Right analog: move automap or simulate mouse -- Right analog click or Select + L: left mouse click -- Select + Right analog click or Select + R: right mouse click -- Select + ZL or Start + Y: quest log -- Select + ZR or Start + B: spell book - -# Touch Controls - - Single finger drag: move the mouse pointer (pointer jumps to finger) - - Single short tap: left mouse click - - Single short tap while holding a second finger down: right mouse click - - Dual finger drag: drag'n'drop (left mouse button is held down) - - Three finger drag: drag'n'drop (right mouse button is held down) - -# Credits - - See list of contributors https://github.com/diasurgical/devilutionX/graphs/contributors - -# Legal -This software is being released to the Public Domain. No assets of Diablo are being provided. You must own a copy of Diablo and have access to the assets beforehand in order to use this software. - -Battle.net® - Copyright © 1996 Blizzard Entertainment, Inc. All rights reserved. Battle.net and Blizzard Entertainment are trademarks or registered trademarks of Blizzard Entertainment, Inc. in the U.S. and/or other countries. - -Diablo® - Copyright © 1996 Blizzard Entertainment, Inc. All rights reserved. Diablo and Blizzard Entertainment are trademarks or registered trademarks of Blizzard Entertainment, Inc. in the U.S. and/or other countries. - -This software is in no way associated with or endorsed by Blizzard Entertainment®. diff --git a/README.md b/README.md index 5a8ff37e4..a19d3b954 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,8 @@ DEVKITPRO= Packaging/switch/build.sh ``` The nro-file will be generated in the build folder. Test with an emulator (RyuJinx) or real hardware. + +[Nintendo Switch manual](docs/manual/platforms/switch.md)
Haiku @@ -204,6 +206,12 @@ Replace `` with one of: `retrofw`, `rg350`, or `gkd350h`. This prepares and uses the buildroot at `$HOME/buildroot-$PLATFORM-devilutionx`. +End-user manuals are available here: + +* [RetroFW manual](docs/manual/platforms/retrofw.md) +* [RG-350 manual](docs/manual/platforms/rg350.md) +* [GKD350h manual](docs/manual/platforms/gkd350h.md) +
Clockwork PI GameShell diff --git a/docs/manual/platforms/gkd350h.md b/docs/manual/platforms/gkd350h.md new file mode 100644 index 000000000..1094cad38 --- /dev/null +++ b/docs/manual/platforms/gkd350h.md @@ -0,0 +1,42 @@ +# DevilutionX (Diablo 1) for GKD350h + +![gkd-350h-devilutionx](https://user-images.githubusercontent.com/216339/73123835-32e41080-3f8c-11ea-970c-8dd159c6e4ef.jpg) + +## Installation + +1. Copy [devilutionx-gkd350h.opk](https://github.com/diasurgical/devilutionX/releases/latest/download/devilutionx-gkd350h.opk) to `/media/data/apps` or `/media/sdcard/apps/`. +2. Copy `diabdat.mpq` (**all lowercase**) from your CD, or GoG install folder to: + + ~~~ + /usr/local/home/.local/share/diasurgical/devilution/diabdat.mpq + ~~~ + +## Controls + +- Joystick / D-Pad: move hero +- ○: attack nearby enemies, talk to townspeople and merchants, pickup/place items in the inventory, OK while in main menu +- ×: select spell, back while in menus +- △: pickup items, open nearby chests and doors, use item in the inventory +- □: cast spell, delete character while in main menu +- L: use health item from belt +- R: use mana potion from belt +- Select + ↑: game menu +- Select + L or ←: character info +- Select + R or →: inventory +- Select + ↓: map +- Select + □: Quest log +- Select + ×: Spell book +- Start + △○×□: Quick spell hotkeys + +## Known issues / quirks + +* Start and Select are swapped in this version because Start + D-Pad controls backlight on the GKD350h. +* There is nothing to map mouse emulation to in this version because of this but it isn't necessary to play the game. Unfortunately, this also means that you can't move the automap. +* This version looks uglier than on RG350 because it uses software scaling beacuse the IPU on the GKD350h doesn't work. + +Saves are compatible with PC saves from Diablo 1 and DevilutionX. + +## Resources + +* Discord: https://discord.gg/aQBQdDe +* GitHub: https://github.com/diasurgical/devilutionX diff --git a/docs/manual/platforms/retrofw.md b/docs/manual/platforms/retrofw.md new file mode 100644 index 000000000..995bceb08 --- /dev/null +++ b/docs/manual/platforms/retrofw.md @@ -0,0 +1,54 @@ +# DevilutionX (Diablo 1) for RetroFW (RG300/RS-97/RS-07/LDK) + +Demo video: + + + +## Installation + +**Requires RetroFW 2.0+.** + +1. Install [devilutionx-retrofw.ipk](https://github.com/diasurgical/devilutionX/releases/latest/download/devilutionx-retrofw.ipk) using the Explorer app. +2. Copy `diabdat.mpq` (**all lowercase**) from your CD, or GoG install folder to: + + ~~~ + ~/.local/share/diasurgical/devilution + ~~~ + +`~` is your home directory, `/home/retrofw` by default. + +## Controls + +- D-pad: move hero +- A: attack nearby enemies, talk to townspeople and merchants, pickup/place items in the inventory, OK while in main menu +- B: select spell, back while in menus +- X: pickup items, open nearby chests and doors, use item in the inventory +- Y: cast spell, delete character while in main menu +- R: use mana potion from belt +- L: use health item from belt +- Start + Select: game menu (alt: Start + ↑) +- Start + L or ←: character info +- Start + R or →: inventory +- Start + ↓: map +- Start + Y: Quest log +- Start + B: Spell book +- Select + A/B/X/Y: hot spell +- Select + D-pad: move map/cursor +- Select + L: left mouse click +- Select + R: right mouse click +- Suspend: map + +--- + +Game saves and `diablo.ini` are located at: + +~~~ +~/.local/share/diasurgical/devilution +~~~ + +Saves are compatible with PC saves from Diablo 1 and DevilutionX. + +## Resources + +* Discord: https://discord.gg/aQBQdDe +* GitHub: https://github.com/diasurgical/devilutionX diff --git a/docs/manual/platforms/rg350.md b/docs/manual/platforms/rg350.md new file mode 100644 index 000000000..3d621edec --- /dev/null +++ b/docs/manual/platforms/rg350.md @@ -0,0 +1,58 @@ +# DevilutionX (Diablo 1) for the RG-350 handheld + +Demo video: + + + +## Installation + +**Requires firmware v1.5+** + +1. Copy [devilutionx-rg350.opk](https://github.com/diasurgical/devilutionX/releases/latest/download/devilutionx-rg350.opk) to `/media/sdcard/APPS/`. + +2. Copy `diabdat.mpq` (**all lowercase**) from your CD, or GoG install folder to: + + ~~~ + /media/home/.local/share/diasurgical/devilution/diabdat.mpq + ~~~ + + **NOTE:** You can copy `diabdat.mpq` to sdcard instead and create a symlink at the expected location. To do this, SSH into your RG350 and run: + + ~~~bash + ln -sf /media/sdcard/ /media/home/.local/share/diasurgical/devilution/diabdat.mpq + ~~~ + +## Controls + +- Left analog or D-Pad: move hero +- A: attack nearby enemies, talk to townspeople and merchants, pickup/place items in the inventory, OK while in main menu +- B: select spell, back while in menus +- X: pickup items, open nearby chests and doors, use item in the inventory +- Y: cast spell, delete character while in main menu +- L1: use health item from belt +- R1: use mana potion from belt +- L2: character sheet (alt: Start + L1 or ←) +- R2: inventory (alt: Start + L2 or →) +- Left analog click: toggle automap (alt: Start + ↓) +- Start + Select: game menu (alt: Start + ↑) +- Select + A/B/X/Y: Spell hotkeys +- Right analog: move automap or simulate mouse +- Right analog click: left mouse click (alt: Select + L1) +- Select + Right analog click: right mouse click (alt: Select + R1) +- Select + L2: quest log (alt: Start + Y) +- Select + R2: spell book (alt: Start + B) + +--- + +Game saves and `diablo.ini` are located at: + +~~~ +/media/home/.local/share/diasurgical/devilution/ +~~~ + +Saves are compatible with PC saves from Diablo 1 and DevilutionX. + +## Resources + +* Discord: https://discord.gg/aQBQdDe +* GitHub: https://github.com/diasurgical/devilutionX diff --git a/docs/manual/platforms/switch.md b/docs/manual/platforms/switch.md new file mode 100644 index 000000000..666158291 --- /dev/null +++ b/docs/manual/platforms/switch.md @@ -0,0 +1,46 @@ +# DevilutionX (Diablo 1) for Nintendo Switch + +## Installation + +1. Download and unzip [devilutionx-switch.zip](https://github.com/diasurgical/devilutionX/releases/latest/download/devilutionx-switch.zip). +2. Put [`devilutionx.nro] and `CharisSILB.ttf` in into `/switch/devilutionx` +3. Copy `diabdat.mpq` from your CD (or GoG install folder) to `/switch/devilutionx`. Make sure it is all lowercase. + +## Usage + +Launch `devilutionx.nro`. (Do not use album to launch; see the note below.) + +*Note:* Hold R on any installed game and launch it. Do not use album to launch. If you use album, the homebrew will only have a small amount memory available, and the touch keyboard won't work. This is true for all homebrew, not just DevilutionX. + +## Joycon Controls + +- Left analog or D-Pad: move hero +- A: attack nearby enemies, talk to townspeople and merchants, pickup/place items in the inventory, OK while in main menu +- B: select spell, back while in menus +- X: pickup items, open nearby chests and doors, use item in the inventory +- Y: cast spell, delete character while in main menu +- L: use health item from belt +- R: use mana potion from belt +- ZL: character sheet (alt: Start + L or ←) +- ZR: inventory (alt: Start + ZL or →) +- Left analog click: toggle automap (alt: Start + ↓) +- Start + Select: game menu (alt: Start + ↑) +- Select + A/B/X/Y: Spell hotkeys +- Right analog: move automap or simulate mouse +- Right analog click: left mouse click (alt: Select + L) +- Select + Right analog click: right mouse click (alt: Select + R) +- Select + ZL: quest log (alt: Start + Y) +- Select + ZR: spell book (alt: Start + B) + +## Touch Controls + +- Single finger drag: move the mouse pointer (pointer jumps to finger) +- Single short tap: left mouse click +- Single short tap while holding a second finger down: right mouse click +- Dual finger drag: drag'n'drop (left mouse button is held down) +- Three finger drag: drag'n'drop (right mouse button is held down) + +## Resources + +* Discord: https://discord.gg/aQBQdDe +* GitHub: https://github.com/diasurgical/devilutionX From 849a7c6301604e02242ce279a2a494209773b569 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Tue, 10 Mar 2020 10:28:11 +0100 Subject: [PATCH 04/35] Update switch.md --- docs/manual/platforms/switch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/manual/platforms/switch.md b/docs/manual/platforms/switch.md index 666158291..cc524238d 100644 --- a/docs/manual/platforms/switch.md +++ b/docs/manual/platforms/switch.md @@ -3,7 +3,7 @@ ## Installation 1. Download and unzip [devilutionx-switch.zip](https://github.com/diasurgical/devilutionX/releases/latest/download/devilutionx-switch.zip). -2. Put [`devilutionx.nro] and `CharisSILB.ttf` in into `/switch/devilutionx` +2. Put `devilutionx.nro` and `CharisSILB.ttf` in into `/switch/devilutionx` 3. Copy `diabdat.mpq` from your CD (or GoG install folder) to `/switch/devilutionx`. Make sure it is all lowercase. ## Usage From be4d8cbb01f62c6b21aeb7a7ea066a2276474fde Mon Sep 17 00:00:00 2001 From: gogogogi Date: Sat, 14 Mar 2020 16:25:45 +0100 Subject: [PATCH 05/35] Update debian build to 1.0.1 version (#660) --- Packaging/debian/changelog | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/Packaging/debian/changelog b/Packaging/debian/changelog index ce814f34f..71e243a51 100644 --- a/Packaging/debian/changelog +++ b/Packaging/debian/changelog @@ -1,3 +1,42 @@ +devilutionx (1.0.1) UNRELEASED; urgency=medium + + * New release + + * Features: + * Toggle fullscreen at any point by hitting alt+enter (mouse grab can be disabled in diablo.ini) + * Controller: B button closes the currently active panel. + * Added a navigation menu for controllers + * Focus on the exit item before quitting. + * Minor performance improvements (save/load time and main menu). + * Add a list of known mods + + + * Platforms: + * Added support for ppc64le + * Added support for Amiga + * Added support Clockwork PI GameShell + * Added support for GKD350h + * Switch to OPK for RetroFW (requires 2.0) + * Update OpendDingus/RetroFW build root + + + * Bugfixes: + * Game crashing on systems that do not report monitor refresh rate. + * Fixed belt not working correctly when holding shift on us keyboard layouts + * Always keep track of the latest hero level when selecting difficulty. + * Correct screenshot path + * Turn the screen red for 200ms when taking screenshots. + * Fix town load screen missing on the first load for 32bit systems. + * Fix minor HOM issue at some houses in town. + * Allow for space as text input + * Fixed a couple of typos in error messages + + * Original Diablo bugs: + * Fix belt not working correctly when holding shift on *non-*us keyboard layouts + * Fix one more rare crash. + + -- Goran Vidovic (gogo) Sat, 14 Mar 2020 16:10:11 +0200 + devilutionx (1.0.0) UNRELEASED; urgency=medium * New release From 7acbb29f7cf9c9e7f147d45e8982b8cc755c17c1 Mon Sep 17 00:00:00 2001 From: qndel Date: Tue, 17 Mar 2020 13:28:18 +0100 Subject: [PATCH 06/35] fix typo in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a19d3b954..e1ecd80ed 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Nightly builds | Platform # How To Play: - Download [the latest DevilutionX release](https://github.com/diasurgical/devilutionX/releases), or build from source - - Copy diabdat.mpq from your CD or GoG installation (or [extract it from the GoG installer](https://github.com/diasurgical/devilutionX/wiki/Extracting-the-DIABDAT.MPQ-from-the-GoG-installer)) to the DevilutionX install folder or data folder; make sure it is all lowercase. The DeviliutionX install folder is the one that contains the DevilutionX executable. The data folder path may differ depending on OS version and security settings, but will normally be as follows: + - Copy diabdat.mpq from your CD or GoG installation (or [extract it from the GoG installer](https://github.com/diasurgical/devilutionX/wiki/Extracting-the-DIABDAT.MPQ-from-the-GoG-installer)) to the DevilutionX install folder or data folder; make sure it is all lowercase. The DevilutionX install folder is the one that contains the DevilutionX executable. The data folder path may differ depending on OS version and security settings, but will normally be as follows: - macOS `~/Library/Application Support/diasurgical/devilution` - Linux `~/.local/share/diasurgical/devilution/` - Windows `C:\Users\[username]\AppData\Roaming\diasurgical\devilution` From 95cf5013a4c0786fbd1095d5cdcf3b7bc1be8a10 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Sun, 22 Mar 2020 13:28:38 +0000 Subject: [PATCH 07/35] docs/manual: Fix typo --- Packaging/OpenDingux/rg350-manual.txt | 2 +- docs/manual/platforms/rg350.md | 2 +- docs/manual/platforms/switch.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Packaging/OpenDingux/rg350-manual.txt b/Packaging/OpenDingux/rg350-manual.txt index 3ffaa14bf..eef971c37 100644 --- a/Packaging/OpenDingux/rg350-manual.txt +++ b/Packaging/OpenDingux/rg350-manual.txt @@ -16,7 +16,7 @@ Controls: - L1: use health item from belt - R1: use mana potion from belt - L2: character sheet (alt: Start + L1 or ←) -- R2: inventory (alt: Start + L2 or →) +- R2: inventory (alt: Start + R1 or →) - Left analog click: toggle automap (alt: Start + ↓) - Start + Select: game menu (alt: Start + ↑) - Select + A/B/X/Y: Spell hotkeys diff --git a/docs/manual/platforms/rg350.md b/docs/manual/platforms/rg350.md index 3d621edec..eed8a608e 100644 --- a/docs/manual/platforms/rg350.md +++ b/docs/manual/platforms/rg350.md @@ -32,7 +32,7 @@ Demo video: - L1: use health item from belt - R1: use mana potion from belt - L2: character sheet (alt: Start + L1 or ←) -- R2: inventory (alt: Start + L2 or →) +- R2: inventory (alt: Start + R1 or →) - Left analog click: toggle automap (alt: Start + ↓) - Start + Select: game menu (alt: Start + ↑) - Select + A/B/X/Y: Spell hotkeys diff --git a/docs/manual/platforms/switch.md b/docs/manual/platforms/switch.md index cc524238d..92bdd026b 100644 --- a/docs/manual/platforms/switch.md +++ b/docs/manual/platforms/switch.md @@ -22,7 +22,7 @@ Launch `devilutionx.nro`. (Do not use album to launch; see the note below.) - L: use health item from belt - R: use mana potion from belt - ZL: character sheet (alt: Start + L or ←) -- ZR: inventory (alt: Start + ZL or →) +- ZR: inventory (alt: Start + R or →) - Left analog click: toggle automap (alt: Start + ↓) - Start + Select: game menu (alt: Start + ↑) - Select + A/B/X/Y: Spell hotkeys From b80f24d08ebe7917953b5541d3cda1e9227f3125 Mon Sep 17 00:00:00 2001 From: Alex Sweet Date: Mon, 23 Mar 2020 01:59:33 -0700 Subject: [PATCH 08/35] Fix ninja-build build error --- CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a8f0c4492..89051b7bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -502,8 +502,14 @@ endif() if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC") # Change __FILE__ to only show the path relative to the project folder - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-builtin-macro-redefined -D'__FILE__=\"$(subst $(realpath ${CMAKE_SOURCE_DIR})/,,$(abspath $<))\"'") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-builtin-macro-redefined -D'__FILE__=\"$(subst $(realpath ${CMAKE_SOURCE_DIR})/,,$(abspath $<))\"'") + get_target_property(devilution_SRCS devilution SOURCES) + foreach(SOURCE_FILE ${devilution_SRCS} ${devilutionx_SRCS}) + set_source_files_properties(${SOURCE_FILE} PROPERTIES + COMPILE_DEFINITIONS __FILE__="${SOURCE_FILE}" + ) + endforeach(SOURCE_FILE) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-builtin-macro-redefined") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-builtin-macro-redefined") if(DEBUG) # Note: For Valgrind suppor. From b152633011ac20382dc9567ec0bcb5d7af8a348c Mon Sep 17 00:00:00 2001 From: Yuri Pourre Date: Fri, 27 Mar 2020 19:24:45 -0300 Subject: [PATCH 09/35] Bugfix: allows resize when fullscreen is toggled --- SourceX/display.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SourceX/display.cpp b/SourceX/display.cpp index 97302b420..653787743 100644 --- a/SourceX/display.cpp +++ b/SourceX/display.cpp @@ -80,7 +80,10 @@ bool SpawnWindow(const char *lpWindowName, int nWidth, int nHeight) #else int flags = 0; if (upscale) { - flags |= fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : SDL_WINDOW_RESIZABLE; + if (fullscreen) { + flags |= SDL_WINDOW_FULLSCREEN_DESKTOP; + } + flags |= SDL_WINDOW_RESIZABLE; char scaleQuality[2] = "2"; DvlStringSetting("scaling quality", scaleQuality, 2); From e993e3497131cddb250de5fd1c9a7b8599c04347 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Sat, 28 Mar 2020 12:54:06 +0000 Subject: [PATCH 10/35] Fix CI Debian Stretch build (#678) The cmake package in debian-stretch has recently been updated: https://packages.debian.org/stretch-backports/cmake This new version of cmake depends on a version of libarchive13 that is only available in stretch-backports-sloppy. To allow libarchive13 to be installed from stretch-backports-sloppy I've added the debian-stretch-sloppy "suite" and changed -t stretch-backports to -t 'stretch-backports*'. --- .circleci/config.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a63c2aa07..8e33959b4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,9 +6,10 @@ jobs: working_directory: ~/repo steps: - checkout + - run: echo deb http://deb.debian.org/debian stretch-backports-sloppy main >> /etc/apt/sources.list.d/debian-backports.list - run: apt-get update -y - run: apt-get install -y g++ libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev git - - run: apt-get install -y -t stretch-backports cmake libsodium-dev + - run: apt-get install -y -t 'stretch-backports*' cmake libsodium-dev - run: cd build && cmake .. -DNIGHTLY_BUILD=ON - run: cd build && cmake --build . -j $(nproc) - store_artifacts: {path: ./build/devilutionx, destination: devilutionx_linux_x86_64} @@ -30,9 +31,10 @@ jobs: working_directory: ~/repo steps: - checkout + - run: echo deb http://deb.debian.org/debian stretch-backports-sloppy main >> /etc/apt/sources.list.d/debian-backports.list - run: apt-get update -y - run: apt-get install -y g++ libsdl-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev git - - run: apt-get install -y -t stretch-backports cmake libsodium-dev + - run: apt-get install -y -t 'stretch-backports*' cmake libsodium-dev - run: cd build && cmake .. -DNIGHTLY_BUILD=ON -DUSE_SDL1=ON - run: cd build && cmake --build . -j $(nproc) - store_artifacts: {path: ./build/devilutionx, destination: devilutionx_linux_x86_64_sdl1} @@ -42,10 +44,11 @@ jobs: working_directory: ~/repo steps: - checkout + - run: echo deb http://deb.debian.org/debian stretch-backports-sloppy main >> /etc/apt/sources.list.d/debian-backports.list - run: dpkg --add-architecture i386 - run: apt-get update -y - run: apt-get install -y g++-multilib libsdl2-dev:i386 libsdl2-mixer-dev:i386 libsdl2-ttf-dev:i386 libsodium-dev git - - run: apt-get install -y -t stretch-backports cmake libsodium-dev:i386 + - run: apt-get install -y -t 'stretch-backports*' cmake libsodium-dev:i386 - run: cd build && cmake -DNIGHTLY_BUILD=ON -DCMAKE_TOOLCHAIN_FILE=../CMake/32bit.cmake .. - run: cd build && cmake --build . -j $(nproc) - store_artifacts: {path: ./build/devilutionx, destination: devilutionx_linux_x86} @@ -77,7 +80,8 @@ jobs: steps: - checkout - run: echo deb http://deb.debian.org/debian stretch-backports main > /etc/apt/sources.list.d/debian-backports.list - - run: apt-get update && apt-get install -y -t stretch-backports cmake + - run: echo deb http://deb.debian.org/debian stretch-backports-sloppy main >> /etc/apt/sources.list.d/debian-backports.list + - run: apt-get update && apt-get install -y -t 'stretch-backports*' cmake - run: dkp-pacman -Syu --noconfirm # Install cmake files (https://github.com/devkitPro/docker/issues/3) - run: dkp-pacman -S --needed --noconfirm --quiet devkitpro-pkgbuild-helpers From fda76393efed2911571213895b11e0b6aeaf7432 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Sat, 4 Apr 2020 07:53:30 +0100 Subject: [PATCH 11/35] docs/manual/platforms/retrofw.md: ipk -> opk --- docs/manual/platforms/retrofw.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/manual/platforms/retrofw.md b/docs/manual/platforms/retrofw.md index 995bceb08..c458706cb 100644 --- a/docs/manual/platforms/retrofw.md +++ b/docs/manual/platforms/retrofw.md @@ -8,7 +8,7 @@ Demo video: **Requires RetroFW 2.0+.** -1. Install [devilutionx-retrofw.ipk](https://github.com/diasurgical/devilutionX/releases/latest/download/devilutionx-retrofw.ipk) using the Explorer app. +1. Copy [devilutionx-retrofw.opk](https://github.com/diasurgical/devilutionX/releases/latest/download/devilutionx-retrofw.opk) to the apps directory. 2. Copy `diabdat.mpq` (**all lowercase**) from your CD, or GoG install folder to: ~~~ From cda77d0068147800065515583322593a95e37204 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Sat, 4 Apr 2020 07:25:08 +0100 Subject: [PATCH 12/35] Update RG350 defconfig I've recently done some massive updates to the buildroot, necessitating some minor changes to the defconfig here. Good news: The buildroot use GCC 5.4 and newer binutils, so it now builds with LTO. --- Packaging/OpenDingux/rg350_devilutionx_defconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Packaging/OpenDingux/rg350_devilutionx_defconfig b/Packaging/OpenDingux/rg350_devilutionx_defconfig index d1cb6e24f..40457fc24 100644 --- a/Packaging/OpenDingux/rg350_devilutionx_defconfig +++ b/Packaging/OpenDingux/rg350_devilutionx_defconfig @@ -3,11 +3,12 @@ BR2_mips_xburst=y # BR2_MIPS_SOFT_FLOAT is not set BR2_OPTIMIZE_2=y BR2_KERNEL_HEADERS_3_12=y +BR2_UCLIBC_CONFIG="board/opendingux/gcw0/uclibc.config" BR2_TOOLCHAIN_BUILDROOT_LARGEFILE=y BR2_TOOLCHAIN_BUILDROOT_INET_IPV6=y BR2_TOOLCHAIN_BUILDROOT_WCHAR=y BR2_BINUTILS_EXTRA_CONFIG_OPTIONS="--enable-lto" -BR2_GCC_VERSION_4_9_X=y +BR2_GCC_VERSION_5_X=y BR2_EXTRA_GCC_CONFIG_OPTIONS="--enable-lto" BR2_TOOLCHAIN_BUILDROOT_CXX=y BR2_PACKAGE_SDL=y From 741cdb249480698bb094e5536b61f0bfa4a83474 Mon Sep 17 00:00:00 2001 From: BDC Date: Fri, 17 Apr 2020 19:03:44 +1200 Subject: [PATCH 13/35] Fix memory leak with audio stream not been released SFileChunk was not been release. --- 3rdParty/Storm/Source/storm.h | 1 + Source/effects.cpp | 1 + SourceX/storm/storm.cpp | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/3rdParty/Storm/Source/storm.h b/3rdParty/Storm/Source/storm.h index dd5548da2..86d8a9f10 100644 --- a/3rdParty/Storm/Source/storm.h +++ b/3rdParty/Storm/Source/storm.h @@ -200,6 +200,7 @@ BOOL STORMAPI SFileCloseArchive(HANDLE hArchive); BOOL STORMAPI SFileCloseFile(HANDLE hFile); BOOL STORMAPI SFileDdaBeginEx(HANDLE hFile, DWORD flags, DWORD mask, unsigned __int32 lDistanceToMove, signed __int32 volume, signed int pan, int a7); +void SFileFreeChunk(); BOOL STORMAPI SFileDdaDestroy(); BOOL STORMAPI SFileDdaEnd(HANDLE hFile); BOOL STORMAPI SFileDdaGetPos(HANDLE hFile, DWORD *current, DWORD *end); diff --git a/Source/effects.cpp b/Source/effects.cpp index 6805324a2..7dfef38fc 100644 --- a/Source/effects.cpp +++ b/Source/effects.cpp @@ -920,6 +920,7 @@ void sfx_stop() if (sfx_stream) { SFileDdaEnd(sfx_stream); SFileCloseFile(sfx_stream); + SFileFreeChunk(); sfx_stream = NULL; sfx_data_cur = NULL; } diff --git a/SourceX/storm/storm.cpp b/SourceX/storm/storm.cpp index 8ea220ab8..9325c0998 100644 --- a/SourceX/storm/storm.cpp +++ b/SourceX/storm/storm.cpp @@ -103,6 +103,12 @@ BOOL SFileDdaBeginEx(HANDLE hFile, DWORD flags, DWORD mask, unsigned __int32 lDi return true; } +void SFileFreeChunk() +{ + if(SFileChunk) + Mix_FreeChunk(SFileChunk); +} + BOOL SFileDdaDestroy() { Mix_FreeChunk(SFileChunk); From 5c02cb96e579a61540aa1cc4ecbaf1ee2d195e42 Mon Sep 17 00:00:00 2001 From: rsn8887 Date: Thu, 14 May 2020 22:25:23 -0500 Subject: [PATCH 14/35] Fix building with latest SDL2 on Switch --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 89051b7bc..7bee2b286 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -137,7 +137,11 @@ if(USE_SDL1) find_package(SDL_mixer REQUIRED) include_directories(${SDL_INCLUDE_DIR}) else() - find_package(SDL2 CONFIG QUIET) + if(SWITCH) + find_package(SDL2_STATIC CONFIG QUIET) + else() + find_package(SDL2 CONFIG QUIET) + endif() if (NOT SDL2_FOUND) find_package(SDL2 REQUIRED) endif() From c8f9219d359694afddd0a8c6e3ddaa071ded809e Mon Sep 17 00:00:00 2001 From: Marek Majkowski Date: Tue, 17 Mar 2020 13:43:53 +0000 Subject: [PATCH 15/35] Bugfix: allow players of level 20 to enter nightmare game Right now we update heroLevel only on "CreateGame" code. This means you can't enter nightmare/hell game at all - unless you do createGame first. Let's set the heroLevel global variable in both create and join game cases. --- SourceX/DiabloUI/selgame.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SourceX/DiabloUI/selgame.cpp b/SourceX/DiabloUI/selgame.cpp index d43d2a7ee..0b409c7eb 100644 --- a/SourceX/DiabloUI/selgame.cpp +++ b/SourceX/DiabloUI/selgame.cpp @@ -145,10 +145,11 @@ void selgame_GameSelection_Select(int value) selgame_enteringGame = true; selgame_selectedGame = value; + gfnHeroInfo(UpdateHeroLevel); + switch (value) { case 0: strcpy(title, "Create Game"); - gfnHeroInfo(UpdateHeroLevel); UiInitList(0, NUM_DIFFICULTIES - 1, selgame_Diff_Focus, selgame_Diff_Select, selgame_Diff_Esc, SELDIFF_DIALOG, size(SELDIFF_DIALOG)); break; case 1: From aace1b46de4132fa837ad0e923c0680a1a696c03 Mon Sep 17 00:00:00 2001 From: Marcin Konicki Date: Thu, 21 May 2020 16:54:18 +0200 Subject: [PATCH 16/35] Implement `--save-dir` CLI option * Lazy load ini, this also fixes launching the game on Android --- 3rdParty/Storm/Source/storm.h | 1 + Source/diablo.cpp | 10 ++++++++++ SourceX/storm/storm.cpp | 16 ++++++++++++++-- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/3rdParty/Storm/Source/storm.h b/3rdParty/Storm/Source/storm.h index 86d8a9f10..fb7e10d38 100644 --- a/3rdParty/Storm/Source/storm.h +++ b/3rdParty/Storm/Source/storm.h @@ -5,6 +5,7 @@ namespace dvl { extern std::string basePath; +extern std::string prefPath; // Note to self: Linker error => forgot a return value in cpp diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 40f2d5d87..1a9323c6a 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -307,6 +307,7 @@ static void print_help_and_exit() printf(" %-20s %-30s\n", "-h, --help", "Print this message and exit"); printf(" %-20s %-30s\n", "--version", "Print the version and exit"); printf(" %-20s %-30s\n", "--data-dir", "Specify the folder of diabdat.mpq"); + printf(" %-20s %-30s\n", "--save-dir", "Specify the folder of save files"); printf(" %-20s %-30s\n", "-n", "Skip startup videos"); printf(" %-20s %-30s\n", "-f", "Display frames per second"); printf(" %-20s %-30s\n", "-x", "Run in windowed mode"); @@ -346,6 +347,15 @@ void diablo_parse_flags(int argc, char **argv) #else if (basePath.back() != '/') basePath += '/'; +#endif + } else if (strcasecmp("--save-dir", argv[i]) == 0) { + prefPath = argv[++i]; +#ifdef _WIN32 + if (prefPath.back() != '\\') + prefPath += '\\'; +#else + if (prefPath.back() != '/') + prefPath += '/'; #endif } else if (strcasecmp("-n", argv[i]) == 0) { showintrodebug = 0; diff --git a/SourceX/storm/storm.cpp b/SourceX/storm/storm.cpp index 9325c0998..339205ae3 100644 --- a/SourceX/storm/storm.cpp +++ b/SourceX/storm/storm.cpp @@ -18,6 +18,7 @@ namespace dvl { std::string basePath; +std::string prefPath; DWORD nLastError = 0; bool directFileAccess = false; @@ -36,7 +37,11 @@ static std::string getIniPath() return result; } -static radon::File ini(getIniPath()); +radon::File& getIni() { + static radon::File ini(getIniPath()); + return ini; +} + static Mix_Chunk *SFileChunk; void GetBasePath(char *buffer, size_t size) @@ -59,6 +64,11 @@ void GetBasePath(char *buffer, size_t size) void GetPrefPath(char *buffer, size_t size) { + if (prefPath.length()) { + snprintf(buffer, size, "%s", prefPath.c_str()); + return; + } + char *path = SDL_GetPrefPath("diasurgical", "devilution"); if (path == NULL) { buffer[0] = '\0'; @@ -341,7 +351,7 @@ bool getIniBool(const char *sectionName, const char *keyName, bool defaultValue) bool getIniValue(const char *sectionName, const char *keyName, char *string, int stringSize, int *dataSize) { - radon::Section *section = ini.getSection(sectionName); + radon::Section *section = getIni().getSection(sectionName); if (!section) return false; @@ -361,6 +371,8 @@ bool getIniValue(const char *sectionName, const char *keyName, char *string, int void setIniValue(const char *sectionName, const char *keyName, char *value, int len) { + radon::File& ini = getIni(); + radon::Section *section = ini.getSection(sectionName); if (!section) { ini.addSection(sectionName); From 9a70a5c644eacf00544bb567ff15c30367391794 Mon Sep 17 00:00:00 2001 From: Marcin Konicki Date: Thu, 28 May 2020 01:17:00 +0200 Subject: [PATCH 17/35] Prevent double free of sound chunk in storm (#744) --- SourceX/storm/storm.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/SourceX/storm/storm.cpp b/SourceX/storm/storm.cpp index 339205ae3..99bc309e5 100644 --- a/SourceX/storm/storm.cpp +++ b/SourceX/storm/storm.cpp @@ -42,7 +42,7 @@ radon::File& getIni() { return ini; } -static Mix_Chunk *SFileChunk; +static Mix_Chunk *SFileChunk = NULL; void GetBasePath(char *buffer, size_t size) { @@ -102,6 +102,10 @@ BOOL SFileDdaBeginEx(HANDLE hFile, DWORD flags, DWORD mask, unsigned __int32 lDi SDL_Log(SDL_GetError()); return false; } + if (SFileChunk) { + SFileDdaEnd(hFile); + SFileFreeChunk(); + } SFileChunk = Mix_LoadWAV_RW(rw, 1); free(SFXbuffer); @@ -115,13 +119,18 @@ BOOL SFileDdaBeginEx(HANDLE hFile, DWORD flags, DWORD mask, unsigned __int32 lDi void SFileFreeChunk() { - if(SFileChunk) + if (SFileChunk) { Mix_FreeChunk(SFileChunk); + SFileChunk = NULL; + } } BOOL SFileDdaDestroy() { - Mix_FreeChunk(SFileChunk); + if (SFileChunk) { + Mix_FreeChunk(SFileChunk); + SFileChunk = NULL; + } return true; } From b67dc43c052017940c42d3ec96a6c91343863f4a Mon Sep 17 00:00:00 2001 From: qndel Date: Mon, 20 Jul 2020 15:00:27 +0200 Subject: [PATCH 18/35] Update README.md new discord link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e1ecd80ed..839500221 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Nightly builds | Platform [![Build Status](https://travis-ci.org/diasurgical/devilutionX.svg?branch=master)](https://travis-ci.org/diasurgical/devilutionX) | macOS 64bit [![Build status](https://ci.appveyor.com/api/projects/status/1a0jus2372qvksht?svg=true)](https://ci.appveyor.com/project/AJenbo/devilutionx) | Windows 64bit (MSVC) -![Discord Channel](https://avatars3.githubusercontent.com/u/1965106?s=16&v=4) [Discord Chat Channel](https://discord.gg/aQBQdDe) +![Discord Channel](https://avatars3.githubusercontent.com/u/1965106?s=16&v=4) [Discord Chat Channel](https://discord.gg/YQKCAYQ) # How To Play: - Download [the latest DevilutionX release](https://github.com/diasurgical/devilutionX/releases), or build from source From a51231a121e7ec15610acf3870be4dbbd28bef8d Mon Sep 17 00:00:00 2001 From: rsn8887 Date: Sat, 1 Aug 2020 09:19:32 -0500 Subject: [PATCH 19/35] Fix compilation on Switch (#764) --- CMake/switch/devkita64-libnx.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMake/switch/devkita64-libnx.cmake b/CMake/switch/devkita64-libnx.cmake index 93da9b3bf..5e2e568e1 100644 --- a/CMake/switch/devkita64-libnx.cmake +++ b/CMake/switch/devkita64-libnx.cmake @@ -23,6 +23,13 @@ set(PORTLIBS_PATH ${DEVKITPRO}/portlibs) set(PORTLIBS ${PORTLIBS_PATH}/switch) set(CMAKE_FIND_ROOT_PATH ${DEVKITA64} ${LIBNX} ${PORTLIBS}) +# FIXME +# Workarounds to fix various linker errors +set(CMAKE_EXE_LINKER_FLAGS_INIT "-march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIE -ftls-model=local-exec -L${DEVKITPRO}/portlibs/switch/lib -L${DEVKITPRO}/libnx/lib -specs=${DEVKITPRO}/libnx/switch.specs") +set(CMAKE_MODULE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT}") +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS_INIT}") +set(CMAKE_EXE_MODULE_FLAGS "${CMAKE_EXE_MODULE_FLAGS_INIT}") + # Set absolute tool paths: set(TOOLCHAIN_PREFIX ${DEVKITA64}/bin/aarch64-none-elf-) if(WIN32) From 1ff6d9cc24f91d17086d30fa12868d1d93206bd5 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Wed, 2 Sep 2020 02:27:58 +0200 Subject: [PATCH 20/35] Fix nightly Windows x86 builds (#787) --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8e33959b4..4d924b358 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -66,8 +66,8 @@ jobs: - run: tar -xzf SDL2_ttf-devel-2.0.15-mingw.tar.gz - run: wget https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-devel-2.0.4-mingw.tar.gz - run: tar -xzf SDL2_mixer-devel-2.0.4-mingw.tar.gz - - run: wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.17-mingw.tar.gz - - run: tar -xzf libsodium-1.0.17-mingw.tar.gz --no-same-owner + - run: wget https://github.com/jedisct1/libsodium/releases/download/1.0.18-RELEASE/libsodium-1.0.18-mingw.tar.gz + - run: tar -xzf libsodium-1.0.18-mingw.tar.gz --no-same-owner - run: cp -r libsodium-win32/* /usr/i686-w64-mingw32 - run: cp -r SDL2*/i686-w64-mingw32 /usr - run: cd build && cmake -DNIGHTLY_BUILD=ON -DCMAKE_TOOLCHAIN_FILE=../CMake/mingwcc.cmake .. From 9997a6c09c10941c63137efb4f2aa8a3ab714c9a Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Wed, 2 Sep 2020 23:02:10 +0200 Subject: [PATCH 21/35] Use older devkitpro/devkita64 image As of 20200730 the latest devkitpro/devkita64 image has been failing to start because of UID issues. https://github.com/devkitPro/docker/issues/9 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4d924b358..2c63a1f1b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -75,7 +75,7 @@ jobs: - store_artifacts: {path: ./build/devilutionx.exe, destination: devilutionx_x86.exe} switch: docker: - - image: devkitpro/devkita64:latest + - image: devkitpro/devkita64:20200528 working_directory: ~/repo steps: - checkout From 9e4b25d3897691026e3635ba33b8dc16d1ac1a74 Mon Sep 17 00:00:00 2001 From: mgpat-gm <60494513+mgpat-gm@users.noreply.github.com> Date: Thu, 13 Aug 2020 12:55:25 -0400 Subject: [PATCH 22/35] typo: readme.md (#776) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 839500221..c0f842024 100644 --- a/README.md +++ b/README.md @@ -324,7 +324,7 @@ variable (see # F.A.Q. > Wow, does this mean I can download and play Diablo for free now? -No, you'll need access to the data from the original game. If you don't have an original CD then you can [buy Diablo from GoG.com](https://www.gog.com/game/diablo). Alternately you can use `spawn.mpq` from the [http://ftp.blizzard.com/pub/demos/diablosw.exe](shareware) version and compile the with the SPAWN flag defined. +No, you'll need access to the data from the original game. If you don't have an original CD then you can [buy Diablo from GoG.com](https://www.gog.com/game/diablo). Alternately you can use `spawn.mpq` from the [http://ftp.blizzard.com/pub/demos/diablosw.exe](shareware) version and compile with the SPAWN flag defined. > What game changes does DevilutionX provide DevilutionX's main focus is to make the game work on multiple platforms. An additional goal is to make the engine mod friendly. As such, there are no changes to gameplay, but we will be making some enhancments to the engine itself. For example, the engine now has upscaling, unlocked fps, controller support, and multiplayer via TCP. From c8da8d7e787f9d2801c8c5f08dbb4b9373a424c8 Mon Sep 17 00:00:00 2001 From: Juliano Leal Goncalves Date: Mon, 31 Aug 2020 22:38:46 -0300 Subject: [PATCH 23/35] Add integer scaling support. Disabled by default. --- SourceX/display.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SourceX/display.cpp b/SourceX/display.cpp index 653787743..f36c21a11 100644 --- a/SourceX/display.cpp +++ b/SourceX/display.cpp @@ -126,6 +126,12 @@ bool SpawnWindow(const char *lpWindowName, int nWidth, int nHeight) ErrSdl(); } + int integerScalingEnabled = 0; + DvlIntSetting("integer scaling", &integerScalingEnabled); + if (integerScalingEnabled && SDL_RenderSetIntegerScale(renderer, SDL_TRUE) < 0) { + ErrSdl(); + } + if (SDL_RenderSetLogicalSize(renderer, nWidth, nHeight) <= -1) { ErrSdl(); } From 78dbbcf4393f7eb8b64d3c5af7908b7368319c66 Mon Sep 17 00:00:00 2001 From: Juliano Leal Goncalves Date: Thu, 3 Sep 2020 21:20:30 -0300 Subject: [PATCH 24/35] Mark executable as DPI aware (per monitor) --- CMakeLists.txt | 1 + SourceX/devilutionx.exe.manifest | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 SourceX/devilutionx.exe.manifest diff --git a/CMakeLists.txt b/CMakeLists.txt index 7bee2b286..b76673863 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -294,6 +294,7 @@ set(devilutionx_SRCS SourceX/DiabloUI/title.cpp SourceX/DiabloUI/ttf_render_wrapped.cpp SourceX/main.cpp + SourceX/devilutionx.exe.manifest Packaging/macOS/AppIcon.icns Packaging/resources/CharisSILB.ttf Packaging/windows/devilutionx.rc) diff --git a/SourceX/devilutionx.exe.manifest b/SourceX/devilutionx.exe.manifest new file mode 100644 index 000000000..ac9b4cc55 --- /dev/null +++ b/SourceX/devilutionx.exe.manifest @@ -0,0 +1,8 @@ + + + + + true/pm + + + From b2a1bdfdc32c54024f1909049253b8969f1822ba Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Mon, 28 Sep 2020 07:57:35 +0200 Subject: [PATCH 25/35] Apply fade out to all colors Fixes #795 --- Source/capture.cpp | 2 +- Source/palette.cpp | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Source/capture.cpp b/Source/capture.cpp index 56379b44b..e0e9b4bdd 100644 --- a/Source/capture.cpp +++ b/Source/capture.cpp @@ -163,7 +163,7 @@ void CaptureScreen() SDL_Log("Screenshot saved at %s", FileName); } SDL_Delay(300); - for (int i = 0; i < 255; i++) { + for (int i = 0; i < 256; i++) { system_palette[i] = palette[i]; } palette_update(); diff --git a/Source/palette.cpp b/Source/palette.cpp index ad2b3a966..eb1cb4c36 100644 --- a/Source/palette.cpp +++ b/Source/palette.cpp @@ -31,11 +31,9 @@ void ApplyGamma(SDL_Color *dst, const SDL_Color *src, int n) g = gamma_correction / 100.0; for (i = 0; i < n; i++) { - dst->r = pow(src->r / 256.0, g) * 256.0; - dst->g = pow(src->g / 256.0, g) * 256.0; - dst->b = pow(src->b / 256.0, g) * 256.0; - dst++; - src++; + dst[i].r = pow(src[i].r / 256.0, g) * 256.0; + dst[i].g = pow(src[i].g / 256.0, g) * 256.0; + dst[i].b = pow(src[i].b / 256.0, g) * 256.0; } force_redraw = 255; } @@ -150,7 +148,7 @@ void SetFadeLevel(DWORD fadeval) { int i; - for (i = 0; i < 255; i++) { + for (i = 0; i < 256; i++) { system_palette[i].r = (fadeval * logical_palette[i].r) >> 8; system_palette[i].g = (fadeval * logical_palette[i].g) >> 8; system_palette[i].b = (fadeval * logical_palette[i].b) >> 8; From 9ff05d0bda17af1388406aeb1ff1ddeee8b546c9 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Tue, 29 Sep 2020 23:34:38 +0200 Subject: [PATCH 26/35] Add note about the the non-commerical nature of the project --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c0f842024..d4a2679a1 100644 --- a/README.md +++ b/README.md @@ -348,7 +348,9 @@ Battle.net is a service provided by Blizzard. We are not associated with them, s [From the beginning until release](docs/CHANGELOG.md) # Legal -DevilutionX is released to the Public Domain. The documentation and functionality provided by Devilution may only be utilized with assets provided by ownership of Diablo. +DevilutionX is released to the Public Domain. The documentation and functionality provided by DevilutionX may only be utilized with assets provided by ownership of Diablo. + +The source code in this repository is for non-commerical use only. If you use the source code you may not charge others for access to it or any derivative work thereof. Diablo® - Copyright © 1996 Blizzard Entertainment, Inc. All rights reserved. Diablo and Blizzard Entertainment are trademarks or registered trademarks of Blizzard Entertainment, Inc. in the U.S. and/or other countries. From 56243d9e05b3b2da26398e56a4fd9952ea4263bd Mon Sep 17 00:00:00 2001 From: Colin Pitrat Date: Sat, 3 Oct 2020 10:30:29 +0100 Subject: [PATCH 27/35] Fix entering player's name with SDL 1. The static bool means there's one copy of the variable per compilation unit using the header. So changing its value in one compilation unit doesn't affect the other compilation units. This is clearly not what is wanted here. Fixing this requires adding a CPP in SourceS. This is the first one there, I hope it's not an issue. The sdl2_to_1_2_backports should only be used with SDL1 so I only include it in the list of sources for SDL1 builds. I'm not familiar with cmake so I hope I don't do anything stupid there! --- CMakeLists.txt | 5 +++++ SourceS/sdl2_to_1_2_backports.cpp | 3 +++ SourceS/sdl2_to_1_2_backports.h | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 SourceS/sdl2_to_1_2_backports.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index b76673863..7768e1961 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -299,6 +299,11 @@ set(devilutionx_SRCS Packaging/resources/CharisSILB.ttf Packaging/windows/devilutionx.rc) +if(USE_SDL1) + list(APPEND devilutionx_SRCS + SourceS/sdl2_to_1_2_backports.cpp) +endif() + if(NOT NONET) list(APPEND devilutionx_SRCS SourceX/dvlnet/tcp_client.cpp diff --git a/SourceS/sdl2_to_1_2_backports.cpp b/SourceS/sdl2_to_1_2_backports.cpp new file mode 100644 index 000000000..4783c1f5b --- /dev/null +++ b/SourceS/sdl2_to_1_2_backports.cpp @@ -0,0 +1,3 @@ +#include "sdl2_to_1_2_backports.h" + +SDL_bool SDLBackport_IsTextInputActive = SDL_FALSE; diff --git a/SourceS/sdl2_to_1_2_backports.h b/SourceS/sdl2_to_1_2_backports.h index 5a8b59f3c..50a87a2a6 100644 --- a/SourceS/sdl2_to_1_2_backports.h +++ b/SourceS/sdl2_to_1_2_backports.h @@ -59,7 +59,7 @@ inline void SDL_Log(const char *fmt, ...) puts(""); } -static SDL_bool SDLBackport_IsTextInputActive = SDL_FALSE; +extern SDL_bool SDLBackport_IsTextInputActive; inline SDL_bool SDL_IsTextInputActive() { From 93358a290c7a1dca407e9193dbd3d31b755f2af8 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sat, 3 Oct 2020 20:02:53 +0200 Subject: [PATCH 28/35] [SDL1.2] Check if an appropriate video mode exists for the given movie This lets us fall back to software scaling for devices that do not support a video mode that matches the given video. --- SourceX/storm/storm.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/SourceX/storm/storm.cpp b/SourceX/storm/storm.cpp index 99bc309e5..282a4164e 100644 --- a/SourceX/storm/storm.cpp +++ b/SourceX/storm/storm.cpp @@ -623,6 +623,30 @@ void SVidPlayBegin(char *filename, int a2, int a3, int a4, int a5, int flags, HA { const auto *display = SDL_GetVideoSurface(); IsSVidVideoMode = (display->flags & (SDL_FULLSCREEN | SDL_NOFRAME)) != 0; + + if (IsSVidVideoMode) { + /* Get available fullscreen/hardware modes */ + SDL_Rect **modes = SDL_ListModes(NULL, display->flags); + + /* Check is there are any modes available */ + if(modes == (SDL_Rect **)0){ + IsSVidVideoMode = false; + } + + /* Check if our resolution is restricted */ + if(modes != (SDL_Rect **)-1){ + // Search for a usable video mode + bool UsableModeFound = false; + for (int i=0; modes[i]; i++) { + if (modes[i]->w == SVidWidth || modes[i]->h == SVidHeight) { + UsableModeFound = true; + break; + } + } + IsSVidVideoMode = UsableModeFound; + } + } + if (IsSVidVideoMode) { int w, h; if (display->w * SVidWidth > display->h * SVidHeight) { From 5f8b9e45c072286e3cdaafce34a6136bdf7e422b Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Mon, 5 Oct 2020 17:34:49 +0200 Subject: [PATCH 29/35] Fix slow shutdowns on error SDL_threadID was being compared to int and woudl thus always fail, resulting in the application thinking that another thread was trying to shutdown. --- Source/appfat.cpp | 3 ++- Source/appfat.h | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/appfat.cpp b/Source/appfat.cpp index d9c2b5bf7..2d502b933 100644 --- a/Source/appfat.cpp +++ b/Source/appfat.cpp @@ -6,7 +6,8 @@ DEVILUTION_BEGIN_NAMESPACE char sz_error_buf[256]; BOOL terminating; -int cleanup_thread_id; +/** Thread id of the last callee to FreeDlg(). */ +SDL_threadID cleanup_thread_id; void app_fatal(const char *pszFmt, ...) { diff --git a/Source/appfat.h b/Source/appfat.h index 08ee83373..2cfb7f5cf 100644 --- a/Source/appfat.h +++ b/Source/appfat.h @@ -4,7 +4,6 @@ extern char sz_error_buf[256]; extern BOOL terminating; -extern int cleanup_thread_id; void TriggerBreak(); char *GetErrorStr(DWORD error_code); From 8208c3bdaaf2d8b948076da61cf98e36b1207664 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Tue, 6 Oct 2020 21:20:43 +0200 Subject: [PATCH 30/35] Fix DRLG_L3SpawnEdge spawntable (again) --- Source/drlg_l3.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/drlg_l3.cpp b/Source/drlg_l3.cpp index 36213b742..45e530a4a 100644 --- a/Source/drlg_l3.cpp +++ b/Source/drlg_l3.cpp @@ -665,7 +665,7 @@ static BOOL DRLG_L3Spawn(int x, int y, int *totarea); static BOOL DRLG_L3SpawnEdge(int x, int y, int *totarea) { BYTE i; - static BYTE spawntable[15] = { 0, 0x0A, 0x43, 0x05, 0x2C, 0x06, 0x09, 0, 0, 0x1C, 0x83, 0x06, 0x09, 0x0A, 0x05 }; + static BYTE spawntable[15] = { 0x00, 0x0A, 0x43, 0x05, 0x2c, 0x06, 0x09, 0x00, 0x00, 0x1c, 0x83, 0x06, 0x09, 0x0A, 0x05 }; if (*totarea > 40) { return TRUE; @@ -715,7 +715,7 @@ static BOOL DRLG_L3SpawnEdge(int x, int y, int *totarea) static BOOL DRLG_L3Spawn(int x, int y, int *totarea) { BYTE i; - static BYTE spawntable[15] = { 0, 0x0A, 0x03, 0x05, 0x0C, 0x06, 0x09, 0, 0, 0x012, 0x03, 0x06, 0x09, 0x0A, 0x05 }; + static BYTE spawntable[15] = { 0x00, 0x0A, 0x03, 0x05, 0x0C, 0x06, 0x09, 0x00, 0x00, 0x0C, 0x03, 0x06, 0x09, 0x0A, 0x05 }; if (*totarea > 40) { return TRUE; From fbf0713185554bf01a739059eaf889cb2fa7c964 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Wed, 7 Oct 2020 19:31:44 +0200 Subject: [PATCH 31/35] Correct Firebolt manacost This partially reverts 4b748904899fa5b0b7378ce0478c92998240d39d Thanks to @Orthotope for pointing this out --- Source/spells.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/spells.cpp b/Source/spells.cpp index 61f36ce81..5fa9c5ec9 100644 --- a/Source/spells.cpp +++ b/Source/spells.cpp @@ -16,12 +16,14 @@ int GetManaAmount(int id, int sn) sl = 0; } + if (sl > 0) { + adj = sl * spelldata[sn].sManaAdj; + } if (sn == SPL_FIREBOLT) { adj >>= 1; - } else if (sn == SPL_RESURRECT && sl > 0) { + } + if (sn == SPL_RESURRECT && sl > 0) { adj = sl * (spelldata[SPL_RESURRECT].sManaCost / 8); - } else if (sl > 0) { - adj = sl * spelldata[sn].sManaAdj; } if (sn == SPL_HEAL || sn == SPL_HEALOTHER) { From b2f60727bc9f3bdcfa5a58ace33246c0fdd36620 Mon Sep 17 00:00:00 2001 From: gogogogi Date: Fri, 26 Jun 2020 13:02:28 +0200 Subject: [PATCH 32/35] Fix PPA debian building version and git commit (#753) --- Packaging/debian/rules | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Packaging/debian/rules b/Packaging/debian/rules index 2b454f3bc..cfb75bc5a 100755 --- a/Packaging/debian/rules +++ b/Packaging/debian/rules @@ -5,16 +5,18 @@ #export DH_VERBOSE=1 export COMPILE_FLAGS="-O0" export DEB_BUILD_MAINT_OPTIONS = hardening=-all -export DEB_CFLAGS_MAINT_APPEND = -Wno-error +export DEB_CFLAGS_MAINT_APPEND = -Wno-error export DEB_LDFLAGS_MAINT_APPEND = -Wno-error export CXXFLAGS="-DTTF_FONT_PATH=\"/usr/share/fonts/truetype/CharisSILB.ttf\"" DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) +GIT_VERSION_DEVILUTIONX ?= $(shell pwd | tail -c 22 | cut -c-5) +GIT_COMMIT_DEVILUTIONX := $(shell pwd | tail -c 8) %: dh $@ --buildsystem=cmake --builddirectory=obj-${DEB_HOST_MULTIARCH} override_dh_auto_configure: - dh_auto_configure -- -DNIGHTLY_BUILD=ON #-DSPAWN=ON + dh_auto_configure -- -DNIGHTLY_BUILD=ON -DVERSION_NUM=${GIT_VERSION_DEVILUTIONX} -DVERSION_SUFFIX=-${GIT_COMMIT_DEVILUTIONX} #-DSPAWN=ON override_dh_auto_install: install -pdm755 debian/diablo-data/usr/share/games/diablo/ @@ -27,10 +29,10 @@ override_dh_auto_install: install -pdm755 debian/devilutionx/usr/share/icons/hicolor/32x32/apps/ install -pdm755 debian/devilutionx/usr/share/icons/hicolor/48x48/apps/ install -pdm755 debian/devilutionx/usr/share/games/diablo/ - install -Dm664 Packaging/resources/16.png debian/devilutionx/usr/share/icons/hicolor/16x16/apps/devilutionx.png - install -Dm664 Packaging/resources/Diablo_32.png debian/devilutionx/usr/share/icons/hicolor/32x32/apps/devilutionx.png - install -Dm664 Packaging/resources/Diablo_48.png debian/devilutionx/usr/share/icons/hicolor/48x48/apps/devilutionx.png + install -Dm664 Packaging/resources/16.png debian/devilutionx/usr/share/icons/hicolor/16x16/apps/devilutionx.png + install -Dm664 Packaging/resources/Diablo_32.png debian/devilutionx/usr/share/icons/hicolor/32x32/apps/devilutionx.png + install -Dm664 Packaging/resources/Diablo_48.png debian/devilutionx/usr/share/icons/hicolor/48x48/apps/devilutionx.png install -Dm664 Packaging/fedora/devilutionx.desktop debian/devilutionx/usr/share/applications/ install -Dm664 Packaging/resources/CharisSILB.ttf debian/devilutionx/usr/share/fonts/truetype/ - install -Dm755 obj-${DEB_HOST_MULTIARCH}/devilutionx debian/devilutionx/usr/share/games/diablo/ + install -Dm755 obj-${DEB_HOST_MULTIARCH}/devilutionx debian/devilutionx/usr/share/games/diablo/ From 3ef2228d859ef26c0b4a9f14ae8b0c97516e2260 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Fri, 9 Oct 2020 03:02:14 +0200 Subject: [PATCH 33/35] [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. --- CMakeLists.txt | 5 ----- SourceS/sdl2_to_1_2_backports.cpp | 3 --- SourceS/sdl2_to_1_2_backports.h | 12 ++---------- SourceX/DiabloUI/diabloui.cpp | 21 ++++++++++++++++----- SourceX/DiabloUI/diabloui.h | 1 + SourceX/DiabloUI/dialogs.cpp | 5 ----- SourceX/controls/menu_controls.cpp | 3 ++- 7 files changed, 21 insertions(+), 29 deletions(-) delete mode 100644 SourceS/sdl2_to_1_2_backports.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 7768e1961..b76673863 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -299,11 +299,6 @@ set(devilutionx_SRCS Packaging/resources/CharisSILB.ttf Packaging/windows/devilutionx.rc) -if(USE_SDL1) - list(APPEND devilutionx_SRCS - SourceS/sdl2_to_1_2_backports.cpp) -endif() - if(NOT NONET) list(APPEND devilutionx_SRCS SourceX/dvlnet/tcp_client.cpp diff --git a/SourceS/sdl2_to_1_2_backports.cpp b/SourceS/sdl2_to_1_2_backports.cpp deleted file mode 100644 index 4783c1f5b..000000000 --- a/SourceS/sdl2_to_1_2_backports.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "sdl2_to_1_2_backports.h" - -SDL_bool SDLBackport_IsTextInputActive = SDL_FALSE; diff --git a/SourceS/sdl2_to_1_2_backports.h b/SourceS/sdl2_to_1_2_backports.h index 50a87a2a6..93b2113ce 100644 --- a/SourceS/sdl2_to_1_2_backports.h +++ b/SourceS/sdl2_to_1_2_backports.h @@ -59,20 +59,12 @@ inline void SDL_Log(const char *fmt, ...) puts(""); } -extern SDL_bool SDLBackport_IsTextInputActive; - -inline SDL_bool SDL_IsTextInputActive() -{ - return SDLBackport_IsTextInputActive; -} - inline void SDL_StartTextInput() { - SDLBackport_IsTextInputActive = SDL_TRUE; } -inline void SDL_StopTextInput() + +inline void SDL_SetTextInputRect(const SDL_Rect *r) { - SDLBackport_IsTextInputActive = SDL_FALSE; } //== Graphics helpers diff --git a/SourceX/DiabloUI/diabloui.cpp b/SourceX/DiabloUI/diabloui.cpp index 0f46ce971..fd4787474 100644 --- a/SourceX/DiabloUI/diabloui.cpp +++ b/SourceX/DiabloUI/diabloui.cpp @@ -47,6 +47,7 @@ int gUiItemCnt; bool UiItemsWraps; char *UiTextInput; int UiTextInputLen; +bool textInputActive = true; int SelectedItem = 0; @@ -85,13 +86,17 @@ void UiInitList(int min, int max, void (*fnFocus)(int value), void (*fnSelect)(i if (fnFocus) fnFocus(min); +#ifndef __SWITCH__ SDL_StopTextInput(); // input is enabled by default +#endif + textInputActive = false; for (int i = 0; i < itemCnt; i++) { if (items[i].type == UI_EDIT) { #ifdef __SWITCH__ switch_start_text_input(items[i - 1].art_text.text, items[i].edit.value, /*multiline=*/0); -#endif +#else SDL_StartTextInput(); +#endif UiTextInput = items[i].edit.value; UiTextInputLen = items[i].edit.max_length; } @@ -252,7 +257,7 @@ void UiFocusNavigation(SDL_Event *event) } #endif - if (SDL_IsTextInputActive()) { + if (textInputActive) { switch (event->type) { case SDL_KEYDOWN: { switch (event->key.keysym.sym) { @@ -294,7 +299,9 @@ void UiFocusNavigation(SDL_Event *event) } #ifndef USE_SDL1 case SDL_TEXTINPUT: - selhero_CatToName(event->text.text, UiTextInput, UiTextInputLen); + if (textInputActive) { + selhero_CatToName(event->text.text, UiTextInput, UiTextInputLen); + } return; #endif default: @@ -348,11 +355,13 @@ void UiHandleEvents(SDL_Event *event) void UiFocusNavigationSelect() { UiPlaySelectSound(); - if (SDL_IsTextInputActive()) { + if (textInputActive) { if (strlen(UiTextInput) == 0) { return; } +#ifndef __SWITCH__ SDL_StopTextInput(); +#endif UiTextInput = NULL; UiTextInputLen = 0; } @@ -363,8 +372,10 @@ void UiFocusNavigationSelect() void UiFocusNavigationEsc() { UiPlaySelectSound(); - if (SDL_IsTextInputActive()) { + if (textInputActive) { +#ifndef __SWITCH__ SDL_StopTextInput(); +#endif UiTextInput = NULL; UiTextInputLen = 0; } diff --git a/SourceX/DiabloUI/diabloui.h b/SourceX/DiabloUI/diabloui.h index 0a3815f27..24880b862 100644 --- a/SourceX/DiabloUI/diabloui.h +++ b/SourceX/DiabloUI/diabloui.h @@ -9,6 +9,7 @@ namespace dvl { extern int SelectedItem; +extern bool textInputActive; typedef enum _artFocus { FOCUS_SMALL, diff --git a/SourceX/DiabloUI/dialogs.cpp b/SourceX/DiabloUI/dialogs.cpp index 865c0b105..edb0bf372 100644 --- a/SourceX/DiabloUI/dialogs.cpp +++ b/SourceX/DiabloUI/dialogs.cpp @@ -20,7 +20,6 @@ Art dialogArt; char dialogText[256]; char dialogCaption[1024]; bool fontWasLoaded; -bool textInputWasActive; UiItem *dialogItems; std::size_t dialogItemsSize; @@ -203,8 +202,6 @@ void Init(const char *text, const char *caption, bool error, bool render_behind) fontWasLoaded = font != nullptr; if (!fontWasLoaded) LoadTtfFont(); - textInputWasActive = SDL_IsTextInputActive(); - SDL_StopTextInput(); } void Deinit() @@ -213,8 +210,6 @@ void Deinit() UnloadSmlButtonArt(); if (!fontWasLoaded) UnloadTtfFont(); - if (textInputWasActive) - SDL_StartTextInput(); for (std::size_t i = 0; i < dialogItemsSize; ++i) { dialogItems[i].FreeCache(); } diff --git a/SourceX/controls/menu_controls.cpp b/SourceX/controls/menu_controls.cpp index 09b03d5ca..da51bed49 100644 --- a/SourceX/controls/menu_controls.cpp +++ b/SourceX/controls/menu_controls.cpp @@ -1,6 +1,7 @@ #include "controls/menu_controls.h" #include "controls/controller.h" +#include "DiabloUI/diabloui.h" namespace dvl { @@ -68,7 +69,7 @@ MenuAction GetMenuAction(const SDL_Event &event) case SDLK_KP_ENTER: return MenuAction::SELECT; case SDLK_SPACE: - if (!SDL_IsTextInputActive()) { + if (!textInputActive) { return MenuAction::SELECT; } break; From 27e171e874084115a9c987e484ea84db58a0d20d Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Fri, 9 Oct 2020 03:06:49 +0200 Subject: [PATCH 34/35] Fix SDL1 builds --- SourceS/sdl2_to_1_2_backports.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SourceS/sdl2_to_1_2_backports.h b/SourceS/sdl2_to_1_2_backports.h index 93b2113ce..9417e8948 100644 --- a/SourceS/sdl2_to_1_2_backports.h +++ b/SourceS/sdl2_to_1_2_backports.h @@ -63,6 +63,10 @@ inline void SDL_StartTextInput() { } +inline void SDL_StopTextInput() +{ +} + inline void SDL_SetTextInputRect(const SDL_Rect *r) { } From 4bf4ebeb19ecb7abe8926253084572755c9b899f Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Fri, 9 Oct 2020 05:06:08 +0200 Subject: [PATCH 35/35] Correct navigation in the difficulty select screen --- SourceX/DiabloUI/selgame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SourceX/DiabloUI/selgame.cpp b/SourceX/DiabloUI/selgame.cpp index 0b409c7eb..9e2c4832c 100644 --- a/SourceX/DiabloUI/selgame.cpp +++ b/SourceX/DiabloUI/selgame.cpp @@ -150,7 +150,7 @@ void selgame_GameSelection_Select(int value) switch (value) { case 0: strcpy(title, "Create Game"); - UiInitList(0, NUM_DIFFICULTIES - 1, selgame_Diff_Focus, selgame_Diff_Select, selgame_Diff_Esc, SELDIFF_DIALOG, size(SELDIFF_DIALOG)); + UiInitList(0, NUM_DIFFICULTIES - 1, selgame_Diff_Focus, selgame_Diff_Select, selgame_Diff_Esc, SELDIFF_DIALOG, size(SELDIFF_DIALOG), true); break; case 1: strcpy(title, "Join TCP Games");