"data" path

muruba

New member
CX Code Contributor
3rd Party Module Dev
Tutorial Author
Patreon Silver
Joined
Jul 5, 2017
Messages
230
Hi dear cx-mates,

I am wondering how to approach reading of the file from "data" folder in different targets?

Say I have a file path in CXS file:

Code:
MikmodPlay("data/beyond_the_network.it")

I really want to have it like this:

Code:
MikmodPlay("beyond_the_network.it")

If I add "data/" in the module, is it good enough?

I noticed GLFW/HTML5 should be fine wit this.

What about Android target? I noticed the "data" files are in /assets/cerberus folder in APK.

What is the right way to resolve path to "data" folder in different targets?

Sorry if this is too confusing...
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
3,167
If you prefix the data path, you will limit it to that. Look into the sound and image loading functions/methods of mojo and mojo2. That will show you how CX resolves the paths. I think, if i remember it correctly, they use some kind of resolvepath function. Sorry that i can't be more detailed as i only have my phone at hand.
 

muruba

New member
CX Code Contributor
3rd Party Module Dev
Tutorial Author
Patreon Silver
Joined
Jul 5, 2017
Messages
230
Thanks! It is using some crazy function FixDataPath

Now my path "beyond_the_network.it" becomes "cerberus://data/beyond_the_network.it"

Howerver my C function wouldn't know how to treat this crazy path it doesnt' work in GLFW or HTML5 for this matter...

Bummer.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
3,167
Sorry. Without my computer i can't help. I will let you know when i know more.
 
Top Bottom