aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/segment.h
AgeCommit message (Collapse)Author
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
2010-11-18SCI3: implement setInfoSelector() for SCI3, fixes infinite recursionLars Skovlund
svn-id: r54328
2010-11-17SCI: More work on SCI3, based on a patch by lskovlunFilippos Karapetis
- Added SCI3 equivalents for access to object selectors - Added SCI3 implementation of object relocation - Added SCI3 implementation of Script::initialiseClasses() svn-id: r54283
2010-11-08SCI: Some changes regarding the string heap in saved gamesFilippos Karapetis
- Maintain the state of the string heap space in saved games - Merged SegManager::reconstructScripts() inside SegManager::saveLoadWithSerializer() - Disabled a now unnecessary script patch for the cipher puzzle in Castle of Dr. Brain, and performed some cleanup for another disabled patch - Removed direct access to the _baseObj variable of objects svn-id: r54133
2010-10-20SCI: Added a new debug command, "find_callk"Filippos Karapetis
This command can be used to find the object methods (including their corresponding objects and owner scripts) that call a specific kernel call. This shall aid us track all the spots where a particular kernel function is called from, therefore it'll be a bit easier to find examples where unimplemented kernel functions are called svn-id: r53646
2010-09-05SCI: kClone cleanupMartin Kiewitz
and fixing possible crash & typo svn-id: r52565
2010-09-05SCI: merging -info- stuff in Clone/DisposeCloneMartin Kiewitz
svn-id: r52562
2010-09-05SCI: initialize members of the Object class when it's constructedFilippos Karapetis
svn-id: r52544
2010-08-03SCI: CleanupFilippos Karapetis
svn-id: r51687
2010-07-07SCI: Dropped support for the very old saved game versions 9 - 11. Rationale: ↵Filippos Karapetis
a lot has changed since then, we're still not stable, and this helps clean up the code, thus we're still in a position to drop support for old saved games svn-id: r50738
2010-06-28SCI: Clarify docs of GC related SegmentObj methodsMax Horn
svn-id: r50440
2010-06-28SCI: Fix DEBUG_GC mode and permanently enable itMax Horn
svn-id: r50430