Commit Graph
223 Commits
Author SHA1 Message Date
Le Philousophe 14e3d1f343 CGE: Don't use unsafe sprintf and vsprintf 2022-10-23 22:46:19 +02:00
Le Philousophe d698fc6bbe CGE: Don't use unsafe strcat and strcpy 2022-10-23 22:46:19 +02:00
Le Philousophe 035f425e9c CGE: Don't pass the engine object to EncryptedStream
It doesn't need it and when linked with detection and with UBSan enabled
build fails because CGEEngine isn't linked in
2022-01-03 14:44:03 +02:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Orgad Shaneh 69f45d9258 CGE: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02:00
D G Turner 48220b8ec5 CGE: Fix Memset on non-trivial Structure GCC Compiler Warning 2021-03-21 15:01:26 +00:00
Tomasz Długosz eaab877d66 JANITORIAL: fix the name of original author of cge and cge2
The first name is Janusz, not Janus.
The correct name was used in AUTHORS and credits.
In case of doubts, see his personal webpage: https://www.jbw.pl/ - name is in the page footer
2020-04-18 20:59:57 +02:00
Paul Gilbert 9f175c4053 ENGINES: Cleanup of savegame filenames generation
This removes filename methods when it matched the Engine method.
Secondly, ensuring there was an overriden getSaveStateName method
for engines that didn't do the standard target.00x save filenames
2020-02-16 15:44:28 -08:00
Paul Gilbert a00e44ba6c ENGINES: Merge saveGameState virtual methods into a single one 2020-02-16 15:44:28 -08:00
D G Turner ca800c3c62 CGE: Fix Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
2019-10-16 20:49:38 +01:00
Adrian Frühwirth 057fb9bc6e CGE: Add play time metadata to savegames 2018-05-05 22:19:03 +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
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
Strangerke 8f41fc10b2 CGE: Remove a useless structure member, reduce a variable scope 2014-03-15 11:31:43 +01:00
Strangerke 0a9b8978ee CGE: Remove a useless variable, remove some associated dead code 2014-03-15 11:19:21 +01:00
Strangerke bc58a42574 CGE: Move hero shadow check inside hero check in sceneUp() 2014-03-02 20:44:22 +01:00
Johannes Schickel ed40653105 CGE: Make GPL headers consistent in themselves. 2014-02-18 02:39:33 +01:00
Strangerke a1ab4cb062 CGE: Reduce the scope of some variables 2014-02-09 11:22:21 +01:00
D G Turner ac4087856f ALL: Remove optimization unstable code on checking for null after new.
These issues were identified by the STACK tool.

By default, the C++ new operator will throw an exception on allocation
failure, rather than returning a null pointer.

The result is that testing the returned pointer for null is redundant
and _may_ be removed by the compiler. This is thus optimization
unstable and may result in incorrect behaviour at runtime.

However, we do not use exceptions as they are not supported by all
compilers and may be disabled.

To make this stable without removing the null check, you could qualify
the new operator call with std::nothrow to indicate that this should
return a null, rather than throwing an exception.

However, using (std::nothrow) was not desirable due to the Symbian
toolchain lacking a <new> header.
A global solution to this was also not easy by redefining "new" as "new
(std::nothrow)" due to custom constructors in NDS toolchain and various
common classes.

Also, this would then need explicit checks for OOM adding to all new
usages as per C malloc which is untidy.

