forked from libtcod/python-tcod
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpath.c
More file actions
45 lines (37 loc) · 1.57 KB
/
Copy pathpath.c
File metadata and controls
45 lines (37 loc) · 1.57 KB
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
#include "path.h"
#include <SDL_stdinc.h>
float PathCostArrayFloat32(const int x1, const int y1,
const int x2, const int y2,
const PathCostArray *map){
return ((float*)map->array)[y2 * map->width + x2];
}
float PathCostArrayInt8(const int x1, const int y1,
const int x2, const int y2,
const PathCostArray *map){
return (float)((int8_t*)map->array)[y2 * map->width + x2];
}
float PathCostArrayInt16(const int x1, const int y1,
const int x2, const int y2,
const PathCostArray *map){
return (float)((int16_t*)map->array)[y2 * map->width + x2];
}
float PathCostArrayInt32(const int x1, const int y1,
const int x2, const int y2,
const PathCostArray *map){
return (float)((int32_t*)map->array)[y2 * map->width + x2];
}
float PathCostArrayUInt8(const int x1, const int y1,
const int x2, const int y2,
const PathCostArray *map){
return (float)((uint8_t*)map->array)[y2 * map->width + x2];
}
float PathCostArrayUInt16(const int x1, const int y1,
const int x2, const int y2,
const PathCostArray *map){
return (float)((uint16_t*)map->array)[y2 * map->width + x2];
}
float PathCostArrayUInt32(const int x1, const int y1,
const int x2, const int y2,
const PathCostArray *map){
return (float)((uint32_t*)map->array)[y2 * map->width + x2];
}