ScummVM API documentation
adv_walk.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_WALK_H
24#define M4_ADV_R_ADV_WALK_H
25
26#include "m4/adv_r/adv.h"
27#include "m4/wscript/ws_machine.h"
28
29namespace M4 {
30
31class Walker {
32public:
33 virtual ~Walker() {}
34
35 virtual void walk_load_walker_and_shadow_series() = 0;
36 virtual machine *walk_initialize_walker() = 0;
37};
38
39void set_walker_scaling(SceneDef *rdef);
40
45void ws_demand_location(machine *myWalker, int32 x, int32 y, int facing = -1);
46void ws_demand_facing(machine *myWalker, int32 newFacing);
47void ws_turn_to_face(machine *myWalker, int32 facing, int32 trigger = -1);
48void ws_hide_walker(machine *myWalker);
49void ws_unhide_walker(machine *myWalker);
50void ws_walk(machine *myWalker, int32 x, int32 y, GrBuff **, int16 trigger, int32 finalFacing, bool complete_walk = true);
51
52void ws_demand_location(int32 x, int32 y, int facing = -1);
53void ws_demand_facing(int32 newFacing);
54void ws_turn_to_face(int32 facing, int32 trigger = -1);
55void ws_hide_walker();
56void ws_unhide_walker();
57void ws_walk(int32 x, int32 y, GrBuff **buffer, int16 trigger, int32 finalFacing = -1, bool complete_walk = true);
58
59void ws_get_walker_info(machine *myWalker, int32 *x, int32 *y, int32 *s, int32 *layer, int32 *facing);
60
61void ws_walk_init_system();
62
63void ws_walk_load_series(const int16 *dir_array, const char *name_array[], bool shadow_flag, bool load_palette);
64void ws_walk_load_walker_series(const int16 *dir_array, const char *name_array[], bool load_palette = false);
65void ws_walk_load_shadow_series(const int16 *dir_array, const char *name_array[]);
66
67void ws_walk_dump_series(int16 num_directions, int16 start_hash);
68#define ws_walk_dump_walker_series(xx, yy) (ws_walk_dump_series (xx, yy))
69#define ws_walk_dump_shadow_series(xx, yy) (ws_walk_dump_series (xx, yy))
70
71#define player_walk(xx, yy, ff, tt) (ws_walk(_G(my_walker), xx, yy, nullptr, tt, ff, true))
72#define player_walk_no_finish(xx, yy, ff, tt) (ws_walk(_G(my_walker), xx, yy, nullptr, tt, ff, FALSE))
73#define player_demand_facing(dd) (ws_demand_facing(_G(my_walker), dd))
74#define player_demand_location(xx, yy) (ws_demand_location(_G(my_walker), xx, yy))
75#define player_turn_to_face(dd, tt) (ws_turn_to_face(_G(my_walker), dd, tt))
76#define player_hide() (ws_hide_walker(_G(my_walker)))
77#define player_unhide() (ws_unhide_walker(_G(my_walker)))
78#define player_get_info() (player_update_info(_G(my_walker), &_G(player_info)))
79
80
81// New walking stuff
82void ws_custom_walk(machine *myWalker, int32 finalFacing, int32 trigger, bool complete_walk = true);
83#define adv_walker_custom_walk(ww, ff, tt) (ws_custom_walk(ww, ff, tt, true))
84#define adv_walker_custom_walk_no_finish(ww, ff, tt) (ws_custom_walk(ww, ff, tt, FALSE))
85#define adv_walker_walk(ww, xx, yy, ff, tt) (ws_walk(ww, xx, yy, nullptr, tt, ff, true))
86#define adv_walker_walk_no_finish(ww, xx, yy, ff, tt) (ws_walk(ww, xx, yy, nullptr, tt, ff, FALSE))
87#define adv_walker_face(ww, dd) (ws_demand_facing(ww, dd))
88#define adv_walker_turn_to_face(ww, dd, tt) (ws_turn_to_face(ww, dd, tt))
89#define adv_walker_move(ww, xx, yy) (ws_demand_location(ww, xx, yy))
90#define adv_walker_hide(ww) (ws_hide_walker(ww))
91#define adv_walker_unhide(ww) (ws_unhide_walker(ww))
92
93void adv_hyperwalk_to_final_destination(void *, void *);
94
95} // End of namespace M4
96
97#endif
Definition: gr_buff.h:30
Definition: adv_walk.h:31
Definition: database.h:28
bool walker_has_walk_finished(machine *sender)
Definition: adv.h:79
Definition: ws_machine.h:156