ScummVM API documentation
adv_rails.h
1
2/* ScummVM - Graphic Adventure Engine
3 *
4 * ScummVM is the legal property of its developers, whose names
5 * are too numerous to list here. Please refer to the COPYRIGHT
6 * file distributed with this source distribution.
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23#ifndef M4_ADV_R_ADV_RAILS_H
24#define M4_ADV_R_ADV_RAILS_H
25
26#include "m4/m4_types.h"
27#include "m4/adv_r/adv.h"
28#include "m4/wscript/ws_machine.h"
29
30namespace M4 {
31
33 railNode **myNodes = nullptr;
34 int16 *myEdges = nullptr;
35
36 railNode **stackBottom = nullptr, **stackTop = nullptr;
37 noWalkRect *noWalkRectList = nullptr;
38
39 int32 memtypePATHN = 0;
40};
41
42void InitRails();
43void rail_system_shutdown();
44void ClearRails();
45noWalkRect *intr_add_no_walk_rect(int32 x1, int32 y1, int32 x2, int32 y2, int32 altX, int32 altY, Buffer *walkCodes);
46noWalkRect *intr_add_no_walk_rect(int32 x1, int32 y1, int32 x2, int32 y2, int32 altX, int32 altY);
47void intr_move_no_walk_rect(noWalkRect *myRect, int32 new_x1, int32 new_y1,
48 int32 new_x2, int32 new_y2, int32 new_altX, int32 new_altY, Buffer *walkCodes);
49void intr_remove_no_walk_rect(noWalkRect *myRect, Buffer *walkCodes);
50void intr_remove_no_walk_rect(noWalkRect *myRect);
51void CreateEdge(int32 node1, int32 node2, Buffer *walkCodes);
52void RestoreNodeEdges(int32 nodeID, Buffer *walkCodes);
53void RestoreEdgeList(Buffer *walkCodes);
54int32 AddRailNode(int32 x, int32 y, Buffer *walkCodes, bool restoreEdges);
55void MoveRailNode(int32 nodeID, int32 x, int32 y, Buffer *walkCodes, bool restoreEdges);
56bool RemoveRailNode(int32 nodeID, Buffer *walkCodes, bool restoreEdges);
57bool RailNodeExists(int32 nodeID, int32 *nodeX, int32 *nodeY);
58int16 GetEdgeLength(int32 node1, int32 node2);
59bool GetShortestPath(int32 origID, int32 destID, railNode **shortPath);
60railNode *CreateCustomPath(int coord, ...);
61void DisposePath(railNode *pathStart);
62bool intr_LineCrossesRect(int32 line_x1, int32 line_y1, int32 line_x2, int32 line_y2,
63 int32 rect_x1, int32 rect_y1, int32 rect_x2, int32 rect_y2);
64bool intr_LinesCross(int32 line1_x1, int32 line1_y1, int32 line1_x2, int32 line1_y2,
65 int32 line2_x1, int32 line2_y1, int32 line2_x2, int32 line2_y2);
66bool intr_PathCrossesLine(int32 startX, int32 startY, railNode *pathStart,
67 int32 line_x1, int32 line_y1, int32 line_x2, int32 line_y2);
68
69} // End of namespace M4
70
71#endif
Definition: database.h:28
Definition: m4_types.h:54
Definition: adv_rails.h:32
Definition: adv.h:68
Definition: ws_machine.h:95