tjhancocks / kestrel-development-kit

A Development Kit for the Kestrel Game Engine
MIT License
13 stars 1 forks source link

Write internal ResourceFile representation to disk. #2

Open tjhancocks opened 4 years ago

tjhancocks commented 4 years ago

Is your feature request related to a problem? Please describe. The kdk::target class is currently building a representation of the final resource file by adding resources to an rsrc::file. However this is not written to disk, and simply discarded as the assembler exits.

Describe the solution you'd like A method (or set of methods) need to be introduced that allow writing the contents of the rsrc::file object to disk, in the binary format of either a Standard ResourceFork or the custom Extended ResourceFork.

tjhancocks commented 4 years ago

The implementation for the older standard resource files is completed.

andrews05 commented 4 years ago

Are you planning to support the windows .rez format?

tjhancocks commented 4 years ago

This could certainly be added!

Ultimately we'd need to have a flag/option on the assembler to define what the output format should be. Something like:

--format=kestrel
--format=nova-mac
--format=nova-rez

I do have some old code lying around somewhere that should contain the general rez format. I can try and get that posted up on gist, for whomever wants to implement that.

andrews05 commented 4 years ago

Yeah, I've got the format around, could possibly look at implementing it. Given .rez doesn't have the file size limitation that standard resourcefork does, what is the advantage of the extended format? I don't think other limitations like 16-bit ids have ever been a concern.

[edit] Here's my plugconvert code which can write .rez files.

tjhancocks commented 4 years ago

To be honest the extended one came out of wanting to be able to extend the format with new features if and when required. Given that Kestrel will be the only consumer of such a format, it can be extended and tweaked right up to the point of Kestrel's release. In theory the format can also be versioned (using the version field in its header), so it can be extended later as well.

Now whether these extensions ever happen or not is another discussion.

I also don't want to tie Kestrel to the older ResourceFile and Rez files that Nova used, and allow it to be able to evolve beyond. I've mentioned in a few places that the initial goal for Kestrel is to allow cloning the EV Nova engine, but beyond the EV: Override Remastering it will be its own thing, with additional features, capabilities and such.

andrews05 commented 4 years ago

Awesome, sounds good. I'm sure we've all got plenty of ideas on how it could be extended/enhanced :)