ScummVM API documentation
walk.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
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
*
20
*/
21
22
#ifndef PARALLACTION_WALK_H
23
#define PARALLACTION_WALK_H
24
25
#include "common/ptr.h"
26
#include "common/list.h"
27
28
#include "parallaction/objects.h"
29
30
namespace
Parallaction
{
31
32
struct
Character;
33
34
class
PathWalker_NS
{
35
AnimationPtr
_a;
36
PointList
_walkPath;
37
int16 _direction, _step;
38
39
// builder routines
40
PointList
_subPath;
41
void
correctPathPoint(
Common::Point
&to);
42
uint32 buildSubPath(
const
Common::Point
& pos,
const
Common::Point
& stop);
43
uint16 walkFunc1(
const
Common::Point
&to,
Common::Point
& node);
44
45
// walker routines
46
void
finalizeWalk();
47
void
clipMove(
Common::Point
& pos,
const
Common::Point
& to);
48
void
checkDoor(
const
Common::Point
&foot);
49
void
updateDirection(
const
Common::Point
& pos,
const
Common::Point
& to);
50
51
Parallaction
*_vm;
52
53
public
:
54
PathWalker_NS
(
Parallaction
*vm);
55
56
void
buildPath(
AnimationPtr
a, uint16 x, uint16 y);
57
void
walk();
58
};
59
60
class
PathWalker_BR
{
61
62
struct
State {
63
bool
_active;
64
AnimationPtr
_a;
65
int
_walkDelay;
66
bool
_stillWalkingTowardsNode;
67
Common::Point
_startFoot;
68
bool
_first;
69
int
_step;
70
int
_dirFrame;
71
PointList
_walkPath;
72
};
73
74
State _character;
75
State _follower;
76
77
void
finalizeWalk(State &s);
78
bool
directPathExists(
const
Common::Point
&from,
const
Common::Point
&to);
79
void
buildPath(State &s, uint16 x, uint16 y);
80
void
doWalk(State &s);
81
void
checkTrap(
const
Common::Point
&p);
82
83
Parallaction
*_vm;
84
85
public
:
86
PathWalker_BR
(
Parallaction
*vm);
87
~
PathWalker_BR
() { }
88
89
void
setCharacterPath(
AnimationPtr
a, uint16 x, uint16 y);
90
void
setFollowerPath(
AnimationPtr
a, uint16 x, uint16 y);
91
void
stopFollower();
92
93
void
walk();
94
};
95
96
}
97
98
#endif
Parallaction::PathWalker_NS
Definition:
walk.h:34
Common::List< Common::Point >
Parallaction
Definition:
debug.h:8
Common::Point
Definition:
rect.h:45
Parallaction::PathWalker_BR
Definition:
walk.h:60
Common::SharedPtr< Animation >
engines
parallaction
walk.h
Generated on Thu Dec 19 2024 09:09:33 for ScummVM API documentation by
1.8.13