diff options
author | Martin Kiewitz | 2009-10-13 16:18:17 +0000 |
---|---|---|
committer | Martin Kiewitz | 2009-10-13 16:18:17 +0000 |
commit | 7cefc4cc989ba7606e6473db9a56c14e30326c24 (patch) | |
tree | 09477c13bfb4bf417eafd9eaa5f47a326e7302ba /engines | |
parent | 65ed9eac4e325d26a684d1ff984e124c9fded03a (diff) | |
download | scummvm-rg350-7cefc4cc989ba7606e6473db9a56c14e30326c24.tar.gz scummvm-rg350-7cefc4cc989ba7606e6473db9a56c14e30326c24.tar.bz2 scummvm-rg350-7cefc4cc989ba7606e6473db9a56c14e30326c24.zip |
SCI/newgui: kSetPort() now also supporting 7 parameters
svn-id: r45027
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 9 | ||||
-rw-r--r-- | engines/sci/gui/gui.cpp | 16 | ||||
-rw-r--r-- | engines/sci/gui/gui.h | 7 | ||||
-rw-r--r-- | engines/sci/gui32/gui32.cpp | 2 | ||||
-rw-r--r-- | engines/sci/gui32/gui32.h | 2 |
5 files changed, 23 insertions, 13 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index cc9d293327..741acaeca3 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -1224,6 +1224,7 @@ reg_t kSetPort(EngineState *s, int argc, reg_t *argv) { uint16 portPtr; Common::Rect picRect; int16 picTop, picLeft; + bool initPriorityBandsFlag = false; switch (argc) { case 1: @@ -1231,15 +1232,17 @@ reg_t kSetPort(EngineState *s, int argc, reg_t *argv) { s->_gui->setPort(portPtr); break; + case 7: + initPriorityBandsFlag = true; case 4: case 6: picRect.top = argv[0].toSint16(); picRect.left = argv[1].toSint16(); picRect.bottom = argv[2].toSint16(); picRect.right = argv[3].toSint16(); - picTop = (argc == 6) ? argv[4].toSint16() : 0; - picLeft = (argc == 6) ? argv[5].toSint16() : 0; - s->_gui->setPortPic(picRect, picTop, picLeft); + picTop = (argc >= 6) ? argv[4].toSint16() : 0; + picLeft = (argc >= 6) ? argv[5].toSint16() : 0; + s->_gui->setPortPic(picRect, picTop, picLeft, initPriorityBandsFlag); break; default: diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp index 4a6abd735c..ce26d75974 100644 --- a/engines/sci/gui/gui.cpp +++ b/engines/sci/gui/gui.cpp @@ -72,15 +72,19 @@ void SciGui::resetEngineState(EngineState *s) { } void SciGui::init(bool usesOldGfxFunctions) { - // Initialize priority bands - if (usesOldGfxFunctions) { + _usesOldGfxFunctions = usesOldGfxFunctions; + + initPriorityBands(); +} + +void SciGui::initPriorityBands() { + if (_usesOldGfxFunctions) { _gfx->PriorityBandsInit(15, 42, 200); } else { _gfx->PriorityBandsInit(14, 42, 190); } } - void SciGui::wait(int16 ticks) { uint32 time; @@ -110,12 +114,12 @@ void SciGui::setPort(uint16 portPtr) { }; } -void SciGui::setPortPic(Common::Rect rect, int16 picTop, int16 picLeft) { +void SciGui::setPortPic(Common::Rect rect, int16 picTop, int16 picLeft, bool initPriorityBandsFlag) { _windowMgr->_picWind->rect = rect; _windowMgr->_picWind->top = picTop; _windowMgr->_picWind->left = picLeft; - //if (argc >= 7) - //InitPri(42,190); + if (initPriorityBandsFlag) + initPriorityBands(); } reg_t SciGui::getPort() { diff --git a/engines/sci/gui/gui.h b/engines/sci/gui/gui.h index b2b0ea0cbb..d045450316 100644 --- a/engines/sci/gui/gui.h +++ b/engines/sci/gui/gui.h @@ -49,7 +49,7 @@ public: virtual void wait(int16 ticks); virtual void setPort(uint16 portPtr); - virtual void setPortPic(Common::Rect rect, int16 picTop, int16 picLeft); + virtual void setPortPic(Common::Rect rect, int16 picTop, int16 picLeft, bool initPriorityBandsFlag); virtual reg_t getPort(); virtual void globalToLocal(int16 *x, int16 *y); virtual void localToGlobal(int16 *x, int16 *y); @@ -115,6 +115,8 @@ public: virtual void resetEngineState(EngineState *s); private: + virtual void initPriorityBands(); + EngineState *_s; SciGuiScreen *_screen; SciGuiPalette *_palette; @@ -123,8 +125,9 @@ private: SciGuiresources *_resources; SciGuiWindowMgr *_windowMgr; SciGuiAnimate *_animate; - // SciGui32 *_gui32; // for debug purposes + + bool _usesOldGfxFunctions; }; } // End of namespace Sci diff --git a/engines/sci/gui32/gui32.cpp b/engines/sci/gui32/gui32.cpp index 5de030992c..84a67365bb 100644 --- a/engines/sci/gui32/gui32.cpp +++ b/engines/sci/gui32/gui32.cpp @@ -118,7 +118,7 @@ void SciGui32::setPort(uint16 portPtr) { s->port = new_port; } -void SciGui32::setPortPic(Common::Rect rect, int16 picTop, int16 picLeft) { +void SciGui32::setPortPic(Common::Rect rect, int16 picTop, int16 picLeft, bool initPriorityBandsFlag) { if (activated_icon_bar) { port_origin_x = port_origin_y = 0; activated_icon_bar = false; diff --git a/engines/sci/gui32/gui32.h b/engines/sci/gui32/gui32.h index c30eeb2b7e..76bb81d1f9 100644 --- a/engines/sci/gui32/gui32.h +++ b/engines/sci/gui32/gui32.h @@ -39,7 +39,7 @@ public: void wait(int16 ticks); void setPort(uint16 portPtr); - void setPortPic(Common::Rect rect, int16 picTop, int16 picLeft); + void setPortPic(Common::Rect rect, int16 picTop, int16 picLeft, bool initPriorityBandsFlag); reg_t getPort(); void globalToLocal(int16 *x, int16 *y); void localToGlobal(int16 *x, int16 *y); |