moved rescast functions to the resource header
pass by ref rescast
Merge pull request #913 from rwcarlsen/mv-rescast

moved rescast functions to the resource header