Commit graph

4582 commits

Author SHA1 Message Date
sluicebox
db19c5a8c2 COMMON: Remove unreachable code
CID 1565716
2024-11-27 13:09:31 -08:00
neuromancer
d182fafe07 COMMON: added (unsigned) long long hash functors 2024-11-23 15:34:55 +01:00
Le Philousophe
be55ccf1a3 COMMON: Remove two outdated function prototypes from Path
These functions don't exist at all.
2024-11-15 09:37:18 +01:00
Le Philousophe
234f3eb7f9 COMMON: Don't puny encode paths using UTF-8 but Latin-1
This avoids choking on invalid codepoints under Windows without
Unicode.
Latin-1 encoding has an identity mapping: every byte in the String will
get translated as-is in the U32String.

Don't modify punycodeDecode and punycodeEncode as the official
punyencoder uses unicode codepoints.
2024-11-15 09:37:18 +01:00
Le Philousophe
6678e1b5b1 COMMON: Avoid encoding paths if possible on all drive based platforms 2024-11-15 09:37:18 +01:00
Le Philousophe
0200a3d562 COMMON: Avoid punycoding of Win32 paths
Win32 paths contain a colon which triggers punycoding.
For Win32 UNICODE, paths are encoded in UTF-8 so there is not a real
need to puny-encode them anyway.
Only detect flagrant forbidden cases and store them the traditional way.

Without UNICODE support, the paths are provided in the system encoding.
Storing them as-is would make the configuration file mixing encodings.
For such paths don't punyencode if they don't need it after the drive
specifier.
2024-11-15 09:37:18 +01:00
Le Philousophe
93c68d38d4 COMMON: Allow to determine if a path needs punyencoding 2024-11-15 09:37:18 +01:00
Le Philousophe
890b0c49bf COMMON: Make punycode_needEncode coherent with punycode_encode
This is a follow-up of b930232e6d
2024-11-15 09:37:18 +01:00
Eugene Sandulenko
754827c68d
COMMON: Avoid scanning out of game directory for AppleDouble files. Bug #15016
Also implement sanity check for paths containing drive, e.g. "Games:" on Amiga
or "D:" on Windows.
2024-11-12 01:10:47 +01:00
Eugene Sandulenko
c6daf24573
COMMON: Add Path::numComponents() method 2024-11-12 01:10:46 +01:00
Le Philousophe
c2db9da310 COMMON: Fix replace with consecutive from characters
The commit 35125f5509 introduced a
spurious +1 which implies skipping a character while looking for the
next character to replace.
2024-11-11 13:01:00 +01:00
Eugene Sandulenko
93ffa28ffe
COMMON: Process gracefully when unarj cannot unpack into memory 2024-11-11 01:00:19 +01:00
Paul Gilbert
aa33d5f720 COMMON: Fix World of Xeen crashing when run from command line
Fixes bug #15079
When run from the command line, the engine starts up and hooks
in the mm.dat data archive. Then when the debugger console is
created, it only then iterates through all the archives for
theme files. The problem was that there was an assert in the
archive class to prevent engines using data from the wrong
subfolder in cases like the MM engine which has multiple games.
So the themes code triggered that by iterating over all the files.

When the game was run from the GUI this wasn't triggered, because
theme files had already been loaded for the launcher prior to the
game starting.
2024-11-10 09:36:26 -08:00
Eugene Sandulenko
52b7b3194c
COMMON: Return application-level value for ConfMan if exists. Bug #15262
This has been since forever. As it is mentioned in the config-manager.cpp,
we need to get rid of these methods. So far, they are used in GUI as supposed
and by usage, the devs were always relying on this behavior.

Thus, changing it should be safe as it seems, however, I plan to remove
these methods completely, so it stays clean without side effects.
2024-11-10 02:16:45 +01:00
Eugene Sandulenko
403a7eaf15
I18N: Added I18N comments for rotation modes 2024-11-08 01:13:23 +01:00
Eugene Sandulenko
656ae92585
Revert "COMMON: Add destructor to TextToSpeechManager. CID 1453087"
This reverts commit d06a7f1168.

The destruction is happening in the backend.
2024-10-25 17:27:46 +02:00
Eugene Sandulenko
d06a7f1168
COMMON: Add destructor to TextToSpeechManager. CID 1453087 2024-10-25 15:59:56 +02:00
Paul Gilbert
2e5eaba8f1 M4: RIDDLE: Merge duplicated click_x/y and player.click_x/y
This fixes the Gallery room, where looking at the cartoons
was previously all showing the same cartoon
2024-10-20 10:50:49 -07:00
Le Philousophe
e61dac6c68 BACKENDS: Allow write streams to be created atomically
When creating an atomic write stream, the file is only created once it
is closed.
This can be done using a temporary file.
This commit only adds the API but not the proper implementation.
2024-10-15 22:45:50 +02:00
Martin Gerhardy
d0d366de50 COMMON: fixed whitespaces 2024-10-11 10:36:14 +02:00
athrxx
c11193f35c COMMON: add Windows 16 colors render mode option 2024-10-09 08:35:11 +03:00
AndywinXp
384968ced2 COMMON: Add getResLength() to MacResManager 2024-10-04 12:40:12 +02:00
Le Philousophe
6d6b48ab64 COMMON: Fix typo in string
Reported by @tunnelsociety
2024-09-29 17:10:05 +02:00
Le Philousophe
27c7a64683 COMMON: Add ImGui API to create images 2024-09-29 17:04:03 +02:00
Vladimir Serbinenko
488353480f SDL, COMMON: Support screen rotation 2024-09-29 02:10:39 +03:00
sluicebox
9e54b692e4 COMMON: Fix memory leak in releaseCJKTables 2024-09-22 19:13:58 -07:00
Thierry Crozat
8f6ab97f67 COMMON: Add scumm_assert macro
This macro is similar to the assert macro but differs in two aspects.
First it is not disabled when NDEBUG is defined and thus remains
enabled in release builds. Secondly it uses error() for the error
message which ensures it is available to the user (e.g. shown on
screen, or at least logged) on all platforms.

