Introjucer: multiple files for Binary Resources?


#1

Hi,

I currently have for ~70MB source code in BinaryData.cpp (images, impulse responses, texts), which makes this file highly undigestible for the compiler (huge memory load, RAM full, system unresponsive, hangs, some system services even crash!).

In another project I have (removed some unused resources and) split the remaining ones by-hand into multiple files, and it compiles just fine (far from reaching the RAM limit) however I can’t do that and maintain the resources while still using the Introjucer for managing the project.

Could it be possible, in the Introjucer, to split the resources into multiple .cpp? I think either:

  • of a general BinaryData.h and multiple .cpp like BinaryData0.cpp, BinaryData1.cpp, BinaryData2.cpp, … (one for each resource, or a pool and round robinning between them) or
  • of specifying on the ressource raw, beside the “Add to Binary Resources” checkbox, a combobox for choosing the file index we would like…
  • maybe other options…

Do you have alternative ideas? Or a better implementations of this idea?

(And ideas are not all, we need implementations :wink: )

PS: or BinaryData_<IntroJucer_FILE_id>.cpp where “IntroJucer_FILE_id” is the id of the file we can find in the .jucer xml file.


#2

The Introjucer has done exactly that for a while now, it splits the BinaryData.cpp file into around 10MB files with a common header. Try grabbing the tip, building the latest version and re-saving your project.


#3

Ohoh! indeed! thanks a lot!

And the 10MB limit is easily hackable to something lower! (ResourceFile::writeCpp)

(this limit could even be an introjucer project config value, don’t you think?)


#4

Well, as I need to share the hack of the max BinaryData file size, attached is a working patch in order to serialize this value at the project level. This is only implemented for plug-in projects, but I think Jules knows better than me how to factorize what needs to be factorized.

[attachment=0]binarydata_maxfilesize.diff.txt[/attachment]


#5

Any chance to have it upstream in Juce? (I’m talking about the max binary file size configured in the project)


#6

Yes, when I get a moment…


#7

Ok, thanks, no pb.

It was just in case you did not want that into Juce I would have propagated that to our local branch.


#8

Maybe one last feature: “one binarydata cpp per resource”. I think it can easily be implemented by setting the max file size to 0 byte. But I don’t know if it’s so useful, though.