- adopted more common dir code from scummvm for easier multi platform support - synced some changes from scummvm code