Not So Fast
In my previous blog I talked about the Android file system and APK package system. The end result was I copied all the project assets into the res/raw folder. However, I learned two additional things that changed my plan a little:
- Android files can only be lower-case.
- Any folders in the res/raw folder will not get copied...it just packs in the files in that directory, with no sub-directories!
That's a big problem if we want Leadwerks to be able to load files the same on each operating system,but I came up with a solution. In the asset copy step, took the asset files and gave them a random name like "jfuendjhgdjkhfndlrhgjfkd". I stored their original path and their new nonsensical path in a text file. When the engine starts, it reads this text file and sets the files up in a virtual file system, so calling Model::Load("Models/Characters/Goblin.mdl") will load the gobbly-gook file behind the scenes, and the user will never know the difference.
This is implemented and it works right now. I'm going to try to automate the final publishing step as much as possible to save everyone time.
I also learned how to change the name of the Android application so we can just auto-generate the Eclipse project for you based on the values you enter in the project creation wizard.
- 1
6 Comments
Recommended Comments