Commit Graph
106 Commits
Author SHA1 Message Date
Anders Jenbo 5c02333fc0 Only log savegame read/write in debug mode 2020-03-09 00:19:31 +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
Anders Jenbo a55d2a811f Clean up mpqapi.cpp 2019-06-09 01:52:24 +02:00
Anders Jenbo 2270bad1b9 Correct type of dwChar in mpqapi.cpp 2019-06-09 01:49:52 +02:00
Robin Eklind 2bc0fe09d8 mpqapi_alloc_block bin exact (#1250) 2019-06-09 00:34:52 +01:00
Sergey Semushin af687e8fd8 Clean up mpqapi_flush_and_close. 2019-06-08 22:14:06 +01:00
Sergey Semushin ae8a6cd5b8 Clean up mpqapi_store_creation_time. 2019-06-06 23:31:40 +03:00
Sergey Semushin b0e75bc028 Clean up mpqapi_store_modified_time. 2019-06-06 23:30:45 +03:00
Anders Jenbo 11b6b1f860 Remove more garbage 2019-06-03 02:20:42 +01:00
Anders Jenbo 73a29f0e68 Merge branch 'master' of github.com:diasurgical/devilution 2019-05-18 16:55:20 +02:00
Anders Jenbo 758c6ac377 Fix save games 2019-05-18 16:47:07 +02:00
Anders Jenbo ee1f79dae7 Clean up mpqapi.cpp 2019-05-12 17:23:52 +01:00
Anders Jenbo 2215013f08 Clean up mpqapi_reg_load_modification_time 2019-05-12 17:23:52 +01:00
Anders Jenbo 4752f30b25 Clean up mpqapi_remove_hash_entry 2019-05-12 17:23:52 +01:00