diff --git a/colorchord2/cnfa b/colorchord2/cnfa index 8fed9b6..f34087c 160000 --- a/colorchord2/cnfa +++ b/colorchord2/cnfa @@ -1 +1 @@ -Subproject commit 8fed9b680a217afabd0d9ce4b459499d370a0719 +Subproject commit f34087cf216cfa8a885fde616659fef3e862c048 diff --git a/colorchord2/configs.c b/colorchord2/configs.c index dadb57f..419e6b7 100644 --- a/colorchord2/configs.c +++ b/colorchord2/configs.c @@ -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