652 Commits

Author SHA1 Message Date
Colin Snover
87285ef609 SWORD25: Fix possible redefinition of FLT_EPSILON 2017-11-17 22:47:59 -06:00
D G Turner
5199f9d080 SWORD25: Suppress GCC Cast Qualification Warnings.
Since lua_pushlightuserdata and lua_touserdata operate on (void *)
values, it is tricky to fix these warnings "correctly" without looking
at invasive changes to a significant amount of Lua internal code.

Since these pointers to consts are already being recast to drop the
const qualifications, then removing the const on the underlying value
declaration does not further expose this to change and stops the
compiler warnings associated with this.

Anyone with a better fix for this can restore the const
qualifications later.
2017-11-12 20:55:59 +00:00
Bastien Bouclet
443211d9ff SWORD25: Add a constructor to initialize SoundHandle members
Fixes #7018
2017-11-11 13:26:22 +01:00
Bastien Bouclet
08f9e05b15 SWORD25: Fix leaking the save thumbnail surface 2017-11-11 13:26:22 +01:00
Colin Snover
432fd522d2 ENGINES: Remove default1x scaler flag
This flag is removed for a few reasons:

* Engines universally set this flag to true for widths > 320,
  which made it redundant everywhere;
* This flag functioned primarily as a "force 1x scaler" flag,
  since its behaviour was almost completely undocumented and users
  would need to figure out that they'd need an explicit non-default
  scaler set to get a scaler to operate at widths > 320;
* (Most importantly) engines should not be in the business of
  deciding how the backend may choose to render its virtual screen.
  The choice of rendering behaviour belongs to the user, and the
  backend, in that order.

A nearby future commit restores the default1x scaler behaviour in
the SDL backend code for the moment, but in the future it is my
hope that there will be a better configuration UI to allow users
to specify how they want scaling to work for high resolutions.
2017-10-07 12:30:29 -05:00
Bastien Bouclet
ddac55699d SWORD25: Fix leaking the lua state MemoryWriteStreamDynamic buffer 2017-09-22 07:06:20 +02:00
Bastien Bouclet
9c2cfee4e5 SWORD25: Fix leaking the save thumbnail MemoryWriteStreamDynamic 2017-09-22 07:06:20 +02:00
Torbjörn Andersson
665f5c99b2 JANITORIAL: Silence some more GCC 7 fall through warnings
I think these are the last one that were already flagged as being
deliberate.
2017-08-06 16:54:38 +02:00
Torbjörn Andersson
a57c5b385d SWORD25: Increase buffer length to silence GCC 7 warning 2017-08-06 16:42:40 +02:00
Torbjörn Andersson
3d8d5541dc JANITORIAL: Silence GCC 7 fall through warning 2017-08-06 16:40:42 +02:00
Eugene Sandulenko
940b2a20f1 Revert "COMMON: Change way the Singleton instances are instantiated"
This reverts commit eefa72afa1978a9dea10f5b1833fcc8f58a3468e.

With this patch ConfigManager is broken.
2017-07-10 21:17:41 +02:00
Thierry Crozat
eefa72afa1 COMMON: Change way the Singleton instances are instantiated
This fixes tons of warnings with clang from a recent xcode version on
macOS (and possibly other systems) complaining that an instantiation
of _singleton is required but no definition is available.
2017-07-10 21:11:20 +02:00
Willem Jan Palenstijn
c3d533a72b SWORD25: Use direct integer index into indexTbl
This matches the behaviour of the Pluto rewrite Eris, and avoids
casting the integer indices to void *.

I verified this code by running this method in parallel with the current
lightuserdata/void* approach and asserting the retrieved objects were
identical when loading a savegame.
2017-01-28 18:47:11 +01:00
D G Turner
5fbb4fc6a0 SWORD25: Fix Warnings about Copy Constructor Failing to Call Base Class. 2017-01-16 09:57:50 +00:00
Eugene Sandulenko
dead4aa014 JANITORIAL: Remove trailing spaces 2016-10-09 14:59:58 +02:00
Eugene Sandulenko
cad834a69c JANITORIAL: Fix include statements 2016-09-03 15:19:37 +02:00
Eugene Sandulenko
fd4bdcc01c SWORD25: Use # as savefile matching pattern 2016-06-08 10:19:12 +02:00
Filippos Karapetis
b966286b17 SWORD25: Fix signed/unsigned warning 2016-05-22 16:28:42 +03:00
Eugene Sandulenko
33abb6118f ALL: Change main engine header guard defines to <directory>_<engine>_H
Recently we started to use this as new semantics, although in the past
we used simly <engine>_H. Now these guard defines are consistent with
rest of the files which are used in the engines.
2016-05-17 18:21:30 +02:00
Eugene Sandulenko
090faf5e9f SWORD25: Bail out instead of silently leaving the object in incosistent state 2016-05-06 11:41:52 +02:00
Eugene Sandulenko
2389de7a8d SWORD25: Translate couple of comments 2016-05-06 11:41:10 +02:00
Eugene Sandulenko
61c9d17abf SWORD25: Fix class initialization 2016-05-06 11:31:53 +02:00
Ori Avtalion
3564032330 JANITORIAL: Reduce audio header dependencies 2016-04-14 16:10:21 +03:00
ottogin
25c852f1a5 SWORD25: Fix frozen/flickering title menu movie
Fixes bug #6978: Unload old movie before loading a new one
2016-03-14 03:29:03 +03:00
Eugene Sandulenko
54ec965f89 Merge pull request #699 from criezy/sword25-en-speech
SWORD25: Add engine option to use English speech instead of German
2016-03-09 10:16:54 +01:00
Thierry Crozat
2f1ae3fb4e SWORD25: Fix error after changing language in-game with the data file distributed by ScummVM
Changing the language in-game causes the language to be set for the target in the
scummvm.ini file. Then the next time we try to start the engine, if was causing an error
(Sword25 failed to instantiate engine: Game data not found) because there was no match
for the path and language in the detection table. Setting the language to Unknown in
the detection table for this multilingual data file fixes the issue.
2016-03-09 00:38:08 +00:00
Thierry Crozat
90a86fd39c SWORD25: Add engine option to use English speech instead of German
When selecting non-English language, the scripts default to using
German voices. This commit edits the file path on the fly to use instead
English voices for all languages other than German. This implements bug
#6804 - SWORD25: add option to choose language speech.

