Commit Graph
184 Commits
Author SHA1 Message Date
sluicebox 046356c85a SCI: Convert LSL1 polygon workaround to script patch 2023-01-08 17:01:01 -08:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Orgad Shaneh 940c7bfc14 SCI: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02:00
sluicebox 7295854df7 SCI: Add LB2 staircase pathfinding workaround
Fixes ego never walking down the museum staircase due to differences
in our pathfinding algorithm.

I don't know if there is a general change to our algorithm that could
take care of this, but given that both points are within multiple
barred access polygons this might be something that just happened to
work in the original.

Either way, we're close to a release so I only want to address this
specific issue.
2021-08-16 18:14:09 -05:00
sluicebox f20c9ab958 SCI: Fix pathfinding debug colors in SCI 1.1 games
The pathfinding debugging code is using Sierra's buggy 8-bit matching
algorithm to find colors for drawing obstacles and path points in most
of the SCI 1.1 games. This usually results all colors being black.
Now we select the good 16-bit algorithm for internal use.
2021-08-13 15:36:15 -05:00
sluicebox ee43d777c4 SCI: Fix crash in pathfinding debug code
Fixes crash when kDebugLevelAvoidPath is enabled and kMergePoly merges
room obstacles, such in QFG1VGA after defeating a monster.

The debugging code that draws obstacles uses the polygon type as an
index to a color array and asserts that this value is between 0 and 3,
but that didn't take into account the 0x10 flag that kMergePoly sets.
2021-08-13 15:36:15 -05:00
Orgad Shaneh a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03:00
Eugene Sandulenko 5e7fe2dc57 JANITORIAL: Replace spaces in indentation with tabs 2021-04-15 21:20:36 +02:00
sluicebox 9982c761a2 SCI: Update all old bug tracker ticket numbers 2021-02-25 01:18:52 -08:00
Filippos Karapetis 9da3d22703 SCI: Fix MSVC warnings
- Remove unused parameters
- Initialize potentially uninitialized variables
- Use Common::String instead of a fixed buffer
- Remove redundant parentheses
- Change float suffix to be uppercase
- Fix spacing
- Fix integer left shifts with boolean variables
- Fix potential division by zero
- Fix missing breaks
2019-05-27 14:53:41 +03:00
Vhati f55fc02e51 SCI32: Fix QFG4 forest 580 pathfinding
Adds a penalty workaround for room 580 entry from the south, bug #10870
2019-01-14 00:23:15 +02:00
Vhati aac5ed1cae SCI32: Fix QFG4 forest pathfinding
Adds workarounds for odd detours during entry, bugs #10857, #10858
2019-01-06 19:17:03 +02:00
Filippos Karapetis f3cb1fcd84 SCI: Fix compilation when SCI32 is disabled 2018-08-26 02:30:29 +03:00
Filippos Karapetis 6fb19d1d01 SCI: Fix compilation when SCI32 is disabled 2018-08-25 12:44:13 +03:00
Filippos Karapetis 66cbaeefe2 SCI32: Adapt the pathfinding debug code to work woth SCI32 games 2018-08-25 12:39:12 +03:00
David Fioramonti d52937cc7e SCI: Update rad2deg usage 2018-05-20 11:21:06 +01:00
Colin Snover 8c555200d9 SCI32: Change storage type of int16 arrays to hold reg_ts instead
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-09 11:21:13 -05:00
Colin Snover 3f91726765 SCI32: Rewrite kArray & kString
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-09-29 19:39:16 -05:00
Colin Snover a613a27b44 SCI32: Implement line drawing (kAddLine/kUpdateLine/kRemoveLine)
This line drawing code lives in a remodelled GfxPaint32 class
that is totally separate from GfxPaint16.
2016-06-21 08:14:12 -05:00
Filippos Karapetis cdbd7c8add SCI: Use uint32 instead of unsigned int 2016-03-01 01:12:58 +02:00
Colin Snover aeee621e44 SCI32: Add initial support for palette cycling (kPalCycle) and fading (kPalFade)
Graphics palette code was rewritten between SCI1 and SCI2, so
SCI32 palette engine code has been moved to a separate GfxPalette32
class.
2016-01-07 16:35:09 -06:00
Johannes Schickel 2bd2db10aa SCI: Silence double to float conversion warning. 2014-06-02 01:00:15 +02:00
Johannes Schickel 8fc7d60feb SCI: Make GPL headers consistent in themselves. 2014-02-18 02:39:37 +01:00
Sven Hesse 989ea7cb56 JANITORIAL: Remove trailing whitespace 2013-07-14 19:01:47 +02:00
Willem Jan Palenstijn f5a6ad6ab9 SCI: Fix memory leak 2013-04-15 21:38:21 +02:00
Filippos Karapetis e7d4f88a57 SCI: Add a workaround for bug #3568452 - "SCI: QFG1VGA - Path finding bug in the forest"
This workaround has been added for now to stop the game from freezing.
A more correct solution would be to match our pathfinding algorithm
to what SSCI is doing, but with this workaround we can stop the more
immediate problem (game freezing) now.
2012-10-22 13:17:57 +03:00
Filippos Karapetis f2fa6a934d SCI: Fix compilation with MSVC (atan2() was ambiguous) 2012-10-01 03:06:59 +03:00
Willem Jan Palenstijn 17887e24a2 SCI: Implement kMergePoly
Thanks to Walter for creating debugging tools for MergePoly and testing.
2012-09-30 18:18:20 +02:00
Filippos Karapetis 2b50824133 SCI: Add setter/getter methods to reg_t's
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-06-18 05:24:06 +03:00
Johannes Schickel fa401a2d3d SCI: Remove unnecessary break after return statement. 2012-01-29 16:34:41 +01:00
Max Horn 88913c0139 ALL: Remove trailing whitespaces
This tries to make our code a bit more compliant with our code formatting
conventions. For future use, this is the command I used:
  git ls-files "*.cpp" "*.h" | xargs sed -i -e 's/[ \t]*$//'
