ScummVM API documentation
transition.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 SNATCHER_TRANSITION_H
23#define SNATCHER_TRANSITION_H
24
25#include "common/platform.h"
26#include "common/scummsys.h"
27#include "snatcher/saveflags.h"
28
29namespace Common {
30 class SeekableWriteStream;
31 class SeekableReadStream;
32}
33
34namespace Snatcher {
35
37public:
38 enum {
39 kHorzA = 0,
40 kVertA = 1,
41 kHorzB = 2,
42 kVertB = 3
43 };
44
45 struct ScrollState {
46 int16 realOffsets[4];
47 int16 unmodifiedOffsets[4];
48 const int16 *hScrollTable;
49 uint16 hScrollTableNumEntries;
50 bool disableVScroll;
51 bool lineScrollMode;
52 bool verbsTabVisible;
53 bool busy;
54 struct HINT {
55 bool needUpdate;
56 bool enable;
57 uint8 counter;
58 } hInt;
59 };
60
62 memset(&_result, 0, sizeof(_result));
63 }
64
65 virtual ~TransitionManager() {}
66 virtual void doCommand(int cmd) = 0;
67 virtual void scroll_setSingleStep(int mode, int16 step) = 0;
68 virtual void scroll_setDirectionAndSpeed(int mode, int16 incr) = 0;
69 virtual void clear() = 0;
70 virtual bool nextFrame() = 0;
71 virtual void hINTCallback(void*) {}
72 const ScrollState &scroll_getState() const { return _result; }
73
74 virtual void saveState(Common::SeekableWriteStream *out, SaveFlags flags) = 0;
75 virtual void loadState(Common::SeekableReadStream *in, SaveFlags flags) = 0;
76 virtual void postLoadProcess() = 0;
77
78protected:
79 ScrollState _result;
80
81private:
82 static TransitionManager *createSegaTransitionManager(GraphicsEngine::GfxState &state);
83
84public:
85 static TransitionManager *create(Common::Platform platform, GraphicsEngine::GfxState &state) {
86 switch (platform) {
87 case Common::kPlatformSegaCD:
88 return createSegaTransitionManager(state);
89 default:
90 break;
91 };
92 return 0;
93 }
94};
95
96} // End of namespace Snatcher
97
98#endif // SNATCHER_TRANSITION_H
Definition: stream.h:745
Definition: stream.h:351
Definition: transition.h:36
Platform
Definition: platform.h:93
Definition: algorithm.h:29
Definition: transition.h:45