ScummVM API documentation
scroll.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 TINSEL_SCROLL_H // prevent multiple includes
23 #define TINSEL_SCROLL_H
24 
25 namespace Tinsel {
26 
27 #define MAX_HNOSCROLL 10
28 #define MAX_VNOSCROLL 10
29 
30 // These structures defined here so boundaries can be saved
31 struct NOSCROLLB {
32  int ln;
33  int c1;
34  int c2;
35 };
36 
37 struct SCROLLDATA {
38  NOSCROLLB NoVScroll[MAX_VNOSCROLL]; // Vertical no-scroll boundaries
39  NOSCROLLB NoHScroll[MAX_HNOSCROLL]; // Horizontal no-scroll boundaries
40  unsigned NumNoV, NumNoH; // Counts of no-scroll boundaries
41  // DW2 fields
42  int xTrigger;
43  int xDistance;
44  int xSpeed;
45  int yTriggerTop;
46  int yTriggerBottom;
47  int yDistance;
48  int ySpeed;
49 };
50 
51 class Scroll {
52 public:
53  Scroll();
54 
55  void DontScrollCursor();
56  void DoScrollCursor();
57 
58  void SetNoScroll(int x1, int y1, int x2, int y2);
59  void DropScroll();
60 
61  void ScrollFocus(int actor);
62  int GetScrollFocus();
63  void ScrollTo(int x, int y, int xIter, int yIter);
64 
65  void KillScroll();
66 
67  void GetNoScrollData(SCROLLDATA *ssd);
68  void RestoreNoScrollData(SCROLLDATA *ssd);
69 
70  void SetScrollParameters(int xTrigger, int xDistance, int xSpeed, int yTriggerTop,
71  int yTriggerBottom, int yDistance, int ySpeed);
72 
73  bool IsScrolling();
74 
75  void ScrollImage();
76  void MonitorScroll();
77 
78  void InitScroll(int width, int height);
79 
80 private:
81  void NeedScroll(int direction);
82  void RestoreScrollDefaults();
83 
84  int _leftScroll, _downScroll; // Number of iterations outstanding
85 
86  int _scrollActor;
87  MOVER *_pScrollMover;
88  int _oldx, _oldy;
89 
91  SCROLLDATA _scrollData;
92 
93  int _imageW, _imageH;
94 
95  bool _scrollCursor; // If a TAG or EXIT polygon is clicked on,
96  // the cursor is kept over that polygon
97  // whilst scrolling
98 
99  int _scrollPixelsX, _scrollPixelsY;
100 };
101 
102 void ScrollProcess(CORO_PARAM, const void *);
103 
104 } // End of namespace Tinsel
105 
106 #endif /* TINSEL_SCROLL_H */
Definition: scroll.h:37
Definition: movers.h:50
Definition: scroll.h:51
#define CORO_PARAM
Definition: coroutines.h:107
Definition: actors.h:36
Definition: scroll.h:31