Commit Graph

4070 Commits

Author SHA1 Message Date
Vladimir Serbinenko
b8f3bc2732 COMMON: In getDataFork use SafeSeekableSubReadStream
It can be opened several times so re-seeking makes sense
2022-11-29 18:35:20 +01:00
Vladimir Serbinenko
3ed46d3484 COMMON: In openFileOrDataFork ensure to seek to the beginning 2022-11-29 18:35:12 +01:00
Vladimir Serbinenko
b66d3ec688 COMMON: Implement ConcatReadStream 2022-11-29 04:30:36 +01:00
Vladimir Serbinenko
c5373134d2 COMMON: Uplift rnc decoder from toon to common
Toon has a RNC implementation with 2 differences from the one taken from SKY:

1. Protection against overread. Add it to common version and adjust callers
   in sky.
2. Lack of key parameter for obfuscation. We ignore it anyway and don't
   support obfuscation, so delete it in common version as well
2022-11-29 04:30:36 +01:00
Vladimir Serbinenko
074888e6b8 COMMON: Move RNC decoder from sky to common
RNC is a common packing algorithm used also in Toonstruck and installer of
Dreamweb floppy.
2022-11-29 04:30:36 +01:00
Donovan Watteau
8140fdfbcc COMMON: Fix MSVC C4309 enum sign warning 2022-11-29 01:37:55 +01:00
Vladimir Serbinenko
357249fb5a COMMON: Split slow and fast CRC implementation
They have almost nothing in common. And we probably want to kill slow
implementation anyway now that we have tests
2022-11-29 01:05:31 +01:00
Vladimir Serbinenko
05f1a0df51 COMMON: Remove the need for most reflecting when initing reflected table
Instead reflect the polynomial and change the shifts. Also removes the
need for explicit init.

This makes our crc more similar to its standard implementation
2022-11-29 01:05:31 +01:00
Vladimir Serbinenko
f06348708c COMMON: Optimize crcFast and related functions.
Currently we reflect every byte when working on reflected CRC's. Instead
follow the standard approach of reversing the table and couple of shifts
which is faster
2022-11-29 01:05:31 +01:00
Vladimir Serbinenko
8f6beba38f COMMON: Make most CRC functions const as they don't modify the object. 2022-11-29 01:05:31 +01:00
Vladimir Serbinenko
ec9bb100e1 COMMON: Switch unzip from zlib to gzio
Tested by loading scummremastered.zip
2022-11-29 01:05:31 +01:00
Vladimir Serbinenko
c60281b3d0 COMMON: Fix crc calculation with reflected messages 2022-11-29 01:05:31 +01:00
Vladimir Serbinenko
b63160a06e COMMON: Remove unused functions in unzip 2022-11-29 01:05:31 +01:00
elasota
78d26927a8 COMMON: Add functions to get Mac Finder metadata such as type/creator codes. 2022-11-29 00:25:50 +01:00
Cameron Cawley
c4526bf158 COMMON: Mark SeekableSubReadStreamEndian as deprecated 2022-11-29 00:06:49 +01:00
Cameron Cawley
309088dfb2 COMMON: Add WARN_DEPRECATED 2022-11-29 00:06:49 +01:00
Cameron Cawley
b67de44eb8 COMMON: Add SeekableReadStreamEndianWrapper 2022-11-29 00:06:49 +01:00
Vladimir Serbinenko
93efb9b8c5 COMMON: Allow DisposablePtr to be backed by SharedPtr
Currently DisposablePtr allows to transparently switch between raw
pointer and ScopedPtr semantics. Add a possibility to have SharedPtr
semantics as well.
2022-11-28 18:41:30 +01:00
Vladimir Serbinenko
68452ef2e7 COMMON: Kill disownPtr and getDispose from DisposablePtr
They unnecessarily expose internal details

