ScummVM API documentation
walk.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 PETKA_WALK_H
23#define PETKA_WALK_H
24
25#include "common/rect.h"
26
27namespace Petka {
28
29struct Point {
30 int x;
31 int y;
32
33 Point() : x(0), y(0) {}
34 Point(int x_, int y_) : x(x_), y(y_) {}
35 Point(Common::Point p) : x(p.x), y(p.y) {}
36 bool operator==(const Point &p) { return x == p.x && y == p.y; }
37 bool operator!=(const Point &p) { return !(*this == p); }
38};
39
40struct DBLPoint {
41 double x;
42 double y;
43
44 DBLPoint() : x(0.0), y(0.0) {}
45 DBLPoint(double x1, double y1) : x(x1), y(y1) {}
46 DBLPoint(Point p) : x(p.x), y(p.y) {}
47
48 bool operator==(const DBLPoint &p) { return x == p.x && y == p.y; }
49};
50
51class Walk {
52public:
53 Walk(int id);
54 ~Walk();
55
56 void init(Point start, Point end);
57
58 void clearBackground();
59 void setBackground(Common::String name);
60
61 void reset();
62
63 Common::Point currPos();
64
65 int getSpriteId();
66
67 int commonPoint(int, int);
68
69 int readWayFile(const Common::String &name, int **, int **);
70
71 int sub_422EA0(Point p1, Point p2);
72 int sub_423350();
73 Common::Point sub_4234B0();
74 bool areEdgesAdjacent(int, int);
75
76 int sub_423600(Point p);
77 int sub_423970(int, int);
78 int sub_423A30(int, int);
79
80 static double angle(Point p1, Point p2, Point p3);
81 static double angle(DBLPoint p1, DBLPoint p2, DBLPoint p3);
82
83 static int sub_423E00(Point p1, Point p2, Point p3, Point p4, Point &p5);
84
85 bool sub_424160(Point *p1, Point *p2);
86 bool sub_424230(Point *p1);
87 int sub_424320(Point *p1, Point *p2);
88
89 int moveInside(Point *p);
90 DBLPoint sub_424610(Point p1, int x, int y, Point p4);
91
92public:
93 char field_4;
94 char field_5;
95 char field_6;
96 char field_7;
97 int *_leg1[8];
98 int *_leg2[8];
99 int *_off1[8];
100 int *_off2[8];
101 int *_offleg1[8];
102 int *_offleg2[8];
103 int *_bkg3_4;
104 int *_bkg3_5;
105 double field_D0[8];
106 int waysSizes[8];
107 Point *_bkg3_3;
108 int field_134;
109 double field_138;
110 double field_140;
111 int resId;
112 int field_14C;
113 double field_150;
114 double field_158;
115 double currX;
116 double currY;
117 double field_170;
118 double field_178;
119 char field_180;
120 char field_181;
121 char field_182;
122 char field_183;
123 char field_184;
124 char field_185;
125 char field_186;
126 char field_187;
127 char field_188;
128 char field_189;
129 char field_18A;
130 char field_18B;
131 char field_18C;
132 char field_18D;
133 char field_18E;
134 char field_18F;
135 int field_190;
136 int field_194;
137 double field_198;
138 int destX;
139 int destY;
140 int _verticesCount;
141 Point *_vertices;
142 int _edgesCount;
143 int _bkg3Count;
144 int *_bkg3_1;
145 int **_bkg3_2;
146 Point *_edges;
147 char field_1C4;
148 char field_1C5;
149 char field_1C6;
150 char field_1C7;
151};
152
153} // End of namespace Petka
154
155#endif
Definition: str.h:59
Definition: walk.h:51
T y
Definition: rect.h:49
T x
Definition: rect.h:48
Definition: rect.h:144
Definition: walk.h:40
Definition: walk.h:29