Commit Graph

714 Commits

Author SHA1 Message Date
Bastien Bouclet
4b42112721 ENGINES: Add an engine ID to all the engines 2019-11-03 11:43:00 +01:00
Nipun Garg
c1f029c6dc COMMON: Move Lua into Common and make it into...
an engine feature
2019-08-13 10:18:02 +02:00
Cameron Cawley
090588fb41 SWORD25: LUA: Remove direct use of ctype.h functions 2019-07-24 22:47:40 +03:00
Fedor Antokhin
acb3edb601 Sword25: image trace on quick cursor changes fix 2019-04-09 21:14:23 +03:00
Bastien Bouclet
9a4c0ae281 ENGINES: Normalize the getName() result of metaengines
Also-By: Matthew Hoops <clone2727@gmail.com>
2018-12-10 06:47:27 +01:00
D G Turner
3d7bb383db SWORD25: Fix Debug Console Activation via CTRL-d. 2018-10-17 15:01:12 +01:00
Colin Snover
81f78d4ddf BLADERUNNER: Remove use of C99 math
C++ math functions are overloaded so operate using single-precision
when receiving a float input. The C standard library on FreeMiNT
does not fully support C99 math so use of sqrtf, sinf, etc.
instead of the C++ API does not work.
2018-08-26 15:33:44 +03:00
Colin Snover
6af0c77b5a SWORD25: Remove use of C99 sqrtf
C++ sqrt is overloaded so operates using single-precision when
receiving a float input. The C standard library on FreeMiNT does
not fully support C99 math so use of sqrtf instead of sqrt(float)
does not work.
2018-08-26 15:33:44 +03:00
Adrian Frühwirth
e45a0ce3da SWORD25: Fix otherwise unused variable not guarded by USE_VORBIS
This silences a gcc warning when compiling with -Wunused-variable.
2018-05-07 09:30:00 +02:00
Adrian Frühwirth
fd4f9c1f2c JANITORIAL: Fix whitespace 2018-04-18 20:18:05 +02:00
Adrian Frühwirth
b17cac8029 JANITORIAL: Fix typos 2018-04-18 20:18:05 +02:00
Adrian Frühwirth
0524ff6e8d JANITORIAL: Silence GCC 7 fallthrough warnings 2018-03-23 18:34:17 +01:00
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 eefa72afa1.

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
Eugene Sandulenko
dbb473752b SWORD25: Fix tint color 2015-11-18 22:54:27 +01:00
Eugene Sandulenko
aa9b5e94b6 SWORD25: Implement missing SWF opcode 2015-11-18 00:13:18 +01:00
Eugene Sandulenko
aa74254f23 SWORD25: Translate comments 2015-11-17 23:28:57 +01:00
Eugene Sandulenko
4dc23ea289 SWORD25: Fix text rendering 2015-11-17 23:17:20 +01:00
Willem Jan Palenstijn
2b31096856 SWORD25: Fix comment translation 2015-11-13 10:51:29 +01:00
Eugene Sandulenko
1f1ef9b632 SWORD25: Fixing typo of typo. This time for real 2015-11-13 09:09:05 +01:00
Eugene Sandulenko
a47ab5e1d9 SWORD25: Fix typo 2015-11-13 08:21:51 +01:00
Eugene Sandulenko
ca4c10f424 SWORD25: Translate comments 2015-11-13 00:21:59 +01:00
Eugene Sandulenko
882989f5c3 SWORD25: Fix thumbnail generation and make it portable 2015-11-13 00:03:42 +01:00
Christian Krause
d39f93af68 SWORD25: Draw next movie frame only when an update is needed
This fixes the problem that the movies are played too fast
and get out of sync with additionally played speech samples.
2015-05-03 12:19:17 +02:00
Matthew Hoops
797506eff7 SWORD25: Use fabs for absolute value of doubles 2015-04-11 16:12:47 -04:00
RichieSams
4c64f7e194 SWORD25: Remove unused code
The original idea was to keep the code variation and pick the best one. However,
these two methods we're portable enough for our needs.
2015-01-07 07:00:13 -06:00
Eugene Sandulenko
baacf0be61 SWORD25: Commend unused and unportable functions 2015-01-04 22:16:50 +01:00
Eugene Sandulenko
17fe53a34c SWORD25: Hopefully fix compilation errors 2015-01-04 22:10:17 +01:00
Eugene Sandulenko
ce45caaf83 SWORD25: Fix warning 2015-01-04 21:06:49 +01:00
RichieSams
e4f74b6c34 SWORD25: Remove the option to persist a double as a string
Since the current method *should* be more accurate
2014-12-30 18:28:14 -06:00
RichieSams
9a4d62e76a SWORD25: Change function names to use persist instead of serialize
Same argument as in 97c35714ce.
To match the rest of the SWORD25 code base
2014-12-30 18:26:59 -06:00
RichieSams
8ee75e1dc5 SWORD25: Add Pluto copyright message to new persistence code
Since the code is based off the Pluto code
2014-12-30 18:22:15 -06:00
RichieSams
eaff6a40f6 SWORD25: Correct include guards to reflect the changes to the file names 2014-12-30 18:21:43 -06:00
RichieSams
67114c3e7e SWORD25: Remove old lua persistence files 2014-12-30 15:40:33 -06:00
RichieSams
8668707f16 SWORD25: Fix how nils are persisted
The unpersist code expects nils to be represented as an index with value 0.
The persist code incorrectly wrote out this data
2014-12-30 15:40:33 -06:00
RichieSams
08e3f21a8d SWORD25: Rename double serialization file to better represent what it is
AKA functions, rather than a class
2014-12-30 15:40:33 -06:00
RichieSams
97c35714ce SWORD25: Rename lua serialization functions to use 'persist' in order to match the rest of the engine 2014-12-30 15:40:29 -06:00
RichieSams
a188b31d15 SWORD25: Use new lua serialization functions to persist state 2014-12-30 13:42:45 -06:00
RichieSams
0b8482b55f SWORD25: Update module.mk with lua serialization changes 2014-12-30 13:42:02 -06:00
RichieSams
2fb116f10e SWORD25: Move all lua serialization helper functions to their own file 2014-12-30 13:41:24 -06:00
Adrian Astley
2c7a87a4e3 SWORD25: Fix code formatting
... with AStyle
2014-12-19 14:51:00 -06:00
Adrian Astley
de20880d9d SWORD25: Re-write the pluto unserializing function(s) 2014-12-19 13:41:58 -06:00
Adrian Astley
dedfd7aa84 SWORD25: Move common functions to their own set of files so they can be shared 2014-12-19 13:38:56 -06:00
Adrian Astley
efcd6196ee SWORD25: Create a function for serializing lua objects
This function is very similar to the Pluto function. However, this code
is much cleaner and is endian-safe
2014-12-19 11:29:22 -06:00
Adrian Astley
ff35d7118c SWORD25: Create a set of functions for manually serializing a double
Since we can't assume IEEE.
2014-12-19 11:29:22 -06:00
Filippos Karapetis
fa9e2f7b29 SWORD25: Disable unused code
Thanks to fingolfin for pointing out this unused code
2014-12-07 17:49:52 +02:00
Filippos Karapetis
e938ddcef7 SWORD25: Remove trailing whitespace 2014-10-28 16:13:07 +02:00
Adrian Astley
91571387d1 SWORD25: Bump the save file version number
Since the previous commit breaks saves for 32 bit binaries
2014-09-12 17:05:53 -05:00
Adrian Astley
2ec3adfad5 SWORD25: Make save files x32/x64 agnostic 2014-09-12 16:07:06 -05:00
Eugene Sandulenko
5da1a45307 SWORD25: Fix sprite flipping 2014-06-24 00:48:52 +03:00
Eugene Sandulenko
5c706dde27 SWORD25: Switch to common TransparentSurface 2014-06-15 15:43:25 +03:00
Johannes Schickel
59d0874ca9 SWORD25: Use float constant values in expressions which result in float.
This silences some float conversion warnings.
2014-06-02 01:00:15 +02:00