More work on the discrete shadowcasting algorithm. Needs to be rubified in some places