4270 Commits

Author SHA1 Message Date
Le Philousophe
be3eb09753 COMMON: Allow GZipReadStream to work on data in the middle of stream 2023-08-28 21:49:03 +02:00
Le Philousophe
191bde03ad COMMON: Use memcpy instead of memmove
memove was used although the buffers were not overlapping.
Using memcpy allows for better optimizations by compiler.
2023-08-28 21:49:03 +02:00
Le Philousophe
5edf74d8a6 COMMON: Cleanup flags defines
In addition, use flags from RFC and not from (really) old gzip
implementations.
2023-08-28 21:49:03 +02:00
Le Philousophe
b5e3173b10 COMMON: Fix inflateZlibHeaderless name
The function takes a stream beginning with zlib header unlike the name
suggests.
inflateInit expects to parse a zlib header.
2023-08-28 21:49:03 +02:00
Le Philousophe
ead4171bbd COMMON: Rewrite writeStream to work with any ReadStream
This let it work with stream without a known size and avoids allocating
big buffers when file is big.
2023-08-28 21:49:03 +02:00
Thierry Crozat
ef7c881416 OSYSTEM: Add kFeatureTouchscreen to identify backends with a touchscreen 2023-08-22 23:37:11 +01:00
elasota
92320d616d COMMON: When flattening QuickTime edit lists, don't flatten non-silent audio chunks into silent chunks or vice versa.
Fixes missing vidbot VO in Obsidian Japanese.
2023-08-22 13:18:15 +03:00
Wyatt Radkiewicz
787837ca41 ALL: Add Cpu prefix to SIMD extension features 2023-08-13 00:22:10 +02:00
Wyatt Radkiewicz
6bdeeb506f OSYSTEM: Added SSE4.1 feature flag 2023-08-13 00:22:10 +02:00
Wyatt Radkiewicz
50a28d1554 OSYSTEM: Added SIMD feature flags 2023-08-13 00:22:10 +02:00
Ankush Dutt
8150c720d3 COMMON: DumpArchive(): add check to skip directory, return error if a file cannot be opened 2023-08-09 18:15:43 +02:00
Ankush Dutt
b90efbe47c COMMON: Handle writing failed in dumpArchive when not enough storage 2023-08-09 18:15:43 +02:00
Cameron Cawley
312f077198 COMMON: Fix comments about screen shaking 2023-08-08 17:34:47 +03:00
Eugene Sandulenko
bb9e86e9c6
COMMON: Fix warnings 2023-08-07 10:48:59 +02:00
elasota
58271a834c COMMON: Remove #pragma once 2023-08-07 10:22:09 +02:00
elasota
3c1efe4f89 COMMON: Add file format info API 2023-08-07 10:22:09 +02:00
Thierry Crozat
9de5b3345c OSYSTEM: Add functions to notify the backend when a task is started or finished
A task can for example be running the local server, downloading icons
or shaders pack, or downloading games from the cloud.
2023-08-06 23:07:35 +02:00
Cameron Cawley
d8cca29783 BACKENDS: Allow filling part of the screen with OSystem::fillScreen 2023-08-06 23:03:46 +02:00
Misty De Meo
b975da2335 COMMON: fix MacResManager native resource forks
These broke in the archive refactor,
b8acbe6bee730a9024e73acc769b54285be9afde/#5108, because it removed
the ability to directly convert an `ArchiveMember` to an `FSNode`.
As a result, it was no longer possible to directly open a resource
fork as a stream.
2023-07-27 11:02:29 +02:00
Scott Percival
7304796a01
VIDEO: Remove extra hexdump in QuickTime parser 2023-07-23 20:26:05 +08:00
Scott Percival
ffa80f5aaf VIDEO: Add alias support to QuickTime parser 2023-07-23 14:07:20 +02:00
Ankush Dutt
ca7e41c4e0 COMMON: Use getPathInArchive() and Path::punycodeEncode() in dumpArchive() and fix directory issue
This commit will fix:
- The dumped games using dumpArchive() are not detected.
- The archive's contents were being dumped one directory back the destPath
2023-07-19 22:22:38 +02:00
elasota
f38b732012 COMMON: Fix override without "override" qualifier warning 2023-07-19 18:51:37 +02:00
elasota
b8acbe6bee COMMON: Archive path refactoring, add getFileName and getPathInArchive that unambiguously return the filename or the full path 2023-07-19 18:51:37 +02:00
Le Philousophe
29a02151d1 COMMON: Only apply alignment on supported platforms 2023-07-14 20:48:13 +02:00
Le Philousophe
5964c36ab4 COMMON: Don't use a pointer to T in UnalignedPtr
This lets the compiler think the pointer value could be aligned.
2023-07-14 11:10:28 +02:00
Le Philousophe
6a1abd09f1 COMMON: Make sure coroutine Process parameter is well aligned 2023-07-14 11:10:28 +02:00
Le Philousophe
f34bef6840 COMMON: Add normalization to Path class 2023-07-09 21:41:58 +02:00
Le Philousophe
7880a660cf COMMON: Allow to know in which archive file was found in SearchSet 2023-07-09 21:41:58 +02:00
Scott Percival
aa32a51c47 DIRECTOR: More fixes for partial filename matching
For Macintosh, it is possible to have filenames with a "/" in them.
Dumper Companion will punyencode this and any other non-ASCII characters
when extracting from a Macintosh filesystem. As such, when checking
components of a filename, we should attempt to match against the punydecoded
name, but always return the "real" name (i.e. the name of the file in
the local filesystem, possibly punyencoded).

