Changeset 722
- Timestamp:
- Mar 4, 2011, 5:03:57 PM (10 years ago)
- Location:
- trunk/monsterz/android
- Files:
-
- 1 added
- 1 edited
- 26 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/monsterz/android/src/org/zoy/LolEngine/LolActivity.java
r720 r722 17 17 import android.content.Context; 18 18 import android.content.pm.ActivityInfo; 19 import android.content.res.AssetManager; /* getAssets() */ 19 20 import android.content.res.Resources; /* getResources() */ 20 21 import android.graphics.Bitmap; … … 70 71 public Bitmap openImage(String name) 71 72 { 72 BitmapFactory.Options opts = new BitmapFactory.Options(); 73 opts.inScaled = false; 74 /* Get rid of both the path and the extension */ 75 name = name.replaceAll("(^.*/|[.][^.]*$)", ""); 76 int id = getResources().getIdentifier(name, "raw", "org.zoy.LolEngine"); 77 return BitmapFactory.decodeResource(getResources(), id, opts); 73 /* Get rid of the path for now */ 74 name = name.replaceAll("^.*/", ""); 75 try 76 { 77 return BitmapFactory.decodeStream(getAssets().open(name)); 78 } 79 catch (Exception e) { } 80 return null; 78 81 } 79 82
Note: See TracChangeset
for help on using the changeset viewer.