ScummVM API documentation
transitions.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef SCI_GRAPHICS_TRANSITIONS_H
23 #define SCI_GRAPHICS_TRANSITIONS_H
24 
25 #include "sci/graphics/helpers.h"
26 
27 namespace Sci {
28 
30  int16 orgId;
31  int16 newId;
32  bool blackoutFlag;
33 };
34 
35 enum {
36  SCI_TRANSITIONS_VERTICALROLL_FROMCENTER = 0,
37  SCI_TRANSITIONS_HORIZONTALROLL_FROMCENTER = 1,
38  SCI_TRANSITIONS_STRAIGHT_FROM_RIGHT = 2,
39  SCI_TRANSITIONS_STRAIGHT_FROM_LEFT = 3,
40  SCI_TRANSITIONS_STRAIGHT_FROM_BOTTOM = 4,
41  SCI_TRANSITIONS_STRAIGHT_FROM_TOP = 5,
42  SCI_TRANSITIONS_DIAGONALROLL_TOCENTER = 6,
43  SCI_TRANSITIONS_DIAGONALROLL_FROMCENTER = 7,
44  SCI_TRANSITIONS_BLOCKS = 8,
45  SCI_TRANSITIONS_PIXELATION = 9,
46  SCI_TRANSITIONS_FADEPALETTE = 10,
47  SCI_TRANSITIONS_SCROLL_RIGHT = 11,
48  SCI_TRANSITIONS_SCROLL_LEFT = 12,
49  SCI_TRANSITIONS_SCROLL_UP = 13,
50  SCI_TRANSITIONS_SCROLL_DOWN = 14,
51  SCI_TRANSITIONS_NONE_LONGBOW = 15,
52  SCI_TRANSITIONS_NONE = 100,
53  // here are transitions that are used by the old tableset, but are not included anymore in the new tableset
54  SCI_TRANSITIONS_VERTICALROLL_TOCENTER = 300,
55  SCI_TRANSITIONS_HORIZONTALROLL_TOCENTER = 301
56 };
57 
58 class Screen;
63 public:
64  GfxTransitions(GfxScreen *screen, GfxPalette *palette);
65  ~GfxTransitions();
66 
67  void setup(int16 number, bool blackoutFlag);
68  void doit(Common::Rect picRect);
69 
70 private:
71  void init();
72  const GfxTransitionTranslateEntry *translateNumber(int16 number, const GfxTransitionTranslateEntry *tablePtr);
73  void doTransition(int16 number, bool blackout);
74  void setNewPalette(bool blackoutFlag);
75  void setNewScreen(bool blackoutFlag);
76  void copyRectToScreen(const Common::Rect rect, bool blackoutFlag);
77  void fadeOut();
78  void fadeIn();
79  void pixelation(bool blackoutFlag);
80  void blocks(bool blackoutFlag);
81  void straight(int16 number, bool blackoutFlag);
82  void scrollCopyOldToScreen(Common::Rect screenRect, int16 x, int16 y);
83  void scroll(int16 number);
84  void verticalRollFromCenter(bool blackoutFlag);
85  void verticalRollToCenter(bool blackoutFlag);
86  void horizontalRollFromCenter(bool blackoutFlag);
87  void horizontalRollToCenter(bool blackoutFlag);
88  void diagonalRollFromCenter(bool blackoutFlag);
89  void diagonalRollToCenter(bool blackoutFlag);
90  bool doCreateFrame(uint32 shouldBeAtMsec);
91  void updateScreen();
92  void updateScreenAndWait(uint32 shouldBeAtMsec);
93 
94  GfxScreen *_screen;
95  GfxPalette *_palette;
96 
97  const GfxTransitionTranslateEntry *_translationTable;
98  int16 _number;
99  bool _blackoutFlag;
100  Common::Rect _picRect;
101  byte *_oldScreen; // buffer for saving current active screen data to, has dimenions of _screen->_displayScreen
102 
103  uint32 _transitionStartTime; // when the current transition started in milliseconds
104 };
105 
106 } // End of namespace Sci
107 
108 #endif // SCI_GRAPHICS_TRANSITIONS_H
Definition: default_display_client.h:78
Definition: rect.h:144
Definition: palette.h:41
Definition: console.h:28
Definition: screen.h:68
Definition: transitions.h:62
Definition: transitions.h:29