Merge branch 'sdl_android' of github.com:pelya/commandergenius into android

This commit is contained in:
pelya
2012-10-29 16:51:46 +02:00
12 changed files with 76 additions and 31 deletions

View File

@@ -771,24 +771,32 @@ public class MainActivity extends Activity
// ----- VCMI hack -----
try {
//System.out.println("libSDL: Extracting VCMI server");
//System.out.println("libSDL: Extracting binaries");
InputStream in = null;
try
{
for( int i = 0; ; i++ )
{
InputStream in2 = getAssets().open("vcmiserver" + String.valueOf(i));
InputStream in2 = getAssets().open("binaries.zip" + String.format("%02d", i));
if( in == null )
in = in2;
else
in = new SequenceInputStream( in, in2 );
}
}
catch( IOException ee ) { }
catch( IOException ee )
{
try
{
if( in == null )
in = getAssets().open("binaries.zip");
}
catch( IOException eee ) {}
}
if( in == null )
throw new RuntimeException("libSDL: Extracting VCMI server failed, the .apk file packaged incorrectly");
throw new RuntimeException("libSDL: Extracting binaries failed, the .apk file packaged incorrectly");
ZipInputStream zip = new ZipInputStream(in);
@@ -808,7 +816,7 @@ public class MainActivity extends Activity
*/
if( entry == null )
{
System.out.println("Extracting libs finished");
System.out.println("Extracting binaries finished");
break;
}
if( entry.isDirectory() )