aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/segment.h
AgeCommit message (Collapse)Author
2018-06-29SCI: Fix shadowing warningEugene Sandulenko
2017-10-06SCI32: Clean up scriptWidth/scriptHeight/screenWidth/screenHeightColin Snover
This removes the unnecessary Buffer subclass and stops most places where the output buffer was being interrogated about dimensions instead of GfxFrameout.
2017-10-06SCI32: Clean up CelObjColin Snover
* Rewrap comments to 80 columns * Clarify comments where possible * Use smart pointers where appropriate * Change view/pic flags detection to always use word-size (byte-size check for flag 0x80 was a compiler optimisation)
2017-09-23Revert "SCI: Fix Warnings about Copy Constructor Failing to Call Base Class."Colin Snover
This reverts commit d2dd942ad79df0c4ac9d841fb5b0919d260bb79c. The Serializable class is an interface class and has only the empty default copy constructor. There is no reason to call this explicitly. Whatever is warning about this should be fixed to stop warning about it, rather than adding such unnecessary calls to the engine code.
2017-09-23SCI32: Fix handling of array copiesColin Snover
kArrayCopy would perform an unnecessary memory copy of the source array, the treatment of the count value as unsigned was clearly not correct since it was being sign-extended and checked against -1.
2017-09-23SCI32: Remove unused shrink-to-fit function for string arraysColin Snover
2017-09-23SCI32: Fix size for dereferencing non-raw SCI32 arraysColin Snover
The maxSize given when generating a SegmentRef is supposed to be the maximum size of raw data that can be held inside the offset- part of a reg_t, not the entire size including the segment. This fixes a buffer overflow in "Inside the Chest", which still does not work, but at least doesn't cause heap overflows anymore with this change.
2017-07-06SCI32: Improve kPlayVMD renderingColin Snover
1. Added a new game option for linear interpolation when scaling overlay-mode video in ScummVM builds with USE_RGB_COLOR; 2. Implemented SCI2.1-variant of the VMD player renderer (fixes Trac#9857), which bypasses the engine's normal rendering pipeline; 3. Improved accuracy of the SCI3-variant of the VMD player by writing HunkPalettes into the VMD's CelObjMem instead of submitting palettes directly to GfxPalette32.
2017-05-26SCI32: Fix kArrayFillHein-Pieter van Braam
The ScummVM implementation of class SciArray::fill() has a bug where it will overwrite the array[index] with the value count times, rather than fill the array starting from index count times. This patch fixes that behavior. This was noticed because the LSL7 dice game was broken, it was impossible to lose. After this patch the dice game works as expected. Closes gh-953.
2017-04-23SCI: Fix support for 32-bit SCI3 script offsetsColin Snover
2017-03-30SCI32: Improve bounds checking in SciString trimColin Snover
2017-02-05SCI: Fix more unsafe C-string usageColin Snover
2017-01-14SCI: Fix Warnings about Copy Constructor Failing to Call Base Class.D G Turner
2017-01-06SCI32: Fix overlapped memory copies in SciStringColin Snover
2017-01-06SCI32: Fix a subtle bug in SciArray::trim()Filippos Karapetis
With this bug, whenever a string was trimmed from the right, the last character was always cut off, even if it wasn't whitespace. This was apparent in the RAMA demo, which parses a text file for its scenes, and each line is trimmed
2017-01-05SCI32: Fix off-by-one error in array resizingColin Snover
This bug existed in SSCI and was pulled in carelessly during initial implementation of SciArray. Closer examination of SCI3 reveals that this only happened to work in SSCI because it would always allocate on the first resize, and would always allocate 25 extra elements per allocation.
2016-12-19SCI32: Undefine macro for SciBitmap when it is done being usedColin Snover
2016-12-19SCI32: Fix nitpicky output errors in SCI32 bitmap debuggingColin Snover
2016-12-19SCI32: Add segment table debugging info for SCI32 arraysColin Snover
2016-12-17SCI32: Improve SciBitmap segment table debugging outputColin Snover
2016-10-27SCI32: Read byte/string array values as signed in SCI2.1early-Colin Snover
KQ7 1.51 writes int16s from the save game catalogue into a Str object, then retrieves byte 0 from the string and compares it to -1. This happens to work out because (1) characters were treated as signed in SCI2.1early and earlier, and (2) int16s in the save game catalogue were little-endian. In SCI2.1mid and later, this trick no longer works because characters are treated as unsigned and get zero-extended instead. Fixes Trac#9632.
2016-10-09SCI32: Clarify some identifiersColin Snover
transparentColor -> skipColor displace -> origin scaledWidth -> xResolution scaledHeight -> yResolution
2016-10-09SCI32: Change storage type of int16 arrays to hold reg_ts insteadColin Snover
Memory references and integers in SSCI are both 16-bit numbers, so game scripts frequently (incorrectly) use an IntArray instead of an IDArray for holding references. Since references in ScummVM are 32-bit reg_ts, IntArray entries must be large enough to hold reg_ts in order to be compatible with game scripts that store references in integer arrays. The alternative solution is to find and patch all incorrect use of IntArray across all games. This is possible, but a bit risky from a save game stability perspective, since incorrect IntArray usage is sometimes not apparent until well after the array is instantiated (like GK1's global interview array). This change invalidates existing SCI32 save games.
2016-10-09JANITORIAL: Remove trailing spacesEugene Sandulenko
2016-09-29SCI32: Ease debugging of wrong array typesColin Snover
2016-09-29SCI32: Implement kBitmapCreateFromView and kBitmapGetInfoColin Snover
Used by Torin room 40300 to perform pathfinding by bitmap.
2016-09-29SCI32: Rewrite kArray & kStringColin Snover
This change invalidates earlier SCI32 save games, which separated arrays and strings in an incompatible manner. Old save games contain invalid references to a string segment which no longer exists, and contain incompatible array structures that lack critical type information.
2016-08-13SCI: Fix pointer invalidation caused by array storage movesColin Snover
When objects are added to a SegmentObjTable, it may cause the internal storage for the table to expand and move to a new region of memory. When this happens, all pointers to objects held by a SegmentObjTable of the same type would be invalidated, due to an implementation detail that should not be exposed. To prevent this, objects are now allocated separately on the heap, so even if the table's storage moves due to insertions, the objects owned by the table will not, so references remain valid for the lifetime of the object.
2016-08-12SCI32: Fix crash when multiple nodes are deleted during kListEachElementDoColin Snover
This happens in e.g. Phant1, when walking from dining, to reception, to up the stairs.
2016-08-01SCI: Fix warningsEugene Sandulenko
2016-08-01SCI32: Implement bitmap save routineColin Snover
2016-08-01SCI32: Fix invalid memory access after BitmapTable is extendedColin Snover
When new bitmaps are added and the underlying Common::Array needs to move to expand, this invalidates all pointers to bitmaps, which makes it basically impossible to use the bitmap segment since you never know if a reference is going to be invalidated due to an array move. To solve this, BitmapTable is changed to hold pointers to SciBitmaps that are allocated separately on the heap instead, so when those bitmaps are looked up, the resulting pointers are valid for the lifetime of the bitmap, instead of the lifetime of the Common::Array used internally by BitmapTable.
2016-08-01SCI32: Add bitmap segment and remove GC option from hunk segmentColin Snover
2016-08-01SCI32: Enable optional explicit memory management of hunk entriesColin Snover
Bitmaps in ScrollWindow and Robot code are managed by the kernel and not by game scripts, although they must be able to be referenced through a reg_t. To prevent incorrect GC of bitmaps that are in use but not referenced by any game script, explicit memory management of hunk entries can be enabled.
2016-03-25SCI: Use aggregation to store objects in SegmentObjTable.Johannes Schickel
This allows to store pointers and fundamental types in a SegmentObjTable.
2016-03-25SCI: Introduce accessors for SegmentObjTable entries.Johannes Schickel
This makes code not use _table directly whenever possible. An exception is the save game code which is not easy to adapt due to design deficiencies.
2016-03-01SCI: Use uint32 instead of unsigned intFilippos Karapetis
2014-02-18SCI: Make GPL headers consistent in themselves.Johannes Schickel
2012-06-18SCI: Add setter/getter methods to reg_t'sFilippos Karapetis
No functionality change has been made with this commit. This avoids setting and getting the reg_t members directly, and is the basis of any future work on large SCI3 scripts (larger than 64KB)
2012-02-10JANITORIAL: Fix template definition whitespaceTarek Soliman
2011-05-25ALL: analyse -> analyzeMatthew Hoops
2011-05-12GIT: Clean up: Suppress SVN tags, now uselessstrangerke
2011-03-24SCI: Close Memory Leak from kAnimate Calls.D G Turner
This was due to a missing destructor in the HunkTable. Thanks to wjp for this patch.
2011-03-08SCI: Cleanupmd5
2011-03-08SCI: Cleanupmd5
2011-02-28SCI: Moved hunk pointer handling to the GC, and removed some related workaroundsmd5
SCI scripts can contain stale pointers, which are used later on. We now delete the contents of hunk entries without invalidating the relevant pointers and let the GC clear the references. Many thanks to waltervn and wjp for all their work and help on this.
2010-12-07SCI: Removed the system strings code and replaced it with a much more ↵Filippos Karapetis
simplified version, thus greatly simplifying handling of system strings svn-id: r54805
2010-11-19SCI: Moved the Object class in a separate fileFilippos Karapetis
svn-id: r54361
2010-11-18SCI: Added species selector functionality for SCI3Filippos Karapetis
svn-id: r54351
2010-11-18Get rid of a const_cast.Lars Skovlund
svn-id: r54333