diff options
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/kgraphics32.cpp | 19 | ||||
-rw-r--r-- | engines/sci/engine/script_patches.cpp | 20 |
2 files changed, 15 insertions, 24 deletions
diff --git a/engines/sci/engine/kgraphics32.cpp b/engines/sci/engine/kgraphics32.cpp index c07282f53e..e75f563efb 100644 --- a/engines/sci/engine/kgraphics32.cpp +++ b/engines/sci/engine/kgraphics32.cpp @@ -75,8 +75,11 @@ reg_t kBaseSetter32(EngineState *s, int argc, reg_t *argv) { CelObjView celObj(viewId, loopNo, celNo); - const int16 scriptWidth = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth; - const Ratio scaleX(scriptWidth, celObj._xResolution); + Ratio scaleX; + if (getSciVersion() < SCI_VERSION_3) { + const int16 scriptWidth = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth; + scaleX = Ratio(scriptWidth, celObj._xResolution); + } int16 brLeft; @@ -414,7 +417,11 @@ reg_t kCelHigh32(EngineState *s, int argc, reg_t *argv) { int16 loopNo = argv[1].toSint16(); int16 celNo = argv[2].toSint16(); CelObjView celObj(resourceId, loopNo, celNo); - return make_reg(0, mulru(celObj._height, Ratio(g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight, celObj._yResolution))); + int16 height = celObj._height; + if (getSciVersion() < SCI_VERSION_3) { + height = mulru(height, Ratio(g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight, celObj._yResolution)); + } + return make_reg(0, height); } reg_t kCelWide32(EngineState *s, int argc, reg_t *argv) { @@ -422,7 +429,11 @@ reg_t kCelWide32(EngineState *s, int argc, reg_t *argv) { int16 loopNo = argv[1].toSint16(); int16 celNo = argv[2].toSint16(); CelObjView celObj(resourceId, loopNo, celNo); - return make_reg(0, mulru(celObj._width, Ratio(g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth, celObj._xResolution))); + int16 width = celObj._width; + if (getSciVersion() < SCI_VERSION_3) { + width = mulru(width, Ratio(g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth, celObj._xResolution)); + } + return make_reg(0, width); } // Used by Shivers 1, room 23601 to determine what blocks on the red door diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index 8bfd1d1732..a8be13edd9 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -6382,25 +6382,6 @@ static const uint16 ramaBenchmarkPatch[] = { PATCH_END }; -// RAMA initialises the font system with an incorrect text resolution (it uses -// the resolution from Phant1) which causes text to be scaled incorrectly. -static const uint16 ramaTextResolutionSignature[] = { - 0x39, 0x03, // pushi 3 - 0x78, // push1 - SIG_MAGICDWORD, - 0x38, SIG_UINT16(0x276), // pushi 630 - 0x38, SIG_UINT16(0x1c2), // pushi 450 - 0x43, 0x49, SIG_UINT16(0x06), // callk Font, 6 - SIG_END -}; - -static const uint16 ramaTextResolutionPatch[] = { - PATCH_ADDTOOFFSET(+3), // pushi 3, push1 - 0x38, PATCH_UINT16(0x280), // pushi 640 - 0x38, PATCH_UINT16(0x1e0), // pushi 480 - PATCH_END -}; - // RAMA uses a custom save game format that game scripts read and write // manually. The save game format serialises object references, which in the // original engine could be done just by writing int16s (since object references @@ -6474,7 +6455,6 @@ static const uint16 ramaChangeDirPatch[] = { }; static const SciScriptPatcherEntry ramaSignatures[] = { - { true, 0, "fix bad text resolution", 1, ramaTextResolutionSignature, ramaTextResolutionPatch }, { true, 55, "fix bad DocReader::init priority calculation", 1, ramaDocReaderInitSignature, ramaDocReaderInitPatch }, { true, 85, "fix SaveManager to use normal readWord calls", 1, ramaSerializeRegTSignature1, ramaSerializeRegTPatch1 }, { true, 64908, "disable video benchmarking", 1, ramaBenchmarkSignature, ramaBenchmarkPatch }, |