diff options
author | Martin Kiewitz | 2010-02-06 17:03:18 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-02-06 17:03:18 +0000 |
commit | 454856b5fd890450be6e3fa4db088495f901d849 (patch) | |
tree | c39f8f8a500fbd59da9da622c1422daf76ed3602 /engines/sci/graphics | |
parent | b431e700d8878b6f6367f4ac15df5080490feb55 (diff) | |
download | scummvm-rg350-454856b5fd890450be6e3fa4db088495f901d849.tar.gz scummvm-rg350-454856b5fd890450be6e3fa4db088495f901d849.tar.bz2 scummvm-rg350-454856b5fd890450be6e3fa4db088495f901d849.zip |
SCI: put kShakeScreen into GfxPaint, called directly now
svn-id: r47936
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/gui.cpp | 16 | ||||
-rw-r--r-- | engines/sci/graphics/gui.h | 2 | ||||
-rw-r--r-- | engines/sci/graphics/gui32.cpp | 14 | ||||
-rw-r--r-- | engines/sci/graphics/gui32.h | 2 | ||||
-rw-r--r-- | engines/sci/graphics/paint.cpp | 4 | ||||
-rw-r--r-- | engines/sci/graphics/paint.h | 2 | ||||
-rw-r--r-- | engines/sci/graphics/paint16.cpp | 19 | ||||
-rw-r--r-- | engines/sci/graphics/paint16.h | 5 |
8 files changed, 28 insertions, 36 deletions
diff --git a/engines/sci/graphics/gui.cpp b/engines/sci/graphics/gui.cpp index 4796659203..4a0185c727 100644 --- a/engines/sci/graphics/gui.cpp +++ b/engines/sci/graphics/gui.cpp @@ -60,7 +60,7 @@ SciGui::SciGui(EngineState *state, GfxScreen *screen, GfxPalette *palette, GfxCa _compare = new GfxCompare(_s->_segMan, _s->_kernel, _cache, _screen, _coordAdjuster); _s->_gfxCompare = _compare; _transitions = new GfxTransitions(this, _screen, _palette, _s->resMan->isVGA()); - _paint16 = new GfxPaint16(_s->resMan, _s->_segMan, _s->_kernel, _cache, _ports, _coordAdjuster, _screen, _palette, _transitions); + _paint16 = new GfxPaint16(_s->resMan, _s->_segMan, _s->_kernel, this, _cache, _ports, _coordAdjuster, _screen, _palette, _transitions); _s->_gfxPaint = _paint16; _s->_gfxPaint16 = _paint16; _animate = new GfxAnimate(_s, _cache, _ports, _paint16, _screen, _palette, _cursor, _transitions); @@ -121,20 +121,6 @@ void SciGui::textColors(int argc, reg_t *argv) { _text16->CodeSetColors(argc, argv); } -void SciGui::shakeScreen(uint16 shakeCount, uint16 directions) { - while (shakeCount--) { - if (directions & SCI_SHAKE_DIRECTION_VERTICAL) - _screen->setVerticalShakePos(10); - // TODO: horizontal shakes - g_system->updateScreen(); - wait(3); - if (directions & SCI_SHAKE_DIRECTION_VERTICAL) - _screen->setVerticalShakePos(0); - g_system->updateScreen(); - wait(3); - } -} - reg_t SciGui::portraitLoad(Common::String resourceName) { //Portrait *myPortrait = new Portrait(_s->resMan, _screen, _palette, resourceName); return NULL_REG; diff --git a/engines/sci/graphics/gui.h b/engines/sci/graphics/gui.h index 911f72facc..732e195026 100644 --- a/engines/sci/graphics/gui.h +++ b/engines/sci/graphics/gui.h @@ -57,8 +57,6 @@ public: virtual void textFonts(int argc, reg_t *argv); virtual void textColors(int argc, reg_t *argv); - virtual void shakeScreen(uint16 shakeCount, uint16 directions); - virtual reg_t portraitLoad(Common::String resourceName); virtual void portraitShow(Common::String resourceName, Common::Point position, uint16 resourceNum, uint16 noun, uint16 verb, uint16 cond, uint16 seq); virtual void portraitUnload(uint16 portraitId); diff --git a/engines/sci/graphics/gui32.cpp b/engines/sci/graphics/gui32.cpp index 64ed619ac3..705ed1b9f4 100644 --- a/engines/sci/graphics/gui32.cpp +++ b/engines/sci/graphics/gui32.cpp @@ -79,20 +79,6 @@ void SciGui32::textSize(const char *text, int16 font, int16 maxWidth, int16 *tex *textHeight = 0; } -void SciGui32::shakeScreen(uint16 shakeCount, uint16 directions) { - while (shakeCount--) { - if (directions & SCI_SHAKE_DIRECTION_VERTICAL) - _screen->setVerticalShakePos(10); - // TODO: horizontal shakes - g_system->updateScreen(); - g_system->delayMillis(50); - if (directions & SCI_SHAKE_DIRECTION_VERTICAL) - _screen->setVerticalShakePos(0); - g_system->updateScreen(); - g_system->delayMillis(50); - } -} - void SciGui32::drawRobot(GuiResourceId robotId) { Robot *test = new Robot(_s->resMan, _screen, robotId); test->draw(); diff --git a/engines/sci/graphics/gui32.h b/engines/sci/graphics/gui32.h index 9ac52854da..603b9e24d4 100644 --- a/engines/sci/graphics/gui32.h +++ b/engines/sci/graphics/gui32.h @@ -48,8 +48,6 @@ public: void textSize(const char *text, int16 font, int16 maxWidth, int16 *textWidth, int16 *textHeight); - void shakeScreen(uint16 shakeCount, uint16 directions); - void drawRobot(GuiResourceId robotId); // FIXME: Don't store EngineState diff --git a/engines/sci/graphics/paint.cpp b/engines/sci/graphics/paint.cpp index 50b0534ba7..13dcebc27a 100644 --- a/engines/sci/graphics/paint.cpp +++ b/engines/sci/graphics/paint.cpp @@ -49,4 +49,8 @@ void GfxPaint::kernelDrawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, ui void GfxPaint::kernelGraphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control) { } +void GfxPaint::kernelShakeScreen(uint16 shakeCount, uint16 directions) { + warning("Unimplemented kShakeScreen"); +} + } // End of namespace Sci diff --git a/engines/sci/graphics/paint.h b/engines/sci/graphics/paint.h index 918e8d3046..f1342d55e5 100644 --- a/engines/sci/graphics/paint.h +++ b/engines/sci/graphics/paint.h @@ -41,6 +41,8 @@ public: virtual void kernelDrawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool hiresMode, reg_t upscaledHiresHandle); virtual void kernelGraphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control); + virtual void kernelShakeScreen(uint16 shakeCount, uint16 directions); + private: }; diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp index dad058f356..7261ad1dd8 100644 --- a/engines/sci/graphics/paint16.cpp +++ b/engines/sci/graphics/paint16.cpp @@ -45,8 +45,8 @@ namespace Sci { -GfxPaint16::GfxPaint16(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxPorts *ports, GfxCoordAdjuster *coordAdjuster, GfxScreen *screen, GfxPalette *palette, GfxTransitions *transitions) - : _resMan(resMan), _segMan(segMan), _kernel(kernel), _cache(cache), _ports(ports), _coordAdjuster(coordAdjuster), _screen(screen), _palette(palette), _transitions(transitions) { +GfxPaint16::GfxPaint16(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, SciGui *gui, GfxCache *cache, GfxPorts *ports, GfxCoordAdjuster *coordAdjuster, GfxScreen *screen, GfxPalette *palette, GfxTransitions *transitions) + : _resMan(resMan), _segMan(segMan), _kernel(kernel), _gui(gui), _cache(cache), _ports(ports), _coordAdjuster(coordAdjuster), _screen(screen), _palette(palette), _transitions(transitions) { } GfxPaint16::~GfxPaint16() { @@ -521,4 +521,19 @@ reg_t GfxPaint16::kernelDisplay(const char *text, int argc, reg_t *argv) { return result; } +// TODO: If this matches the sci32 implementation, we may put it into GfxScreen +void GfxPaint16::kernelShakeScreen(uint16 shakeCount, uint16 directions) { + while (shakeCount--) { + if (directions & SCI_SHAKE_DIRECTION_VERTICAL) + _screen->setVerticalShakePos(10); + // TODO: horizontal shakes + g_system->updateScreen(); + _gui->wait(3); + if (directions & SCI_SHAKE_DIRECTION_VERTICAL) + _screen->setVerticalShakePos(0); + g_system->updateScreen(); + _gui->wait(3); + } +} + } // End of namespace Sci diff --git a/engines/sci/graphics/paint16.h b/engines/sci/graphics/paint16.h index a880da74c8..f962c6e02a 100644 --- a/engines/sci/graphics/paint16.h +++ b/engines/sci/graphics/paint16.h @@ -45,7 +45,7 @@ class GfxView; */ class GfxPaint16 : public GfxPaint { public: - GfxPaint16(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxPorts *ports, GfxCoordAdjuster *coordAdjuster, GfxScreen *screen, GfxPalette *palette, GfxTransitions *transitions); + GfxPaint16(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, SciGui *gui, GfxCache *cache, GfxPorts *ports, GfxCoordAdjuster *coordAdjuster, GfxScreen *screen, GfxPalette *palette, GfxTransitions *transitions); ~GfxPaint16(); void init(GfxAnimate *animate, GfxText16 *text16); @@ -88,10 +88,13 @@ public: reg_t kernelDisplay(const char *text, int argc, reg_t *argv); + void kernelShakeScreen(uint16 shakeCount, uint16 directions); + private: ResourceManager *_resMan; SegManager *_segMan; Kernel *_kernel; + SciGui *_gui; GfxAnimate *_animate; GfxCache *_cache; GfxPorts *_ports; |