diff options
author | Martin Kiewitz | 2010-07-21 12:05:10 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-07-21 12:05:10 +0000 |
commit | 15fc39589d109245fd66d5cee6319ee19bb8e4d2 (patch) | |
tree | cde6cc5cdf22f703f76005f107365537517d66e6 /engines/sci/graphics/coordadjuster.cpp | |
parent | d53e5fbfb7a3cafff6f21a6d656428f670256e9f (diff) | |
download | scummvm-rg350-15fc39589d109245fd66d5cee6319ee19bb8e4d2.tar.gz scummvm-rg350-15fc39589d109245fd66d5cee6319ee19bb8e4d2.tar.bz2 scummvm-rg350-15fc39589d109245fd66d5cee6319ee19bb8e4d2.zip |
SCI: more work on coordadjustment sci32
svn-id: r51084
Diffstat (limited to 'engines/sci/graphics/coordadjuster.cpp')
-rw-r--r-- | engines/sci/graphics/coordadjuster.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/engines/sci/graphics/coordadjuster.cpp b/engines/sci/graphics/coordadjuster.cpp index fbeffa7cd2..69f89aa656 100644 --- a/engines/sci/graphics/coordadjuster.cpp +++ b/engines/sci/graphics/coordadjuster.cpp @@ -101,14 +101,11 @@ void GfxCoordAdjuster32::kernelGlobalToLocal(int16 &x, int16 &y, reg_t planeObje uint16 planeTop = readSelectorValue(s->_segMan, planeObject, SELECTOR(top)); uint16 planeLeft = readSelectorValue(s->_segMan, planeObject, SELECTOR(left)); - planeTop = (planeTop * g_sci->_gfxScreen->getHeight()) / planeResY; - planeLeft = (planeLeft * g_sci->_gfxScreen->getWidth()) / planeResX; + y = ((y * planeResY) / g_sci->_gfxScreen->getHeight()); + x = ((x * planeResX) / g_sci->_gfxScreen->getWidth()); y -= planeTop; x -= planeLeft; - - y = ((y * planeResY) / g_sci->_gfxScreen->getHeight()); - x = ((x * planeResX) / g_sci->_gfxScreen->getWidth()); } void GfxCoordAdjuster32::kernelLocalToGlobal(int16 &x, int16 &y, reg_t planeObject) { EngineState *s = g_sci->getEngineState(); @@ -117,14 +114,11 @@ void GfxCoordAdjuster32::kernelLocalToGlobal(int16 &x, int16 &y, reg_t planeObje uint16 planeTop = readSelectorValue(s->_segMan, planeObject, SELECTOR(top)); uint16 planeLeft = readSelectorValue(s->_segMan, planeObject, SELECTOR(left)); - planeTop = (planeTop * g_sci->_gfxScreen->getHeight()) / planeResY; - planeLeft = (planeLeft * g_sci->_gfxScreen->getWidth()) / planeResX; + x += planeLeft; + y += planeTop; y = ((y * g_sci->_gfxScreen->getHeight()) / planeResY); x = ((x * g_sci->_gfxScreen->getWidth()) / planeResX); - - x += planeLeft; - y += planeTop; } Common::Rect GfxCoordAdjuster32::onControl(Common::Rect rect) { |