Make card images show up

This commit is contained in:
drdev
2014-03-08 05:43:39 +00:00
parent 4b61238c20
commit c1e24d6043
2 changed files with 4 additions and 13 deletions

View File

@@ -62,9 +62,9 @@ public class ImageCache {
private static final LoadingCache<String, Texture> _CACHE = CacheBuilder.newBuilder().softValues().build(new ImageLoader()); private static final LoadingCache<String, Texture> _CACHE = CacheBuilder.newBuilder().softValues().build(new ImageLoader());
private static final Texture _defaultImage; private static final Texture _defaultImage;
static { static {
Texture defImage = new Texture(Gdx.files.internal(Constants.DEFAULT_DUELS_DIR)); Texture defImage = null;
try { try {
defImage = new Texture(Gdx.files.internal(Constants.DEFAULT_DUELS_DIR)); defImage = new Texture(Gdx.files.internal(Constants.NO_CARD_FILE));
} catch (Exception ex) { } catch (Exception ex) {
System.err.println("could not load default card image"); System.err.println("could not load default card image");
} finally { } finally {

View File

@@ -1,8 +1,7 @@
package forge.toolbox; package forge.toolbox;
import com.badlogic.gdx.graphics.Color;
import forge.Forge.Graphics; import forge.Forge.Graphics;
import forge.assets.ImageCache;
import forge.game.card.Card; import forge.game.card.Card;
public class FCardPanel extends FDisplayObject { public class FCardPanel extends FDisplayObject {
@@ -25,14 +24,6 @@ public class FCardPanel extends FDisplayObject {
w = h / ASPECT_RATIO; w = h / ASPECT_RATIO;
} }
if (card.isCreature()) { //TODO: Render actual card image g.drawImage(ImageCache.getImage(card), x, y, w, h);
g.fillRect(Color.BLUE, x, y, w, h);
}
else if (card.isLand()) {
g.fillRect(Color.GREEN, x, y, w, h);
}
else {
g.fillRect(Color.RED, x, y, w, h);
}
} }
} }