Build harness for eclipse & make

v5stable
Ondřej Hruška 11 years ago
parent 06c7303988
commit c09c2eb248
  1. 3
      .gitignore
  2. 16
      README.md
  3. 32
      build/Makefile
  4. 17
      build/export.jardesc
  5. 0
      build/in/.gitkeep
  6. 0
      build/out/.gitkeep
  7. BIN
      build/stub.jar
  8. 2
      build/~fatjar/fatjar.sh
  9. BIN
      build/~fatjar/jarsplice-0.40.jar
  10. 3
      src/mightypork/gamecore/render/Render.java
  11. 30
      src/mightypork/gamecore/resources/audio/DeferredAudio.java
  12. 3
      src/mightypork/gamecore/util/files/InstanceLock.java

3
.gitignore vendored

@ -1,5 +1,8 @@
/bin/
/target/
/.rogue-save/
/build/.rogue-save/
/build/out/*.jar
/build/in/*.jar
*.log
.attach_pid*

@ -5,8 +5,6 @@ Goals
-----
- Simple retro-themed dungeon crawler
- (Multiplayer support) <- maybe
- Threads for resource loading and event handling
Features
@ -15,17 +13,19 @@ Features
- Full OOP design
- Event driven
- OpenGL 2D rendering
- Screen / layer based graphics with Constraint System.
- Screen / layer based graphics with Constraint System
- A* path-finding system
- Audio, Font & Texture systems
- Easily extensible base framework
Gameplay
--------------
- Random floors
- Turn-based
- Monsters with AI (-> combat system)
- Collectable items, armor upgrades etc.
- Health, Hunger, Level
- Real-time action
- Monsters with AI
- Collectable items (weapons, food)
- Random floor generator
Used libraries

@ -0,0 +1,32 @@
STUB = ./stub.jar
IN_DIR = ./in
IN = $(IN_DIR)/build.jar
OUT_DIR = ./out
OUT = $(OUT_DIR)/release.jar
TMP_DIR = ./tmp
all:
# clean
mkdir -p $(TMP_DIR)
mkdir -p $(OUT_DIR)
# extract
unzip $(IN) -d $(TMP_DIR)
rm -rf $(TMP_DIR)/META-INF
unzip $(STUB) -d $(TMP_DIR)
# export
(cd $(TMP_DIR); zip -r9 ./pack.zip .)
mv -f $(TMP_DIR)/pack.zip $(OUT)
chmod +x $(OUT)
# clean
rm -rf $(TMP_DIR)
run:
java -jar $(OUT)

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jardesc>
<jar path="Rogue/build/in/build.jar"/>
<options buildIfNeeded="true" compress="false" descriptionLocation="/Rogue/build/export.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="true" overwrite="true" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/>
<storedRefactorings deprecationInfo="true" structuralOnly="false"/>
<selectedProjects/>
<manifest generateManifest="true" manifestLocation="" manifestVersion="1.0" reuseManifest="false" saveManifest="false" usesManifest="true">
<sealing sealJar="false">
<packagesToSeal/>
<packagesToUnSeal/>
</sealing>
</manifest>
<selectedElements exportClassFiles="true" exportJavaFiles="false" exportOutputFolder="false">
<javaElement handleIdentifier="=Rogue/src"/>
<folder path="/Rogue/res"/>
</selectedElements>
</jardesc>

Binary file not shown.

@ -0,0 +1,2 @@
#! /bin/bash
java -jar ./jarsplice-0.40.jar

Binary file not shown.

@ -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;
}
}

Loading…
Cancel
Save