… | |
… | |
117 | { |
117 | { |
118 | maptile *style_map; |
118 | maptile *style_map; |
119 | |
119 | |
120 | /* Given a file. See if its in memory */ |
120 | /* Given a file. See if its in memory */ |
121 | for (style_map = styles; style_map != NULL; style_map = style_map->next) |
121 | for (style_map = styles; style_map != NULL; style_map = style_map->next) |
122 | { |
|
|
123 | if (!strcmp (style_name, style_map->path)) |
122 | if (!strcmp (style_name, style_map->path)) |
124 | return style_map; |
123 | return style_map; |
125 | } |
124 | |
126 | style_map = load_original_map (style_name, MAP_STYLE); |
125 | style_map = load_original_map (style_name, MAP_STYLE); |
|
|
126 | |
127 | /* Remove it from global list, put it on our local list */ |
127 | /* Remove it from global list, put it on our local list */ |
128 | if (style_map) |
128 | if (style_map) |
129 | { |
129 | { |
130 | maptile *tmp; |
130 | maptile *tmp; |
131 | |
131 | |
… | |
… | |
135 | { |
135 | { |
136 | for (tmp = first_map; tmp && tmp->next != style_map; tmp = tmp->next); |
136 | for (tmp = first_map; tmp && tmp->next != style_map; tmp = tmp->next); |
137 | if (tmp) |
137 | if (tmp) |
138 | tmp->next = style_map->next; |
138 | tmp->next = style_map->next; |
139 | } |
139 | } |
|
|
140 | |
140 | style_map->next = styles; |
141 | style_map->next = styles; |
141 | styles = style_map; |
142 | styles = style_map; |
142 | } |
143 | } |
|
|
144 | |
143 | return style_map; |
145 | return style_map; |
144 | } |
146 | } |
145 | |
147 | |
146 | maptile * |
148 | maptile * |
147 | find_style (const char *dirname, const char *stylename, int difficulty) |
149 | find_style (const char *dirname, const char *stylename, int difficulty) |