243 for (layer = 0; layer <
tree->num_layers; layer++) {
244 for (
i = 0;
i <
tree->layer_size[layer];
i++) {
252 for (j = 0; j < node->
nrequire; j++) {
302 for (
i = 0;
i <
tree->num_nodes;
i++) {
312 tree->diagram_height = 0;
385 for (
i = 0;
i <
tree->diagram_height;
i++) {
413 if (pplayer && !show_all
432 if (nodes[tech] ==
NULL) {
466 tree->nodes[j++] = nodes[tech];
482 for (
i = 0;
i <
tree->num_nodes;
i++) {
489 for (
i = 0;
i <
tree->num_layers;
i++) {
492 if (
tree->layer_size) {
507 if (node->
layer != -1) {
514 node->
layer = max + 1;
525 for (
i = 0;
i <
tree->num_nodes;
i++) {
526 if (
tree->nodes[
i]) {
538 int max = node->
layer;
560 for (
i = 0;
i <
tree->num_nodes;
i++) {
567 if (
mpl >
tree->nodes[
i]->layer + 1) {
580 for (
i = 0;
i <
tree->num_nodes;
i++) {
585 tree->nodes[
i]->number =
i;
596 for (
i = 0;
i <
tree->num_nodes;
i++) {
607 for (j = node->
layer + 2; j <
mpl; j++) {
611 for (j = node->
layer + 1; j <
mpl; j++) {
617 for (j = 0; j < node->
nprovide; j++) {
652 for (
i = 0;
i <
tree->num_nodes;
i++) {
653 num_layers =
MAX(num_layers,
tree->nodes[
i]->layer);
656 tree->num_layers = num_layers;
664 for (
i = 0;
i < num_layers;
i++) {
666 tree->layer_size[
i] = 0;
668 for (
i = 0;
i <
tree->num_nodes;
i++) {
669 tree->layer_size[
tree->nodes[
i]->layer]++;
672 for (
i = 0;
i < num_layers;
i++) {
676 for (
i = 0;
i <
tree->num_nodes;
i++) {
698 if (a->
value > b->value) {
701 if (a->
value < b->value) {
714 if (
tree->layer_size[layer] > 0) {
719 for (
i = 0;
i <
tree->layer_size[layer];
i++) {
724 for (j = 0; j < node->
nrequire; j++) {
737 T[
i].node->order =
i;
760 for (j = 0; j < node->
nprovide; j++) {
763 for (j = 0; j < node->
nprovide; j++) {
793 int layers =
tree->num_layers;
797 for (
i = 0;
i < layers - 1;
i++) {
802 int layer_size =
tree->layer_size[
layer];
808 if (
layer < layers - 1) {
812 for (
x1 = 0;
x1 < layer_size;
x1++) {
813 for (
x2 =
x1 + 1;
x2 < layer_size;
x2++) {
822 if (
layer < layers - 1) {
832 if (
layer < layers - 1) {
859 for (j = 0; j < 20; j++) {
860 for (
i = 0;
i <
tree2->num_layers;
i++) {
866 for (j = 0; j < 20; j++) {
1055 for (
i = 0;
i <
tree->num_layers;
i++) {
1056 for (j = 0; j <
tree->layer_size[
i]; j++) {
1160 for (k = 0; k < node->
nprovide; k++) {
1189 for (
i = 0;
i <
tree->num_nodes;
i++) {
1210 int *
x,
int *
y,
int *w,
int *h)
1214 for (
i = 0;
i <
tree->num_nodes;
i++) {
struct canvas int int struct sprite int int int int height
struct canvas int int int int struct sprite *sprite canvas_put_rectangle
struct canvas int int canvas_y
struct canvas int canvas_x
struct canvas int int int int struct sprite *sprite struct canvas struct color int int int int height canvas_put_line
struct canvas int int struct sprite int int int width
struct color * get_color(const struct tileset *t, enum color_std stdcolor)
#define governments_iterate(NAME_pgov)
#define governments_iterate_end
void canvas_put_sprite_full(struct canvas *pcanvas, int canvas_x, int canvas_y, struct sprite *sprite)
void get_text_size(int *width, int *height, enum client_font font, const char *text)
void canvas_put_curved_line(struct canvas *pcanvas, struct color *pcolor, enum line_type ltype, int start_x, int start_y, int dx, int dy)
const struct impr_type * valid_improvement(const struct impr_type *pimprove)
#define improvement_iterate_end
#define improvement_iterate(_p)
#define fc_assert_ret(condition)
#define fc_assert(condition)
#define fc_assert_action(condition, action)
#define fc_calloc(n, esz)
#define fc_realloc(ptr, sz)
struct client_options gui_options
static int max_provide_layer(struct tree_node *node)
static int longest_path(struct tree_node *node)
static void barycentric_sort(struct reqtree *tree, int layer)
static int cmp_func(const void *_a, const void *_b)
void draw_reqtree(struct reqtree *tree, struct canvas *pcanvas, int canvas_x, int canvas_y, int tt_x, int tt_y, int w, int h)
void get_reqtree_dimensions(struct reqtree *reqtree, int *width, int *height)
static void node_rectangle_minimum_size(struct tree_node *node, int *width, int *height)
static void add_requirement(struct tree_node *node, struct tree_node *req)
static enum color_std node_color(struct tree_node *node)
static int count_crossings(struct reqtree *tree, int layer)
static void improve(struct reqtree *tree)
static void symmetrize(struct reqtree *tree)
static struct reqtree * add_dummy_nodes(struct reqtree *tree)
static void set_layers(struct reqtree *tree)
static void longest_path_layering(struct reqtree *tree)
static void calculate_diagram_layout(struct reqtree *tree)
Tech_type_id get_tech_on_reqtree(struct reqtree *tree, int x, int y)
bool find_tech_on_reqtree(struct reqtree *tree, Tech_type_id tech, int *x, int *y, int *w, int *h)
static void swap(struct reqtree *tree, int layer, int order1, int order2)
static enum reqtree_edge_type get_edge_type(struct tree_node *node, struct tree_node *dest_node)
static enum color_std edge_color(struct tree_node *node, struct tree_node *dest_node)
static struct tree_node * new_tree_node(void)
void destroy_reqtree(struct reqtree *tree)
struct reqtree * create_reqtree(struct player *pplayer, bool show_all)
static struct reqtree * create_dummy_reqtree(struct player *pplayer, bool show_all)
#define requirement_vector_iterate_end
#define requirement_vector_iterate(req_vec, preq)
bool research_invention_reachable(const struct research *presearch, const Tech_type_id tech)
bool research_goal_tech_req(const struct research *presearch, Tech_type_id goal, Tech_type_id tech)
const char * research_advance_name_translation(const struct research *presearch, Tech_type_id tech)
struct research * research_get(const struct player *pplayer)
enum tech_state research_invention_state(const struct research *presearch, Tech_type_id tech)
bool research_invention_gettable(const struct research *presearch, const Tech_type_id tech, bool allow_holes)
struct sprite int int int int struct sprite int int float bool smooth get_sprite_dimensions
bool reqtree_curved_lines
struct tree_node ** nodes
struct tree_node *** layers
struct tree_node ** provide
struct tree_node ** require
struct advance * advance_by_number(const Tech_type_id atype)
struct advance * valid_advance_by_number(const Tech_type_id id)
Tech_type_id advance_required(const Tech_type_id tech, enum tech_req require)
Tech_type_id advance_number(const struct advance *padvance)
#define advance_index_iterate_max(_start, _index, _max)
#define advance_index_iterate_max_end
static Tech_type_id advance_count(void)
struct sprite * get_government_sprite(const struct tileset *t, const struct government *gov)
struct sprite * get_building_sprite(const struct tileset *t, const struct impr_type *pimprove)
struct sprite * get_unittype_sprite(const struct tileset *t, const struct unit_type *punittype, enum unit_activity activity, enum direction8 facing)
bool is_tech_req_for_utype(const struct unit_type *ptype, struct advance *padv)
#define unit_type_iterate(_p)
#define unit_type_iterate_end