diff options
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/animate.cpp | 2 | ||||
-rw-r--r-- | engines/sci/graphics/compare.cpp | 4 | ||||
-rw-r--r-- | engines/sci/graphics/compare.h | 3 | ||||
-rw-r--r-- | engines/sci/graphics/controls16.cpp | 7 | ||||
-rw-r--r-- | engines/sci/graphics/controls16.h | 1 | ||||
-rw-r--r-- | engines/sci/graphics/controls32.cpp | 4 | ||||
-rw-r--r-- | engines/sci/graphics/controls32.h | 3 | ||||
-rw-r--r-- | engines/sci/graphics/coordadjuster.h | 2 | ||||
-rw-r--r-- | engines/sci/graphics/cursor.cpp | 48 | ||||
-rw-r--r-- | engines/sci/graphics/fontsjis.h | 3 | ||||
-rw-r--r-- | engines/sci/graphics/frameout.cpp | 3 | ||||
-rw-r--r-- | engines/sci/graphics/menu.cpp | 1 | ||||
-rw-r--r-- | engines/sci/graphics/paint16.cpp | 12 | ||||
-rw-r--r-- | engines/sci/graphics/paint16.h | 3 | ||||
-rw-r--r-- | engines/sci/graphics/paint32.cpp | 4 | ||||
-rw-r--r-- | engines/sci/graphics/paint32.h | 5 | ||||
-rw-r--r-- | engines/sci/graphics/palette.cpp | 2 | ||||
-rw-r--r-- | engines/sci/graphics/picture.cpp | 2 | ||||
-rw-r--r-- | engines/sci/graphics/screen.cpp | 2 | ||||
-rw-r--r-- | engines/sci/graphics/text16.cpp | 4 | ||||
-rw-r--r-- | engines/sci/graphics/text16.h | 3 |
21 files changed, 61 insertions, 57 deletions
diff --git a/engines/sci/graphics/animate.cpp b/engines/sci/graphics/animate.cpp index ee28c5ca31..53715613fc 100644 --- a/engines/sci/graphics/animate.cpp +++ b/engines/sci/graphics/animate.cpp @@ -528,7 +528,7 @@ void GfxAnimate::addToPicDrawCels() { it->priority = _ports->kernelCoordinateToPriority(it->y); if (!view->isScaleable()) { - // Laura Bow 2 specific - ffs. fill() + // Laura Bow 2 specific - Check fill() below it->scaleSignal = 0; it->scaleY = it->scaleX = 128; } diff --git a/engines/sci/graphics/compare.cpp b/engines/sci/graphics/compare.cpp index 70dff15a86..b42063b119 100644 --- a/engines/sci/graphics/compare.cpp +++ b/engines/sci/graphics/compare.cpp @@ -37,8 +37,8 @@ namespace Sci { -GfxCompare::GfxCompare(SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxScreen *screen, GfxCoordAdjuster *coordAdjuster) - : _segMan(segMan), _kernel(kernel), _cache(cache), _screen(screen), _coordAdjuster(coordAdjuster) { +GfxCompare::GfxCompare(SegManager *segMan, GfxCache *cache, GfxScreen *screen, GfxCoordAdjuster *coordAdjuster) + : _segMan(segMan), _cache(cache), _screen(screen), _coordAdjuster(coordAdjuster) { } GfxCompare::~GfxCompare() { diff --git a/engines/sci/graphics/compare.h b/engines/sci/graphics/compare.h index 91e3b90fdb..0080406a3b 100644 --- a/engines/sci/graphics/compare.h +++ b/engines/sci/graphics/compare.h @@ -34,7 +34,7 @@ class Screen; */ class GfxCompare { public: - GfxCompare(SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxScreen *screen, GfxCoordAdjuster *coordAdjuster); + GfxCompare(SegManager *segMan, GfxCache *cache, GfxScreen *screen, GfxCoordAdjuster *coordAdjuster); ~GfxCompare(); uint16 kernelOnControl(byte screenMask, const Common::Rect &rect); @@ -47,7 +47,6 @@ public: private: SegManager *_segMan; - Kernel *_kernel; GfxCache *_cache; GfxScreen *_screen; GfxCoordAdjuster *_coordAdjuster; diff --git a/engines/sci/graphics/controls16.cpp b/engines/sci/graphics/controls16.cpp index 7c09969717..0098f7b9ef 100644 --- a/engines/sci/graphics/controls16.cpp +++ b/engines/sci/graphics/controls16.cpp @@ -42,16 +42,13 @@ namespace Sci { GfxControls16::GfxControls16(SegManager *segMan, GfxPorts *ports, GfxPaint16 *paint16, GfxText16 *text16, GfxScreen *screen) : _segMan(segMan), _ports(ports), _paint16(paint16), _text16(text16), _screen(screen) { - init(); + _texteditBlinkTime = 0; + _texteditCursorVisible = false; } GfxControls16::~GfxControls16() { } -void GfxControls16::init() { - _texteditCursorVisible = false; -} - const char controlListUpArrow[2] = { 0x18, 0 }; const char controlListDownArrow[2] = { 0x19, 0 }; diff --git a/engines/sci/graphics/controls16.h b/engines/sci/graphics/controls16.h index 90bd7beacb..2cde86d4b1 100644 --- a/engines/sci/graphics/controls16.h +++ b/engines/sci/graphics/controls16.h @@ -63,7 +63,6 @@ public: void kernelTexteditChange(reg_t controlObject, reg_t eventObject); private: - void init(); void texteditSetBlinkTime(); void drawListControl(Common::Rect rect, reg_t obj, int16 maxChars, int16 count, const char **entries, GuiResourceId fontId, int16 upperPos, int16 cursorPos, bool isAlias); diff --git a/engines/sci/graphics/controls32.cpp b/engines/sci/graphics/controls32.cpp index 5535a7408a..5b61e1a86a 100644 --- a/engines/sci/graphics/controls32.cpp +++ b/engines/sci/graphics/controls32.cpp @@ -35,8 +35,8 @@ namespace Sci { -GfxControls32::GfxControls32(SegManager *segMan, GfxCache *cache, GfxScreen *screen, GfxText32 *text) - : _segMan(segMan), _cache(cache), _screen(screen), _text(text) { +GfxControls32::GfxControls32(SegManager *segMan, GfxCache *cache, GfxText32 *text) + : _segMan(segMan), _cache(cache), _text(text) { } GfxControls32::~GfxControls32() { diff --git a/engines/sci/graphics/controls32.h b/engines/sci/graphics/controls32.h index 68dca59462..1b705988c2 100644 --- a/engines/sci/graphics/controls32.h +++ b/engines/sci/graphics/controls32.h @@ -34,7 +34,7 @@ class GfxText32; */ class GfxControls32 { public: - GfxControls32(SegManager *segMan, GfxCache *cache, GfxScreen *screen, GfxText32 *text); + GfxControls32(SegManager *segMan, GfxCache *cache, GfxText32 *text); ~GfxControls32(); void kernelTexteditChange(reg_t controlObject); @@ -42,7 +42,6 @@ public: private: SegManager *_segMan; GfxCache *_cache; - GfxScreen *_screen; GfxText32 *_text; }; diff --git a/engines/sci/graphics/coordadjuster.h b/engines/sci/graphics/coordadjuster.h index 63f608be6b..25279b34b1 100644 --- a/engines/sci/graphics/coordadjuster.h +++ b/engines/sci/graphics/coordadjuster.h @@ -71,8 +71,6 @@ public: private: GfxPorts *_ports; - - Port *backuppedPort; }; #ifdef ENABLE_SCI32 diff --git a/engines/sci/graphics/cursor.cpp b/engines/sci/graphics/cursor.cpp index fe2aefd689..a9c741670f 100644 --- a/engines/sci/graphics/cursor.cpp +++ b/engines/sci/graphics/cursor.cpp @@ -69,6 +69,10 @@ GfxCursor::GfxCursor(ResourceManager *resMan, GfxPalette *palette, GfxScreen *sc _useSilverSQ4CDCursors = ConfMan.getBool("silver_cursors"); else _useSilverSQ4CDCursors = false; + + // _coordAdjuster and _event will be initialized later on + _coordAdjuster = NULL; + _event = NULL; } GfxCursor::~GfxCursor() { @@ -277,16 +281,16 @@ void GfxCursor::kernelSetView(GuiResourceId viewNum, int loopNum, int celNum, Co delete cursorHotspot; } -// this list contains all mandatory set cursor changes, that need special handling -// ffs. GfxCursor::setPosition (below) -// Game, newPosition, validRect +// This list contains all mandatory set cursor changes, that need special handling +// Refer to GfxCursor::setPosition() below +// Game, newPosition, validRect static const SciCursorSetPositionWorkarounds setPositionWorkarounds[] = { - { GID_ISLANDBRAIN, 84, 109, 46, 76, 174, 243 }, // island of dr. brain / game menu - { GID_ISLANDBRAIN,143, 135, 57, 102, 163, 218 },// island of dr. brain / pause menu within copy protection - { GID_LSL5, 23, 171, 0, 0, 26, 320 }, // larry 5 / skip forward helper - { GID_QFG1VGA, 64, 174, 40, 37, 74, 284 }, // Quest For Glory 1 VGA / run/walk/sleep sub-menu - { GID_QFG3, 70, 170, 40, 61, 81, 258 }, // Quest For Glory 3 / run/walk/sleep sub-menu - { (SciGameId)0, -1, -1, -1, -1, -1, -1 } + { GID_ISLANDBRAIN, 84, 109, 46, 76, 174, 243 }, // Island of Dr. Brain, game menu + { GID_ISLANDBRAIN, 143, 135, 57, 102, 163, 218 }, // Island of Dr. Brain, pause menu within copy protection + { GID_LSL5, 23, 171, 0, 0, 26, 320 }, // Larry 5, skip forward helper pop-up + { GID_QFG1VGA, 64, 174, 40, 37, 74, 284 }, // Quest For Glory 1 VGA, run/walk/sleep sub-menu + { GID_QFG3, 70, 170, 40, 61, 81, 258 }, // Quest For Glory 3, run/walk/sleep sub-menu + { (SciGameId)0, -1, -1, -1, -1, -1, -1 } }; void GfxCursor::setPosition(Common::Point pos) { @@ -306,16 +310,24 @@ void GfxCursor::setPosition(Common::Point pos) { g_system->warpMouse(pos.x, pos.y); } + // WORKAROUNDS for games with windows that are hidden when the mouse cursor + // is moved outside them - also check setPositionWorkarounds above. + // // Some games display a new menu, set mouse position somewhere within and - // expect it to be in there. This is fine for a real mouse, but on wii using - // wii-mote or touch interfaces this won't work. In fact on those platforms - // the menus will close immediately because of that behavior. - // We identify those cases and set a reaction-rect. If the mouse it outside - // of that rect, we won't report the position back to the scripts. - // As soon as the mouse was inside once, we will revert to normal behavior - // Currently this code is enabled for all platforms, especially because we can't - // differentiate between e.g. Windows used via mouse and Windows used via touchscreen - // The workaround won't hurt real-mouse platforms + // expect it to be in there. This is fine for a real mouse, but on platforms + // without a mouse, such as a Wii with a Wii Remote, or touch interfaces, + // this won't work. In these platforms, the affected menus will close + // immediately, because the mouse cursor's position won't be what the game + // scripts expect. + // We identify these cases via the cursor position set. If the mouse position + // is outside the expected rectangle, we report back to the game scripts that + // it's actually inside it, the first time that the mouse position is polled, + // as the scripts expect. In subsequent mouse position poll attempts, we + // return back the actual mouse coordinates. + // Currently this code is enabled for all platforms, as we can't differentiate + // between ones that have normal mouse input, and platforms that have + // alternative mouse input methods, like a touch screen. Platforms that have + // a normal mouse for input won't be affected by this workaround. const SciGameId gameId = g_sci->getGameId(); const SciCursorSetPositionWorkarounds *workaround; workaround = setPositionWorkarounds; diff --git a/engines/sci/graphics/fontsjis.h b/engines/sci/graphics/fontsjis.h index c4ae4ab580..ae5eaa43f9 100644 --- a/engines/sci/graphics/fontsjis.h +++ b/engines/sci/graphics/fontsjis.h @@ -50,9 +50,6 @@ private: GuiResourceId _resourceId; Graphics::FontSJIS *_commonFont; - - byte _lastForDoubleByteWidth; - byte _lastForDoubleByteDraw; }; } // End of namespace Sci diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp index 5f65762685..bf1ce6da64 100644 --- a/engines/sci/graphics/frameout.cpp +++ b/engines/sci/graphics/frameout.cpp @@ -747,7 +747,8 @@ void GfxFrameout::kernelFrameout() { // TODO: We can only process symmetrical scaling for now (i.e. same value for scaleX/scaleY) if ((itemEntry->scaleSignal & kScaleSignalDoScaling32) && !(itemEntry->scaleSignal & kScaleSignalDisableGlobalScaling32) && - (itemEntry->scaleX == itemEntry->scaleY)) + (itemEntry->scaleX == itemEntry->scaleY) && + itemEntry->scaleX != 128) applyGlobalScaling(itemEntry, it->planeRect, view->getHeight(itemEntry->loopNo, itemEntry->celNo)); if ((itemEntry->scaleX == 128) && (itemEntry->scaleY == 128)) diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp index e5b734782c..d2416ab4e0 100644 --- a/engines/sci/graphics/menu.cpp +++ b/engines/sci/graphics/menu.cpp @@ -46,6 +46,7 @@ GfxMenu::GfxMenu(EventManager *event, SegManager *segMan, GfxPorts *ports, GfxPa _menuSaveHandle = NULL_REG; _barSaveHandle = NULL_REG; _oldPort = NULL; + _mouseOldState = false; reset(); } diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp index d20aa80c77..940a1ac3cf 100644 --- a/engines/sci/graphics/paint16.cpp +++ b/engines/sci/graphics/paint16.cpp @@ -41,8 +41,14 @@ namespace Sci { -GfxPaint16::GfxPaint16(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxPorts *ports, GfxCoordAdjuster *coordAdjuster, GfxScreen *screen, GfxPalette *palette, GfxTransitions *transitions, AudioPlayer *audio) - : _resMan(resMan), _segMan(segMan), _kernel(kernel), _cache(cache), _ports(ports), _coordAdjuster(coordAdjuster), _screen(screen), _palette(palette), _transitions(transitions), _audio(audio) { +GfxPaint16::GfxPaint16(ResourceManager *resMan, SegManager *segMan, GfxCache *cache, GfxPorts *ports, GfxCoordAdjuster *coordAdjuster, GfxScreen *screen, GfxPalette *palette, GfxTransitions *transitions, AudioPlayer *audio) + : _resMan(resMan), _segMan(segMan), _cache(cache), _ports(ports), + _coordAdjuster(coordAdjuster), _screen(screen), _palette(palette), + _transitions(transitions), _audio(audio), _EGAdrawingVisualize(false) { + + // _animate and _text16 will be initialized later on + _animate = NULL; + _text16 = NULL; } GfxPaint16::~GfxPaint16() { @@ -51,8 +57,6 @@ GfxPaint16::~GfxPaint16() { void GfxPaint16::init(GfxAnimate *animate, GfxText16 *text16) { _animate = animate; _text16 = text16; - - _EGAdrawingVisualize = false; } void GfxPaint16::debugSetEGAdrawingVisualize(bool state) { diff --git a/engines/sci/graphics/paint16.h b/engines/sci/graphics/paint16.h index 46df203200..e06021c3e7 100644 --- a/engines/sci/graphics/paint16.h +++ b/engines/sci/graphics/paint16.h @@ -38,7 +38,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, AudioPlayer *audio); + GfxPaint16(ResourceManager *resMan, SegManager *segMan, GfxCache *cache, GfxPorts *ports, GfxCoordAdjuster *coordAdjuster, GfxScreen *screen, GfxPalette *palette, GfxTransitions *transitions, AudioPlayer *audio); ~GfxPaint16(); void init(GfxAnimate *animate, GfxText16 *text16); @@ -89,7 +89,6 @@ public: private: ResourceManager *_resMan; SegManager *_segMan; - Kernel *_kernel; AudioPlayer *_audio; GfxAnimate *_animate; GfxCache *_cache; diff --git a/engines/sci/graphics/paint32.cpp b/engines/sci/graphics/paint32.cpp index a9590c829a..a03e77dfa6 100644 --- a/engines/sci/graphics/paint32.cpp +++ b/engines/sci/graphics/paint32.cpp @@ -34,8 +34,8 @@ namespace Sci { -GfxPaint32::GfxPaint32(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, GfxCoordAdjuster *coordAdjuster, GfxCache *cache, GfxScreen *screen, GfxPalette *palette) - : _resMan(resMan), _segMan(segMan), _kernel(kernel), _coordAdjuster(coordAdjuster), _cache(cache), _screen(screen), _palette(palette) { +GfxPaint32::GfxPaint32(ResourceManager *resMan, GfxCoordAdjuster *coordAdjuster, GfxScreen *screen, GfxPalette *palette) + : _resMan(resMan), _coordAdjuster(coordAdjuster), _screen(screen), _palette(palette) { } GfxPaint32::~GfxPaint32() { diff --git a/engines/sci/graphics/paint32.h b/engines/sci/graphics/paint32.h index 66b31de282..81e355f77f 100644 --- a/engines/sci/graphics/paint32.h +++ b/engines/sci/graphics/paint32.h @@ -34,7 +34,7 @@ class GfxPorts; */ class GfxPaint32 : public GfxPaint { public: - GfxPaint32(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, GfxCoordAdjuster *coordAdjuster, GfxCache *cache, GfxScreen *screen, GfxPalette *palette); + GfxPaint32(ResourceManager *resMan, GfxCoordAdjuster *coordAdjuster, GfxScreen *screen, GfxPalette *palette); ~GfxPaint32(); void fillRect(Common::Rect rect, byte color); @@ -44,10 +44,7 @@ public: private: ResourceManager *_resMan; - SegManager *_segMan; - Kernel *_kernel; GfxCoordAdjuster *_coordAdjuster; - GfxCache *_cache; GfxScreen *_screen; GfxPalette *_palette; }; diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp index 9b6eff6edc..d8d788b00a 100644 --- a/engines/sci/graphics/palette.cpp +++ b/engines/sci/graphics/palette.cpp @@ -851,7 +851,7 @@ int16 GfxPalette::kernelPalVaryReverse(int16 ticks, uint16 stepStop, int16 direc if (!_palVaryTicks) { _palVaryDirection = _palVaryStepStop - _palVaryStep; - // ffs. see palVaryInit right above, we fix the code here as well + // see palVaryInit above, we fix the code here as well // just in case palVaryProcess(1, true); } else { diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp index bb326b1d2f..af372640da 100644 --- a/engines/sci/graphics/picture.cpp +++ b/engines/sci/graphics/picture.cpp @@ -605,7 +605,7 @@ void GfxPicture::drawVectorData(byte *data, int dataSize) { case PIC_OP_MEDIUM_LINES: // medium line vectorGetAbsCoords(data, curPos, x, y); if (icemanDrawFix) { - // WORKAROUND: remove certain lines in iceman ffs. see above + // WORKAROUND: remove certain lines in iceman - see above if ((pic_color == 1) && (pic_priority == 14)) { if ((y < 100) || (!(y & 1))) { pic_color = 255; diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp index 246b6bfff9..74503c0c77 100644 --- a/engines/sci/graphics/screen.cpp +++ b/engines/sci/graphics/screen.cpp @@ -115,6 +115,8 @@ GfxScreen::GfxScreen(ResourceManager *resMan) : _resMan(resMan) { _controlScreen = (byte *)calloc(_pixels, 1); _displayScreen = (byte *)calloc(_displayPixels, 1); + memset(&_ditheredPicColors, 0, sizeof(_ditheredPicColors)); + // Sets display screen to be actually displayed _activeScreen = _displayScreen; diff --git a/engines/sci/graphics/text16.cpp b/engines/sci/graphics/text16.cpp index 7eaa0168b8..56e9ea8b69 100644 --- a/engines/sci/graphics/text16.cpp +++ b/engines/sci/graphics/text16.cpp @@ -36,8 +36,8 @@ namespace Sci { -GfxText16::GfxText16(ResourceManager *resMan, GfxCache *cache, GfxPorts *ports, GfxPaint16 *paint16, GfxScreen *screen) - : _resMan(resMan), _cache(cache), _ports(ports), _paint16(paint16), _screen(screen) { +GfxText16::GfxText16(GfxCache *cache, GfxPorts *ports, GfxPaint16 *paint16, GfxScreen *screen) + : _cache(cache), _ports(ports), _paint16(paint16), _screen(screen) { init(); } diff --git a/engines/sci/graphics/text16.h b/engines/sci/graphics/text16.h index b33c2c4df0..321c7fc25e 100644 --- a/engines/sci/graphics/text16.h +++ b/engines/sci/graphics/text16.h @@ -40,7 +40,7 @@ class GfxFont; */ class GfxText16 { public: - GfxText16(ResourceManager *_resMan, GfxCache *fonts, GfxPorts *ports, GfxPaint16 *paint16, GfxScreen *screen); + GfxText16(GfxCache *fonts, GfxPorts *ports, GfxPaint16 *paint16, GfxScreen *screen); ~GfxText16(); GuiResourceId GetFontId(); @@ -75,7 +75,6 @@ private: void init(); bool SwitchToFont900OnSjis(const char *text); - ResourceManager *_resMan; GfxCache *_cache; GfxPorts *_ports; GfxPaint16 *_paint16; |