src/map.cpp
changeset 5860 7fdc9b423ba1
parent 5838 9c3129cb019b
child 6285 187e3ef04cc9
equal deleted inserted replaced
5859:158718283d16 5860:7fdc9b423ba1
    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