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. 24
      src/mightypork/gamecore/resources/audio/DeferredAudio.java
  12. 3
      src/mightypork/gamecore/util/files/InstanceLock.java

3
.gitignore vendored

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

@ -5,8 +5,6 @@ Goals
----- -----
- Simple retro-themed dungeon crawler - Simple retro-themed dungeon crawler
- (Multiplayer support) <- maybe
- Threads for resource loading and event handling
Features Features
@ -15,17 +13,19 @@ Features
- Full OOP design - Full OOP design
- Event driven - Event driven
- OpenGL 2D rendering - 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 Gameplay
-------------- --------------
- Random floors - Real-time action
- Turn-based - Monsters with AI
- Monsters with AI (-> combat system) - Collectable items (weapons, food)
- Collectable items, armor upgrades etc. - Random floor generator
- Health, Hunger, Level
Used libraries 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.lwjgl.opengl.GL11;
import org.newdawn.slick.opengl.Texture; import org.newdawn.slick.opengl.Texture;
import org.newdawn.slick.opengl.TextureLoader; 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 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) { if (texture == null) {
Log.w("Texture " + resourcePath + " could not be loaded."); Log.w("Texture " + resourcePath + " could not be loaded.");

@ -2,6 +2,7 @@ package mightypork.gamecore.resources.audio;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream;
import mightypork.gamecore.logging.LogAlias; import mightypork.gamecore.logging.LogAlias;
import mightypork.gamecore.resources.loading.DeferredResource; import mightypork.gamecore.resources.loading.DeferredResource;
@ -91,20 +92,23 @@ public class DeferredAudio extends DeferredResource {
{ {
final String ext = FileUtils.getExtension(resource); final String ext = FileUtils.getExtension(resource);
if (ext.equalsIgnoreCase("ogg")) { try(final InputStream stream = FileUtils.getResource(resource)) {
backingAudio = SoundStore.get().getOgg(resource);
} else if (ext.equalsIgnoreCase("wav")) { if (ext.equalsIgnoreCase("ogg")) {
backingAudio = SoundStore.get().getWAV(resource); backingAudio = SoundStore.get().getOgg(resource, stream);
} else if (ext.equalsIgnoreCase("aif")) { } else if (ext.equalsIgnoreCase("wav")) {
backingAudio = SoundStore.get().getAIF(resource); backingAudio = SoundStore.get().getWAV(resource, stream);
} else if (ext.equalsIgnoreCase("mod")) { } else if (ext.equalsIgnoreCase("aif")) {
backingAudio = SoundStore.get().getMOD(resource); backingAudio = SoundStore.get().getAIF(resource, stream);
} else { } else if (ext.equalsIgnoreCase("mod")) {
throw new RuntimeException("Invalid audio file extension."); 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) public static boolean onFile(final File lockFile)
{ {
try { try {
lockFile.getParentFile().mkdirs();
final RandomAccessFile randomAccessFile = new RandomAccessFile(lockFile, "rw"); final RandomAccessFile randomAccessFile = new RandomAccessFile(lockFile, "rw");
final FileLock fileLock = randomAccessFile.getChannel().tryLock(); final FileLock fileLock = randomAccessFile.getChannel().tryLock();
@ -44,6 +45,8 @@ public class InstanceLock {
return false; return false;
} catch (final IOException e) { } catch (final IOException e) {
System.err.println("IO error while obtaining lock.");
e.printStackTrace();
return false; return false;
} }
} }

Loading…
Cancel
Save