Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[intern] using slick (236) and lzma(1.2) from maven repos

  • Loading branch information...
commit d69bbb2bc666d8459d3bc5c19e111cf56c392054 1 parent 5363fb1
@ahoehma ahoehma authored Cervator committed
View
7 build.gradle
@@ -50,6 +50,9 @@ ext {
repositories {
mavenCentral()
+ maven {
+ url "http://slick2d-maven-dependencies.googlecode.com/svn/trunk/repository/"
+ }
}
/* Natives ----------------------------------------------------------------- */
@@ -119,6 +122,10 @@ dependencies {
compile group: 'io.netty', name: 'netty', version: '3.5.11.Final'
compile group: 'org.reflections', name: 'reflections', version: '0.9.8'
compile group: 'java3d', name: 'vecmath', version: '1.3.1'
+ compile group: 'com.github.jponge', name: 'lzma-java', version: '1.2'
+ compile(group: 'org.newdawn.slick', name: 'slick', version: '236') {
+ transitive = false
+ }
// Would have liked to have left this runtime, but needed to "compile" the groovy config in IntelliJ
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.0.9'
compile fileTree(dir: 'libs', include: '*.jar')
View
BIN  libs/lzma.jar
Binary file not shown
View
BIN  libs/slick.jar
Binary file not shown
View
2  src/main/java/org/terasology/rendering/assetLoaders/PNGTextureLoader.java
@@ -70,7 +70,7 @@ public Texture load(AssetUri uri, InputStream stream, List<URL> urls) throws IOE
PNGDecoder decoder = new PNGDecoder(pngStream);
ByteBuffer buf = ByteBuffer.allocateDirect(4 * decoder.getWidth() * decoder.getHeight());
- decoder.decode(buf, decoder.getWidth() * 4, PNGDecoder.RGBA);
+ decoder.decode(buf, decoder.getWidth() * 4, PNGDecoder.Format.RGBA);
buf.flip();
ByteBuffer data = buf;
View
39 src/main/java/org/terasology/world/block/loader/BlockLoader.java
@@ -91,12 +91,12 @@
public BlockLoader() {
parser = new JsonParser();
gson = new GsonBuilder()
- .registerTypeAdapterFactory(new CaseInsensitiveEnumTypeAdapterFactory())
- .registerTypeAdapter(BlockDefinition.Tiles.class, new BlockTilesDefinitionHandler())
- .registerTypeAdapter(BlockDefinition.ColorSources.class, new BlockColorSourceDefinitionHandler())
- .registerTypeAdapter(BlockDefinition.ColorOffsets.class, new BlockColorOffsetDefinitionHandler())
- .registerTypeAdapter(Vector4f.class, new Vector4fHandler())
- .create();
+ .registerTypeAdapterFactory(new CaseInsensitiveEnumTypeAdapterFactory())
+ .registerTypeAdapter(BlockDefinition.Tiles.class, new BlockTilesDefinitionHandler())
+ .registerTypeAdapter(BlockDefinition.ColorSources.class, new BlockColorSourceDefinitionHandler())
+ .registerTypeAdapter(BlockDefinition.ColorOffsets.class, new BlockColorOffsetDefinitionHandler())
+ .registerTypeAdapter(Vector4f.class, new Vector4fHandler())
+ .create();
cubeShape = (BlockShape) Assets.get(new AssetUri(AssetType.SHAPE, "engine:cube"));
loweredShape = (BlockShape) Assets.get(new AssetUri(AssetType.SHAPE, "engine:loweredCube"));
trimmedLoweredShape = (BlockShape) Assets.get(new AssetUri(AssetType.SHAPE, "engine:trimmedLoweredCube"));
@@ -139,18 +139,18 @@ public LoadBlockDefinitionResults loadBlockDefinitions() {
if (blockDef.shapes.isEmpty()) {
switch (blockDef.rotation) {
- case ALIGNTOSURFACE:
- result.families.add(processAlignToSurfaceFamily(blockDefUri, blockDefJson));
- break;
- case HORIZONTAL:
- result.families.add(processHorizontalBlockFamily(blockDefUri, blockDef));
- break;
- case CONNECTTOADJACENT:
- result.families.add(processConnectToAdjacentFamily(blockDefUri, blockDefJson));
- break;
- default:
- result.families.add(processSingleBlockFamily(blockDefUri, blockDef));
- break;
+ case ALIGNTOSURFACE:
+ result.families.add(processAlignToSurfaceFamily(blockDefUri, blockDefJson));
+ break;
+ case HORIZONTAL:
+ result.families.add(processHorizontalBlockFamily(blockDefUri, blockDef));
+ break;
+ case CONNECTTOADJACENT:
+ result.families.add(processConnectToAdjacentFamily(blockDefUri, blockDefJson));
+ break;
+ default:
+ result.families.add(processSingleBlockFamily(blockDefUri, blockDef));
+ break;
}
} else {
result.families.addAll(processMultiBlockFamily(blockDefUri, blockDef));
@@ -219,7 +219,7 @@ public void buildAtlas() {
ImageIO.write(image, "png", bos);
PNGDecoder decoder = new PNGDecoder(new ByteArrayInputStream(bos.toByteArray()));
ByteBuffer buf = ByteBuffer.allocateDirect(4 * decoder.getWidth() * decoder.getHeight());
- decoder.decode(buf, decoder.getWidth() * 4, PNGDecoder.RGBA);
+ decoder.decode(buf, decoder.getWidth() * 4, PNGDecoder.Format.RGBA);
buf.flip();
data[i] = buf;
} catch (IOException e) {
@@ -773,6 +773,7 @@ private String properCase(String s) {
}
public static class CaseInsensitiveEnumTypeAdapterFactory implements TypeAdapterFactory {
+ @Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
Class<T> rawType = (Class<T>) type.getRawType();
if (!rawType.isEnum()) {
Please sign in to comment.
Something went wrong with that request. Please try again.