If I understand correctly, you're looking for a way to mass replace 'Module' with 'Module_Game' in https://github.com/kripken/emscripten/blob/master/tools/file_packager.py#L185 and everywhere below?
If so, it looks like it should be quite easy to make that an option like MODULE_NAME currently is, and e.g. route the used MODULE_NAME to file_packager.py calls. Let me know if that would solve your use case and I can work on a PR (or feel free to also do it if you'd like) 2017-02-16 12:55 GMT-08:00 Joe Bibbo <[email protected]>: > I think I need to re-frame my question, and explain my workflow. > > I need a way to supply a file system to a emscripten-built game that has > been located in a name space other than 'Module' > > I have tried it many different ways, and they always end up with the same > problem: the preamble from the file_packager.py ends up > negating my efforts to modularize the game. > > For example: > > I build the game using > <emccc> .... -s EXPORT_NAME=\"Module_Game\" ---preload > '/somelocalpath/gameassets@/' --o game.js > > this creates two files: > game.js - preamble FS + preamble > EMSCRIPTEN + game code > gameassets.data - data file for my FS. > > inside my html/JS page I will load the game > . > . > var Module_Game = {}; > . > . > _Module.memoryInitializerPrefixURL = "./" + name + "/"; // I > am locating the game code in a subfolder off this location of the root > document page. > $.getScript( "./" + name + "/game.js", function(v) > { > // do something > } > > > The PROBLEM when I tried to use some module name OTHER than 'Module' is > seen in the game.js file > " > var Module; > > if (typeof Module === 'undefined') Module = {}; // Since > I ( hosting web page ) didn't define 'Module' this bit of code will now > assign it {} > > < preamble code for the File system > > > var Module; > if (!Module) Module = (typeof Module_Game !== 'undefined' ? Module_Game : > null) || {}; > > // Since (!Module) is false because the above code, the > following will not be setting up the 'Module_Game' object. I am hosed! > > < preamble code for the Game > > > > I can hand edit this file and fix up the FS check on the 'Module' to fix > my problem, but it would seem that my needs are fairly mainstream and I am > hoping that I am just missing something. > > Thanks for your consideration. > > Regards, > Joe > > > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
