v0.7.4b: Initial LibGDX commit! more details below:
Large sections of game logic are now working through libgdx instead of android libraries. There is still work to do but this is the first major step. Big changes include: - Graphics code is now through LibGDX (except for text rendering) - Initialization and screen-handling logic is now mostly through LibGDX - Audio is now through LibGDX - Input handling is now through LibGDX - Most misc functions are now through LibGDX
This commit is contained in:
@@ -21,8 +21,7 @@
|
||||
|
||||
package com.watabou.gltextures;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
|
||||
import com.badlogic.gdx.graphics.Pixmap;
|
||||
import com.watabou.glwrap.Texture;
|
||||
import com.watabou.utils.RectF;
|
||||
|
||||
@@ -37,22 +36,22 @@ public class SmartTexture extends Texture {
|
||||
public int wModeH;
|
||||
public int wModeV;
|
||||
|
||||
public Bitmap bitmap;
|
||||
public Pixmap bitmap;
|
||||
|
||||
public Atlas atlas;
|
||||
|
||||
protected SmartTexture( ) {
|
||||
//useful for subclasses which want to manage their own texture data
|
||||
// in cases where android.graphics.bitmap isn't fast enough.
|
||||
// in cases where pixmaps isn't fast enough.
|
||||
|
||||
//subclasses which use this MUST also override some mix of reload/generate/bind
|
||||
}
|
||||
|
||||
public SmartTexture( Bitmap bitmap ) {
|
||||
public SmartTexture( Pixmap bitmap ) {
|
||||
this( bitmap, NEAREST, CLAMP, false );
|
||||
}
|
||||
|
||||
public SmartTexture( Bitmap bitmap, int filtering, int wrapping, boolean premultiplied ) {
|
||||
public SmartTexture( Pixmap bitmap, int filtering, int wrapping, boolean premultiplied ) {
|
||||
|
||||
this.bitmap = bitmap;
|
||||
width = bitmap.getWidth();
|
||||
@@ -66,7 +65,7 @@ public class SmartTexture extends Texture {
|
||||
@Override
|
||||
protected void generate() {
|
||||
super.generate();
|
||||
bitmap( bitmap, premultiplied );
|
||||
bitmap( bitmap );
|
||||
filter( fModeMin, fModeMax );
|
||||
wrap( wModeH, wModeV );
|
||||
}
|
||||
@@ -88,16 +87,8 @@ public class SmartTexture extends Texture {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bitmap( Bitmap bitmap ) {
|
||||
bitmap( bitmap, false );
|
||||
}
|
||||
|
||||
public void bitmap( Bitmap bitmap, boolean premultiplied ) {
|
||||
if (premultiplied) {
|
||||
super.bitmap( bitmap );
|
||||
} else {
|
||||
handMade( bitmap, true );
|
||||
}
|
||||
public void bitmap( Pixmap bitmap ) {
|
||||
super.bitmap( bitmap );
|
||||
|
||||
this.bitmap = bitmap;
|
||||
width = bitmap.getWidth();
|
||||
@@ -119,7 +110,7 @@ public class SmartTexture extends Texture {
|
||||
super.delete();
|
||||
|
||||
if (bitmap != null)
|
||||
bitmap.recycle();
|
||||
bitmap.dispose();
|
||||
bitmap = null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user