From 4a157d43b352997e05164d231a634bc65d302308 Mon Sep 17 00:00:00 2001 From: Walter van Niftrik Date: Sun, 11 Oct 2009 14:58:58 +0000 Subject: SCI: Implement CoordPri() with two args. svn-id: r44927 --- engines/sci/engine/kernel.cpp | 2 +- engines/sci/engine/kgraphics.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index 01e42df13d..a57ba731ab 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -288,7 +288,7 @@ SciKernelFunction kfunct_mappers[] = { /*62*/ DEFUN("GetCWD", kGetCWD, "r"), /*63*/ DEFUN("CheckFreeSpace", kCheckFreeSpace, "r"), /*64*/ DEFUN("ValidPath", kValidPath, "r"), - /*65*/ DEFUN("CoordPri", kCoordPri, "i"), + /*65*/ DEFUN("CoordPri", kCoordPri, "ii*"), /*66*/ DEFUN("StrAt", kStrAt, "rii*"), /*67*/ DEFUN("DeviceInfo", kDeviceInfo, "i.*"), // FIXME: signature check removed (set to .*), as this function accepts a parameter in SCI32 games diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 3765835295..6206c69a48 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -753,7 +753,12 @@ reg_t kWait(EngineState *s, int argc, reg_t *argv) { reg_t kCoordPri(EngineState *s, int argc, reg_t *argv) { int16 y = argv[0].toSint16(); - return make_reg(0, s->_gui->coordinateToPriority(y)); + if ((argc < 2) || (y != 1)) { + return make_reg(0, s->_gui->coordinateToPriority(y)); + } else { + int16 priority = argv[1].toSint16(); + return make_reg(0, s->_gui->priorityToCoordinate(priority)); + } } reg_t kPriCoord(EngineState *s, int argc, reg_t *argv) { -- cgit v1.2.3