2016-07-25 11:06:27 -05:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SCI_GRAPHICS_TRANSITIONS32_H
|
|
|
|
#define SCI_GRAPHICS_TRANSITIONS32_H
|
|
|
|
|
|
|
|
#include "common/list.h"
|
|
|
|
#include "common/scummsys.h"
|
|
|
|
#include "sci/engine/vm_types.h"
|
|
|
|
|
|
|
|
namespace Sci {
|
2017-10-05 21:41:29 -05:00
|
|
|
enum ShowStyleType {
|
2016-07-25 11:06:27 -05:00
|
|
|
kShowStyleNone = 0,
|
|
|
|
kShowStyleHShutterOut = 1,
|
|
|
|
kShowStyleHShutterIn = 2,
|
|
|
|
kShowStyleVShutterOut = 3,
|
|
|
|
kShowStyleVShutterIn = 4,
|
|
|
|
kShowStyleWipeLeft = 5,
|
|
|
|
kShowStyleWipeRight = 6,
|
|
|
|
kShowStyleWipeUp = 7,
|
|
|
|
kShowStyleWipeDown = 8,
|
|
|
|
kShowStyleIrisOut = 9,
|
|
|
|
kShowStyleIrisIn = 10,
|
|
|
|
kShowStyleDissolveNoMorph = 11,
|
|
|
|
kShowStyleDissolve = 12,
|
|
|
|
kShowStyleFadeOut = 13,
|
|
|
|
kShowStyleFadeIn = 14,
|
|
|
|
kShowStyleMorph = 15
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* A show style represents a transition applied to a Plane. One show style per
|
|
|
|
* plane can be active at a time.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
struct PlaneShowStyle {
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* The ID of the plane this transition applies to.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
reg_t plane;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The type of the transition.
|
|
|
|
*/
|
|
|
|
ShowStyleType type;
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* When true, the show style is an entry transition to a new room. When
|
|
|
|
* false, it is an exit transition away from an old room.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
bool fadeUp;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The number of steps for the show style.
|
|
|
|
*/
|
|
|
|
int16 divisions;
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* The color used by transitions that draw CelObjColor screen items. -1 for
|
|
|
|
* transitions that do not draw screen items.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
int16 color;
|
|
|
|
|
2017-10-05 21:41:29 -05:00
|
|
|
/**
|
|
|
|
* The amount of time, in ticks, between each cycle of the animation.
|
|
|
|
*/
|
2016-07-25 11:06:27 -05:00
|
|
|
int delay;
|
|
|
|
|
2017-10-05 21:41:29 -05:00
|
|
|
/**
|
|
|
|
* If true, GfxTransitions32 will yield back to the main game loop after
|
|
|
|
* calculating the next frame. Otherwise, GfxTransitions32 takes exclusive
|
|
|
|
* control over the game loop until the transition has completed.
|
|
|
|
*/
|
2016-07-25 11:06:27 -05:00
|
|
|
bool animate;
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* The time at which the next step of the animation should execute.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
uint32 nextTick;
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* During playback of the show style, the current step (out of `divisions`).
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
int currentStep;
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Whether or not this style has finished running and is ready for disposal.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
bool processed;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Engine specific properties for SCI2.1early
|
|
|
|
//
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* A list of screen items, each representing one block of a wipe transition.
|
|
|
|
* These screen items are owned by GfxFrameout.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
Common::Array<ScreenItem *> screenItems;
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* For wipe transitions, the number of edges with a moving wipe (1, 2, or
|
|
|
|
* 4).
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
uint8 numEdges;
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* The dimensions of the plane, in game script coordinates.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
int16 width, height;
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* For pixel dissolve transitions, the screen item used to render the
|
|
|
|
* transition. This screen item is owned by GfxFrameout.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
ScreenItem *bitmapScreenItem;
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* For pixel dissolve transitions, the bitmap used to render the transition.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
reg_t bitmap;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The bit mask used by pixel dissolve transitions.
|
|
|
|
*/
|
|
|
|
uint32 dissolveMask;
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* The first pixel that was dissolved in a pixel dissolve transition.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
uint32 firstPixel;
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* The last pixel that was dissolved. Once all pixels have been dissolved,
|
|
|
|
* `pixel` will once again equal `firstPixel`.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
uint32 pixel;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Engine specific properties for SCI2.1mid through SCI3
|
|
|
|
//
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* An array of palette indexes, in the order [ fromColor, toColor, ... ].
|
2016-07-25 11:06:27 -05:00
|
|
|
* Only colors within this range are transitioned.
|
|
|
|
*/
|
2017-10-05 21:41:29 -05:00
|
|
|
Common::Array<uint16> fadeColorRanges;
|
2016-07-25 11:06:27 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* PlaneScroll describes a transition between two different pictures within a
|
|
|
|
* single plane.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
struct PlaneScroll {
|
|
|
|
/**
|
|
|
|
* The ID of the plane to be scrolled.
|
|
|
|
*/
|
|
|
|
reg_t plane;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The current position of the scroll.
|
|
|
|
*/
|
|
|
|
int16 x, y;
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* The distance that should be scrolled. Only one of `deltaX` or `deltaY`
|
|
|
|
* may be set.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
int16 deltaX, deltaY;
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* The pic that should be created and scrolled into view inside the plane.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
GuiResourceId newPictureId;
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* The picture that should be scrolled out of view and deleted from the
|
|
|
|
* plane.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
GuiResourceId oldPictureId;
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* If true, GfxTransitions32 will yield back to the main game loop after
|
|
|
|
* calculating the next frame. Otherwise, GfxTransitions32 takes exclusive
|
|
|
|
* control over the game loop until the transition has completed.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
bool animate;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The tick after which the animation will start.
|
|
|
|
*/
|
|
|
|
uint32 startTick;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef Common::List<PlaneShowStyle> ShowStyleList;
|
|
|
|
typedef Common::List<PlaneScroll> ScrollList;
|
|
|
|
|
|
|
|
class GfxTransitions32 {
|
|
|
|
public:
|
|
|
|
GfxTransitions32(SegManager *_segMan);
|
|
|
|
~GfxTransitions32();
|
2017-10-05 21:41:29 -05:00
|
|
|
|
2016-07-25 11:06:27 -05:00
|
|
|
private:
|
|
|
|
SegManager *_segMan;
|
|
|
|
|
|
|
|
/**
|
2016-12-12 15:13:36 -06:00
|
|
|
* Throttles transition playback to prevent transitions from being
|
|
|
|
* instantaneous on modern computers.
|
|
|
|
*
|
|
|
|
* kSetShowStyle transitions are throttled at 10ms intervals, under the
|
|
|
|
* assumption that the default fade transition of 101 divisions was designed
|
|
|
|
* to finish in one second. Empirically, this seems to roughly match the
|
|
|
|
* speed of DOSBox, and feels reasonable.
|
|
|
|
*
|
|
|
|
* Transitions using kSetScroll (used in the LSL6hires intro) need to be
|
|
|
|
* slower, so they get throttled at 33ms instead of 10ms. This value was
|
|
|
|
* chosen by gut feel, as these scrolling transitions are instantaneous in
|
|
|
|
* DOSBox.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
2016-12-12 15:13:36 -06:00
|
|
|
void throttle(const uint32 ms = 10);
|
2016-07-25 11:06:27 -05:00
|
|
|
|
SCI32: Fix slow SCI2.1mid transitions
SSCI transitions code sends a large number of small show rects
to the graphics manager, one at a time, for each division of a
transition. Each time a rect is submitted, a call to showBits
is made. This design was used when transitions for SCI32 were
first implemented in ScummVM, and it worked OK because the
hardware surface was updated by EventManager::getSciEvent,
not showBits, so the large number of calls to showBits from the
transitions code did not adversely affect engine performance.
Later in SCI32 engine development, hardware surface updates
were changed to occur in showBits so that the hardware surface
would be updated at frame-out time, instead of at input-in time.
This change meant that now the large number of calls to showBits
from transitions became very expensive, and the engine would
stall constantly refreshing the entire hardware surface.
To fix this problem, the transitions code now (1) maximises the
size of rects coming from transitions, when possible, and (2) only
calls showBits when all the rects from one frame of a transition
have been calculated and added to the show rects list.
Additionally, there were some arithmetic errors in the
implementation of pixel dissolve that have been corrected in this
changeset.
Fixes Trac#9614.
2016-10-22 12:41:39 -05:00
|
|
|
void clearShowRects();
|
|
|
|
void addShowRect(const Common::Rect &rect);
|
|
|
|
void sendShowRects();
|
|
|
|
|
2016-07-25 11:06:27 -05:00
|
|
|
#pragma mark -
|
|
|
|
#pragma mark Show styles
|
|
|
|
public:
|
|
|
|
inline bool hasShowStyles() const { return !_showStyles.empty(); }
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Processes all active show styles in a loop until they are finished.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
void processShowStyles();
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Processes show styles that are applied through
|
|
|
|
* `GfxFrameout::palMorphFrameOut`.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
void processEffects(PlaneShowStyle &showStyle);
|
|
|
|
|
|
|
|
void kernelSetShowStyle(const uint16 argc, const reg_t planeObj, const ShowStyleType type, const int16 seconds, const int16 direction, const int16 priority, const int16 animate, const int16 frameOutNow, reg_t pFadeArray, int16 divisions, const int16 blackScreen);
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Sets the range that will be used by `GfxFrameout::palMorphFrameOut` to
|
|
|
|
* alter palette entries.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
void kernelSetPalStyleRange(const uint8 fromColor, const uint8 toColor);
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* A map of palette entries that can be morphed by the Morph show style.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
int8 _styleRanges[256];
|
|
|
|
|
|
|
|
private:
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Default sequence values for pixel dissolve transition bit masks.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
int *_dissolveSequenceSeeds;
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Default values for `PlaneShowStyle::divisions` for the current SCI
|
|
|
|
* version.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
int16 *_defaultDivisions;
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* The list of PlaneShowStyles that are currently active.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
ShowStyleList _showStyles;
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Finds a show style that applies to the given plane.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
PlaneShowStyle *findShowStyleForPlane(const reg_t planeObj);
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Finds the iterator for a show style that applies to the given plane.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
ShowStyleList::iterator findIteratorForPlane(const reg_t planeObj);
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Deletes the given PlaneShowStyle and returns the next PlaneShowStyle from
|
|
|
|
* the list of styles.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
ShowStyleList::iterator deleteShowStyle(const ShowStyleList::iterator &showStyle);
|
|
|
|
|
2017-01-12 10:55:13 -06:00
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Initializes the given PlaneShowStyle for a horizontal wipe effect for
|
|
|
|
* SCI2 to 2.1early.
|
2017-01-12 10:55:13 -06:00
|
|
|
*/
|
|
|
|
void configure21EarlyHorizontalWipe(PlaneShowStyle &showStyle, const int16 priority);
|
|
|
|
|
2017-07-07 21:02:39 -05:00
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Initializes the given PlaneShowStyle for a horizontal shutter effect for
|
|
|
|
* SCI2 to 2.1early.
|
2017-07-07 21:02:39 -05:00
|
|
|
*/
|
|
|
|
void configure21EarlyHorizontalShutter(PlaneShowStyle &showStyle, const int16 priority);
|
|
|
|
|
2016-07-25 11:06:27 -05:00
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Initializes the given PlaneShowStyle for an iris effect for SCI2 to
|
|
|
|
* 2.1early.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
void configure21EarlyIris(PlaneShowStyle &showStyle, const int16 priority);
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Initializes the given PlaneShowStyle for a pixel dissolve effect for SCI2
|
|
|
|
* to 2.1early.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
void configure21EarlyDissolve(PlaneShowStyle &showStyle, const int16 priority, const Common::Rect &gameRect);
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Processes one tick of the given PlaneShowStyle.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
bool processShowStyle(PlaneShowStyle &showStyle, uint32 now);
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Performs an instant transition between two rooms.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
bool processNone(PlaneShowStyle &showStyle);
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Performs a transition that renders into a room with a horizontal shutter
|
|
|
|
* effect.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
2017-07-07 21:02:39 -05:00
|
|
|
bool processHShutterOut(PlaneShowStyle &showStyle);
|
2016-07-25 11:06:27 -05:00
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Performs a transition that renders to black with a horizontal shutter
|
|
|
|
* effect.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
SCI32: Fix slow SCI2.1mid transitions
SSCI transitions code sends a large number of small show rects
to the graphics manager, one at a time, for each division of a
transition. Each time a rect is submitted, a call to showBits
is made. This design was used when transitions for SCI32 were
first implemented in ScummVM, and it worked OK because the
hardware surface was updated by EventManager::getSciEvent,
not showBits, so the large number of calls to showBits from the
transitions code did not adversely affect engine performance.
Later in SCI32 engine development, hardware surface updates
were changed to occur in showBits so that the hardware surface
would be updated at frame-out time, instead of at input-in time.
This change meant that now the large number of calls to showBits
from transitions became very expensive, and the engine would
stall constantly refreshing the entire hardware surface.
To fix this problem, the transitions code now (1) maximises the
size of rects coming from transitions, when possible, and (2) only
calls showBits when all the rects from one frame of a transition
have been calculated and added to the show rects list.
Additionally, there were some arithmetic errors in the
implementation of pixel dissolve that have been corrected in this
changeset.
Fixes Trac#9614.
2016-10-22 12:41:39 -05:00
|
|
|
void processHShutterIn(const PlaneShowStyle &showStyle);
|
2016-07-25 11:06:27 -05:00
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Performs a transition that renders into a room with a vertical shutter
|
|
|
|
* effect.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
void processVShutterOut(PlaneShowStyle &showStyle);
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Performs a transition that renders to black with a vertical shutter
|
|
|
|
* effect.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
void processVShutterIn(PlaneShowStyle &showStyle);
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Performs a transition that renders into a room with a wipe to the left.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
void processWipeLeft(PlaneShowStyle &showStyle);
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Performs a transition that renders to black with a wipe to the right.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
void processWipeRight(PlaneShowStyle &showStyle);
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Performs a transition that renders into a room with a wipe upwards.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
void processWipeUp(PlaneShowStyle &showStyle);
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Performs a transition that renders to black with a wipe downwards.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
void processWipeDown(PlaneShowStyle &showStyle);
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Performs a transition that renders into a room with an iris effect.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
bool processIrisOut(PlaneShowStyle &showStyle);
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Performs a transition that renders to black with an iris effect.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
bool processIrisIn(PlaneShowStyle &showStyle);
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Performs a transition that renders between rooms using a block dissolve
|
|
|
|
* effect.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
void processDissolveNoMorph(PlaneShowStyle &showStyle);
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Performs a transition that renders between rooms with a pixel dissolve
|
|
|
|
* effect.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
bool processPixelDissolve(PlaneShowStyle &showStyle);
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* SCI2 to 2.1early implementation of pixel dissolve.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
bool processPixelDissolve21Early(PlaneShowStyle &showStyle);
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* SCI2.1mid and later implementation of pixel dissolve.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
SCI32: Fix slow SCI2.1mid transitions
SSCI transitions code sends a large number of small show rects
to the graphics manager, one at a time, for each division of a
transition. Each time a rect is submitted, a call to showBits
is made. This design was used when transitions for SCI32 were
first implemented in ScummVM, and it worked OK because the
hardware surface was updated by EventManager::getSciEvent,
not showBits, so the large number of calls to showBits from the
transitions code did not adversely affect engine performance.
Later in SCI32 engine development, hardware surface updates
were changed to occur in showBits so that the hardware surface
would be updated at frame-out time, instead of at input-in time.
This change meant that now the large number of calls to showBits
from transitions became very expensive, and the engine would
stall constantly refreshing the entire hardware surface.
To fix this problem, the transitions code now (1) maximises the
size of rects coming from transitions, when possible, and (2) only
calls showBits when all the rects from one frame of a transition
have been calculated and added to the show rects list.
Additionally, there were some arithmetic errors in the
implementation of pixel dissolve that have been corrected in this
changeset.
Fixes Trac#9614.
2016-10-22 12:41:39 -05:00
|
|
|
bool processPixelDissolve21Mid(const PlaneShowStyle &showStyle);
|
2016-07-25 11:06:27 -05:00
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Performs a transition that fades to black between rooms.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
bool processFade(const int8 direction, PlaneShowStyle &showStyle);
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Morph transition calls back into the transition system's `processEffects`
|
|
|
|
* method, which then applies transitions other than None, Fade, or Morph.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
bool processMorph(PlaneShowStyle &showStyle);
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Performs a generic transition for any of the wipe/shutter/iris effects.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
bool processWipe(const int8 direction, PlaneShowStyle &showStyle);
|
|
|
|
|
|
|
|
#pragma mark -
|
|
|
|
#pragma mark Scrolls
|
|
|
|
public:
|
|
|
|
inline bool hasScrolls() const { return !_scrolls.empty(); }
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Processes all active plane scrolls in a loop until they are finished.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
void processScrolls();
|
|
|
|
|
|
|
|
void kernelSetScroll(const reg_t plane, const int16 deltaX, const int16 deltaY, const GuiResourceId pictureId, const bool animate, const bool mirrorX);
|
|
|
|
|
|
|
|
private:
|
|
|
|
/**
|
|
|
|
* A list of active plane scrolls.
|
|
|
|
*/
|
|
|
|
ScrollList _scrolls;
|
|
|
|
|
|
|
|
/**
|
2017-10-05 21:41:29 -05:00
|
|
|
* Performs a scroll of the content of a plane.
|
2016-07-25 11:06:27 -05:00
|
|
|
*/
|
|
|
|
bool processScroll(PlaneScroll &scroll);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Sci
|
|
|
|
#endif
|