From f8ac5c390dfda248edbaabdcdee77858b01d68c0 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 20 Sep 2016 09:39:21 +0200 Subject: [PATCH] SAMRT_INTERVALS is no longer an option, but regular --- src/kernel/faction.c | 2 -- src/kernel/faction.h | 7 ------- src/kernel/unit.c | 2 -- src/reports.c | 10 ---------- src/travelthru.c | 2 -- 5 files changed, 23 deletions(-) diff --git a/src/kernel/faction.c b/src/kernel/faction.c index 794554cec..d9c9d4e15 100755 --- a/src/kernel/faction.c +++ b/src/kernel/faction.c @@ -509,7 +509,6 @@ void renumber_faction(faction * f, int no) fset(f, FFL_NEWID); } -#ifdef SMART_INTERVALS void update_interval(struct faction *f, struct region *r) { if (r == NULL || f == NULL) @@ -521,7 +520,6 @@ void update_interval(struct faction *f, struct region *r) f->last = r; } } -#endif const char *faction_getname(const faction * self) { diff --git a/src/kernel/faction.h b/src/kernel/faction.h index 80a71da48..de5524294 100644 --- a/src/kernel/faction.h +++ b/src/kernel/faction.h @@ -33,9 +33,6 @@ extern "C" { struct gamedata; extern struct attrib_type at_maxmagicians; - /* SMART_INTERVALS: define to speed up finding the interval of regions that a - faction is in. defining this speeds up the turn by 30-40% */ -#define SMART_INTERVALS /* faction flags */ #define FFL_NEWID (1<<0) /* Die Partei hat bereits einmal ihre no gewechselt */ @@ -57,10 +54,8 @@ extern "C" { struct faction *next; struct faction *nexthash; -#ifdef SMART_INTERVALS struct region *first; struct region *last; -#endif int no; int subscription; int flags; @@ -138,9 +133,7 @@ extern "C" { void free_factions(void); void remove_empty_factions(void); -#ifdef SMART_INTERVALS void update_interval(struct faction *f, struct region *r); -#endif const char *faction_getbanner(const struct faction *self); void faction_setbanner(struct faction *self, const char *name); diff --git a/src/kernel/unit.c b/src/kernel/unit.c index 246f59cb7..4623e895e 100644 --- a/src/kernel/unit.c +++ b/src/kernel/unit.c @@ -964,9 +964,7 @@ void move_unit(unit * u, region * r, unit ** ulist) addlist(ulist, u); } -#ifdef SMART_INTERVALS update_interval(u->faction, r); -#endif u->region = r; } diff --git a/src/reports.c b/src/reports.c index 420cdb752..11d913ef5 100644 --- a/src/reports.c +++ b/src/reports.c @@ -1147,9 +1147,7 @@ static void faction_add_seen(faction *f, region *r, seen_mode mode) { } } } -#ifdef SMART_INTERVALS update_interval(f, r); -#endif } /** mark all regions seen by the lighthouse. @@ -1270,16 +1268,11 @@ void reorder_units(region * r) static region *lastregion(faction * f) { -#ifdef SMART_INTERVALS return f->last ? f->last->next : NULL; -#else - return NULL; -#endif } static region *firstregion(faction * f) { -#ifdef SMART_INTERVALS region *r = f->first; if (f->units == NULL) @@ -1288,9 +1281,6 @@ static region *firstregion(faction * f) return r; return f->first = regions; -#else - return regions; -#endif } static void cb_add_seen(region *r, unit *u, void *cbdata) { diff --git a/src/travelthru.c b/src/travelthru.c index 32607ae5c..8e1fc946b 100644 --- a/src/travelthru.c +++ b/src/travelthru.c @@ -80,12 +80,10 @@ void travelthru_add(region * r, unit * u) ql_push(&ql, u); a->data.v = ql; -#ifdef SMART_INTERVALS /* the first and last region of the faction gets reset, because travelthrough * could be in regions that are located before the [first, last] interval, * and recalculation is needed */ update_interval(u->faction, r); -#endif } bool travelthru_cansee(const struct region *r, const struct faction *f, const struct unit *u) {