Quote from: Crimson Wizard on Fri 26/09/2014 22:32:21Actually it does create a separate raw data with the call to CompileGameToDTAFile.
What it needs, is a change in a workflow that would optionally leave game data unmerged with any exe.
I kind of realized this in retrospect... I lost sight of what I was actually trying to accomplish I think (obviously, I'm trying to separate building the EXE from building the actual game data file). I realized what the real root of my problem was though. The engine file operations only have file modes for "Open", "Create", and "CreateAlways". If the file mode is "Create" then confusingly (IMO) it actually does an Append operation:
Common/util/filestream.cpp:190-200
else if (open_mode == kFile_Create)
{
if (work_mode == kFile_Write)
{
mode.AppendChar('a');
}
else if (work_mode == kFile_Read || work_mode == kFile_ReadWrite)
{
mode.Append("a+");
}
}
I was treating this as "OpenOrCreate" which opens the file at the beginning. And apparently I never did actually check the Length of the stream (in my C# implementation), just the Position...
Edit: With one more minor correction (writing startOffset as a 64-bit long instead of 32-bit int), I can now confirm that my C# conversion of "make_data_file" is fully functional. Now I'll start working on actually splitting the game data out from the EXE during the build process, and appending them back together afterwards.
