Commit Graph

3033 Commits

Author SHA1 Message Date
Filippos Karapetis
7f83640894 SCI32: Add a game option to double the videos in KQ7 by default
Scaling works correctly with the Windows variant, which uses AVI files,
but the DOS variant uses Robot videos, and the way scaling is done
there is different, and is not working yet with KQ7 DOS. Nonetheless,
both versions are included in the game, so it's not a major issue.
2018-09-01 13:14:38 +03:00
David Fioramonti
51c11efbbc COMMON: Cos/Sin Table switch internal structure so at() is faster
A new internal table has been added so that no if checks need to
be performed for the at() lookup.

The old table can still be accessed using getTable or atLegacy().

at() and atLegacy() return the same values, but at() is faster.
2018-08-25 23:51:40 +02:00
David Fioramonti
cf99bb0a5e COMMON: Update RDFT and DCT cos/sin table constructor usage
When the constructor for the cos/sin table was changed from
number of bits to number of points all usages thoughout the
code should of been changed, but this was missed in RDFT and DCT.

Fixes Trac#10683.
2018-08-25 23:50:07 +02:00
Ľubomír Remák
0e90d6eae3 MUTATIONOFJB: Use advanced detector. 2018-08-25 23:12:01 +02:00
David Fioramonti
da57cef0c3 COMMON: FFT update cos/sin table constructor change
They now take in the size rather than the power of 2 exponent.
2018-08-18 16:30:57 +02:00
David Fioramonti
9cfc70e7fe COMMON: allow cos/sin number of points to be more flexible
Previously, the cos/sin table had to be a power of 2, but there
are many use cases where the number of points is not necessarily
a power of 2 so this change the constructor so it now takes
in the number of points rather than the number of points as the
exponent of a power of 2.

The restriction is that the size must be divisible by 4.
2018-08-18 16:30:57 +02:00
Cameron Cawley
4016cffd7a COMMON: Make strdup a forbidden symbol 2018-08-18 16:30:05 +02:00
Cameron Cawley
7a437e909c COMMON: Move new_strdup to common/str.cpp 2018-08-18 16:30:05 +02:00
Andrei Prykhodko
47130eceb3 COMMON: changed code page constant name from ascii to utf8 2018-08-05 22:50:42 +03:00
Andrei Prykhodko
ca54a72072 COMMON: made code pages conversion arrays static and constant 2018-08-05 21:57:36 +03:00
Andrei Prykhodko
9948b2452f COMMON: named CodePage enum 2018-08-05 21:53:31 +03:00
Andrei Prykhodko
62c250a8be COMMON: added method to convert text from various code pages to Unicode 2018-08-05 20:32:25 +03:00
lolbot-iichan
d91307e401 COMMON: Added Ukrainian language
Common::UA_UKR is needed for FoxTail game at WinterMute engine
2018-08-03 00:43:33 +02:00
Thierry Crozat
53d0fe22d9 COMMON: Fix HashMap never reusing erased items storage
When erasing and inserting many items this caused the hashmap capacity
to grow more than it should which resulted in performances issues (and
possibly memory issues as well). The issue was reported on IRC today
with the wintermute engine.
2018-07-30 19:32:02 +01:00
David Fioramonti
650e26b6ab COMMON: Add at() index function to cosine/sine table
The cos/sin table class now has an at() function for indexing
safely into its internal array.

This allows the checking and computing of the correct
indexes to be done internally.

The indexing in allows cos/sine of 0 to 2pi to be
obtained.

The values returned by getTable are the same as before.

