ScummVM API documentation
movclass.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 CHEWY_MOVCLASS_H
23 #define CHEWY_MOVCLASS_H
24 
25 #include "common/scummsys.h"
26 
27 namespace Chewy {
28 
29 #define MAX_KNOTEN_PKT 15
30 #define MOV_LINE_IDX 28
31 #define MOV_LINE_KNOTEN 29
32 #define MOV_LINE_CROSS 30
33 #define MLE_UP 0
34 #define MLE_RIGHT 1
35 #define MLE_DOWN 2
36 #define MLE_LEFT 3
37 
38 struct MovInfo {
39  int16 XyzStart[3] = { 0 };
40  int16 XyzEnd[3] = { 0 };
41 
42  int16 HotX = 0;
43  int16 HotY = 0;
44  int16 HotMovX = 0;
45  int16 HotMovY = 0;
46  int16 Vorschub = 0;
47  int16 Delay = 0;
48  uint8 Id = 0;
49 
50  uint8 Mode = 0;
51 };
52 
53 struct ObjMov {
54  int16 Xypos[3] = { 0 };
55  int16 Xyvo[3] = { 0 };
56  int16 Xyna[3][2] = {{ 0 }};
57  int16 Count = 0;
58 
59  int16 Delay = 0;
60 
61  int16 _delayCount = 0;
62 
63  int16 Phase = 0;
64  int16 PhNr = 0;
65  int16 PhAnz = 0;
66  int16 Xzoom = 0;
67  int16 Yzoom = 0;
68  int16 StNr = 0;
69 };
70 
71 struct GotoPkt {
72  int16 Sx = 0;
73  int16 Sy = 0;
74  int16 Dx = 0;
75  int16 Dy = 0;
76  int16 AkMovEbene = 0;
77  int16 Vorschub = 0;
78 };
79 
80 struct GotoMovLine {
81  int16 GotoFeld = 0;
82  int16 MLineFeld = 0;
83 };
84 
85 struct MovLineExit {
86  int16 Steps = 0;
87  int16 Direction = 0;
88  int16 FNr = 0;
89  int16 KnPkt[MAX_KNOTEN_PKT] = { 0 };
90 };
91 
92 struct AutoGoVar {
93  bool AutoGo = false;
94  bool Continue = false;
95 
96  int16 PktAnz = 0;
97 
98  int16 Start = 0;
99  int16 X_End = 0;
100  int16 Y_End = 0;
101  int16 LastFeld = 0;
102 
103  int16 AkFeld = 0;
104  int16 AkKnoten = 0;
105 };
106 
107 class MovClass {
108 public:
109  MovClass();
110  ~MovClass();
111 
112  void goto_xy(GotoPkt *gpkt);
113  int16 calc_auto_go(int16 x, int16 y, int16 *auto_x, int16 *auto_y);
114  void stop_auto_go();
115  void continue_auto_go();
116  bool auto_go_status();
117  void get_mov_vector(int16 *startXyz, int16 *endXyz, int16 vorschub, ObjMov *om);
118 
119 private:
120  void calc_xy();
121  int16 get_feld_nr(int16 x, int16 y);
122  void get_feld_xy(int16 fnr, int16 *x, int16 *y);
123  int16 calc_go(int16 src_feld, int16 *dst_feld);
124  void get_mov_line();
125  void calc_mov_line_xit(int16 start_feld);
126 
127  int16 _feld1knoten = 0;
128  int16 _plotDelay = 0;
129  AutoGoVar _agv;
130  MovLineExit _mle;
131  GotoMovLine _gml;
132  GotoPkt *_gpkt = nullptr;
133  int16 _vecTbl[4];
134 };
135 
136 } // namespace Chewy
137 
138 #endif
Definition: movclass.h:92
Definition: movclass.h:107
Definition: movclass.h:71
Definition: movclass.h:53
Definition: movclass.h:85
Definition: movclass.h:80
Definition: movclass.h:38
Definition: ani_dat.h:25