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 
30 namespace M4 {
31 
32 struct Rails_Globals {
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 
42 bool InitRails();
43 void rail_system_shutdown();
44 void ClearRails();
45 noWalkRect *intr_add_no_walk_rect(int32 x1, int32 y1, int32 x2, int32 y2, int32 altX, int32 altY, Buffer *walkCodes);
46 noWalkRect *intr_add_no_walk_rect(int32 x1, int32 y1, int32 x2, int32 y2, int32 altX, int32 altY);
47 void 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);
49 void intr_remove_no_walk_rect(noWalkRect *myRect, Buffer *walkCodes);
50 void intr_remove_no_walk_rect(noWalkRect *myRect);
51 void CreateEdge(int32 node1, int32 node2, Buffer *walkCodes);
52 void RestoreNodeEdges(int32 nodeID, Buffer *walkCodes);
53 void RestoreEdgeList(Buffer *walkCodes);
54 int32 AddRailNode(int32 x, int32 y, Buffer *walkCodes, bool restoreEdges);
55 void MoveRailNode(int32 nodeID, int32 x, int32 y, Buffer *walkCodes, bool restoreEdges);
56 bool RemoveRailNode(int32 nodeID, Buffer *walkCodes, bool restoreEdges);
57 bool RailNodeExists(int32 nodeID, int32 *nodeX, int32 *nodeY);
58 int16 GetEdgeLength(int32 node1, int32 node2);
59 bool GetShortestPath(int32 origID, int32 destID, railNode **shortPath);
60 railNode *CreateCustomPath(int32 coord, ...);
61 void DisposePath(railNode *pathStart);
62 bool 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);
64 bool 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);
66 bool 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: m4_types.h:67
Definition: database.h:28
Definition: ws_machine.h:69
Definition: adv_rails.h:32
Definition: adv.h:68