forked from github/server
SAMRT_INTERVALS is no longer an option, but regular
This commit is contained in:
parent
b44a249795
commit
f8ac5c390d
|
@ -509,7 +509,6 @@ void renumber_faction(faction * f, int no)
|
||||||
fset(f, FFL_NEWID);
|
fset(f, FFL_NEWID);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SMART_INTERVALS
|
|
||||||
void update_interval(struct faction *f, struct region *r)
|
void update_interval(struct faction *f, struct region *r)
|
||||||
{
|
{
|
||||||
if (r == NULL || f == NULL)
|
if (r == NULL || f == NULL)
|
||||||
|
@ -521,7 +520,6 @@ void update_interval(struct faction *f, struct region *r)
|
||||||
f->last = r;
|
f->last = r;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
const char *faction_getname(const faction * self)
|
const char *faction_getname(const faction * self)
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,9 +33,6 @@ extern "C" {
|
||||||
struct gamedata;
|
struct gamedata;
|
||||||
|
|
||||||
extern struct attrib_type at_maxmagicians;
|
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 */
|
/* faction flags */
|
||||||
#define FFL_NEWID (1<<0) /* Die Partei hat bereits einmal ihre no gewechselt */
|
#define FFL_NEWID (1<<0) /* Die Partei hat bereits einmal ihre no gewechselt */
|
||||||
|
@ -57,10 +54,8 @@ extern "C" {
|
||||||
struct faction *next;
|
struct faction *next;
|
||||||
struct faction *nexthash;
|
struct faction *nexthash;
|
||||||
|
|
||||||
#ifdef SMART_INTERVALS
|
|
||||||
struct region *first;
|
struct region *first;
|
||||||
struct region *last;
|
struct region *last;
|
||||||
#endif
|
|
||||||
int no;
|
int no;
|
||||||
int subscription;
|
int subscription;
|
||||||
int flags;
|
int flags;
|
||||||
|
@ -138,9 +133,7 @@ extern "C" {
|
||||||
void free_factions(void);
|
void free_factions(void);
|
||||||
void remove_empty_factions(void);
|
void remove_empty_factions(void);
|
||||||
|
|
||||||
#ifdef SMART_INTERVALS
|
|
||||||
void update_interval(struct faction *f, struct region *r);
|
void update_interval(struct faction *f, struct region *r);
|
||||||
#endif
|
|
||||||
|
|
||||||
const char *faction_getbanner(const struct faction *self);
|
const char *faction_getbanner(const struct faction *self);
|
||||||
void faction_setbanner(struct faction *self, const char *name);
|
void faction_setbanner(struct faction *self, const char *name);
|
||||||
|
|
|
@ -964,9 +964,7 @@ void move_unit(unit * u, region * r, unit ** ulist)
|
||||||
addlist(ulist, u);
|
addlist(ulist, u);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SMART_INTERVALS
|
|
||||||
update_interval(u->faction, r);
|
update_interval(u->faction, r);
|
||||||
#endif
|
|
||||||
u->region = r;
|
u->region = r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1147,9 +1147,7 @@ static void faction_add_seen(faction *f, region *r, seen_mode mode) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef SMART_INTERVALS
|
|
||||||
update_interval(f, r);
|
update_interval(f, r);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** mark all regions seen by the lighthouse.
|
/** mark all regions seen by the lighthouse.
|
||||||
|
@ -1270,16 +1268,11 @@ void reorder_units(region * r)
|
||||||
|
|
||||||
static region *lastregion(faction * f)
|
static region *lastregion(faction * f)
|
||||||
{
|
{
|
||||||
#ifdef SMART_INTERVALS
|
|
||||||
return f->last ? f->last->next : NULL;
|
return f->last ? f->last->next : NULL;
|
||||||
#else
|
|
||||||
return NULL;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static region *firstregion(faction * f)
|
static region *firstregion(faction * f)
|
||||||
{
|
{
|
||||||
#ifdef SMART_INTERVALS
|
|
||||||
region *r = f->first;
|
region *r = f->first;
|
||||||
|
|
||||||
if (f->units == NULL)
|
if (f->units == NULL)
|
||||||
|
@ -1288,9 +1281,6 @@ static region *firstregion(faction * f)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
return f->first = regions;
|
return f->first = regions;
|
||||||
#else
|
|
||||||
return regions;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cb_add_seen(region *r, unit *u, void *cbdata) {
|
static void cb_add_seen(region *r, unit *u, void *cbdata) {
|
||||||
|
|
|
@ -80,12 +80,10 @@ void travelthru_add(region * r, unit * u)
|
||||||
ql_push(&ql, u);
|
ql_push(&ql, u);
|
||||||
a->data.v = ql;
|
a->data.v = ql;
|
||||||
|
|
||||||
#ifdef SMART_INTERVALS
|
|
||||||
/* the first and last region of the faction gets reset, because travelthrough
|
/* the first and last region of the faction gets reset, because travelthrough
|
||||||
* could be in regions that are located before the [first, last] interval,
|
* could be in regions that are located before the [first, last] interval,
|
||||||
* and recalculation is needed */
|
* and recalculation is needed */
|
||||||
update_interval(u->faction, r);
|
update_interval(u->faction, r);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool travelthru_cansee(const struct region *r, const struct faction *f, const struct unit *u) {
|
bool travelthru_cansee(const struct region *r, const struct faction *f, const struct unit *u) {
|
||||||
|
|
Loading…
Reference in New Issue