Commit Graph

3902 Commits

Author SHA1 Message Date
trembyle
5ef7793578 COMMON: Return updated language from obsolete code
When an obsolete language code is encountered in a user's
config file, we translate this to the updated language ID.
2021-11-11 12:06:15 +01:00
trembyle
c740f96f63 COMMON: Normalize and document language maintenance
* Add documentation to add or maintain language values
* Fix and reorder existing entries to match ISO standards
2021-11-11 12:06:15 +01:00
Orgad Shaneh
7a4e5612de JANITORIAL: Replace new[]/memset with new[]()
Mostly done using the following Ruby script:

(Dir.glob('**/*.cpp') + Dir.glob('**/*.h')).each do |file|
  s = File.read(file, encoding: 'iso8859-1')
  t = s.gsub(/(([\w_.\[\]]+)\s*=\s*new\s+\S+?\[[^\]]+?\](?!\())([^\{\}]*?)\n\s+memset\(\s*\2\s*,\s*0\s*,[^;]*;/m, '\1()\3')
  if t != s
    File.open(file, 'w') { |io| io.write(t) }
  end
end
2021-11-10 19:53:15 +01:00
Cameron Cawley
6dbb129f40 BACKENDS: Allow activating the system virtual keyboard using the keymapper 2021-11-01 16:54:39 +01:00
Eugene Sandulenko
f0af2b513b
COMMON: Remove c++11-compat.h. It is not needed anymore 2021-10-31 23:07:36 +02:00
Eugene Sandulenko
44bc2e2eab
COMMON: Fix punycode implementation for upper Unicode characters 2021-10-31 23:00:35 +02:00
Alexandre Detiste
6044504762 JANITORIAL: typos
some in the variable names, some in the comments;
no change for the strings that interract with original games assets
2021-10-31 20:46:31 +01:00
neuromancer
0925d2b823 COMMON: changed type of variable in the directory count loop 2021-10-31 19:15:06 +01:00
neuromancer
c608f28f05 COMMON: removed convertPath 2021-10-31 19:15:06 +01:00
neuromancer
ceaf573ecf COMMON: extended InstallShieldV3 support to read all the files in every subdirectory 2021-10-31 19:15:06 +01:00
Eugene Sandulenko
3b281bd85c
COMMON: Further synchronisation of the escape characters for punycode 2021-10-31 19:26:48 +02:00
Eugene Sandulenko
b9c5ef933f
COMMON: Sync punycode with JS/Python code:
* Allow [] in file names
* Process files ending with spaces or dots
2021-10-31 16:36:27 +02:00
Eugene Sandulenko
c544e5119b
COMMON: Remove USE_CXX11 checks, it is now always present 2021-10-31 11:52:29 +02:00
Le Philousophe
454e30312c COMMON: Add isAscii function to replace non standard isascii 2021-10-24 15:11:18 +03:00
Eugene Sandulenko
63870b65fa
AD: Properly seek to the tail of file for md5 computation 2021-10-19 21:09:15 +03:00
Eugene Sandulenko
841254e6f1
AD: Fix seeking for tail md5 2021-10-19 13:05:22 +03:00
Eugene Sandulenko
91b91c0cba
COMMON: Fix bug in Mac resfork data size calculation. This invalidates many detection entries 2021-10-17 20:48:02 +03:00
Eugene Sandulenko
4eea8524f7
COMMON: Add possibility to compute md5 for tail of resfork data 2021-10-17 20:48:01 +03:00
Thierry Crozat
32d4173fda COMMON: Remove unused and useless getCurrentCharset in TransMan
Now all translations use unicode.
2021-10-02 23:50:21 +01:00
Thierry Crozat
ebd8915009 GUI: Simplify builtin language check 2021-10-02 23:50:21 +01:00
Cameron Cawley
987c0eb76a COMMON: Add a signed version of uintptr 2021-09-19 11:21:41 +03:00
TehGelly
0992fa9c3b
COMMON: Change PRNG Function to Xorshift* (#3341)
The old RNG method had non-standard periods, ranging from some seeds looping on themselves (seed = 1184201285) to some seeds having periods as low as 11 or 48, as listed in https://github.com/scummvm/scummvm/pull/3340. This is a problem even for games that run the RNG once a frame, as the possibilities for random events is greatly reduced should the initial seed be in one of these sets of small periods.

Xorshift* is a standard, fast, non-cryptographic PRNG with academic backing that has period 2^32-1 (all seeds lead to another seed except 0, which is excluded from the initial seeds).  Many different flavors are possible, as listed in the paper, but the choice implemented in this pull request uses only a single 32-bit integer as a state, like the old PRNG.

Co-authored-by: Thierry Crozat <criezy@scummvm.org>
Co-authored-by: Filippos Karapetis <bluegr@gmail.com>
2021-09-09 21:46:08 +03:00
Scott Percival
666f241d29 EVENTRECORDER: Remove backwards compatibility 2021-09-09 19:32:02 +02:00
Scott Percival
fb421a0ca7 EVENTRECORDER: Change file format to big-endian
Previously the file format had all chunks, offsets and values stored in
little-endian format. The one exception was screenshots, which used the
existing THMB code in graphics/thumbnail.cpp, that is entirely
big-endian. Any tooling which attempts to parse the Event Recorder file
format must make a special exception for THMB chunks, and read the chunk
size and contents as big-endian.

In the interests of making the file format more consistant
to parse, and given that backwards compatibility is not required for
this iteration of Event Recorder, this patch changes everything to
big-endian.
2021-09-09 19:32:02 +02:00
Scott Percival
1040bd2862 EVENTRECORDER: Fixes based on feedback 2021-09-09 19:32:02 +02:00
Scott Percival
84707ec828 EVENTRECORDER: Prevent recursive call to warpMouse 2021-09-09 19:32:02 +02:00
Scott Percival
5cbcd98963 EVENTRECORDER: Add screen update tracking
Screen update boundaries are now used as sync points.
Screenshots are now processed on a screen update boundary.

This change increments the version of the Event Recorder
file format to 2; version 1 files will still play back as
before, without synchronising to screen updates.
2021-09-09 19:32:02 +02:00
Torbjörn Andersson
15916e02f1 COMMON: Fix Valgrind warning in PEResources
As with NEResources, _disposeFileHandle was never set.
2021-09-06 08:37:25 +02:00
Torbjörn Andersson
e14ffec25a COMMON: Fix _disposeFileHandle not being set
If there is a file handle, the clear() method checks if it should be
disposed of. However, the _disposeFileHandle variable was never set, so
it's unlikely that _exe was ever deleted. I found this out from a
Valgrind warning when quitting Buried in Time.

This seems like a very obvious fix to me, and as such it seems like a
good candidate for backporting to the release branch. On the other hand,
maybe there are cases where it worked by sheer, dumb luck? I'm not
familiar enough with where and how it is used.
2021-09-06 08:01:08 +02:00
Torbjörn Andersson
24ea36d3e9 COMMON: Don't decompress more bytes than the file specifies (bug 12900)
When running my CD version of Buried in Time, the loadFromCompresedEXE()
function would try to decompress beyond the allocated buffer, causing it
to crash. Up to that point, the decompressed data was identical to what
I would get if I let the original installer decompress the EXE and DLL
files.

So keep track of how many bytes have been decompressed, and terminate
when the upper limit is reached.
2021-09-05 21:26:49 +03:00
Matthew Duggan
2c4aae5294 COMMON: Use const references where possible in punycode
As suggested by coverity.
2021-09-04 23:15:23 +03:00
trembyle
05a27c3cfc COMMON: Add Macromedia/Adobe Shockwave as platform
These can be big- or little-endian. The development platform can be
autodetected based on RIFX/XFIR in header.

These games ran in Shockwave Player either as a standalone app or as
web browser plugins on Windows and Mac.

Shockwave game added as D6 detection entry as an example.
2021-08-31 11:44:44 +02:00
trembyle
8cea642962 COMMON: Add constants for new Director game languages
Catalan and Flemish use existing ISO/locale codes

Arabic uses generic ARB for country code. There is no clear country code
to apply here. We can take ARB to mean Arab League or Modern Standard
Arabic.

TODO: Consult Arabic speakers on country-level dialects
2021-08-31 11:44:44 +02:00
Die4Ever
b617364f45 COMMON: improve RandomSource initial seed
This improves the range of seeds compared to using only getMillis (which
is the number of milliseconds since program start) as the seed. This was
especially an issue if you started the game directly from command line,
Steam, or GOG instead of using the ScummVM interface. Previously the
initial seed was just the load time, which can have very small variance
on a fast computer.
2021-08-28 22:55:13 +02:00
sluicebox
386c5659ec BASE: Purge keyboard/mouse events before running Engine
Fixes GUI events leaking into engines at startup. This caused
Phantasmagoria 1 to skip its introduction if the game was started from
the ScummVM GUI with a keyboard (Enter) but not with a mouse because
the key-down event started the engine and the key-up event remained
in the queue.

This also purges and mouse events since we happen to already have a
purgeMouseEvents() method. We may want to also clear joystick inputs,
or possibly the entire event queue, but that can be done after the
upcoming release. For now, the known bug is fixed.
2021-08-23 15:46:33 -05:00
SupSuper
c9d67e48a9 BACKENDS: Use FSNode::getName in string operations 2021-08-23 21:22:27 +01:00
SupSuper
8c86319923 BACKENDS: Use U32String for FSNode::getDisplayName 2021-08-23 21:22:27 +01:00
Orgad Shaneh
a0c818bde6 COMMON: Introduce SaveFileManager::exists
Checks if a savefile with given name exists.

Implement on all backends.
2021-08-23 13:34:35 +02:00
djsrv
952dc3d3e1 COMMON: Fix punycoding strings with no ASCII chars 2021-08-22 14:42:33 -04:00
djsrv
ad6f533175 COMMON: Fix punycode encoder/decoder
These need to use Unicode code points, not raw bytes.
2021-08-22 13:11:26 -04:00
djsrv
7b71e617f6 COMMON: Fully remove old punycode path functions 2021-08-22 11:45:02 -04:00
Fiodar Stryzhniou
fe274d10ba COMMON: Fix c++ header usage. 2021-08-18 18:22:55 +03:00
Eugene Sandulenko
83fc4f7338
COMMON: Persist global debug channels between engine runs 2021-08-16 21:33:15 +02:00
Eugene Sandulenko
ed09f11eaa
COMMON: Keep only one instance of global debug flags 2021-08-16 20:43:16 +02:00
Thierry Crozat
abf782c670 COMMON: Remove kFeatureHiDPI from OSystem and use getHiDPIScreenFactor instead 2021-08-13 21:41:33 +01:00
Thierry Crozat
6d8462674f COMMON: Add getHiDPIScreenFactor to OSystem 2021-08-13 21:41:33 +01:00
Eugene Sandulenko
a197e7e795
COMMON: Added MacintoshII platform 2021-08-13 17:07:27 +02:00
djsrv
9c6fa32c82 COMMON: Create DisposablePtr::getDispose() 2021-08-12 13:18:27 -04:00
djsrv
b40233ffe7 COMMON: Create DisposablePtr::disownPtr() 2021-08-12 13:18:27 -04:00
Le Philousophe
6a82f704d4 COMMON: Fix build with old GCC 2021-08-11 12:01:40 +02:00