aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/kstring.cpp
AgeCommit message (Collapse)Author
2017-09-08SCI32: Remove redundant kStringGetData implementationColin Snover
This code is identical to the kArrayGetData implementation.
2017-09-08SCI32: Fix kString signatures to allow null references where appropriateColin Snover
The original interpreter allowed most string references to be null references, in which case it would substitute an empty string.
2017-08-06JANITORIAL: Silence some GCC 7 warningsTorbjörn Andersson
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-02-05SCI: Fix more unsafe C-string usageColin Snover
2017-01-09SCI32: Ignore attempts to free null array reg_tsColin Snover
2016-12-03SCI: Deduplicate text-reading code in kGetFarTextColin Snover
2016-11-04SCI32: Allow format strings with missing argumentsColin Snover
SSCI created a fake va_list and passed it to vsprintf, so extra placeholders would just silently end up reading garbage memory.
2016-11-04SCI32: Treat %d as unsigned in kStringColin Snover
At least Shivers has VMDs with resource IDs above 2^15; treating %d as signed means that the wrong filename gets created.
2016-09-29SCI32: Fix compilation warningsColin Snover
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-03-18SCI32: More correctly fix kStringCopy overflowColin Snover
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-18SCI32: Fix heap overflow (read) in kStringCopyColin Snover
2016-02-28SCI32: Non-titled text bitmap implementationColin Snover
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-01-15SCI: Add an initial implementation of kStringTrimFilippos Karapetis
Thanks to lskovlun for his help
2015-12-29SCI32: split up SCI2.1 into EARLY/MIDDLE/LATEMartin Kiewitz
- 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
2014-11-04SCI: kStrCat does language-splitting for QfG1 tooMartin Kiewitz
2014-02-18SCI: Make GPL headers consistent in themselves.Johannes Schickel
2013-07-14JANITORIAL: Remove trailing whitespaceSven Hesse
2013-04-23SCI: Fix kMessage REF subop orderingMatthew Hoops
Thanks to waltervn for testing values from running in DOSBox. Fixes bug #3034704
2013-01-25SCI: Fix kReadNumber sign/hex behaviourWillem Jan Palenstijn
Negative numbers now work, and hex overflow is handled like SSCI. Thanks to waltervn for testing.
2013-01-24SCI: Fix shadow warningWillem Jan Palenstijn
2013-01-23SCI: Bugfix for commit 0968acc: only filter out missing messages for the jarFilippos Karapetis
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-23SCI: Fix script bug #3601090 - "SCI: Pepper's Adventures in Time: Game ↵Filippos Karapetis
becomes unsolvable" Many thanks to lskovlun for debugging this problem and finding the offending script code that caused it.
2013-01-23SCI: Slight cleanup in kMessage()Filippos Karapetis
2012-10-05SCI: Add kReadNumber fixmeWillem Jan Palenstijn
Thanks to Walter for noticing this.
2012-06-21SCI: Fix silly typoFilippos Karapetis
Thanks to digitall for spotting this
2012-06-21SCI: Fix warningsFilippos Karapetis
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-06-11SCI: Fix comment in kString(at)Matthew Hoops
2012-06-11SCI: Bugfix for negative numbers in kString(at)Filippos Karapetis
Fixes one of the bugs in the savegame selection screen in Phantasmagoria
2012-02-20COMMON: Move isFoo functions to namespace Common, add doxygen commentsMax Horn
2012-02-15ALL: Avoid using is* macros from ctype.hMax Horn
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-01-16SCI: Remove outdated commentWillem Jan Palenstijn
2012-01-15SCI: Simplify kString(Dup) using the overloaded = operatorFilippos Karapetis
Thanks to wjp for his suggestion
2012-01-15SCI: Use fromString() in kString(Dup) to simplify codeFilippos Karapetis
2012-01-15SCI: Fix a nasty bug in kString(Dup)Filippos Karapetis
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
2011-10-30SCI32: kString: Move variable declaration to prevent problemsLars Skovlund
with object lifetimes.
2011-09-25SCI2: kString(Format) uses %d for unsigned integers. Some cleanupFilippos Karapetis
2011-08-26SCI: Fixed bug #3396887 - "SCI: pq2-pc98-jp - Listing of items / Inventory ↵Filippos Karapetis
not working" Thanks to wjp for his valuable help on this
2011-07-18SCI: Fix kFormat's handling of %c with a 0 argumentWillem Jan Palenstijn
SSCI used a sprintf to handle %c, appending the result to the output, which is effectively a nop for a zero argument. This is bug #3368821. Thanks to digitall for tracing it to KFormat and testing this patch.
2011-07-07SCI: Applied patch #3357096 with minor modificationsFilippos Karapetis
This prevents a string pointer from getting invalidated under some circumstances in kString(Dup). Thanks to lephilousophe for the patch.
2011-06-23ANALYSIS: Add static casts to is* functionsLittleboy
This fixes a potential problem with passing char values that would be sign-extended and yield unexpected results. See http://msdn.microsoft.com/en-us/library/ms245348.aspx
2011-06-20ALL: Remove trailing whitespacesMax Horn
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-05-29SCI: Added a more generalized fix for bug #3306417md5
2011-05-27SCI: Fixed bug #3306417 - "LAURA BOW 2: segmentation fault while talking to ↵md5
Dr. Myklos"
2011-05-12GIT: Clean up: Suppress SVN tags, now uselessstrangerke
2011-04-14ALL: centre -> centerMax Horn
2011-03-13SCI: Add workaround for a QFG1 VGA Mac kFormat bugMatthew Hoops
Also, fix the kernel signature for kFormat to require two parameters
2011-03-04SCI: Use BE string handling for Mac games.Walter van Niftrik
2011-03-04SCI: Removed warning from kReadNumbermd5