ScummVM API documentation
autoroute.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 SKY_AUTOROUTE_H
23 #define SKY_AUTOROUTE_H
24 
25 
26 #include "common/scummsys.h"
27 
28 namespace Sky {
29 
30 struct Compact;
31 class Grid;
32 class SkyCompact;
33 
34 class AutoRoute {
35 public:
36  AutoRoute(Grid *pGrid, SkyCompact *compact);
37  ~AutoRoute();
38  uint16 autoRoute(Compact *cpt);
39 private:
40  uint16 checkBlock(uint16 *blockPos);
41  void clipCoordX(uint16 x, uint8 &blkX, int16 &initX);
42  void clipCoordY(uint16 y, uint8 &blkY, int16 &initY);
43  void initWalkGrid(uint8 screen, uint8 width);
44  bool calcWalkGrid(uint8 startX, uint8 startY, uint8 destX, uint8 destY);
45  uint16 *makeRouteData(uint8 startX, uint8 startY, uint8 destX, uint8 destY);
46  uint16 *checkInitMove(uint16 *data, int16 initStaX);
47  Grid *_grid;
48  SkyCompact *_skyCompact;
49  uint16 *_routeGrid;
50  uint16 *_routeBuf;
51  static const int16 _routeDirections[4];
52  static const uint16 _logicCommands[4];
53 };
54 
55 } // End of namespace Sky
56 
57 #endif // AUTOROUTE_H
Definition: autoroute.h:34
Definition: struc.h:78
Definition: grid.h:35
Definition: compact.h:58
Definition: autoroute.h:28