Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: map ALLEGRO_TEMP_PATH to the application cache #1522

Merged
merged 1 commit into from
Feb 4, 2024

Conversation

alemart
Copy link
Contributor

@alemart alemart commented Dec 20, 2023

In Allegro 5.2.9 for Android, ALLEGRO_TEMP_PATH is a synonym of ALLEGRO_USER_DATA_PATH and of other paths (see the code snippet below). Currently, ALLEGRO_TEMP_PATH is mapped to the app-specific directory for persistent files located in internal storage - it relies on getFilesDir(). On Android, the app's cache directory is meant to be used for temporary storage instead (see docs).

This patch modifies ALLEGRO_TEMP_PATH so that it is mapped to the internal cache. No additional permissions are required.

case ALLEGRO_TEMP_PATH:
case ALLEGRO_USER_DATA_PATH:
case ALLEGRO_USER_HOME_PATH:
case ALLEGRO_USER_SETTINGS_PATH:
case ALLEGRO_USER_DOCUMENTS_PATH:
/* path to sdcard */
path = al_create_path_for_directory(al_cstr(system_data.data_dir));
break;

@SiegeLord
Copy link
Member

Makes sense, thanks!

@SiegeLord SiegeLord merged commit 02f0918 into liballeg:master Feb 4, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants