Commit Graph
119 Commits
Author SHA1 Message Date
staphen 132d911a41 Fix year in screenshot file names 2023-03-21 16:36:25 +01:00
Gleb Mazovetskiy 0950750ed9 Avoid dependency on fmt/chrono
We only used it in one place and it doesn't work on Amiga GCC-6 with the
latest libfmt.

Also handles the case where `localtime` returns `nullptr`.
2023-03-12 18:53:02 +00:00
Gleb Mazovetskiy 1a1a282d9a Use C FILE instead of C++ streams throughout
Reduces binary size by ~2 KiB and may improve compatibility with oddball
systems (e.g. PS2).
2023-02-15 18:15:07 +00:00
Gleb Mazovetskiy 680ab5ec40 Overhaul backbuffer state handling
When rendering directly to the output buffer, we need to maintain the
state of what has been drawn and what needs redrawing per-buffer.

We previously tried to do it implicitly by checking `SDL_DOUBLEBUF` and
other flags. The previous implementation was broken in several
ways, resulting in rendering issues on devices that support 8-bit output
directly.

Changes this mechanism to explicitly maintain buffer state per output
buffer. The new mechanism doesn't require knowledge of the number of
buffers, and thus also works correctly with triple-buffering.

Fixes #5447
2022-11-01 02:43:24 +00:00
Gleb Mazovetskiy 6327e713e0 Lowercase all file paths
We want to be able to use unpacked MPQs on low-end platforms
(PS2/rg99/etc).

