diff options
Diffstat (limited to 'engines/sci/engine/kgraphics32.cpp')
-rw-r--r-- | engines/sci/engine/kgraphics32.cpp | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/engines/sci/engine/kgraphics32.cpp b/engines/sci/engine/kgraphics32.cpp index f710df1ca5..f6aeeb7f9e 100644 --- a/engines/sci/engine/kgraphics32.cpp +++ b/engines/sci/engine/kgraphics32.cpp @@ -430,31 +430,28 @@ reg_t kCelWide32(EngineState *s, int argc, reg_t *argv) { return make_reg(0, mulru(celObj._width, Ratio(g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth, celObj._xResolution))); } +// Used by Shivers 1, room 23601 to determine what blocks on the red door +// puzzle board are occupied by pieces already, and by Phantasmagoria 2 when +// saving the game from the in-game UI reg_t kCelInfo(EngineState *s, int argc, reg_t *argv) { - // Used by Shivers 1, room 23601 to determine what blocks on the red door puzzle board - // are occupied by pieces already - - CelObjView view(argv[1].toUint16(), argv[2].toSint16(), argv[3].toSint16()); + if (!s) + return make_reg(0, getSciVersion()); + error("not supposed to call this"); +} - int16 result = 0; +reg_t kCelInfoGetOriginX(EngineState *s, int argc, reg_t *argv) { + CelObjView view(argv[0].toUint16(), argv[1].toSint16(), argv[2].toSint16()); + return make_reg(0, view._origin.x); +} - switch (argv[0].toUint16()) { - case 0: - result = view._origin.x; - break; - case 1: - result = view._origin.y; - break; - case 2: - case 3: - // null operation - break; - case 4: - result = view.readPixel(argv[4].toSint16(), argv[5].toSint16(), view._mirrorX); - break; - } +reg_t kCelInfoGetOriginY(EngineState *s, int argc, reg_t *argv) { + CelObjView view(argv[0].toUint16(), argv[1].toSint16(), argv[2].toSint16()); + return make_reg(0, view._origin.y); +} - return make_reg(0, result); +reg_t kCelInfoGetPixel(EngineState *s, int argc, reg_t *argv) { + CelObjView view(argv[0].toUint16(), argv[1].toSint16(), argv[2].toSint16()); + return make_reg(0, view.readPixel(argv[4].toSint16(), argv[5].toSint16(), view._mirrorX)); } reg_t kScrollWindow(EngineState *s, int argc, reg_t *argv) { |