Commit Graph
118 Commits
Author SHA1 Message Date
Anders Jenbo fa3785a475 Merge branch 'master' of github.com:diasurgical/devilution 2020-11-04 03:02:48 +01:00
Anders Jenbo f2f4de8e33 Reorder mpqapi.cpp 2020-11-04 00:01:29 +01:00
Anders Jenbo a3505ab904 Remove the std namespace from uint32_t
Again to help older compileres that aren't C++11 aware.
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
Anders Jenbo 5641e2bdec Fix MSVC build 2020-04-14 16:05:29 +02:00
Anders Jenbo 7108145a04 Merge branch 'master' of github.com:diasurgical/devilution 2020-04-14 15:30:49 +02:00
Anders Jenbo cd18914026 Avoid void pointers 2020-04-08 20:34:38 +02:00
Anders Jenbo c384711a5f Backport cleanups from hellfire branch 2020-04-08 20:16:32 +02:00
Anders Jenbo 776ab10476 Merge branch 'master' of github.com:diasurgical/devilution 2020-03-29 23:40:05 +02:00
Gleb Mazovetskiy 82845004cc Ensure _HASH/BLOCKENTRY are 16-bytes and aligned 2020-03-16 02:19:49 +01:00
Anders Jenbo 5c02333fc0 Only log savegame read/write in debug mode 2020-03-09 00:19:31 +01:00
Anders Jenbo 0383f9abcd Add documentation to more files 2020-03-02 02:29:28 +01:00
Anders Jenbo 3c276a3cd3 Add documentation
- Add file documentation to about 1/4 of the files in Source
- Copy over a lot of the documentation from the sanctuary/notes repo
- Standardise all the existing documentation
- Create a configuration for Doxygen
- Add more documentation (engine.cpp is now fully documented)
2020-03-01 22:18:00 +01:00
Gleb Mazovetskiy 4ed20e0607 mpqapi: Use format macros instead of literals
Testing if this builds on VS 2017
2020-02-22 23:44:30 +01:00
Gleb Mazovetskiy 768a07d7d0 mpqapi: Replace macro with template function
Fixes MSVC compatibility, where `__VA_ARGS__` is not implemented
correctly.
2020-02-22 23:07:52 +01: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 e08007670f Revert "mpqapi: Log all fstream calls"
This reverts commit c530b7f62b.
2020-02-16 02:57:19 +01:00
Gleb Mazovetskiy c530b7f62b mpqapi: Log all fstream calls 2020-02-16 01:34:15 +01:00
Anders Jenbo 25993b4043 Merge branch 'master' of github.com:diasurgical/devilution 2020-02-14 23:03:31 +01:00
Anders Jenbo 20621a0642 add all.h and use in place of diablo.h (#2005)
Now diablo.h is treated in the same way as all other header files of
Source, as it only contains the declarations of global variables and
functions of diablo.cpp.

Besides consistency, this also enables mods to include diablo.h just
like any other header file without having to include every header file
(and without having to include C++ specific aspects of the now all.h).
2020-02-14 13:12:54 +01:00
Gleb Mazovetskiy 42fd614609 mpqapi: Log errno on error 2020-02-11 19:38:51 +01:00
Anders Jenbo 40ba1e7a6f Merge branch 'master' of github.com:diasurgical/devilution 2020-02-01 14:48:39 +01:00
Anders Jenbo 17b0c7186d Check sgdwMpqOffset before resizing 2020-02-01 03:13:40 +01:00
Anders Jenbo cc4d6b57d8 Remove unused miniwin IO 2020-01-31 22:30:13 +01:00
Gleb Mazovetskiy d2c39767e3 mpqapi: Fix open MPQs getting cleared on exit 2020-01-31 01:01:41 +01:00
Gleb Mazovetskiy cfe288a28e mpqapi: Use <fstream> instead of custom functions 2020-01-31 01:01:41 +01:00
Samuel-DEVULDER 9c516819c1 Make save game code big-endian compatible 2020-01-27 00:03:02 +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
qndel 3008439bc7 enums and stuff 2020-01-15 15:46:21 +01:00
Anders Jenbo 40cea40aa4 Remove windows call types collisions 2019-12-26 05:00:02 +01:00
Anders Jenbo f4496aa7f9 Merge branch 'master' of github.com:diasurgical/devilution 2019-11-09 21:27:06 +01:00
Anders Jenbo 4532f009ff Remove old anti-cheat code from save function
Tthis code simply logs the save time of a multiplayer game in the
register database, this was likly done as part of an anti cheat scheme
(the key was "Video Player"), but appears to have since been disabled.
Probably to allow moving save games between PC's which was supported
when better Windows 2000 support was added.
2019-11-09 20:00:53 +01:00
Anders Jenbo 802f2e76fa save_archive_modified = TRUE; 2019-11-09 19:41:58 +01:00
Anders Jenbo 1bc2ea4f58 Update mpqapi.cpp 2019-11-09 19:40:47 +01:00
Marlon Beijer d641c65562 Some fixes for Big Endian systems 2019-10-06 20:50:35 +02:00
Gleb Mazovetskiy 2cc0c2cfbb Clang: Remove -fms-extensions -fms-compatibility 2019-09-25 03:32:00 +02:00
Anders Jenbo 14f8c9368a Merge branch 'master' of github.com:diasurgical/devilution 2019-09-13 17:51:58 +02:00
qndel f473ffbe7f mpqapi_add_file cleanup 2019-09-05 20:20:45 +02:00
Anders Jenbo 98ab9b9600 Merge branch 'master' of github.com:diasurgical/devilution 2019-08-18 08:07:33 +02:00
Anders Jenbo 68d51e7d27 Implementing Spawned Shareware version 2019-08-12 16:04:20 +02:00
Anders Jenbo 2fcf8dab70 Merge branch 'master' of github.com:diasurgical/devilution 2019-07-21 19:39:17 +02:00
Anders Jenbo b023104434 Remove u from values 2019-07-21 00:57:53 +02:00
Xadhoom 148a7be44d Merge upstream branch 'devilution/master' 2019-07-10 17:04:38 +00:00
Anders Jenbo 7c071924ad Format recently cleaned code 2019-07-06 05:13:01 +02:00
Anders Jenbo f187fe7d3a Merge branch 'master' of github.com:diasurgical/devilution 2019-06-22 18:14:48 +02:00
Anders Jenbo a7788ccddf Format bin exact code 2019-06-17 04:55:41 +02:00
Anders Jenbo e6f4e21631 Merge branch 'master' of github.com:diasurgical/devilution 2019-06-16 19:18:19 +02:00
Anders Jenbo 8ac54ddcaa Make mpqapi_write_file_contents C compatible 2019-06-14 23:51:47 +02:00
Sergey Semushin f3f29cf0a9 Clean up mpqapi_write_file_contents. 2019-06-14 23:44:41 +02:00
Sergey Semushin 536b1b58aa Clean up OpenMPQ (with goto) 2019-06-12 23:43:55 +01:00