For now to remove this optimisation unstable code is best as it is
likely to not be present anyway, and OOM will cause a system library
exception instead, even without exceptions enabled in the application
code.
2014-01-15 02:36:19 +00:00
Strangerke 2f333f997b CGE: Ensure string copy don't overrun. Fix CID 1003674 to 1003678 2013-11-10 09:57:42 +01:00
Johannes Schickel c874721109 CGE: Take advantage of Surface::getPixels. 2013-08-03 04:02:50 +02:00
Johannes Schickel 1f0832b4f2 CGE: Prefer getBasePtr over direct Surface::pixels access. 2013-08-03 02:52:32 +02:00
Johannes Schickel 89abab97e3 JANITORIAL: Remove trailing whitespaces.
Powered by:
git ls-files "*.cpp" "*.h" "*.m" "*.mm" | xargs sed -i -e 's/[ \t]*$//'
2012-09-26 04:17:55 +02:00
Strangerke 6472ef86bb CGE: Fix bug #3557904 - Shadow at wrong position 2012-09-05 08:12:14 +02:00
Strangerke 5c522575c7 CGE: Keep Soltys' position when saving 2012-08-05 22:24:32 +02:00
Strangerke de752a5336 CGE: Fix bug #3547274 - missing travel buttons after save 2012-08-04 23:51:27 +02:00
Strangerke b1cc34a080 CGE: Remove hack used to store keycode in CGEEvent 2012-07-05 21:31:42 +02:00
Strangerke d73ed91051 CGE: Remove unused Demo text id 2012-06-28 07:25:56 +02:00
Strangerke 647bc59f99 CGE: Rename variable 2012-06-28 07:19:54 +02:00
Strangerke f32c9a7735 CGE: Fix bug 3538039 - level buttons not pressed 2012-06-27 01:15:32 +02:00
Strangerke ad2b898eb3 CGE: Remove dead code originally used to load a savegame when starting the game 2012-06-18 20:59:52 +02:00
D G Turner b01d712a63 CGE: Close memory leak in savegame loading. 2012-03-28 01:51:56 +01:00
D G Turner 83d4eeadc6 CGE: Close memory leak in savegame thumbnail loading. 2012-03-28 00:10:56 +01:00
Thierry Crozat b419f73973 CGE: Fix issue with music not stopping when reloading game
If you turn off the music and then save a game, then turn on the music
again and then load the saved game, the music from the scene continue
to play despite the _music flag being false. So the first time you click on
the music on/off button the music restart and only the second time
does it stop. This fixes the bug by stoping the music before reloading
a game.
2011-12-07 07:59:19 +00:00
Strangerke 14cdd034a8 CGE: Fix an assert in intro 2011-12-03 18:25:10 +01:00
Strangerke 816b65ff2c CGE: Soltys - Fix initialization of a couple of bool variables 2011-12-03 17:52:05 +01:00
Strangerke ab2e5015af CGE: Soltys - Fix for bug #3448836 (losing scene number display after loading and changing scene) 2011-12-03 14:55:04 +01:00
Strangerke 22263bd763 CGE: Only skips animations when pressing ESC.
This should allow tsoliman to see the end of the intro
2011-11-30 21:21:34 +01:00
Strangerke a12ba5f6a6 CGE: Simplify keyboard handling 2011-11-30 19:52:19 +01:00
Strangerke 7320066113 CGE: Remove key sound in System::touch().
ALTering dice no longer is no longer noisy
2011-11-29 23:27:35 +01:00
Paul Gilbert 37756c9ffe CGE: Better fix for restoring savegames when a cut-scene is active 2011-11-27 22:16:52 +11:00
Strangerke 3d59d9a137 CGE: Add RTL, hook Main Menu to right click on audio button 2011-11-16 00:00:07 +01:00
Strangerke d2027b0290 CGE: Rename a structure member using double-underscore (reserved)
Also removed a useless comment
2011-11-14 18:24:46 +01:00
Strangerke c6c9620ff2 CGE: Remove some useless constants 2011-11-13 12:48:09 +01:00
Paul Gilbert 17027a7afc CGE: Properly stop player moving when saving or restoring 2011-11-09 19:34:43 +11:00
Eugene Sandulenko 558a499a02 CGE: Fix warning 2011-11-03 00:03:04 +00:00
Strangerke 727afcf4bd CGE: Add some doxygen comments 2011-10-22 06:30:04 +02:00
Strangerke 2d882fdf18 CGE: Rename Snail into CommandHandler, plus some associated renamings 2011-09-18 11:25:34 +02:00
Strangerke 17802f8903 CGE: Fix a potential bug in insertCommand(), some renaming 2011-09-17 23:04:12 +02:00
Strangerke ff0185d038 CGE: Remove a use reference to g_engine
Thanks fuzzie for mentioning it
2011-09-17 18:22:35 +02:00