Build harness for eclipse & make

This commit is contained in:
Ondřej Hruška
2014-05-13 00:54:58 +02:00
parent 06c7303988
commit c09c2eb248
12 changed files with 83 additions and 23 deletions
+1 -2
View File
@@ -20,7 +20,6 @@ import mightypork.gamecore.util.math.constraints.vect.VectConst;
import org.lwjgl.opengl.GL11;
import org.newdawn.slick.opengl.Texture;
import org.newdawn.slick.opengl.TextureLoader;
import org.newdawn.slick.util.ResourceLoader;
/**
@@ -308,7 +307,7 @@ public class Render {
final String ext = FileUtils.getExtension(resourcePath).toUpperCase();
final Texture texture = TextureLoader.getTexture(ext, ResourceLoader.getResourceAsStream(resourcePath), false, filtering.num);
final Texture texture = TextureLoader.getTexture(ext, FileUtils.getResource(resourcePath), false, filtering.num);
if (texture == null) {
Log.w("Texture " + resourcePath + " could not be loaded.");
@@ -2,6 +2,7 @@ package mightypork.gamecore.resources.audio;
import java.io.IOException;
import java.io.InputStream;
import mightypork.gamecore.logging.LogAlias;
import mightypork.gamecore.resources.loading.DeferredResource;
@@ -91,20 +92,23 @@ public class DeferredAudio extends DeferredResource {
{
final String ext = FileUtils.getExtension(resource);
if (ext.equalsIgnoreCase("ogg")) {
backingAudio = SoundStore.get().getOgg(resource);
try(final InputStream stream = FileUtils.getResource(resource)) {
} else if (ext.equalsIgnoreCase("wav")) {
backingAudio = SoundStore.get().getWAV(resource);
} else if (ext.equalsIgnoreCase("aif")) {
backingAudio = SoundStore.get().getAIF(resource);
} else if (ext.equalsIgnoreCase("mod")) {
backingAudio = SoundStore.get().getMOD(resource);
} else {
throw new RuntimeException("Invalid audio file extension.");
if (ext.equalsIgnoreCase("ogg")) {
backingAudio = SoundStore.get().getOgg(resource, stream);
} else if (ext.equalsIgnoreCase("wav")) {
backingAudio = SoundStore.get().getWAV(resource, stream);
} else if (ext.equalsIgnoreCase("aif")) {
backingAudio = SoundStore.get().getAIF(resource, stream);
} else if (ext.equalsIgnoreCase("mod")) {
backingAudio = SoundStore.get().getMOD(resource, stream);
} else {
throw new RuntimeException("Invalid audio file extension.");
}
}
}
@@ -18,6 +18,7 @@ public class InstanceLock {
public static boolean onFile(final File lockFile)
{
try {
lockFile.getParentFile().mkdirs();
final RandomAccessFile randomAccessFile = new RandomAccessFile(lockFile, "rw");
final FileLock fileLock = randomAccessFile.getChannel().tryLock();
@@ -44,6 +45,8 @@ public class InstanceLock {
return false;
} catch (final IOException e) {
System.err.println("IO error while obtaining lock.");
e.printStackTrace();
return false;
}
}