2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2003-04-27 15:02:52 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2003-04-27 15:02:52 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2007-02-20 17:52:55 +00:00
|
|
|
#ifndef SKY_AUTOROUTE_H
|
|
|
|
#define SKY_AUTOROUTE_H
|
2003-04-27 15:02:52 +00:00
|
|
|
|
2007-09-19 08:40:12 +00:00
|
|
|
|
2003-10-05 20:21:20 +00:00
|
|
|
#include "common/scummsys.h"
|
2003-04-27 15:02:52 +00:00
|
|
|
|
2004-01-03 01:58:58 +00:00
|
|
|
namespace Sky {
|
|
|
|
|
2003-10-05 20:21:20 +00:00
|
|
|
struct Compact;
|
2004-01-03 15:57:57 +00:00
|
|
|
class Grid;
|
2004-12-15 06:48:08 +00:00
|
|
|
class SkyCompact;
|
2003-04-27 15:08:35 +00:00
|
|
|
|
2004-01-03 15:57:57 +00:00
|
|
|
class AutoRoute {
|
2003-04-27 15:02:52 +00:00
|
|
|
public:
|
2004-12-15 06:48:08 +00:00
|
|
|
AutoRoute(Grid *pGrid, SkyCompact *compact);
|
2009-11-02 21:54:57 +00:00
|
|
|
~AutoRoute();
|
2003-07-31 02:09:24 +00:00
|
|
|
uint16 autoRoute(Compact *cpt);
|
2003-04-27 15:02:52 +00:00
|
|
|
private:
|
|
|
|
uint16 checkBlock(uint16 *blockPos);
|
2003-07-31 02:09:24 +00:00
|
|
|
void clipCoordX(uint16 x, uint8 &blkX, int16 &initX);
|
|
|
|
void clipCoordY(uint16 y, uint8 &blkY, int16 &initY);
|
2003-11-08 20:27:27 +00:00
|
|
|
void initWalkGrid(uint8 screen, uint8 width);
|
2003-07-31 02:09:24 +00:00
|
|
|
bool calcWalkGrid(uint8 startX, uint8 startY, uint8 destX, uint8 destY);
|
2003-11-08 20:27:27 +00:00
|
|
|
uint16 *makeRouteData(uint8 startX, uint8 startY, uint8 destX, uint8 destY);
|
2003-07-31 02:09:24 +00:00
|
|
|
uint16 *checkInitMove(uint16 *data, int16 initStaX);
|
2004-01-03 15:57:57 +00:00
|
|
|
Grid *_grid;
|
2004-12-15 06:48:08 +00:00
|
|
|
SkyCompact *_skyCompact;
|
2003-04-27 15:02:52 +00:00
|
|
|
uint16 *_routeGrid;
|
2003-07-31 02:09:24 +00:00
|
|
|
uint16 *_routeBuf;
|
|
|
|
static const int16 _routeDirections[4];
|
2003-11-08 20:27:27 +00:00
|
|
|
static const uint16 _logicCommands[4];
|
2003-04-27 15:02:52 +00:00
|
|
|
};
|
|
|
|
|
2004-01-03 01:58:58 +00:00
|
|
|
} // End of namespace Sky
|
|
|
|
|
2003-04-29 14:34:23 +00:00
|
|
|
#endif // AUTOROUTE_H
|