Browse Source

fixed indentations

fysx 12 years ago
parent
commit
5849e8d369
2 changed files with 49 additions and 49 deletions
  1. 1 1
      AndroidManifest.xml
  2. 48 48
      src/org/love2d/android/GameLauncher.java

+ 1 - 1
AndroidManifest.xml

@@ -38,7 +38,7 @@
             <intent-filter>
                 <action android:name="android.intent.action.VIEW" />
                 <category android:name="android.intent.category.DEFAULT" />
-								<data android:scheme="file" />
+                <data android:scheme="file" />
                 <data android:mimeType="*/*" />
                 <data android:pathPattern=".*\\.love" />
                 <data android:host="*" />

+ 48 - 48
src/org/love2d/android/GameLauncher.java

@@ -17,11 +17,11 @@ public class GameLauncher extends GameActivity {
     protected void onCreate(Bundle bundle) {
         Uri game = this.getIntent().getData();
         if (game != null) {
-					if (game.getScheme().equals ("file")) {
-						gamePath = game.getPath();
-					} else {
-	          copyGameToCache (game);
-					}
+          if (game.getScheme().equals ("file")) {
+            gamePath = game.getPath();
+          } else {
+            copyGameToCache (game);
+          }
           Log.d("GameLauncher", "Selected the file: " + getGamePath());
         }
         super.onCreate(bundle);
@@ -30,57 +30,57 @@ public class GameLauncher extends GameActivity {
     public static String getGamePath() {
         return gamePath;
     }
-	
+  
     void copyGameToCache (Uri sourceuri)
     {
-    	String destinationFilename = this.getCacheDir().getPath()+"/downloaded.love";
-    	gamePath = destinationFilename;
+      String destinationFilename = this.getCacheDir().getPath()+"/downloaded.love";
+      gamePath = destinationFilename;
 
-    	BufferedOutputStream bos = null;
-    	try {
-    		bos = new BufferedOutputStream(new FileOutputStream(destinationFilename, false));
-    	} catch (IOException e) {
-    		Log.d ("GameLauncher", "Could not open destination file:" + e.getMessage());
-    	}
+      BufferedOutputStream bos = null;
+      try {
+        bos = new BufferedOutputStream(new FileOutputStream(destinationFilename, false));
+      } catch (IOException e) {
+        Log.d ("GameLauncher", "Could not open destination file:" + e.getMessage());
+      }
 
-    	int chunk_read = 0;
-    	int bytes_written = 0;
+      int chunk_read = 0;
+      int bytes_written = 0;
 
-    	BufferedInputStream bis = null;
-    	if (sourceuri.getScheme().equals("content")) {
-    		try {
-    			bis = new BufferedInputStream(getContentResolver().openInputStream(sourceuri));
-    		} catch (IOException e) {
-    			Log.d ("GameLauncher", "Could not open game file:" + e.getMessage());
-    		}
-    	} else {
-    		Log.d ("GameLauncher", "Unsupported scheme: " + sourceuri.getScheme());
-    	}
+      BufferedInputStream bis = null;
+      if (sourceuri.getScheme().equals("content")) {
+        try {
+          bis = new BufferedInputStream(getContentResolver().openInputStream(sourceuri));
+        } catch (IOException e) {
+          Log.d ("GameLauncher", "Could not open game file:" + e.getMessage());
+        }
+      } else {
+        Log.d ("GameLauncher", "Unsupported scheme: " + sourceuri.getScheme());
+      }
 
-    	if (bis != null) {
-    		// actual copying
-    		try {
-    			byte[] buf = new byte[1024];
-    			chunk_read = bis.read(buf);
-    			do {
-    				bos.write(buf, 0, chunk_read);
-    				bytes_written += chunk_read;
-    				chunk_read = bis.read(buf);				
-    			} while(chunk_read != -1);
-    		} catch (IOException e) {
-    			Log.d ("GameLauncher", "Copying failed:" + e.getMessage());
-    		} 
-    	}
+      if (bis != null) {
+        // actual copying
+        try {
+          byte[] buf = new byte[1024];
+          chunk_read = bis.read(buf);
+          do {
+            bos.write(buf, 0, chunk_read);
+            bytes_written += chunk_read;
+            chunk_read = bis.read(buf);        
+          } while(chunk_read != -1);
+        } catch (IOException e) {
+          Log.d ("GameLauncher", "Copying failed:" + e.getMessage());
+        } 
+      }
 
-    	// close streams
-    	try {
-    		if (bis != null) bis.close();
-    		if (bos != null) bos.close();
-    	} catch (IOException e) {
-    		Log.d ("GameLauncher", "Copying failed: " + e.getMessage());
-    	}
+      // close streams
+      try {
+        if (bis != null) bis.close();
+        if (bos != null) bos.close();
+      } catch (IOException e) {
+        Log.d ("GameLauncher", "Copying failed: " + e.getMessage());
+      }
 
-    	Log.d("GameLauncher", "Copied " + bytes_written + " bytes");
+      Log.d("GameLauncher", "Copied " + bytes_written + " bytes");
     }
 
 }