Updated VCMI, fixed crash due to SDL_Image not supporting PCX format
This commit is contained in:
@@ -306,19 +306,12 @@ class DataDownloader extends Thread
|
||||
}
|
||||
if( FileInAssets )
|
||||
{
|
||||
System.out.println("Unpacking from assets: '" + url + "'");
|
||||
try {
|
||||
System.out.println("Unpacking from assets: '" + url + "' 1");
|
||||
stream = new CountingInputStream(Parent.getAssets().open(url), 8192);
|
||||
System.out.println("Unpacking from assets: '" + url + "' 2");
|
||||
while( stream.skip(65536) > 0 ) { };
|
||||
System.out.println("Unpacking from assets: '" + url + "' 3");
|
||||
totalLen = stream.getBytesRead();
|
||||
System.out.println("Unpacking from assets: '" + url + "' 4 totalLen = " + String.valueOf(totalLen));
|
||||
stream.close();
|
||||
System.out.println("Unpacking from assets: '" + url + "' 5");
|
||||
stream = new CountingInputStream(Parent.getAssets().open(url), 8192);
|
||||
System.out.println("Unpacking from assets: '" + url + "' 6");
|
||||
} catch( IOException e ) {
|
||||
System.out.println("Unpacking from assets '" + url + "' - error: " + e.toString());
|
||||
Status.setText( res.getString(R.string.error_dl_from, url) );
|
||||
|
||||
@@ -508,12 +508,19 @@ public class MainActivity extends Activity {
|
||||
}
|
||||
if( entry.isDirectory() )
|
||||
{
|
||||
System.out.println("Warning '" + entry.getName() + "' is a directory");
|
||||
File outDir = new File( cacheDir.getAbsolutePath() + "/" + entry.getName() );
|
||||
if( !(outDir.exists() && outDir.isDirectory()) )
|
||||
outDir.mkdirs();
|
||||
continue;
|
||||
}
|
||||
|
||||
OutputStream out = null;
|
||||
String path = cacheDir.getAbsolutePath() + "/" + entry.getName();
|
||||
try {
|
||||
File outDir = new File( path.substring(0, path.lastIndexOf("/") ));
|
||||
if( !(outDir.exists() && outDir.isDirectory()) )
|
||||
outDir.mkdirs();
|
||||
} catch( SecurityException eeeee ) { };
|
||||
|
||||
System.out.println("Saving to file '" + path + "'");
|
||||
|
||||
@@ -589,12 +596,19 @@ public class MainActivity extends Activity {
|
||||
}
|
||||
if( entry.isDirectory() )
|
||||
{
|
||||
System.out.println("Warning '" + entry.getName() + "' is a directory");
|
||||
File outDir = new File( cacheDir.getAbsolutePath() + "/" + entry.getName() );
|
||||
if( !(outDir.exists() && outDir.isDirectory()) )
|
||||
outDir.mkdirs();
|
||||
continue;
|
||||
}
|
||||
|
||||
OutputStream out = null;
|
||||
String path = cacheDir.getAbsolutePath() + "/" + entry.getName();
|
||||
try {
|
||||
File outDir = new File( path.substring(0, path.lastIndexOf("/") ));
|
||||
if( !(outDir.exists() && outDir.isDirectory()) )
|
||||
outDir.mkdirs();
|
||||
} catch( SecurityException eeeeeee ) { };
|
||||
|
||||
try {
|
||||
CheckedInputStream check = new CheckedInputStream( new FileInputStream(path), new CRC32() );
|
||||
@@ -608,7 +622,7 @@ public class MainActivity extends Activity {
|
||||
}
|
||||
System.out.println("File '" + path + "' exists and passed CRC check - not overwriting it");
|
||||
continue;
|
||||
} catch( Exception e ) { }
|
||||
} catch( Exception eeeeee ) { }
|
||||
|
||||
System.out.println("Saving to file '" + path + "'");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user