A vacant leisure centre will finally be transformed into new homes and shops after passing the last planning hurdle.