Comments that describe the values that the table
contains has been modified to line up with what
the code is doing.
2018-07-25 10:18:32 +02:00
Thierry Crozat
89f1b1c96e GUI: Add Stretch Mode selection in Options dialog 2018-07-08 16:54:51 +01:00
Thierry Crozat
8526c2c31a OSYSTEM: Add Stretch Mode API 2018-07-08 16:54:51 +01:00
Eugene Sandulenko
4d847d83ed COMMON: Added Finnish language constants 2018-06-28 23:51:32 +02:00
Eugene Sandulenko
79e158671e COMMON: Add simplistic UTF8->UTF32 converter 2018-06-18 00:08:01 +02:00
Bastien Bouclet
3b794d2633 MOHAWK: Display a GUI error message when no audio devices are available 2018-06-07 20:14:27 +02:00
David Fioramonti
2fcc429498 COMMON: More nullptr usage in common/ptr
Replaces some more ptr=0 with ptr=nullptr.
2018-06-04 03:36:27 -07:00
Thierry Crozat
4229e2642e
Merge pull request #1141 from DanielSWolf/larryscale
SCI: High-quality "LarryScale" cel scaler for LSL7
2018-06-03 17:41:47 +01:00
David Fioramonti
8d10fbe1ba COMMON: coding convention improvements for degree conversion funcs
Removed whitespace before template keyword.

Made template types camel case starting with lowercase.
2018-05-28 23:00:53 +01:00
whiterandrek
ac5f61265f COMMON: fix wrong size assignment in HashMap 2018-05-25 19:13:14 +01:00
Adrian Frühwirth
cee4d6b853 JANITORIAL: Fix trailing whitespace 2018-05-24 15:30:55 +02:00
David Fioramonti
abb8ae0936 COMMON: Template deg2rad and rad2deg in Common/math
The input and output type can be different.

Currently, rad2deg is only being used by sci (float to int)
and deg2rad in wintermute.
2018-05-20 11:21:06 +01:00
Bastien Bouclet
955e18c648 COMMON: Use nullptr instead of NULL or 0 where appropriate 2018-05-10 08:35:46 +02:00
Bastien Bouclet
7382af32be GUI: Make the tab completion case insensitive in the debug console
It made little sense for the tab-completion to be case sensitive while
command execution itself is case insensitive.
2018-04-30 20:31:44 +02:00
Lothar Serra Mari
05c1e593c0 COMMON: Add hasInstance() bool to singleton class 2018-04-29 21:47:10 +01:00
Thierry Crozat
3fe0e3c38e OSYSTEM: Add API to copy text to clipboard
This has also been implemented for the SDL2 and macOS backends.
2018-04-29 21:47:10 +01:00
Adrian Frühwirth
a20f90cbb7 JANITORIAL: Fix formatting 2018-04-22 00:56:21 +02:00
Adrian Frühwirth
9bee9e1ba6 JANITORIAL: Fix whitespace 2018-04-19 12:08:31 +02:00
Adrian Frühwirth
3747d852ee JANITORIAL: Fix whitespace 2018-04-15 16:31:31 +02:00
Adrian Frühwirth
00e59a3122 ALL: Load savegame thumbnail only when necessary
This commit introduces the following changes:

