Commit Graph
138 Commits
Author SHA1 Message Date
Ivan Epifanov 1e53f32049 [vita] Initial port 2021-02-21 20:30:34 +01:00
MrHuu 1fa8b6f4e4 [3DS] Initial port 2021-02-21 00:31:13 +01:00
qndel 0fe08dbe68 numpad potions + chat (#1027) 2021-02-20 20:06:55 +01:00
Anders Jenbo 1ec1e69c04 Fix builds on older versions of SDL2 2021-02-19 06:20:40 +01:00
Anders Jenbo 8001cc77f8 Fix SDL1 builds 2021-02-19 06:09:16 +01:00
Anders Jenbo 06b7c78406 Notes of untimly header cleanups 2021-01-26 03:12:58 +01:00
Anders Jenbo 88a715cdcc Clean up narator sound logic
Also this provides a helper function for calculating the length of a
sound
2021-01-24 07:08:11 +01:00
Anders Jenbo 374e8177ef Remove wave.cpp 2021-01-23 21:24:25 +01:00
Gleb Mazovetskiy b10b4381ef Multiple controllers support (#935) 2020-11-28 22:58:13 +01:00
qndel 9c7d6c96ea specify path to diablo.ini (#928) 2020-11-24 02:17:33 +01:00
Anders Jenbo e40653c1e0 fixup! Clean up unused return type 2020-10-29 21:39:58 +01:00
Anders Jenbo b7ca9a812a Clean up unused return type 2020-10-29 21:39:58 +01:00
Gleb Mazovetskiy a091a56e8e Remove MAX_PATH restriction (#898)
Do not limit filesystem paths to 259 chars for MPQs, save files, and diablo.ini.

The MAX_PATH constant remains but now only limits path lengths within the MPQs.
2020-10-26 13:39:27 +01:00
Anders Jenbo 42af8b938f Fix SDL1 builds 2020-10-09 03:06:49 +02: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
Colin Pitrat 565ae69631 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!
2020-10-03 18:49:14 +02:00
Anders Jenbo c53ca1a62a Adjust resolution to monitor default on startup 2020-09-28 07:03:22 +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 36cd56868b Use preprocessor macros instead of constexpr for events enums 2020-05-14 11:44:15 +02:00
Anders Jenbo 0da3461d35 Use explicit types instead of auto 2020-05-14 11:44:15 +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
Gleb Mazovetskiy 7b72b3d4ea CMake: Use generator expressions more
Generator expressions are the only way to distinguish between build
types in multi-configuration builds (Visual Studio).

This adds generator expressions for some of build type dependent
values as a starting point.

See a more detailed explanation at:
https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#build-specification-with-generator-expressions

Notably:

> Some buildsystems generated by cmake(1) have a predetermined build-configuration set in the CMAKE_BUILD_TYPE variable. The buildsystem for the IDEs such as Visual Studio and Xcode are generated independent of the build-configuration, and the actual build configuration is not known until build-time. Therefore, code such as
>
>     string(TOLOWER ${CMAKE_BUILD_TYPE} _type)
>     if (_type STREQUAL debug)
>       target_compile_definitions(exe1 PRIVATE DEBUG_BUILD)
>     endif()
>
> may appear to work for Makefile Generators and Ninja generators, but is not portable to IDE generators.
2020-04-08 04:36:34 +02:00
Gleb Mazovetskiy d065202ff2 Reformat the .clang-format files
These files are YAML, changes to a more idiomatic YAML syntax
2020-03-29 23:50:05 +02:00
Gleb Mazovetskiy c9c1c323cd mpqapi cleanup (#624)
* mpqapi FStreamWrapper: Fix silly bugs

* mpqapi cleanup

1. Do not rely on stream positions for getting the initial file size.
2. Remove most `seek` calls that were unnecessary.
3. Replace magic numbers with constants.
4. A class to manage archive lifetime and all associated data.

* Revert "Revert "mpqapi: Log all fstream calls""

This reverts commit e08007670f.

* mpqapi: Fix saves on Amiga

Works around https://github.com/bebbo/libnix/issues/30

* mpqapi: Fix logging format specifiers

This fixes fstream logging on Amiga

* mpqapi: Do not ResizeFile unless it was modified

* Add tests for file_util

* mpqapi: Replace malloc/free with new[]/delete[]

* mpqapi: Keep track of size instead of using tellp

This reduces log noise and reliance on `tellp`.

* mpqapi: Refactor mpqapi_write_file_contents

* mpqapi: Ensure we don't seekp beyond EOF on Amiga

* mpqapi: Minor fixes

* mpqapi: Fix FSTREAM_CHECK on Windows

* mpqapi: Remove undefined methods from header
2020-02-22 19:19:13 +01:00
Anders Jenbo 25993b4043 Merge branch 'master' of github.com:diasurgical/devilution 2020-02-14 23:03:31 +01:00
Anders Jenbo c26fa8fa3f Remove threading from miniwin 2020-02-11 01:24:43 +01:00
Gleb Mazovetskiy 5526140672 Fix SDL_PrefPath on SDL1 for non-Amiga
snprintf was used incorrectly - its arguments cannot overlap
2020-02-11 01:23:40 +01:00
Marlon Beijer f5ee32c218 SDL_GetPrefPath for non UNIX
Skip trailing slash when creating dirs and append it afterwards, as
trailing slash gets treated as '..' on Amiga.
Append /.local/share/ only on UNIX systems.
2020-02-09 23:38:18 +01:00
Gleb Mazovetskiy 58fde28a2a Blit: ifdef all SDL1 stretching code
OutputRequiresScaling is always false on SDL2 so we don't need SDL2
compatibility there
2020-02-09 16:40:04 +00:00
Gleb Mazovetskiy 114a166a01 Blit: Fix scaled output handling
Fixes #594
2020-02-09 14:55:27 +00:00
Anders Jenbo 118e3668b4 Remove unused code 2020-02-01 16:45:07 +01:00
Anders Jenbo edeca6574d Replace tagRECT with SDL_Rect 2020-02-01 15:43:51 +01:00
Anders Jenbo 3ab9b7f2d3 Inline rand 2020-02-01 15:23:03 +01:00
Anders Jenbo 08aa6a860a Move generic helpers out of miniwin 2020-02-01 13:56:08 +01:00
Anders Jenbo 67c58583d8 Implement fullscreen toggeling via alt+enter 2020-02-01 13:55:21 +01:00
Anders Jenbo cc4d6b57d8 Remove unused miniwin IO 2020-01-31 22:30:13 +01:00
Anders Jenbo baf2d14440 Remove unused parts of miniwin 2020-01-31 01:20:10 +01:00
Anders Jenbo 6e9987cc93 Rename dsound and it nolonger reflects DirectSound 2020-01-31 01:20:10 +01:00
Anders Jenbo 913de17a56 Use SDL_Color nativly instead of converting betwen it and PALETTEENTRY 2020-01-31 01:20:10 +01:00
Gleb Mazovetskiy cfe288a28e mpqapi: Use <fstream> instead of custom functions 2020-01-31 01:01:41 +01:00
Anders Jenbo e279fc2fe6 Revert "Treat booleans as bool"
This reverts commit 2dcf237dd2.
As BOOLs are loaded as 32bit uint the swap would break the value on big
endian if mapped to bool (8bit)
2020-01-27 00:03:02 +01:00
Gleb Mazovetskiy c8605f79bd capture.cpp: Replace WriteFile with <fstream> 2020-01-26 16:53:41 +01:00
Anders Jenbo 7f699dbad2 Remove more legacy savegame code
This code was only active in versions prior to 1.08
2020-01-23 16:38:35 +01:00
Anders Jenbo 2dcf237dd2 Treat booleans as bool
The engine should now be stable/clean enough to hanlde all bool types as
bool
2020-01-06 07:11:08 +01:00
Anders Jenbo d04e0e44bb Implement scroll wheel navigation
up/down/left/right = arrow keys
ctrl+up/down = zoom automap in/out
2019-12-31 06:29:02 +01:00
Anders Jenbo 40d272241b Implement --data-dir for setting mpq path
This also implements a much cleaner version of diablo_parse_flags
Fixes #219
2019-12-27 02:05:16 +01:00
Anders Jenbo e577f9bdc7 Remove more old save game format code
Multiplayer save games from before 1.08 where using the system name as
the password, so they would need to be converted on the original machine
by 1.08-1.09b before they can be transfered to another system.
2019-12-26 22:22:49 +01:00
Anders Jenbo 16d3fa69c6 Fix checking if sound is playing
Fixes #392
2019-12-26 17:15:50 +01:00
Anders Jenbo 40cea40aa4 Remove windows call types collisions 2019-12-26 05:00:02 +01:00
Samuel DEVULDER 319bdeddd2 Fix palette in 8bit color mode 2019-12-20 23:58:52 +01:00