Those differences make it more appropriate than assert() for sanity
checks that we want to keep in release builds, for example related
to reading content from game data files that may be corrupted.
2024-09-20 19:54:52 +03:00
Filippos Karapetis
a689ba0d95 COMMON: Replace NDEBUG define checks with RELEASE_BUILD 2024-09-20 19:05:29 +03:00
Eugene Sandulenko
c71697975a
COMMON: Make the collision warnings unique
This fixes 3 equal warnings in different code branches, so the
rootcause could be identified more easily
2024-09-16 21:35:15 +02:00
Hubert Maier
c96b045510 JANITORIAL: COMMON: Fix typos 2024-09-13 12:06:46 +03:00
Vladimir Serbinenko
fb045768e3 COMMON: Support transcoding Traditional Chinese to Simplified 2024-09-13 00:11:38 +02:00
Vladimir Serbinenko
510d97dae8 COMMON: Fix bug when using old encoding.dat 2024-09-13 00:11:38 +02:00
Le Philousophe
d7f0142af1 COMMON: Force use of int for uint32 for some platforms
These platforms define int32_t as being `long int` which makes a lot of warnings when %d is used for uint32 values.
On these platforms `int` and `long int` are equivalent.

Co-authored-by: Filippos Karapetis <bluegr@gmail.com>
2024-09-08 00:47:36 +03:00
Cameron Cawley
8162951761 COMMON: Replace type detection in configure with aliases for stdint.h types 2024-09-08 00:47:36 +03:00
Le Philousophe
35491fdea8 PSP: Load additional headers at the end after all typedefs
We need byte type for them
2024-09-08 00:47:36 +03:00
sluicebox
9f91a01124 COMMON: Fix DiskImage stream deletion 2024-08-26 11:55:36 -07:00
kunxl-gg
6c2c8924d7 COMMON: Add ConfigManager::setFloat and ConfigManager::getFloat
Signed-off-by: kunxl-gg <tiwari.25@iitj.ac.in>
2024-08-25 23:17:20 +02:00
kunxl-gg
624d5a59b3 JANITORIAL: Get rid of redundant whitespaces
Signed-off-by: kunxl-gg <tiwari.25@iitj.ac.in>
2024-08-25 23:17:20 +02:00
Eugene Sandulenko
83f07ddc49
COMMON: Added Lithuanian to the language list 2024-08-25 20:46:45 +02:00
sluicebox
23a9f4ed54 COMMON: Add DiskImage lazy-decoding mode
Images can now be read without decoding all disk tracks.

This allows DiskImage to be used in detection code, where only
a little disk data is needed. Otherwise, formats such as WOZ
would cause noticeable delays due to decoding entire disks.
2024-08-25 14:57:06 +03:00
sluicebox
5a7555dfcc COMMON: Add BitArray::size() 2024-08-25 14:57:06 +03:00
sluicebox
f31eb92d7a COMMON: Add DiskImage enhancements
- open(FSNode)
- releaseStream()
- ".do" file extension recognized
- Parsing errors handled instead of calling error()
- Skip sector logging when it does nothing
2024-08-25 14:57:06 +03:00
sluicebox
78552492b1 ADL: Move DiskImage into COMMON 2024-08-25 14:57:06 +03:00
sluicebox
b5c4802ea8 COMMON: Remove MemoryReadStream::seek() assertion 2024-08-24 14:38:09 -07:00
Donovan Watteau
4092006494 COMMON: Fix inttypes.h behavior on macOS 10.4
The macOS 10.4 SDK uses the non-standard (BSD) '%q' value, instead of
the more standard '%ll' value, triggering -Wformat warnings. This was
fixed in the 10.5 SDK, so borrow its fixes when targeting 10.4.

Also, __STDC_CONSTANT_MACROS is be necessary for OSX < 10.7.
2024-08-24 00:42:47 +02:00
Eugene Sandulenko
4f247f6e80 COMMON: Fix potentially uninitalized variable. CID 1559623 2024-08-23 15:33:27 +02:00
Krish
764e4c15ae COMMON: FORMATS: Make _panoTrack protected 2024-08-14 21:52:03 +02:00
Krish
aee953ca0b COMMON: FORMATS: Make QTVRType enum public 2024-08-14 21:52:03 +02:00
Orgad Shaneh
255d0d35fa COMMON: Fix function comment
It was copied from emplace.
2024-08-13 22:46:36 +03:00
Cameron Cawley
5f24ed9a83 COMMON: Remove emplace_back variant from Std::vector 2024-08-11 19:46:37 +03:00