Skip to content
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

All file IO should go through PhysFs #43

Open
verhoevenv opened this issue Apr 14, 2015 · 1 comment
Open

All file IO should go through PhysFs #43

verhoevenv opened this issue Apr 14, 2015 · 1 comment
Milestone

Comments

@verhoevenv
Copy link
Owner

If we ever want to be able to distribute our game, we can't go opening or writing files at random locations. Windows, Linux and Mac have different conventions about where files are supposed to be, and none of them allow writing to the directory where the executable lives.

So I would like to replace all direct calls to fopen etc to calls through PhysFs, which should manage these things for us.

I also think we should put all those calls behind an anti-corruption-layer of our own (engine.h), in case we ever need to move away from PhysFs. It sounds a bit like gold-plating (it kinda violates YAGNI and KISS), but File_Exists and a few others are already there, and it was a huge help to have this layer when moving from Grim to SDL. I might reconsider this if it's too much work, though. :)

@Enet4
Copy link
Contributor

Enet4 commented Apr 15, 2015

I wouldn't necessarily enforce an extra API layer for file I/O, even when we can do it without a run-time overhead. But anything that makes the program more modular is welcome at this point. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants