equal
deleted
inserted
replaced
40 _map_size_y = size_y; |
40 _map_size_y = size_y; |
41 _map_size = size_x * size_y; |
41 _map_size = size_x * size_y; |
42 _map_tile_mask = _map_size - 1; |
42 _map_tile_mask = _map_size - 1; |
43 |
43 |
44 free(_m); |
44 free(_m); |
45 CallocT(&_m, _map_size); |
45 _m = CallocT<Tile>(_map_size); |
46 |
46 |
47 // XXX TODO handle memory shortage more gracefully |
47 // XXX TODO handle memory shortage more gracefully |
48 if (_m == NULL) error("Failed to allocate memory for the map"); |
48 if (_m == NULL) error("Failed to allocate memory for the map"); |
49 } |
49 } |
50 |
50 |