Refactor the ride painting to C++ and use interface for all the drawing so that its more easily testable. This will also help towards making drawing thread safe.
It might be good for ride paint functions to have the parameters
(IPaintContext pc, const RidePaintContext rc)
IPaintContext is an interface containing the methods for adding the draw instructions and
RidePaintContext is a simple structure containing fields for ride index, ride, track type, map element, direction, rotation etc. The reason for splitting this is so that the ride paint context fields do not have the virtual call overhead. It also allows you to make those const, while the paint context isn't. The same paint context definition can also be used for other things like footpaths.