Some selection optimizations

- Add bounds, so that we don't process any locations outside
  as those locations are known to be unset
- The bounds are only recalculated if needed
- Replace instances of selection_not where we actually want
  a new selection with all locations set
This commit is contained in:
Pasi Kallinen
2022-08-26 12:43:40 +03:00
parent e815498f07
commit 5e9ed7a290
5 changed files with 203 additions and 31 deletions
+3
View File
@@ -2307,6 +2307,7 @@ extern void init_rect(void);
extern void free_rect(void);
extern NhRect *get_rect(NhRect *);
extern NhRect *rnd_rect(void);
extern void rect_bounds(NhRect, NhRect, NhRect *);
extern void remove_rect(NhRect *);
extern void add_rect(NhRect *);
extern void split_rects(NhRect *, NhRect *);
@@ -2582,7 +2583,9 @@ extern boolean load_special(const char *);
extern coordxy selection_getpoint(coordxy, coordxy, struct selectionvar *);
extern struct selectionvar *selection_new(void);
extern void selection_free(struct selectionvar *, boolean);
extern void selection_clear(struct selectionvar *, int);
extern struct selectionvar *selection_clone(struct selectionvar *);
extern void selection_getbounds(struct selectionvar *, NhRect *);
extern void set_selection_floodfillchk(int(*)(coordxy, coordxy));
extern void selection_floodfill(struct selectionvar *, coordxy, coordxy, boolean);
extern boolean pm_good_location(coordxy, coordxy, struct permonst *);