diff options
author | Martin Kiewitz | 2010-07-25 16:37:36 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-07-25 16:37:36 +0000 |
commit | d5ced8ab9e6a3b089792d27741699c1928e7fc58 (patch) | |
tree | 7b8db797457e0c234a1cd6f928a69087a962ee33 /engines | |
parent | b3949cf4be02136c633becd841a4a5e45033f8d5 (diff) | |
download | scummvm-rg350-d5ced8ab9e6a3b089792d27741699c1928e7fc58.tar.gz scummvm-rg350-d5ced8ab9e6a3b089792d27741699c1928e7fc58.tar.bz2 scummvm-rg350-d5ced8ab9e6a3b089792d27741699c1928e7fc58.zip |
SCI: using coordadjuster in GfxView
svn-id: r51276
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/graphics/view.cpp | 15 | ||||
-rw-r--r-- | engines/sci/graphics/view.h | 1 |
2 files changed, 6 insertions, 10 deletions
diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp index 80778504ec..d32e60335f 100644 --- a/engines/sci/graphics/view.cpp +++ b/engines/sci/graphics/view.cpp @@ -28,6 +28,7 @@ #include "sci/engine/state.h" #include "sci/graphics/screen.h" #include "sci/graphics/palette.h" +#include "sci/graphics/coordadjuster.h" #include "sci/graphics/view.h" namespace Sci { @@ -35,6 +36,7 @@ namespace Sci { GfxView::GfxView(ResourceManager *resMan, GfxScreen *screen, GfxPalette *palette, GuiResourceId resourceId) : _resMan(resMan), _screen(screen), _palette(palette), _resourceId(resourceId) { assert(resourceId != -1); + _coordAdjuster = g_sci->_gfxCoordAdjuster; initData(resourceId); } @@ -267,16 +269,9 @@ void GfxView::initData(GuiResourceId resourceId) { break; case SCI_VERSION_2_1: - // half the width returned here, fixes lsl6 action icon placements - // the scripts work low-res and add the returned value from here to the coordinate - // TODO: check, if this is actually right. I'm slightly confused by this, but even GK1CD has some idivs in this - // code, so it seems plausible. - if (_screen->getDisplayWidth() > 320) { - for (loopNo = 0; loopNo < _loopCount; loopNo++) { - for (celNo = 0; celNo < _loop[loopNo].celCount; celNo++) { - _loop[loopNo].cel[celNo].scriptWidth /= 2; - _loop[loopNo].cel[celNo].scriptHeight /= 2; - } + for (loopNo = 0; loopNo < _loopCount; loopNo++) { + for (celNo = 0; celNo < _loop[loopNo].celCount; celNo++) { + _coordAdjuster->fromDisplayToScript(_loop[loopNo].cel[celNo].scriptHeight, _loop[loopNo].cel[celNo].scriptWidth); } } default: diff --git a/engines/sci/graphics/view.h b/engines/sci/graphics/view.h index bcfae8a112..25e110ad13 100644 --- a/engines/sci/graphics/view.h +++ b/engines/sci/graphics/view.h @@ -82,6 +82,7 @@ private: void unditherBitmap(byte *bitmap, int16 width, int16 height, byte clearKey); ResourceManager *_resMan; + GfxCoordAdjuster *_coordAdjuster; GfxScreen *_screen; GfxPalette *_palette; |