Rather simple algorithm, chunks up the map, as the ray moves it checks nearby, and because the map consists only of squares, it solves the x and y intercepts of the line with the bounds of the box, if they fit one of the sides of the box, we've got a hit.