From 2a4b04f3b28a924cad402f21979e143fa5cd248a Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 15 Jan 2016 03:25:40 +0200 Subject: SCI: Add an initial implementation of kStringTrim Thanks to lskovlun for his help --- engines/sci/engine/kstring.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'engines/sci/engine/kstring.cpp') diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index cd0d6af936..310e38dbd1 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -860,7 +860,12 @@ reg_t kStringAtoi(EngineState *s, int argc, reg_t *argv) { } reg_t kStringTrim(EngineState *s, int argc, reg_t *argv) { - warning("kStringTrim (argc = %d)", argc); + Common::String string = s->_segMan->getString(argv[0]); + + string.trim(); + // TODO: Second parameter (bitfield, trim from left, right, center) + warning("kStringTrim (%d)", argv[1].getOffset()); + s->_segMan->strcpy(argv[0], string.c_str()); return NULL_REG; } -- cgit v1.2.3