32 #define SPACE_BLOCK 0.5 66 for (i = 0; i <
index; i++) {
67 if (block[x][y].x[i] == bx
68 && block[x][y].y[i] == by)
76 LOG(
llevDebug,
"setblock: added %d %d -> %d %d (%d)\n", x, y, bx, by, block[x][y].index);
90 static const int block_x[3] = {
104 for (x = 1; x <= MAP_CLIENT_X/2; x++) {
105 for (y = 1; y <= MAP_CLIENT_Y/2; y++) {
107 if (x == MAP_CLIENT_X/2 && y == MAP_CLIENT_Y/2)
110 for (i = 0; i < 3; i++) {
115 if ((dx == x && x == MAP_CLIENT_X/2)
116 || (dy == y && y == MAP_CLIENT_Y/2)) {
121 if (x == MAP_CLIENT_X/2) {
122 set_block(x, MAP_CLIENT_Y-y-1, dx, MAP_CLIENT_Y-dy-1);
123 }
else if (y == MAP_CLIENT_Y/2) {
124 set_block(MAP_CLIENT_X-x-1, y, MAP_CLIENT_X-dx-1, dy);
136 d1 = (float)(pow(MAP_CLIENT_X/2-dx, 2)+pow(MAP_CLIENT_Y/2-dy, 2));
137 s = (float)((dy-y)*(MAP_CLIENT_X/2-dx)-(dx-x)*(MAP_CLIENT_Y/2-dy))/d1;
138 l =
FABS(sqrt(d1)*s);
145 set_block(MAP_CLIENT_X-x-1, y, MAP_CLIENT_X-dx-1, dy);
146 set_block(x, MAP_CLIENT_Y-y-1, dx, MAP_CLIENT_Y-dy-1);
147 set_block(MAP_CLIENT_X-x-1, MAP_CLIENT_Y-y-1, MAP_CLIENT_X-dx-1, MAP_CLIENT_Y-dy-1);
174 const blocks *
const at = block[
x] +
y;
181 for (
int i = 0; i < at->
index; i++) {
182 int dx = at->
x[i], dy = at->
y[i];
220 if (!block[x][y].
index)
282 for (i = 1; i <= 8; i += 1) {
330 int x,
y, darklevel, ax, ay, basex, basey, mflags, light, x1, y1;
385 for (ax = basex-light; ax <= basex+light; ax++) {
388 for (ay = basey-light; ay <= basey+light; ay++) {
400 x1 = abs(basex-ax)*abs(basex-ax);
401 y1 = abs(basey-ay)*abs(basey-ay);
420 for (x = -1; x <= 1; x++)
421 for (y = -1; y <= 1; y++) {
487 for (x = -2; x <= 2; x++)
488 for (y = -2; y <= 2; y++)
512 if (pl->
ob->
map == map)
555 if (pl->
ob->
map == map) {
610 snprintf(buf,
sizeof(buf),
"[fixed] ");
612 snprintf(buf2,
sizeof(buf2),
"%2d", x);
613 strncat(buf, buf2,
sizeof(buf)-strlen(buf)-1);
617 snprintf(buf,
sizeof(buf),
"[fixed]%2d:", y);
620 strncat(buf, buf2,
sizeof(buf)-strlen(buf)-1);
static void set_wall(player *pl, int x, int y)
static void expand_lighted_sight(object *op)
struct mapdef * tile_map[4]
short freearr_x[SIZEOFFREE]
static void expand_sight(object *op)
void make_sure_seen(const object *op)
static void check_wall(object *op, int x, int y)
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
short freearr_y[SIZEOFFREE]
static void blinded_sight(player *pl)
static blocks block[MAP_CLIENT_X][MAP_CLIENT_Y]
void update_all_los(const mapstruct *map, int x, int y)
void clear_los(player *pl)
static void set_block(int x, int y, int bx, int by)
#define GET_MAP_LIGHT(M, X, Y)
int8_t blocked_los[MAP_CLIENT_X][MAP_CLIENT_Y]
#define QUERY_FLAG(xyz, p)
#define MSG_TYPE_COMMAND_DEBUG
int has_carried_lights(const object *op)
void print_los(object *op)
void update_all_map_los(mapstruct *map)
void update_los(object *op)
EXTERN player * first_player
int get_map_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny)
void LOG(LogLevel logLevel, const char *format,...)
void make_sure_not_seen(const object *op)