version 1.28 | | version 1.29 |
---|
| | |
/* | | /* |
* static char *rcsid_map_c = | | * static char *rcsid_map_c = |
* "$Id: map.c,v 1.28 2001/12/17 04:15:20 mwedel Exp $"; | | * "$Id: map.c,v 1.29 2001/12/18 08:58:03 garbled Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
/* Gah - these should really have a zero default! */ | | /* Gah - these should really have a zero default! */ |
MAP_ENTER_X(map)=1; | | MAP_ENTER_X(map)=1; |
MAP_ENTER_Y(map)=1; | | MAP_ENTER_Y(map)=1; |
| | #if 0 |
| | /* the calloc should already clear all this */ |
| | map->next=NULL; |
| | map->path[0]='\0'; |
| | map->tmpname=NULL; |
| | map->players=0; |
| | map->timeout=0; |
| | map->light = (objectlink *) NULL; |
| | map->darkness = 0; |
| | map->do_los=0; |
| | map->map_object = NULL; |
| | map->buttons = NULL; |
| | map->compressed = 0; |
| | #endif |
return map; | | return map; |
} | | } |
| | |
| | |
tile, m->path); | | tile, m->path); |
} else { | | } else { |
*end = 0; | | *end = 0; |
if (m->tile_path[tile-1]) { | | if (m->tile_path[tile]) { |
LOG(llevError,"load_map_header: tile location %d duplicated (%s)\n", | | LOG(llevError,"load_map_header: tile location %d duplicated (%s)\n", |
tile, m->path); | | tile, m->path); |
free(m->tile_path[tile-1]); | | free(m->tile_path[tile]); |
} | | } |
if (!editor) { | | if (!editor) { |
if (check_path(value, 1)==-1) { | | if (check_path(value, 1)==-1) { |
| | |
if (m->buttons) | | if (m->buttons) |
free_objectlinkpt(m->buttons); | | free_objectlinkpt(m->buttons); |
m->buttons = NULL; | | m->buttons = NULL; |
for (i=0; i<4; i++) { | | for (i=0; i<4; i++) |
if (m->tile_path[i]) FREE_AND_CLEAR(m->tile_path[i]); | | if (m->tile_path[i]) FREE_AND_CLEAR(m->tile_path[i]); |
m->tile_map[i] = NULL; | | |
} | | |
m->in_memory = MAP_SWAPPED; | | m->in_memory = MAP_SWAPPED; |
} | | } |
| | |
| | |
* tiling can be assymetric, we just can not look to see which | | * tiling can be assymetric, we just can not look to see which |
* maps this map tiles with and clears those. | | * maps this map tiles with and clears those. |
*/ | | */ |
for (tmp = first_map; tmp != NULL; tmp = tmp->next) { | | for (tmp = first_map; tmp != m; tmp = tmp->next) { |
if (tmp->next == m) last = tmp; | | if (tmp->next == m) last = tmp; |
| | |
/* This should hopefully get unrolled on a decent compiler */ | | /* This should hopefully get unrolled on a decent compiler */ |
| | |
m = has_been_loaded (name); | | m = has_been_loaded (name); |
| | |
/* Map is good to go, so just return it */ | | /* Map is good to go, so just return it */ |
if (m && (m->in_memory == MAP_LOADING || m->in_memory == MAP_IN_MEMORY)) | | if (m && (m->in_memory == MAP_LOADING || m->in_memory == MAP_IN_MEMORY)) { |
| | (*set_darkness_map_func)(m); |
return m; | | return m; |
| | } |
| | |
/* unique maps always get loaded from their original location, and never | | /* unique maps always get loaded from their original location, and never |
* a temp location. Likewise, if map_flush is set, or we have never loaded | | * a temp location. Likewise, if map_flush is set, or we have never loaded |
| | |
| | |
/* In case other objects press some buttons down */ | | /* In case other objects press some buttons down */ |
update_buttons(m); | | update_buttons(m); |
| | (*set_darkness_map_func)(m); |
return m; | | return m; |
} | | } |
| | |