1. Graphics::loadThumbnail()

   Now returns a boolean and takes a new argument skipThumbnail which
   defaults to false. In case of true, loadThumbnail() reads past the
   thumbnail data in the input stream instead of actually loading the
   thumbnail. This simplifies savegame handling where, up until now,
   many engines always read the whole savegame metadata (including
   the thumbnail) and then threw away the thumbnail when not needed
   (which is in almost all cases, the most common exception being
   MetaEngine::querySaveMetaInfos() which is responsible for loading
   savegame metadata for displaying it in the GUI launcher.

2. readSavegameHeader()

   Engines which already implement such a method (name varies) now take
   a new argument skipThumbnail (default: true) which is passed
   through to loadThumbnail(). This means that the default case for
   readSavegameHeader() is now _not_ loading the thumbnail from a
   savegame and just reading past it. In those cases, e.g.
   querySaveMetaInfos(), where we actually are interested in loading
   the thumbnail readSavegameHeader() needs to explicitely be called
   with skipThumbnail == false.

   Engines whose readSavegameHeader() (name varies) already takes an
   argument loadThumbnail have been adapted to have a similar
   prototype and semantics.
   I.e. readSaveHeader(in, loadThumbnail, header) now is
   readSaveHeader(in, header, skipThumbnail).

3. Error handling

   Engines which previously did not check the return value of
   readSavegameHeader() (name varies) now do so ensuring that possibly
   broken savegames (be it a broken thumbnail or something else) don't
   make it into the GUI launcher list in the first place.
2018-04-07 09:26:20 +02:00
Adrian Frühwirth
a0d7a99439 COMMON: Add WARN_UNUSED_RESULT to scummsys.h 2018-04-04 20:56:41 +00:00
Adrian Frühwirth
4c5afcf780 COMMON: Verify nb_NO locale
Despite looking weird, this is the correct locale for Norwegian (Bokmål).
2018-04-04 22:48:28 +02:00
Adrian Frühwirth
f8a195b034 COMMON: Fix Doxygen comment 2018-03-29 00:19:33 +02:00
Adrian Frühwirth
d623ec2c38 COMMON: Fix UB, left shift of negative value 2018-03-22 22:16:24 +01:00
Daniel Wolf
999cf71dcf SCI: Add game option for enabling/disabling LarryScale in LSL7
All other SCI games continue using the default scaler.
2018-03-16 22:33:06 +01:00
Colin Snover
2e061d95c5 COMMON: Move VER macro for serializer into common code 2018-01-31 17:58:01 +01:00
Colin Snover
157ee95f64 COMMON: Add support for array serialization to Serializer
SCUMM engine does quite a bit of direct array serialization.
2018-01-31 17:58:01 +01:00
Bastien Bouclet
2c8afb2bd2 COMMON: Add a reset method to DisposablePtr 2017-12-28 21:18:51 +01:00
Colin Snover
a5bc89102e ALL: Remove obsolete register keyword
The register keyword was deprecated from the C++11 standard,
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4193.html#809>,
and removed from the C++17 standard,
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4340>, so
cannot exist in a well-formed C++17 program.

It has never done anything in GCC
<https://gcc.gnu.org/ml/gcc/2010-05/msg00113.html>
and because of the way it is specified in the standard, it is “as
meaningful as whitespace”
<http://www.drdobbs.com/keywords-that-arent-or-comments-by-anoth/184403859>.

The one remaining use of the register keyword is in the DS backend,
where it is used to create a local register variable using the
non-standard GCC Extended Asm feature.

Closes gh-1079.
2017-12-03 20:27:42 -06:00
Colin Snover
02614f2f1a COMMON: Fix UB shifting negative integers
Compilers optimise these back into shifts on architectures where
shifts of negative integers work the same as mul/div, so this
solves the UB without actually causing any performance issue.
2017-12-01 19:22:24 -06:00
Bastien Bouclet
acf87add27 COMMON: Improve spacing between members in the event structs 2017-11-19 20:16:10 +01:00
Bastien Bouclet
8beb519c5e EVENTS: Rename synthetic to kbdRepeat 2017-11-19 16:12:50 +01:00
Colin Snover
076667dc00 COMMON: Add limited support for custom deleters to ScopedPtr
Custom deleters of ScopedPtr are not currently fully conforming to
C++11's support for custom deleters in std::unique_ptr for the
sake of simplicity of implementation. Unlike in the standard
library, plain functions and lvalue references are not supported,
nor may custom deleters be passed to the constructor at runtime.
This can be improved in the future, if necessary, by doing what
standard library implementations usually do and creating a Pair
class that uses the Empty Base Optimization idiom to avoid extra
storage overhead of the deleter instance when it is not needed, as
in typical standard library implementations, plus some additional
type traits to support the necessary metaprogramming for the
different type overloads.
2017-11-18 22:35:12 +01:00
Colin Snover
dda0f77bcf COMMON: Add basic fixed-width word wrap to Common::String 2017-11-10 09:57:41 -06:00
Colin Snover
2de83e0937 COMMON: Use C++11 static_assert when available
This improves the output of static assertions in all compilers,
and prevents problems in MSVC 2015 where the mechanism for
triggering a compilation error in C++98 mode may cause errors when
that compiler builds in release mode.

Fixes Trac#10154.
2017-11-10 09:56:43 -06:00
Bastien Bouclet
bd82345f0b Merge pull request #1035 from bgK/require-64bits-integers
BUILD: Require 64bits integers
2017-10-25 19:17:11 +02:00