In addition, it is possible for a movie A/B/C.DIR to go to a movie
"E/F.DIR", where the actual path is A/E/F.DIR. To make the partial matching
work, first we try removing each component from the start of the target
path, then retry all combinations again after removing a component from
the end of the source directory, etc.

Fixes several movie switches in The Seven Colors.
2023-07-08 22:01:00 +03:00
D G Turner
231d7ffaee COMMON: Fix Signed vs. Unsigned GCC Compiler Warnings in Punycode 2023-06-25 15:45:26 +01:00
Donovan Watteau
a46253647a COMMON: BUILD: Try detecting UBSan when not using configure
Newer versions of Clang can tell us when UBSan has been enabled, which
is useful to define SCUMM_NEED_ALIGNMENT when -fsanitize=alignment is
in use (https://reviews.llvm.org/D52386).

Can be useful to avoid some false positives about alignment when doing
a build with UBSan but without using the "configure" script which
already tries to detect this setting.

See earlier commit 8a73f5d496437f8211c67c1da4c6cc4b200c4970.
2023-06-21 12:56:58 +02:00
elasota
eda8c2698f COMMON: Fix incorrect StuffIt directory paths 2023-06-21 08:26:28 +03:00
elasota
b9175e1810 COMMON: Fix up comments 2023-06-19 21:59:24 +03:00
elasota
8cb45fe696 COMMON: Update comment to explain buggy normalization behavior more clearly 2023-06-19 21:59:24 +03:00
elasota
8ce2ffd68b COMMON: Move Gentee Installer from V-Cruise to Common 2023-06-19 21:59:24 +03:00
elasota
654f7fd8d0 COMMON: Add comments on usage 2023-06-19 08:45:32 +03:00
elasota
907252ecbd COMMON: Return correct path separator for InstallShieldV3 2023-06-19 08:45:32 +03:00
elasota
e53d2ec594 COMMON: Add "getPathSeparator" to Archive and return ":" for Mac archive formats 2023-06-19 08:45:32 +03:00
elasota
7be3c8f602 COMMON: Add "flattenTree" param to createStuffItArchive and preserve directory structure by default 2023-06-19 08:45:32 +03:00
Misty De Meo
e05e33a06e
COMMON: remove unused variable assignment 2023-06-17 10:08:24 -07:00
Harishankar Kumar
7d8dcebeb7
COMMON: Fix memory leak when invalid PE executable is loaded
In function `PEResources::loadFromEXE`, there were memory leaks
because of not properly handling with streams, and thus when the
loaded movie was bad/non-exe file, the memory was not freed.

This was undetected in normal exe loading because there the streams
were being assigned and closed properly.
2023-06-14 13:57:50 +02:00
Paul Gilbert
eb80a2119b COMMON: Fix string method comments in forbidden.h 2023-06-12 19:14:09 -07:00
Scott Percival
d69dac6016 COMMON: Fix file handle leak in generateZipSet() 2023-06-08 09:16:30 +02:00
Misty De Meo
90c4b57e9a
COMMON: punycode: move npos guard up
b0d722473b49e27417258f03ee802372f3ee354e introduced code that used
ni before this guard that ensures it has a proper value for strings
that contain no ASCII component.
2023-06-07 14:55:41 -07:00
Misty De Meo
fb5982eacb
COMMON: do not process the tail if there is no tail
If the illegal character scanner flags the final character, it
shouldn't continue on try to process the tail - it's the end of the
string, and indexing past that is invalid.
2023-06-07 11:58:05 -07:00
Eugene Sandulenko
bc6b225eed
COMMON: Include <limits> by default
We discussed it in https://github.com/scummvm/scummvm/pull/3966, so
std::numeric_limits is OK to use in the ScummVM codebase.
2023-06-05 17:17:19 +02:00
grisenti
7698d18a9b COMMON: Fix StableMap API to conform to std::map 2023-06-03 23:23:09 +02:00
grisenti
b8f7e9416b COMMON: Remove unused method in Common::RBTree 2023-06-03 23:11:03 +02:00
grisenti
09db135b3a COMMON: Fix documentation for Common::RBTree 2023-06-03 23:09:19 +02:00