Their only user has been eliminated in the previous commit
2022-11-28 18:41:30 +01:00
Vladimir Serbinenko
02f1759f73 COMMON: Add functions to dynamically cast DisposablePtr 2022-11-28 18:41:30 +01:00
Vladimir Serbinenko
8d722dc3c1 COMMON: Add DisposablePtr constructor with move semantics
This allows easy move from one DisposablePtr to another
2022-11-28 18:41:30 +01:00
Vladimir Serbinenko
ba10a93d99 COMMON: Support multivolume arj archives 2022-11-28 00:25:05 +01:00
Sergio
d136a5f54c COMMON: fix String::rfind for default value of pos (max value of size_t) 2022-11-26 23:13:42 +02:00
Eugene Sandulenko
9fda7aa12a
COMMON: Fix warning 2022-11-24 00:19:27 +01:00
Eugene Sandulenko
0a4580a34c
COMMON: Add missing override keyword 2022-11-24 00:18:37 +01:00
Donovan Watteau
8caa8db4ba COMMON: Drop register from common/gzio.cpp
Deprecated in C++11, incompatible with C++17.
2022-11-23 14:13:48 +01:00
Vladimir Serbinenko
c92ec629db COMMON: Convenience function for retrieving data fork 2022-11-20 17:21:44 +01:00
Vladimir Serbinenko
98f178c58f DETECTOR: Allow detecting with MacBinary with no resource fork 2022-11-20 17:21:44 +01:00
Cameron Cawley
e04000d4b0 COMMON: Move FFT, DCT, MDCT, RDFT, SineTable, CosineTable and getSineWindow into Math 2022-11-20 14:32:05 +01:00
Cameron Cawley
3441c7230d COMMON: Fix handling escaped percents in Common::U32String::format 2022-11-20 14:23:30 +01:00
Cameron Cawley
29024cded7 COMMON: Fix handling negative numbers in Common::U32String::format 2022-11-20 14:23:30 +01:00
elasota
b3c70aa1ba COMMON: Add Macintosh Finder Info types and add parsing of it to StuffItArchive. 2022-11-20 14:20:30 +01:00
D G Turner
ab636b708b COMMON: Fix Signed vs. Unsigned GCC Compiler Warning 2022-11-18 12:02:50 +00:00
Vladimir Serbinenko
33475787a2 COMMON: Add clickteam installer unpacker 2022-11-18 01:22:59 +01:00
Vladimir Serbinenko
c72ddd3ec7 COMMON: Import modified gzio from GRUB 2022-11-18 01:22:59 +01:00
Cameron Cawley
ed9c052d57 COMMON: Split Lua into a separate module 2022-11-16 22:45:26 +02:00
Hubert Maier
3fb0612194 JANITORIAL: COMMON: Correct Spelling Mistake
heigth -> height
2022-11-15 22:52:43 +02:00
Vladimir Serbinenko
ac0fa51d1c COMMON: Add mention of Rex Nebular in dcl. 2022-11-14 00:13:54 +02:00
Vladimir Serbinenko
a48b8dab49 COMMON: Add deleter for arrays 2022-11-14 00:13:54 +02:00
Le Philousophe
87bad2cc7d COMMON: Allow games to use overlay for something else than GUI
This can be used for subtitles without changing the mouse coordinates.
2022-11-12 19:12:05 +01:00
Donovan Watteau
d14114e6a9 COMMON: Fix duplicate "line" word in INIFile warning 2022-11-11 20:56:53 +01:00
Thierry Crozat
eff98b0c56 COMMON: Fix undefined behaviour in RandomSource constructor
The 'time.tm_year * 86400 * 366' line caused the result to overflow
what can be stored in an int; and signed int overflow is undefined
behaviour. The result goes into an unsigned int anyway, so now
all the intermediate computations are also done with unsigned int.
It still overflows (not on this line, but on the next one), but
that is fine as the standard guarantees that unsigned int overflow
wraps around.
2022-10-31 21:46:22 +00:00
Le Philousophe
032904f626 COMMON: Use forward to avoid extraneous copies
This is more a test than really useful as printf doesn't take objects
with move semantics
2022-10-30 18:37:16 +01:00
Le Philousophe
f0cf08ec91 COMMON: Add move semantics helpers 2022-10-30 18:37:16 +01:00
Le Philousophe
7021b938e5 COMMON: Add remove type helpers for const and volatile 2022-10-30 18:37:16 +01:00
Le Philousophe
1800117031 COMMON: Remove useless str.h inclusion
The util.h header must not include str.h as it will get used in it
(inclusion loop).
2022-10-30 18:37:16 +01:00
Hubert Maier
a722cd9811
COMMON: Correct spelling mistake
begining -> beginning
2022-10-27 15:56:05 +02:00
Hubert Maier
54e833d16b
COMMON: Correct spelling mistake
refrence -> reference
2022-10-27 15:56:05 +02:00
Hubert Maier
6633c32acb
Update endian.h
alot - > a lot of
2022-10-27 15:56:04 +02:00
Hubert Maier
6bd7b6a59b
COMMON: Correct spelling mistake
alot - > a lot
2022-10-27 15:56:04 +02:00