From d30d57b923ddad194071d3fc07d79385c1ce4a37 Mon Sep 17 00:00:00 2001 From: Walter van Niftrik Date: Mon, 7 Jun 2010 02:11:19 +0000 Subject: SCI: Relax signature of kCreateTextBitmap. svn-id: r49470 --- engines/sci/engine/kernel.cpp | 2 +- engines/sci/engine/kernel32.cpp | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'engines/sci/engine') diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index 0b7198d1bc..6ebee2dfbd 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -363,7 +363,7 @@ SciKernelFunction kfunct_mappers[] = { DEFUN("ListIndexOf", kListIndexOf, "lZo"), DEFUN("OnMe", kOnMe, "iio.*"), DEFUN("InPolygon", kInPolygon, "iio"), - DEFUN("CreateTextBitmap", kCreateTextBitmap, "iiio"), + DEFUN("CreateTextBitmap", kCreateTextBitmap, "i.*"), // SCI2.1 Kernel Functions DEFUN("Save", kSave, ".*"), diff --git a/engines/sci/engine/kernel32.cpp b/engines/sci/engine/kernel32.cpp index d2a3362aca..0afdc3f2eb 100644 --- a/engines/sci/engine/kernel32.cpp +++ b/engines/sci/engine/kernel32.cpp @@ -804,9 +804,16 @@ reg_t kInPolygon(EngineState *s, int argc, reg_t *argv) { reg_t kCreateTextBitmap(EngineState *s, int argc, reg_t *argv) { // TODO: argument 0 is usually 0, and arguments 1 and 2 are usually 1 - reg_t object = argv[3]; - Common::String text = s->_segMan->getString(readSelector(s->_segMan, object, SELECTOR(text))); - debug("kCreateTextBitmap: %s", text.c_str()); + switch (argv[0].toUint16()) { + case 0: + if (argc != 4) { + warning("kCreateTextBitmap(0): expected 4 arguments, got %i", argc); + return NULL_REG; + } + reg_t object = argv[3]; + Common::String text = s->_segMan->getString(readSelector(s->_segMan, object, SELECTOR(text))); + debug("kCreateTextBitmap: %s", text.c_str()); + } return NULL_REG; } -- cgit v1.2.3