Permalink
Browse files

Removed Context dependency from LevelLoader and using AssetManager an…

…d Resources directly.
  • Loading branch information...
1 parent 513f2fc commit 9b06d28df80c9167491ccfd8ed5caea5963d7417 Nicolas Gramlich committed Apr 19, 2012
Showing with 6 additions and 5 deletions.
  1. +6 −5 src/org/andengine/util/level/LevelLoader.java
@@ -16,7 +16,8 @@
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
-import android.content.Context;
+import android.content.res.AssetManager;
+import android.content.res.Resources;
/**
* (c) 2010 Nicolas Gramlich
@@ -102,12 +103,12 @@ public void registerEntityLoader(final String[] pEntityNames, final IEntityLoade
}
}
- public void loadLevelFromAsset(final Context pContext, final String pAssetPath) throws IOException {
- this.loadLevelFromStream(pContext.getAssets().open(this.mAssetBasePath + pAssetPath));
+ public void loadLevelFromAsset(final AssetManager pAssetManager, final String pAssetPath) throws IOException {
+ this.loadLevelFromStream(pAssetManager.open(this.mAssetBasePath + pAssetPath));
}
- public void loadLevelFromResource(final Context pContext, final int pRawResourceID) throws IOException {
- this.loadLevelFromStream(pContext.getResources().openRawResource(pRawResourceID));
+ public void loadLevelFromResource(final Resources pResources, final int pRawResourceID) throws IOException {
+ this.loadLevelFromStream(pResources.openRawResource(pRawResourceID));
}
public void loadLevelFromStream(final InputStream pInputStream) throws IOException {

0 comments on commit 9b06d28

Please sign in to comment.