… | |
… | |
295 | MTH int change_map_light (int change); |
295 | MTH int change_map_light (int change); |
296 | MTH int estimate_difficulty () const; |
296 | MTH int estimate_difficulty () const; |
297 | |
297 | |
298 | MTH void play_sound (faceidx sound, int x, int y) const; |
298 | MTH void play_sound (faceidx sound, int x, int y) const; |
299 | |
299 | |
|
|
300 | // connected links |
|
|
301 | oblinkpt *find_link (shstr_tmp id); |
|
|
302 | MTH void trigger (shstr_tmp id, bool state = true, object *activator = 0, object *originator = 0); |
|
|
303 | |
300 | // set the given flag on all objects in the map |
304 | // set the given flag on all objects in the map |
301 | MTH void set_object_flag (int flag, int value = 1); |
305 | MTH void set_object_flag (int flag, int value = 1); |
302 | MTH void post_load_original (); |
306 | MTH void post_load_original (); |
303 | |
307 | |
304 | MTH void link_multipart_objects (); |
308 | MTH void link_multipart_objects (); |
… | |
… | |
489 | // can be used as a single statement, but both iterate macros |
493 | // can be used as a single statement, but both iterate macros |
490 | // invocations must not be followed by a ";" |
494 | // invocations must not be followed by a ";" |
491 | // see common/los.C for usage example |
495 | // see common/los.C for usage example |
492 | // the walk will be ordered, outer loop x, inner loop y |
496 | // the walk will be ordered, outer loop x, inner loop y |
493 | // m will be set to the map (or 0), nx, ny to the map coord, dx, dy to the offset relative to op |
497 | // m will be set to the map (or 0), nx, ny to the map coord, dx, dy to the offset relative to op |
|
|
498 | // "continue" will skip to the next space |
494 | #define ordered_mapwalk_begin(op,dx0,dy0,dx1,dy1) \ |
499 | #define ordered_mapwalk_begin(op,dx0,dy0,dx1,dy1) \ |
495 | for (int dx = (dx0); dx <= (dx1); ++dx) \ |
500 | for (int dx = (dx0); dx <= (dx1); ++dx) \ |
496 | { \ |
501 | { \ |
497 | sint16 nx, ny; \ |
502 | sint16 nx, ny; \ |
498 | maptile *m = 0; \ |
503 | maptile *m = 0; \ |
… | |
… | |
514 | } |
519 | } |
515 | |
520 | |
516 | // loop over every space in the given maprect, |
521 | // loop over every space in the given maprect, |
517 | // setting m, nx, ny to the map and -coordinate and dx, dy to the offste relative to dx0,dy0 |
522 | // setting m, nx, ny to the map and -coordinate and dx, dy to the offste relative to dx0,dy0 |
518 | // the iterator code must be a single statement following this macro call, similar to "if" |
523 | // the iterator code must be a single statement following this macro call, similar to "if" |
|
|
524 | // "continue" will skip to the next space |
519 | #define rect_mapwalk(rect,dx0,dy0) \ |
525 | #define rect_mapwalk(rect,dx0,dy0) \ |
520 | statementvar (maptile *, m, (rect)->m) \ |
526 | statementvar (maptile *, m, (rect)->m) \ |
521 | for (int nx = (rect)->x0; nx < (rect)->x1; ++nx) \ |
527 | for (int nx = (rect)->x0; nx < (rect)->x1; ++nx) \ |
522 | for (int ny = (rect)->y0; ny < (rect)->y1; ++ny) \ |
528 | for (int ny = (rect)->y0; ny < (rect)->y1; ++ny) \ |
523 | statementvar (int, dx, nx + (rect)->dx - (dx0)) \ |
529 | statementvar (int, dx, nx + (rect)->dx - (dx0)) \ |
524 | statementvar (int, dy, ny + (rect)->dy - (dy0)) |
530 | statementvar (int, dy, ny + (rect)->dy - (dy0)) |
525 | |
531 | |
526 | // same as above, but the walk will not follow any particular |
532 | // same as above, but the walk will not follow any particular |
527 | // order (unorded), but is likely faster. |
533 | // order (unorded), but is likely faster. |
528 | // m will be set to the map (never 0!), nx, ny to the map coord, dx, dy to the offset relative to op |
534 | // m will be set to the map (never 0!), nx, ny to the map coord, dx, dy to the offset relative to op |
|
|
535 | // "continue" will skip to the next space |
529 | #define unordered_mapwalk(op,dx0,dy0,dx1,dy1) \ |
536 | #define unordered_mapwalk(op,dx0,dy0,dx1,dy1) \ |
530 | for (maprect *r_e_c_t = (op)->map->split_to_tiles ( \ |
537 | for (maprect *r_e_c_t = (op)->map->split_to_tiles ( \ |
531 | (op)->x + (dx0) , (op)->y + (dy0) , \ |
538 | (op)->x + (dx0) , (op)->y + (dy0) , \ |
532 | (op)->x + (dx1) + 1, (op)->y + (dy1) + 1); \ |
539 | (op)->x + (dx1) + 1, (op)->y + (dy1) + 1); \ |
533 | r_e_c_t->m; \ |
540 | r_e_c_t->m; \ |