New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make ISpriteLoader aware of the source file name. #19228
Conversation
That seems messier than it should be. You have methods that take a |
That job is already performed by |
A potential |
Adding a new method, on the other hand, now either requires you to do the same checks twice, or to say that |
Wouldn't it be better to let ISpiritLoader to expose a property on what file exts it can handle? Or do we have cases when there is no file exts to check? |
IMO that would be needlessly restrictive, by preventing implementations that might want to filter on more than just the extension (e.g. the directory that holds the sprites) and would also signal that we encourage implementations to use extensions as their primary filtering mechanism which they really shouldn't be! |
56ee20b
to
8d9f994
Compare
Sometimes games have have multiple different sprite formats, where the only possible filetype detection algorythm would be wether the file could be successfully parsed till fileend is reached... This PR basicaly makes the ISpriteLoader aware of the filename, which allows in these cases to avoid unnecesary complex code based checks and simply rely on the file extension.