diff options
author | Martin Kiewitz | 2010-06-15 12:01:49 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-06-15 12:01:49 +0000 |
commit | 59d0035b033ac4791bfa91245418852a66e4e63a (patch) | |
tree | 231cb99ee2f86069d4bdaad81bc6893b612801ca /engines | |
parent | 5b484b5be7a9b9abbaf6b686e59b2ee9f88acb2d (diff) | |
download | scummvm-rg350-59d0035b033ac4791bfa91245418852a66e4e63a.tar.gz scummvm-rg350-59d0035b033ac4791bfa91245418852a66e4e63a.tar.bz2 scummvm-rg350-59d0035b033ac4791bfa91245418852a66e4e63a.zip |
SCI: move portrait methods to gfxPaint16
svn-id: r49806
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 6 | ||||
-rw-r--r-- | engines/sci/graphics/gui.cpp | 20 | ||||
-rw-r--r-- | engines/sci/graphics/gui.h | 4 | ||||
-rw-r--r-- | engines/sci/graphics/paint16.cpp | 20 | ||||
-rw-r--r-- | engines/sci/graphics/paint16.h | 4 |
5 files changed, 27 insertions, 27 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index f025d03a09..cf6bd41fa9 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -698,7 +698,7 @@ reg_t kPortrait(EngineState *s, int argc, reg_t *argv) { case 0: { // load if (argc == 2) { Common::String resourceName = s->_segMan->getString(argv[1]); - s->r_acc = g_sci->_gui->portraitLoad(resourceName); + s->r_acc = g_sci->_gfxPaint16->kernelPortraitLoad(resourceName); } else { warning("kPortrait(loadResource) called with unsupported argc %d", argc); } @@ -715,7 +715,7 @@ reg_t kPortrait(EngineState *s, int argc, reg_t *argv) { uint seq = argv[8].toUint16() & 0xff; // argv[9] is usually 0??!! - g_sci->_gui->portraitShow(resourceName, position, resourceNum, noun, verb, cond, seq); + g_sci->_gfxPaint16->kernelPortraitShow(resourceName, position, resourceNum, noun, verb, cond, seq); return SIGNAL_REG; } else { warning("kPortrait(show) called with unsupported argc %d", argc); @@ -725,7 +725,7 @@ reg_t kPortrait(EngineState *s, int argc, reg_t *argv) { case 2: { // unload if (argc == 2) { uint16 portraitId = argv[1].toUint16(); - g_sci->_gui->portraitUnload(portraitId); + g_sci->_gfxPaint16->kernelPortraitUnload(portraitId); } else { warning("kPortrait(unload) called with unsupported argc %d", argc); } diff --git a/engines/sci/graphics/gui.cpp b/engines/sci/graphics/gui.cpp index 63ac6c0a05..677359c201 100644 --- a/engines/sci/graphics/gui.cpp +++ b/engines/sci/graphics/gui.cpp @@ -43,7 +43,6 @@ #include "sci/graphics/animate.h" #include "sci/graphics/controls.h" #include "sci/graphics/menu.h" -#include "sci/graphics/portrait.h" #include "sci/graphics/text16.h" #include "sci/graphics/transitions.h" #include "sci/graphics/view.h" @@ -112,23 +111,4 @@ void SciGui::textColors(int argc, reg_t *argv) { _text16->CodeSetColors(argc, argv); } -reg_t SciGui::portraitLoad(Common::String resourceName) { - //Portrait *myPortrait = new Portrait(g_sci->getResMan(), _screen, _palette, resourceName); - return NULL_REG; -} - -void SciGui::portraitShow(Common::String resourceName, Common::Point position, uint16 resourceId, uint16 noun, uint16 verb, uint16 cond, uint16 seq) { - Portrait *myPortrait = new Portrait(g_sci->getResMan(), g_sci->getEventManager(), this, _screen, _palette, _audio, resourceName); - // TODO: cache portraits - // adjust given coordinates to curPort (but dont adjust coordinates on upscaledHires_Save_Box and give us hires coordinates - // on kDrawCel, yeah this whole stuff makes sense) - position.x += _ports->getPort()->left; position.y += _ports->getPort()->top; - _screen->adjustToUpscaledCoordinates(position.y, position.x); - myPortrait->doit(position, resourceId, noun, verb, cond, seq); - delete myPortrait; -} - -void SciGui::portraitUnload(uint16 portraitId) { -} - } // End of namespace Sci diff --git a/engines/sci/graphics/gui.h b/engines/sci/graphics/gui.h index 8e4abdf5b7..73c37de099 100644 --- a/engines/sci/graphics/gui.h +++ b/engines/sci/graphics/gui.h @@ -57,10 +57,6 @@ public: virtual void textFonts(int argc, reg_t *argv); virtual void textColors(int argc, reg_t *argv); - 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); - protected: GfxCursor *_cursor; EngineState *_s; diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp index 6a13f792cb..eb3fea969a 100644 --- a/engines/sci/graphics/paint16.cpp +++ b/engines/sci/graphics/paint16.cpp @@ -42,6 +42,7 @@ #include "sci/graphics/view.h" #include "sci/graphics/screen.h" #include "sci/graphics/palette.h" +#include "sci/graphics/portrait.h" #include "sci/graphics/text16.h" #include "sci/graphics/transitions.h" @@ -580,4 +581,23 @@ void GfxPaint16::kernelShakeScreen(uint16 shakeCount, uint16 directions) { } } +reg_t GfxPaint16::kernelPortraitLoad(Common::String resourceName) { + //Portrait *myPortrait = new Portrait(g_sci->getResMan(), _screen, _palette, resourceName); + return NULL_REG; +} + +void GfxPaint16::kernelPortraitShow(Common::String resourceName, Common::Point position, uint16 resourceId, uint16 noun, uint16 verb, uint16 cond, uint16 seq) { + Portrait *myPortrait = new Portrait(g_sci->getResMan(), g_sci->getEventManager(), this, _screen, _palette, _audio, resourceName); + // TODO: cache portraits + // adjust given coordinates to curPort (but dont adjust coordinates on upscaledHires_Save_Box and give us hires coordinates + // on kDrawCel, yeah this whole stuff makes sense) + position.x += _ports->getPort()->left; position.y += _ports->getPort()->top; + _screen->adjustToUpscaledCoordinates(position.y, position.x); + myPortrait->doit(position, resourceId, noun, verb, cond, seq); + delete myPortrait; +} + +void GfxPaint16::kernelPortraitUnload(uint16 portraitId) { +} + } // End of namespace Sci diff --git a/engines/sci/graphics/paint16.h b/engines/sci/graphics/paint16.h index 65f9dd0d9c..7a1a3bd7eb 100644 --- a/engines/sci/graphics/paint16.h +++ b/engines/sci/graphics/paint16.h @@ -91,6 +91,10 @@ public: void kernelShakeScreen(uint16 shakeCount, uint16 directions); + reg_t kernelPortraitLoad(Common::String resourceName); + void kernelPortraitShow(Common::String resourceName, Common::Point position, uint16 resourceNum, uint16 noun, uint16 verb, uint16 cond, uint16 seq); + void kernelPortraitUnload(uint16 portraitId); + private: ResourceManager *_resMan; SegManager *_segMan; |