If the English voice pack is not present it falls back to using German voices.

The way this is implemented here however does not allow to use German
voices with English text or English voices with German text. This could be
achieved with a slightly different implementation of the same idea.
2016-03-09 00:02:45 +00:00
Johannes Schickel
0b6befdcc5 ENGINES: Make variable names of AdvancedMetaEngine conform to our guidelines.
_singleid   -> _singleId
_gameids    -> _gameIds
_guioptions -> _guiOptions
2016-03-08 19:01:13 +01:00
Eugene Sandulenko
fe7332cb18 Merge pull request #689 from Tkachov/master
SWORD25: Fix "Resource not released" warnings
2016-03-06 01:37:03 +01:00
Eugene Sandulenko
23d74fddb4 CONFIGURE: Introduced new engine dependency: highres
Some backends like GCW0 do no support graphics >320x240 due to
the hardware limitation (downscaling is possible but it will ruin
the pixel hunting which is often part of the gameplay).

Instead of manually updating the list of engines, we now introduce
a new dependency.

I marked all relevant engines, but some, like tinsel, require more
work with putting their relevant high-res games under USE_HIGHRES
define.
2016-03-05 14:25:56 +01:00
Tkachov
9515d07f00 SWORD25: Fixed "Resource not released" warnings [GSoC]
(Look https://sourceforge.net/p/scummvm/bugs/6980/)

The warning messages were appearing because when PRECACHE_RESOURCES is
not defined, ResourceManager's `requestResource()` was used to manually
"cache" them. When you do that, ResourceManager "locks" the resource
once, so you must `release()` it later.

Resources were not released, and warnings appeared. When you
`release()` resource, it still is loaded ("cached"). Resource's
`getLockCount()` is 0, though, so it might be unloaded by
ResourceManager if there is a lot of resources.
2016-03-04 22:21:11 +06:00
Kirben
818a33ea30 SWORD25: Remove ADGF_TESTING from Broken Sword 2.5 2016-02-28 11:13:55 +11:00
Eugene Sandulenko
59aede6228 SWORD25: Fix bug #6981: High CPU usage on one core
The game loop is implemented in Lua, and there are no delays.
Now we wait 10ms on each event pulling, as we always do.
2016-02-21 22:53:26 +01:00
Eugene Sandulenko
12fadf713d SWORD25: Fixing bug #7041: SWORD25: Crash in final scene
The original was ignoring Lua errors in that scene and was
restoring the state with longjmp.

We are yet to see the platform compatibility, but Lua's code
is too tangled to make simple replacement with error() work.

Another possible alternative would be to rework the original
game scripts. We will do it if this commit is problematic.
2016-02-19 22:42:01 +01:00
Alexandre Detiste
6c298e964f JANITORIAL: Typos detected with lintian & grep 2016-02-15 18:27:02 +01:00
Willem Jan Palenstijn
ad688f9d6f SWORD25: Remove now unused function 2016-02-02 02:16:41 +01:00
Willem Jan Palenstijn
75f1d2e259 SWORD25: Use more appropriate function for growing the stack
The call to lua_growstack in unpersistThread would unconditionally at
least double the size of the stack. This caused memory usage to grow
exponentially (literally) with the number of serialized threads.

Bugs #6977, #6999.
2016-02-02 01:21:28 +01:00
Johannes Schickel
35244a8643 SWORD25: Make #include follow our conventions. 2015-12-14 05:23:16 +01:00
Johannes Schickel
6dabb5c414 SWORD25: Call requested pixel format by its correct name. 2015-12-14 05:16:12 +01:00
Johannes Schickel
40421f1854 SWORD25: Cleanup. 2015-12-14 05:08:05 +01:00
Johannes Schickel
cb8e611e33 SWORD25: Fix uninitialized variable usage.
When using the constructor of Panel which directly calls unpersist _color was
uninitialized. However, unpersit uses setColor which assumes _color is
initialized properly. Caused valgrind warnings when loading.
2015-12-14 05:08:05 +01:00
Johannes Schickel
184ae49302 SWORD25: Plug memory leak in RenderedImage. 2015-12-14 05:08:05 +01:00
Johannes Schickel
74321fcd22 SWORD25: Let ImgLoader write into Graphics::Surface. 2015-12-14 05:08:05 +01:00
Jakub Wilk
407a5a1f55 SWORD25: Fix typo 2015-12-09 23:02:01 +01:00
Strangerke
ade912da56 SWORD25: Build engine by default 2015-12-06 22:31:29 +01:00
Eugene Sandulenko
1779fba59b SWORD25: Mark Sword 2.5 as testing 2015-12-04 11:53:07 +01:00
Eugene Sandulenko
3a574272b8 SWORD25: Remove unused class variable 2015-11-30 23:54:27 +01:00
Eugene Sandulenko
7449c09f4a SWORD25: Init variables 2015-11-30 23:54:27 +01:00
Eugene Sandulenko
2d0b914301 SWORD25: Added Ultimate version detection 2015-11-19 00:52:20 +01:00
Eugene Sandulenko
efaf82c66e SWORD25: Fix Hungarian version support 2015-11-19 00:51:44 +01:00