refactor: hide backend Adapter handles
- static methods for backend adapters
This commit is contained in:
@@ -48,7 +48,7 @@ public abstract class SpriteManager<T> {
|
||||
|
||||
Sprite items;
|
||||
|
||||
protected final Canvas mCanvas = CanvasAdapter.g.getCanvas();
|
||||
protected final Canvas mCanvas = CanvasAdapter.newCanvas();
|
||||
protected TextureItem mTexture;
|
||||
|
||||
public SpriteManager() {
|
||||
|
||||
@@ -18,7 +18,7 @@ public class ThemeTest {
|
||||
|
||||
public static void main(String[] args) {
|
||||
AwtGraphics.init();
|
||||
AssetAdapter.g = new AssetAdapter() {
|
||||
AssetAdapter.init(new AssetAdapter() {
|
||||
@Override
|
||||
public InputStream openFileAsStream(String name) {
|
||||
try {
|
||||
@@ -29,7 +29,7 @@ public class ThemeTest {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
IRenderTheme t = ThemeLoader.load(VtmThemes.DEFAULT);
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public class SymbolRenderLayer extends ElementRenderer {
|
||||
it.billboard = false;
|
||||
|
||||
try {
|
||||
it.bitmap = CanvasAdapter.g.loadBitmapAsset("jar:symbols/cafe.png");
|
||||
it.bitmap = CanvasAdapter.getBitmapAsset("jar:symbols/cafe.png");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user