-
Notifications
You must be signed in to change notification settings - Fork 64
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
Allow resources to be loaded from files #824
Conversation
I had been thinking that there might need to be resources from both a blorb and an extra resource file, but that won't be the case with any of our terps, will it? That makes things easier. It would be simpler if Please add a new Does it look for Otherwise this looks good! Probably worth asking for feedback on the forum too though. And then, to add support to TADS. Eventually... |
Agreed: this is really for formats that don't use Blorb.
That's reasonable. I can make the switch.
Thanks, I completely forgot about that; on that note, where do you land on the naming, then? I really don't want to step on the GLK/glk namespace at all, but I'm 100% fine with marking it as something more generic than just Gargoyle.
The interpreters provide the full path; I thought that made more sense because they're in more of a position to know where the resource file/files are. Everything I've seen always has the resources in the same directory for SCARE (for Hugo the resource file is always the game file), but this is a bit more flexible, and it's possible that SCARE games might have resources elsewhere. I'm not sure it's necessary to worry about opening arbitrary files: they're opened read-only, and if the user has access to the file, there's no harm, and if they don't, it'll just fail to load.
Good point; I'll get a post up shortly. Thanks for all the input! |
Oh, if the terps provide a full path then that makes things simple on the Glk side. I think you've mixed it up again, as it's Hugo that can have multiple files (as can TADS). But for Scare, if it can only refer to the storyfile, which is already open, do you think it would be good to add a second function for adding resources from memory? Or do you think it wouldn't make enough of a performance difference to bother with? |
Haha, I think I'm perpetually condemned to mix those two up. I don't think it's worth adding the memory functions. At least for Scare (yes, really Scare), I'm not even sure if there's a full buffer of the story file. I can see that it reads in the header first, and then eventually the rest of the file, though I'm not sure if it rewinds first. In any case, the file will almost certainly already be cached by the OS, so rereading it will be effectively free. And if not, yeah, it's really not going to make a performance difference anyway. And in this PR, I have it caching loads, so resources will be loaded at most once, and then pulled from memory afterward. |
b9cf4b9
to
82512a4
Compare
This allows both Hugo and Adrift games to load media without the clumsy method of writing out SND and PIC files.
82512a4
to
4830ed6
Compare
Alright, I've decided to split this into two parts. First is the API implementation (now in #825), and when that's complete, I'll do the Hugo/Scare updates. |
Closing in favor of #825. |
This allows both Hugo and Adrift games to load media without the clumsy method of writing out SND and PIC files.