2011-06-20 00:59:48 +02:00
Walter van Niftrik 05ac17f7b9 SCI: Fix up start/end points when pathfinding with opt == 0.
Fixes bug #3304901: "SCI: Freddy Pharkas - Stuck in the brothel door".
2011-05-31 16:26:38 +02:00
strangerke 69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Walter van Niftrik 23dcd3c761 SCI: Remove SCI version check from READ/WRITE_SCI1ENDIAN_UINT16. 2011-03-04 21:55:39 +01:00
md5 51437ba5e6 SCI: Fixed path finding in Amiga SCI1 games
Added wrapper functions to read/write from dynmem segments, as these are
treated as BE in Amiga versions (as we treat them like raw data instead
of reg_t's), whereas the rest are LE. Thanks to waltervn and wjp for their
help on this
2011-03-03 19:34:11 +02:00
Filippos Karapetis 32d7e687ee SCI: debugC calls no longer require a debug level of 2 to show output
svn-id: r55086
2011-01-01 12:48:12 +00:00
Walter van Niftrik ecaab84cb5 SCI: Fixup pathfinding start point when on polygon edge.
We now also fixup the start point when it's on the edge of an obstacle. If the
start point is also on the edge of the screen, the actor is now allowed to
walk through that obstacle to find his way to clear territory. This is based
on observation of SSCI behavior.

svn-id: r54230
2010-11-13 14:46:27 +00:00
Walter van Niftrik 97067a75db SCI: Allow paths along the edge of the screen in kAvoidPath.
Paths along the edge of the screen are now taken as a last resort. Fixes
bugs #3047418 and #3059595.

svn-id: r54199
2010-11-11 11:24:12 +00:00
Filippos Karapetis 7f43ed3f9d SCI: Changed the check for vertex_min into an assert (thanks wjp)
svn-id: r53504
2010-10-15 15:40:36 +00:00
Filippos Karapetis 7cdddd5ffb SCI: Fixed code bugs from bug #3087872 - "SCI: Code analysis warnings"
svn-id: r53482
2010-10-15 12:40:24 +00:00
Torbjörn Andersson b442ee7010 SCI: Fixed potential memory leak in convert_polygon()
svn-id: r52413
2010-08-27 17:26:34 +00:00
Filippos Karapetis c04d3e4689 SCI: Fixed bug #3041232 - "LB2Floppy: Crash at Museum"
svn-id: r52197
2010-08-18 20:41:03 +00:00
Filippos Karapetis e320103926 SCI: Refactored readPoint() to accept a segment reference to the polygon data, thus removing the check for invalid segment types. Also, added a sanity check to verify that the memory reference to polygon data is big enough to hold all the expected polygon vertices (thanks to waltervn)
svn-id: r52176
2010-08-17 23:55:07 +00:00
Filippos Karapetis d8b0b445f3 Limited the sanity check in rev #52174 to invalid segment types only (apparently, polygon data may be placed in non-dynmem segments too)
svn-id: r52175
2010-08-17 23:11:30 +00:00
Filippos Karapetis 3c010fc2f9 SCI: Fixed bug #3034501 - "LSL6: Segfault while leaving the penthouse"
svn-id: r52174
2010-08-17 22:51:24 +00:00
Filippos Karapetis d365b71945 SCI: Turned a warning into an error
svn-id: r51838
2010-08-07 16:42:10 +00:00
Filippos Karapetis 82bf2437e3 SCI: also break in AvoidPath instead of continuing, when the start point is contained in multiple polygons, otherwise we'll end up in an infinite loop
svn-id: r51458
2010-07-29 09:08:20 +00:00
Filippos Karapetis c099127c3d SCI: Break out instead of continuing when an end point is contained in multiple polygons, while running the avoidpath algorithm (or we'll end up in an infinite loop). Fixes bug #3036299 - "LB2CD: Game Hangs at Speakeasy"
svn-id: r51450
2010-07-28 23:30:59 +00:00
Filippos Karapetis 9e164f429d SCI: Changed another warning into debug output
svn-id: r51445
2010-07-28 23:01:28 +00:00
Filippos Karapetis a2b6b84bfb SCI: Changed a warning into a debug message
svn-id: r51444
2010-07-28 22:41:03 +00:00