Commit Graph
224 Commits
Author SHA1 Message Date
Le Philousophe f54bdf989a SCI: Don't use unsafe sprintf and vsprintf 2022-10-23 22:46:19 +02:00
Le Philousophe 682c11e801 SCI: Don't use unsafe strcat and strcpy 2022-10-23 22:46:19 +02:00
Le Philousophe 0b918a5352 SCI: Rename strcpy function to prepare for forbidden name
Even though strcpy in SegManager isn't a problem, our forbidden symbols
list being defined at preprocessor level, we won't be able to use this
name anymore.
2022-10-23 22:46:19 +02:00
Donovan Watteau bf5e489567 JANITORIAL: Fix "to to" and "if if" typos in some comments 2022-09-11 17:45:25 +02:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Filippos Karapetis 0aaf48f900 SCI: Handle text in TTS where the first character is chopped off
This occurs in games such as KQ5 and KQ6
2021-12-24 02:57:27 +02:00
Orgad Shaneh 940c7bfc14 SCI: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02:00
sluicebox 27e00993ce SCI: Fix PEPPER glass jar bugs with script patch
Fixes the remaining script bugs and cleans up kMessage
2021-03-20 13:37:37 -07:00
sluicebox bfd4170532 SCI32: Fix kStringToInteger space parsing
Fixes reading settings from game.opt in HOYLE5, where most strings
begin with spaces. SSCI called atoi() which handles this, and so did
we, until it was changed during a large refactor in
3f91726765
2021-03-11 05:47:02 -08:00
sluicebox 9982c761a2 SCI: Update all old bug tracker ticket numbers 2021-02-25 01:18:52 -08:00
Filippos Karapetis bd7e708fc3 SCI: Move resource related functionality into a separate folder 2020-11-29 14:34:55 +02:00
D G Turner d11c61db14 SCI: Fix Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
2019-12-01 05:06:31 +00:00
Colin Snover 94b39c83b6 SCI32: Remove redundant kStringGetData implementation
This code is identical to the kArrayGetData implementation.
2017-09-08 21:10:51 -05:00
Colin Snover 7eedfdbeaf SCI32: Fix kString signatures to allow null references where appropriate
The original interpreter allowed most string references to be
null references, in which case it would substitute an empty
string.
2017-09-08 21:10:51 -05:00
Torbjörn Andersson 14525bb412 JANITORIAL: Silence some GCC 7 warnings
We have lots and lots of -Wimplicit-fallthrough warnings, and I
don't know if it's worth fixing them or not. But if we want to,
this is how it can be done.
2017-08-06 11:48:14 +02:00
Colin Snover 10d97ce379 SCI: Fix more unsafe C-string usage 2017-02-05 12:38:21 -06:00
Colin Snover 8cce4f1b8c SCI32: Ignore attempts to free null array reg_ts 2017-01-09 19:34:54 -06:00
Colin Snover 9e1bf888b8 SCI: Deduplicate text-reading code in kGetFarText 2016-12-03 12:21:55 -06:00
Colin Snover 5a5945cbbb SCI32: Allow format strings with missing arguments
SSCI created a fake va_list and passed it to vsprintf, so extra
placeholders would just silently end up reading garbage memory.
2016-11-04 15:16:10 -05:00
Colin Snover 44dfa4c49f SCI32: Treat %d as unsigned in kString
At least Shivers has VMDs with resource IDs above 2^15; treating %d
as signed means that the wrong filename gets created.
2016-11-04 15:16:10 -05:00
Colin Snover 4d73736d1f SCI32: Fix compilation warnings 2016-09-29 19:39:16 -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 856f3ae648 SCI32: More correctly fix kStringCopy overflow
This entire kString code needs to be reviewed/refactored, but
at least this fix is more complete than the last one.

Thanks to @lordhoto and @wjp for their assistance.
2016-03-18 11:10:49 -05:00
Colin Snover b7d5dd9187 SCI32: Fix heap overflow (read) in kStringCopy 2016-03-18 10:28:51 -05:00
Colin Snover 3e5adc33a8 SCI32: Non-titled text bitmap implementation
This implementation is not 100% engine accurate, but it is
more accurate than what was there, and hopefully the differences
between this and the engine code are merely cosmetic.

The known (intentional) differences are:

1. Uses ScummVM rects inside the engine code, converting to/from
   SCI rects on the kernel edges and when scaling
2. Fewer side effects when performing operations that *should*
   have been pure from the start (like text dimension calculation).
   Still not side-effect-free, but at least things like colours
   and alignment do not need to be reset every time a measurement
   is taken, unlike in the actual engine.

