ScummVM API documentation
route_manager.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  * Additional copyright for this file:
8  * Copyright (C) 1999-2000 Revolution Software Ltd.
9  * This code is based on source code created by Revolution Software,
10  * used with permission.
11  *
12  * This program is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation, either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program. If not, see <http://www.gnu.org/licenses/>.
24  *
25  */
26 
27 #ifndef ICB_ROUTE_MANAGER_H
28 #define ICB_ROUTE_MANAGER_H
29 
30 #include "engines/icb/common/px_rcutypes.h"
31 #include "engines/icb/common/px_array.h"
32 #include "engines/icb/graphic_prims.h" //_point etc.
33 #include "engines/icb/animation_mega_set.h"
34 
35 namespace ICB {
36 
37 // note MAX_final_route must be a multiple of 4 to get alignment
38 #define MAX_final_route 16
39 
40 enum _route_type { ROUTE_find_shortest_direct_floor_route, ROUTE_return_all_floor_routes, ROUTE_points_only };
41 
42 enum __route_request_error { __ROUTE_REQUEST_PRIM_FAILED, __ROUTE_REQUEST_ROOMS_FAILED, __RR_NO_ROUTE_REQUIRED, __ROUTE_REQUEST_OK };
43 
44 #define POST_INTERACTION \
45  M->actor_xyz.x = M->target_xyz.x; \
46  M->actor_xyz.z = M->target_xyz.z; \
47  L->cur_anim_type = __STAND; \
48  M->reverse_route = FALSE8; \
49  L->anim_pc = 0;
50 
51 typedef struct {
52  _route_type rtype;
53 
54  PXreal initial_x;
55  PXreal initial_z;
56  PXreal dest_x;
57  PXreal dest_z;
58 
59  PXreal character_y;
60 
61  uint32 initial_floor;
62  uint32 dest_floor;
63 
64  __mega_set_names anim_type; // walk or run - this declares the route movement type
65 
66  __route_request_error error;
67 
68  bool8 finish_on_stand; // when the route is complete the manager will attempt to slow out and stand the character
69  bool8 finish_on_null_stand; // when the route is complete the manager will attempt to slow out and stand the character WITHOUT MOVEMENT ON FINAL ANIM
70  uint8 padding1;
71  uint8 padding2;
73 
75 public:
76  void ___init();
77 
78  _route_request request_form;
79 
80  _point prim_route[MAX_final_route];
81 
82  uint32 total_points; // total number of point junctions in the route
83  uint32 current_position; // current point number
84  PXreal dist_left; // unit distance left to travel on current line
85 
86  // barriers for nethack diagnostics
87  _point *diag_bars;
88  uint32 number_of_diag_bars;
89 
90  bool8 arrived; // set when route done so we know we're into the optional slow out phase
91  uint8 padding1;
92  uint8 padding2;
93  uint8 padding3;
94 };
95 
96 enum _route_phase { RM_NONE, RM_MAIN, RM_ALT };
97 
98 } // End of namespace ICB
99 
100 #endif
Definition: graphic_prims.h:47
Definition: actor.h:32
Definition: route_manager.h:74
void NORETURN_PRE error(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
Definition: route_manager.h:51