Switch search paths + update CNFA

This commit is contained in:
cnlohr 2020-05-18 15:29:35 -07:00
parent 911f60ae56
commit 9d11a76f69
2 changed files with 14 additions and 8 deletions

@ -1 +1 @@
Subproject commit 8fed9b680a217afabd0d9ce4b459499d370a0719
Subproject commit f34087cf216cfa8a885fde616659fef3e862c048

View file

@ -48,16 +48,19 @@ void LoadFile( const char * filename )
void SetEnvValues( int force )
{
int i;
static int ifcheck;
int hits = 0;
for( i = 0; i < InitialFileCount; i++ )
if( InitialFileCount )
{
double ft = OGGetFileTime( InitialFile[i] );
if( FileTimes[i] != ft )
//Only check one location per frame.
double ft = OGGetFileTime( InitialFile[ifcheck] );
if( FileTimes[ifcheck] != ft )
{
FileTimes[i] = ft;
FileTimes[ifcheck] = ft;
hits++;
}
ifcheck = ( ifcheck + 1 ) % InitialFileCount;
}
if( !hits && !force ) return;
@ -109,6 +112,7 @@ void SetEnvValues( int force )
printf( "On Android, looking for configuration file in: %s\n", InitialFile[0] );
#endif
int i;
for( i = 0; i < InitialFileCount; i++ )
{
LoadFile( InitialFile[i] );
@ -151,8 +155,10 @@ void SetupConfigs()
{
#ifdef ANDROID
InitialFile[0] = "/sdcard/colorchord-android.txt";
InitialFile[1] = "/sdcard/colorchord-android-overlay.txt";
InitialFileCount = 2;
InitialFile[1] = "/storage/emulated/0/colorchord-android.txt";
InitialFile[2] = "/sdcard/colorchord-android-overlay.txt";
InitialFile[3] = "/storage/emulated/0/colorchord-android-overlay.txt";
InitialFileCount = 4;
#else
InitialFile[0] = "default.conf";
#endif