Commit Graph

1770 Commits

Author SHA1 Message Date
Torbjörn Andersson
4eef7a42e3 FULLPIPE: Silence GCC memset() warnings
Recent GCC versions complain if you memset() a class or struct that
contain non-POD data types. Get around that by either initializing
the object when created, or by adding a reset() method.
2019-07-14 14:58:19 +03:00
Filippos Karapetis
92aa713958 FULLPIPE: Silence a false positive warning in MSVC
MSVC complained about a potentially uninitialized variable here
2018-12-23 20:41:33 +02: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
0ac7887856 FULLPIPE: Fix For Memory Leak When Exiting Through Game Menu.
This fixes bug #10398 ("FULLPIPE: memory leak when exiting via in-game
menu (not gmm)").
2018-09-26 04:44:04 +01:00
David Fioramonti
ccd46b7db9 FULLPIPE: Use degree conversion common math funcs
Swapped out the #define ANGLE(X) function that did degrees
to radians.

I have made everything doubles in the angle calculation.
2018-07-03 23:08:48 +01:00
Gabriel Corona
39c2477fbe FULLPIPE: fix URI
The previous URI spawns many useless subshells on the POSIX backend
through (harmless) shell command injection.
2018-05-24 01:08:28 +02:00
Eugene Sandulenko
ae2637e36e FULLPIPE: Properly reserve arrays when deserializing. Pointed by whiterandrek 2018-05-21 22:32:24 +02:00
David Fioramonti
1ff0aba6c4 FULLPIPE: Reduce duplicate header includes
Remove duplicate headers in two files and ordered
the headers similar to other fullpipe files.
2018-05-05 06:58:47 +02:00
Bastien Bouclet
91c8f2df7d FULLPIPE: Remove useless AD include 2018-05-01 12:48:05 +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
Eugene Sandulenko
5c77858aee FULLPIPE: Remove unneeded variable 2018-03-28 12:07:10 +02:00
dm33tri
c8cdaef918 FULLPIPE: fix #10321 "Hardlock when stepping onto stool"
Scene 22 now doesn't freeze when pulling lever with stool under it
2018-03-26 21:00:16 +02:00
Adrian Frühwirth
c750a8e6be FULLPIPE: Fix playtime not being read from savegames
Fixes Trac#10394.
2018-03-24 23:38:36 +01:00
Adrian Frühwirth
abe9f0fa15 FULLPIPE: Use zero playtime when filling dummy header
This is a tad more meaningful than a random value, especially should we
for some reason use dummy header information to actually set playtime in
the future.
2018-03-24 23:38:34 +01:00
Eugene Sandulenko
6d59ecdd41 FULLPIPE: Load gameobj.h 2017-12-08 23:57:48 +01:00
Eugene Sandulenko
7724e51936 FULLPIPE: Added debug output for GameObject 2017-12-08 23:57:48 +01:00
Eugene Sandulenko
1408ffc427 FULLPIPE: Better debug output for movement 2017-12-08 23:57:48 +01:00
Eugene Sandulenko
c728c29857 FULLPIPE: More debug output to loading 2017-12-08 23:57:48 +01:00
Eugene Sandulenko
20fb25d58a FULLPIPE: Renames in ExCommand 2017-12-03 23:04:58 +01:00
Eugene Sandulenko
26747d0400 FULLPIPE: Added more debug output to the class loading 2017-12-03 23:04:58 +01:00
Eugene Sandulenko
1f2290cd30 FULLPIPE: Fix bug #10317: Save game metadata is missing 2017-12-02 00:53:57 +01:00
Eugene Sandulenko
cd516b93ef FULLPIPE: Fix bug #10325: New game does not put back already picked up items 2017-12-01 23:16:09 +01:00
Eugene Sandulenko
cee6a336f2 FULLPIPE: Fix bug #9673: Unable to move after loading a save from the title screen 2017-12-01 22:43:16 +01:00
Eugene Sandulenko
8f8b2ed003 FULLPIPE: Fix bug #9672: "Several inventory items highlighted at the same time" 2017-12-01 19:58:11 +01:00
Eugene Sandulenko
19d3e3d103 FULLPIPE: Properly cleanup menu after quitting 2017-11-27 22:24:33 +01:00
Eugene Sandulenko
a5ab1cd293 FULLPIPE: Attempt to crash when calling paletteless scenes 2017-11-27 21:20:24 +01:00
Bastien Bouclet
1e593a4e69 FULLPIPE: Fix out of bounds string access
abe1c65d62 changed _trackName from a char * to a Common::String,
but still tried to access the null terminator byte.
2017-11-26 08:51:36 +01:00
Bastien Bouclet
0bd2e53cd4 FULLPIPE: Fix handleInteraction for non static ani objects
cce851d1af introduced a check to allow only static ani objects. However
after this change, only part of the pipes for vertical movement were
interactive.
This change aims to restore functionality for the other object types
while still preventing the invalid casts.
2017-11-26 08:51:36 +01:00
Bastien Bouclet
694990e712 FULLPIPE: Fix big picture array indexing
Fixes #10322.
2017-11-21 19:43:28 +01:00
Bastien Bouclet
183571f7c2 FULLPIPE: Fix loading inventory items from saves
In C++ the function parameter evaluation order is undefined. The count
property was being read first from the stream, instead of the itemId.

Fixes #10324.
2017-11-20 20:22:32 +01:00
Colin Snover
2cc79fe9c8 FULLPIPE: Fix memory leaks restoring save games 2017-11-18 22:35:12 +01:00
Colin Snover
e40b4a348a FULLPIPE: Fix memory leaks of arcade keys
Fixes Trac#9657.
2017-11-18 22:35:12 +01:00
Colin Snover
a5060cf378 FULLPIPE: Remove manual memory management and fix in-game save/load 2017-11-18 22:35:12 +01:00
Colin Snover
d0efcb7ad5 FULLPIPE: Fix use-after-free in ModalMainMenu
Pointers to objects which are invalidated when the scene gets
unloaded may continue to be accessed if a mouse hover event is
dispatched to the ModalMainMenu.
2017-11-18 22:35:12 +01:00
Colin Snover
8808817d56 FULLPIPE: Fix memory leaks of MessageQueues when clearing GlobalMessageQueueList 2017-11-18 22:35:12 +01:00
Colin Snover
2be96457b9 FULLPIPE: Make list item ownership comments more consistent 2017-11-18 22:35:12 +01:00
Colin Snover
0cc3d8f05d FULLPIPE: Fix leaks of ExCommands loaded from an archive
Nearly every construction of an ExCommand in the engine sets flag
2 of _excFlags. It may even be that the remaining ones that don't
are themselves bugs. This flag is needed in order for an ExCommand
to be cleaned up when its parent MessageQueue is deleted.
2017-11-18 22:35:12 +01:00
Colin Snover
dcf8f588c7 FULLPIPE: Remove unnecessary member array clear in destructor 2017-11-18 22:35:12 +01:00
Colin Snover
bd07925134 FULLPIPE: Fix leaks of MessageQueues 2017-11-18 22:35:12 +01:00
Colin Snover
51b19e97c8 FULLPIPE: Fix memory leaks of Interactions 2017-11-18 22:35:12 +01:00
Colin Snover
c9327f2985 FULLPIPE: Fix memory leaks of PreloadItems 2017-11-18 22:35:12 +01:00
Colin Snover
7323bef77b FULLPIPE: Remove manual memory management of use list 2017-11-18 22:35:12 +01:00
Colin Snover
54f8cf55ea FULLPIPE: Fix memory leaks of InventoryPoolItem 2017-11-18 22:35:12 +01:00
Colin Snover
a8b635e4cd FULLPIPE: Fix leaks of DynamicPhases
I am not entirely sure this is a correct fix for these leaks;
there is still the issue of the last member of _dynamicPhases being
invalidated and not removed sometime before the destruction of
Movement. Also, some of the items in this array are not actually
owned by Movement so deleting them will cause double-frees or
use-after-frees. It may be the case that a second list should be
maintained instead containing only the objects that are created
internally within Movement. Further testing will tell for sure.
2017-11-18 22:35:12 +01:00
Colin Snover
cef4d77877 FULLPIPE: Fix memory leaks of MctlItems in MctlCompound 2017-11-18 22:35:12 +01:00
Colin Snover
c7b1f6b26c FULLPIPE: Clarify ownership of DynamicPhase::_exCommand 2017-11-18 22:35:12 +01:00
Colin Snover
a6fc77ec65 FULLPIPE: Clarify ownership of pointer arrays in StaticANIObject 2017-11-18 22:35:12 +01:00
Colin Snover
4cc64c4139 FULLPIPE: Fix memory leaks in PictureObject, Background 2017-11-18 22:35:12 +01:00
Colin Snover
a2e2569347 FULLPIPE: Use flag enum 2017-11-18 22:35:12 +01:00
Colin Snover
7232f67fe9 FULLPIPE: Fix memory leak of graph nodes and lists 2017-11-18 22:35:12 +01:00