This is tricky on case-sensitive filesystems. Avoids case issues by
lowercasing all paths in the code (then we'll just need lowercased
listfiles).
2022-08-20 23:49:23 +01:00
Anders Jenbo 2d21fc372e Remove more miniwin code 2022-07-10 21:13:39 +02:00
Gleb Mazovetskiy 4063afb792 Xbox NXDK platform 2022-07-09 18:50:53 +01:00
Cesar Canassa e538acb248 📝 Fixes Doxygen warnings (#4904) 2022-07-07 12:51:24 +02:00
Anders Jenbo 72656b3011 Move path and palette to the engine folder 2022-06-24 16:34:20 +02:00
Anders Jenbo 99181fd709 Move more files to the engine folder 2022-06-24 11:08:15 +02:00
DakkJaniels 1b83d68dc7 remove two includes that didn't need to be added. 2022-05-10 15:59:18 +02:00
DakkJaniels 1fb712c63a fix clang formatting 2022-05-10 15:59:18 +02:00
DakkJaniels 3f9b385a1d revised for date/time stamps instead. 2022-05-10 15:59:18 +02:00
DakkJaniels 1d4f91c9e1 add parenthesis to max 2022-05-10 15:59:18 +02:00
DakkJaniels dd3da0a639 change to std::numeric_limits 2022-05-10 15:59:18 +02:00
DakkJaniels c4d5068e3e Take up to 4.29B screenshots 2022-05-10 15:59:18 +02:00
Gleb Mazovetskiy 7de6a25b41 Remove (un)lock_buf
We do not seem to render from multiple threads, so these calls are
unnecessary.
2022-03-26 22:27:54 +00:00
Anders Jenbo 1409e604f5 Reduce string conversions 2022-03-20 11:04:15 +01:00
Gleb Mazovetskiy 3d308983a8 Migrate to libmpq
libmpq is a much simpler alternative to StormLib for reading MPQ archives.

We use our own fork of libmpq: https://github.com/diasurgical/libmpq

Impact:

* DevilutionX is now a lot more portable. Unlike StormLib, libmpq only
  needs platform-specific code for Windows.
* Locks around file access **removed** (instead we duplicate the file descriptor for streamed audio only).
* RAM usage is **300 KiB** lower than StormLib.
* Stripped release linux_x86_64 binary is **32 KiB** smaller.
* Amiga build now hangs instead of crashing.
2021-11-06 23:51:42 +00:00
Anders Jenbo 7169882b1f ✨ Implement new font rendering 2021-09-12 01:37:28 +02:00
BC Ko 68a971f160 documentation cleanup: capture 2021-08-30 13:51:42 +02:00
Vladimir Olteanu ef5af325d6 Make CaptureFile return ofstream 2021-08-17 17:48:49 +02:00
Anders Jenbo ef6275caac Clean up private function names 2021-07-12 17:59:22 -07:00
Anders Jenbo bc51e1616d 🎨 Apply clang-tidy 2021-07-08 08:14:03 -07:00
Anders Jenbo 20262e4569 🚚 Move local symbols in to anon namespace 2021-07-08 08:14:03 -07:00
Anders Jenbo 903d4bd2e1 Scope all for loops
This caused 7 of the loops to be rewriteen using range by clang-tidy
2021-07-08 08:14:03 -07:00
Anders Jenbo 4eabc6024b Apply various cleanups via Android Studio 2021-07-03 18:27:17 -07:00
Gleb Mazovetskiy cb0dae8590 🚚 Rename CelOutputBuf to Surface and extract 2021-07-03 05:33:32 -07:00
Anders Jenbo f0e5bd819b 💚 Fix debug builds
This the change from 8e07ef8fe5.
2021-06-27 20:48:39 +02:00
Anders Jenbo 8e07ef8fe5 Clang-tidy: misc-unused-parameters 2021-06-27 17:34:32 +02:00
Anders Jenbo f167bd4dfb Clang-tidy: llvm-include-order 2021-06-27 01:45:49 +02:00
Anders Jenbo f99ef2c195 A couple of clean ups suggested by Android Studio/Clang Tidy 2021-06-18 16:17:46 +02:00
Gleb Mazovetskiy 1181cc68ac 🎉 Remove buffer padding
The padding is no longer needed
2021-05-11 07:57:08 +02:00
Gleb Mazovetskiy 59dd42692f 🚚 Move render.cpp to engine/render/dun_render.cpp 2021-05-06 21:30:06 +02:00
Gleb Mazovetskiy f33f7ae7eb 💨 Do not zero-initalize arrays we write to
`std::make_unique<T[]>(size)` always zero-initalizes the array.

C++20 has `std::make_unique_for_overwrite` to avoid that, while
older C++ versions can use the approach applied here.
2021-05-02 05:52:11 +02:00
Vladimir Olteanu af50ed7302 Fix memleak in CapturePix (#1762) 2021-04-30 08:02:02 +02:00
thebigMuh ad8f342db0 Adding constness 2021-04-26 23:30:02 +02:00
JmgrandGleb Mazovetskiy d4f62870b8 Remove globals from paths.h
Fix for Vita

Update to use free functions

Use std::optional to allow setting empty paths

Change header inclusion order

Co-authored-by: Gleb Mazovetskiy <[email protected]>

Use std::optional to allow setting empty paths

Apply clang-format

Temporary commit
2021-04-25 22:26:37 +02:00
Jmgr 1b7e0d2cb3 Migrate existing log entries 2021-04-25 02:39:42 +02:00
Anders Jenbo f004c78824 🧹 performance-unnecessary-value-param 2021-04-22 00:08:19 +02:00
Anders Jenbo f8e3672469 ♻️Fully apply clang-tidy rules to a few files 2021-04-20 19:39:38 +02:00
Anders Jenbo bb4e1960e7 🎨 modernize-use-nullptr 2021-04-19 16:02:05 +02:00
Anders Jenbo 8c821e98d3 🚚 Restructure files 2021-04-16 03:57:22 +02:00
Anders Jenbo 997c1dba55 🚚 Split up all.h in to proper header relations 2021-04-16 01:04:54 +02:00
Anders Jenbo 6e1a106a38 🚚 Move header we implement into the project 2021-04-16 01:04:54 +02:00
Anders Jenbo 93d42b62b8 ♻️ Change BOOL to bool 2021-04-09 15:13:02 +02:00
Anders Jenbo bfb3c11c2b 🎨 Change namespace to devilution 2021-04-06 15:21:25 +02:00
Anders Jenbo 630e507f63 🚚 Apply namespace 2021-04-06 15:21:25 +02:00
Anders Jenbo 6f1498d315 🚚 Move structures to there respective headers 2021-04-06 12:41:00 +02:00
Gleb Mazovetskiy 70d1d633bd Get rid of SCREEN_X / SCREEN_Y
GlobalOutputBuffer() now returns a clipped subregion
2021-03-17 23:37:58 +01:00