blob: 6c7d23c95f4822cb09d8822e16c9e0af503f851b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
/*
* File: direct.cc
* Summary: Functions used when picking squares.
* Written by: Linley Henzell
*
* Modified for Crawl Reference by $Author$ on $Date$
*
* Change History (most recent first):
*
* <1> -/--/-- LRH Created
*/
#ifndef DIRECT_H
#define DIRECT_H
#include "externs.h"
#include "enum.h"
// last updated 12may2000 {dlb}
/* ***********************************************************************
* called from: acr - debug - effects - it_use3 - item_use - spells1 -
* spells2 - spells3 - spells4
* *********************************************************************** */
void direction( struct dist &moves, targeting_type restricts = DIR_NONE,
int mode = TARG_ANY, bool just_looking = false,
const char *prompt = NULL );
bool in_los_bounds(int x, int y);
bool in_viewport_bounds(int x, int y);
bool in_los(int x, int y);
bool in_vlos(int x, int y);
int dos_direction_unmunge(int doskey);
std::string feature_description(int mx, int my);
std::string feature_description(int grid);
std::vector<dungeon_feature_type> features_by_desc(const text_pattern &pattern);
inline int view2gridX(int vx)
{
return (you.x_pos + vx - VIEW_CX);
}
inline int view2gridY(int vy)
{
return (you.y_pos + vy - VIEW_CY);
}
inline coord_def view2grid(const coord_def &pos)
{
return coord_def( view2gridX(pos.x), view2gridY(pos.y) );
}
inline int grid2viewX(int gx)
{
return (gx - you.x_pos + VIEW_CX);
}
inline int grid2viewY(int gy)
{
return (gy - you.y_pos + VIEW_CY);
}
inline coord_def grid2view(const coord_def &pos)
{
return coord_def( grid2viewX(pos.x), grid2viewY(pos.y) );
}
#endif
|