src/map.cpp
changeset 5609 dc6a58930ba4
parent 5587 167d9a91ef02
child 6201 bee01dc45e39
equal deleted inserted replaced
5608:0b0aff054402 5609:dc6a58930ba4
    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