Re: [AD] Android port notes

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Sun Mar 25, 2012, Michał Cichoń wrote:
> I'm using prefixes like 'assets:' or 'res:' in the engine. Flag or
> prefix, both will work.
> 
> The question is: should all possibilities be exposed?
> 
> Let see, for Android we have:
> ALLEGRO_INTERNAL_DATA_PATH
> ALLEGRO_EXTERNAL_DATA_PATH
> ALLEGRO_EXTRA_EXTERNAL_DATA_PATH (optional)
> ALLEGRO_ASSETS_PATH
> ALLEGRO_RES_PATH
> Those flags can be stored in Android specific header.
> 
> Some of flags listed in system.h may be mapped using
> ALLEGRO_INTERNAL_DATA_PATH, but not all.
> So, without doing additional assumptions, just map what can be mapped
> and tell rest should be handled by
> platform specific code. What do you think?

I dunno. I want to avoid adding too much platform specific stuff, let games be 
more easily ported. Also, ALLEGRO_RESOURCES_PATH maps directly to the apk 
resources the best. And USER_DATA seems to fit the best with internal data. 
Only wondering about where we can provide the user with the external data.

And when I say "resources" I really mean the data thats stored with the native 
assets dir, but the raw assets, not the compiled stuff. But the resources path 
can point to the root of the assets and people can load what ever files they 
want from there, either regular assets or raw assets.

> How path API should behave?

same as unix?

> How ALLEGRO_EXENAME_PATH is relevant to Android?

It isn't really. Right now it should give the path of the APK. But how useful 
that is, I dunno. Other than people wanting to say read it using their own zip 
file reading? I dunno.
 
> On 25 March 2012 21:25, Thomas Fjellstrom <tfjellstrom@xxxxxxxxxx> 
wrote:
> > Ok, been thinking about how to handle the various storage options on
> > Android.
> > 
> > There's three separate locations for data that we need to cover, and only
> > really two standard path enum values. The following is my current plan:
> > 
> > ALLEGRO_RESOURCES_PATH = apk packed resources[1]
> > ALLEGRO_USER_DATA_PATH  = internal phone per-app flash storage
> > ALLEGRO_????_DATA_PATH   = external SD storage
> > 
> > I'm not sure if we should add a new enum value, or have an android
> > specific function to get the latter? It's a fairly android specific
> > thing.
> > 
> > What does everyone think?
> > 
> > 
> > 1. My current plan involves using an android specific fshook driver
> > that'll check for some special prefix to let you load packed resources,
> > and fall back to stdio for regular paths. either a res:/ type uri
> > prefix, or /res prefix or even the full path to the APK, followed by
> > data/ or something. I prefer one of the first two, probably /res is my
> > first pick. Either way,
> > ALLEGRO_RESOURCES_PATH will be that prefix.


-- 
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/