Editor controls and some other kBitmap code are temporarily
disabled as a result of changes to GfxText32 until they can be
updated to be engine-accurate.
2016-02-28 21:48:56 -06:00
Filippos Karapetis 2a4b04f3b2 SCI: Add an initial implementation of kStringTrim
Thanks to lskovlun for his help
2016-01-15 03:25:40 +02:00
Martin Kiewitz 0dd760724e SCI32: split up SCI2.1 into EARLY/MIDDLE/LATE
- Detection works via signatures (couldn't find a better way)
- new kString subcalls were introduced SCI2.1 LATE
- kString now has signatures and is split via subcall table
- kString fix, so that KQ7 doesn't crash, when starting a chapter
- Sci2StringFunctionType removed, because no longer needed
2015-12-29 01:44:11 +01:00
Martin Kiewitz ad8dbd3642 SCI: kStrCat does language-splitting for QfG1 too 2014-11-04 19:46:44 +01: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
Matthew Hoops 829847cb88 SCI: Fix kMessage REF subop ordering
Thanks to waltervn for testing values from running in DOSBox.

Fixes bug #3034704
2013-04-23 22:34:37 -04:00
Willem Jan Palenstijn f5e43484a0 SCI: Fix kReadNumber sign/hex behaviour
Negative numbers now work, and hex overflow is handled like SSCI.
Thanks to waltervn for testing.
2013-01-25 00:57:50 +01:00
Willem Jan Palenstijn 498fe75dc5 SCI: Fix shadow warning 2013-01-24 22:12:15 +01:00
Filippos Karapetis 0143a5d938 SCI: Bugfix for commit 0968acc: only filter out missing messages for the jar
This is to properly fix bug #3601090 without removing any functionality.
The additional check ensures that the look and hand icons work with the
jar. Many thanks to lskovlun for debugging this and providing a fix
2013-01-23 21:31:26 +02:00
Filippos Karapetis 0968acccfd SCI: Fix script bug #3601090 - "SCI: Pepper's Adventures in Time: Game becomes unsolvable"
Many thanks to lskovlun for debugging this problem and finding the
offending script code that caused it.
2013-01-23 03:17:10 +02:00
Filippos Karapetis b1ff5ba247 SCI: Slight cleanup in kMessage() 2013-01-23 03:17:10 +02:00
Willem Jan Palenstijn ba1307b0ce SCI: Add kReadNumber fixme
Thanks to Walter for noticing this.
2012-10-05 16:41:02 +02:00
Filippos Karapetis 99b1c73639 SCI: Fix silly typo
Thanks to digitall for spotting this
2012-06-21 22:57:00 +03:00
Filippos Karapetis 76f3f1b136 SCI: Fix warnings 2012-06-21 22:24:22 +03: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
Matthew Hoops ef8239df48 SCI: Fix comment in kString(at) 2012-06-11 20:10:49 -04:00
Filippos Karapetis b812ed50c8 SCI: Bugfix for negative numbers in kString(at)
Fixes one of the bugs in the savegame selection screen in Phantasmagoria
2012-06-11 11:54:11 +03:00
Max Horn 4f8665fc83 COMMON: Move isFoo functions to namespace Common, add doxygen comments 2012-02-20 16:18:27 +01:00
Max Horn 658080deed ALL: Avoid using is* macros from ctype.h
On some systems, passing signed chars to macros like isspace() etc. lead
to a runtime error. Hence, mark these macros as forbidden by default,
and introduce otherwise equivalent alternatives for them.
2012-02-15 16:51:37 +01:00
Willem Jan Palenstijn c60394eb3f SCI: Remove outdated comment 2012-01-16 16:07:48 +01:00
Filippos Karapetis 7560007ba9 SCI: Simplify kString(Dup) using the overloaded = operator
Thanks to wjp for his suggestion
2012-01-15 21:42:09 +02:00
Filippos Karapetis cbe7527805 SCI: Use fromString() in kString(Dup) to simplify code 2012-01-15 21:05:10 +02:00
Filippos Karapetis 34b297748c SCI: Fix a nasty bug in kString(Dup)
The rawString variable is no longer pointing to invalidated data. This
fixes cases where strings are manipulated by game scripts, such as the
graveyard and rada drum puzzles in GK1
2012-01-15 20:11:30 +02:00
Lars Skovlund 40e22d9e33 SCI32: kString: Move variable declaration to prevent problems
with object lifetimes.
2011-10-30 13:56:37 +01:00
Filippos Karapetis ecddcc12b7 SCI2: kString(Format) uses %d for unsigned integers. Some cleanup 2011-09-25 23:55:44 +03:00