parent
50cbc9479b
commit
a4108f2caf
@ -1,14 +1,14 @@ |
||||
package mightypork.gamecore.resources.audio; |
||||
package mightypork.gamecore.audio; |
||||
|
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
import mightypork.gamecore.backend.BackendModule; |
||||
import mightypork.gamecore.audio.players.EffectPlayer; |
||||
import mightypork.gamecore.audio.players.LoopPlayer; |
||||
import mightypork.gamecore.core.App; |
||||
import mightypork.gamecore.resources.ResourceLoadRequest; |
||||
import mightypork.gamecore.resources.audio.players.EffectPlayer; |
||||
import mightypork.gamecore.resources.audio.players.LoopPlayer; |
||||
import mightypork.gamecore.core.BackendModule; |
||||
import mightypork.gamecore.resources.loading.ResourceLoadRequest; |
||||
import mightypork.utils.interfaces.Updateable; |
||||
import mightypork.utils.math.constraints.vect.Vect; |
||||
|
@ -1,4 +1,4 @@ |
||||
package mightypork.gamecore.resources.audio; |
||||
package mightypork.gamecore.audio; |
||||
|
||||
|
||||
import mightypork.gamecore.core.App; |
@ -1,4 +1,4 @@ |
||||
package mightypork.gamecore.resources.audio; |
||||
package mightypork.gamecore.audio; |
||||
|
||||
|
||||
import mightypork.utils.interfaces.Destroyable; |
@ -1,4 +1,4 @@ |
||||
package mightypork.gamecore.resources.audio; |
||||
package mightypork.gamecore.audio; |
||||
|
||||
|
||||
import mightypork.utils.math.Calc; |
@ -1,12 +1,12 @@ |
||||
package mightypork.gamecore.resources.audio; |
||||
package mightypork.gamecore.audio; |
||||
|
||||
|
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
import mightypork.gamecore.audio.players.EffectPlayer; |
||||
import mightypork.gamecore.audio.players.LoopPlayer; |
||||
import mightypork.gamecore.core.App; |
||||
import mightypork.gamecore.resources.audio.players.EffectPlayer; |
||||
import mightypork.gamecore.resources.audio.players.LoopPlayer; |
||||
|
||||
|
||||
/** |
@ -1,4 +1,4 @@ |
||||
package mightypork.gamecore.resources.audio; |
||||
package mightypork.gamecore.audio; |
||||
|
||||
|
||||
import mightypork.utils.math.Calc; |
@ -1,8 +1,8 @@ |
||||
package mightypork.gamecore.resources.audio.players; |
||||
package mightypork.gamecore.audio.players; |
||||
|
||||
|
||||
import mightypork.gamecore.resources.audio.DeferredAudio; |
||||
import mightypork.gamecore.resources.audio.Volume; |
||||
import mightypork.gamecore.audio.DeferredAudio; |
||||
import mightypork.gamecore.audio.Volume; |
||||
import mightypork.utils.interfaces.Destroyable; |
||||
|
||||
|
@ -1,8 +1,8 @@ |
||||
package mightypork.gamecore.resources.audio.players; |
||||
package mightypork.gamecore.audio.players; |
||||
|
||||
|
||||
import mightypork.gamecore.resources.audio.DeferredAudio; |
||||
import mightypork.gamecore.resources.audio.Volume; |
||||
import mightypork.gamecore.audio.DeferredAudio; |
||||
import mightypork.gamecore.audio.Volume; |
||||
import mightypork.utils.math.constraints.vect.Vect; |
||||
|
||||
|
@ -1,8 +1,8 @@ |
||||
package mightypork.gamecore.resources.audio.players; |
||||
package mightypork.gamecore.audio.players; |
||||
|
||||
|
||||
import mightypork.gamecore.resources.audio.DeferredAudio; |
||||
import mightypork.gamecore.resources.audio.Volume; |
||||
import mightypork.gamecore.audio.DeferredAudio; |
||||
import mightypork.gamecore.audio.Volume; |
||||
import mightypork.utils.interfaces.Pauseable; |
||||
import mightypork.utils.interfaces.Updateable; |
||||
import mightypork.utils.math.animation.NumAnimated; |
@ -1,4 +1,4 @@ |
||||
package mightypork.gamecore.util; |
||||
package mightypork.gamecore.backends.lwjgl; |
||||
|
||||
|
||||
import java.nio.FloatBuffer; |
@ -1,10 +1,10 @@ |
||||
package mightypork.gamecore.backend.lwjgl; |
||||
package mightypork.gamecore.backends.lwjgl.audio; |
||||
|
||||
|
||||
import java.io.IOException; |
||||
import java.io.InputStream; |
||||
|
||||
import mightypork.gamecore.resources.audio.DeferredAudio; |
||||
import mightypork.gamecore.audio.DeferredAudio; |
||||
import mightypork.utils.files.FileUtil; |
||||
|
||||
import org.lwjgl.openal.AL10; |
@ -1,11 +1,11 @@ |
||||
package mightypork.gamecore.backend.lwjgl; |
||||
package mightypork.gamecore.backends.lwjgl.audio; |
||||
|
||||
|
||||
import java.nio.FloatBuffer; |
||||
|
||||
import mightypork.gamecore.resources.audio.AudioModule; |
||||
import mightypork.gamecore.resources.audio.DeferredAudio; |
||||
import mightypork.gamecore.util.BufferHelper; |
||||
import mightypork.gamecore.audio.AudioModule; |
||||
import mightypork.gamecore.audio.DeferredAudio; |
||||
import mightypork.gamecore.backends.lwjgl.BufferHelper; |
||||
import mightypork.utils.logging.Log; |
||||
import mightypork.utils.math.constraints.vect.Vect; |
||||
import mightypork.utils.math.constraints.vect.var.VectVar; |
@ -1,10 +1,10 @@ |
||||
package mightypork.gamecore.backend.lwjgl; |
||||
package mightypork.gamecore.backends.lwjgl.graphics; |
||||
|
||||
|
||||
import java.io.IOException; |
||||
|
||||
import mightypork.gamecore.resources.MustLoadInRenderingContext; |
||||
import mightypork.gamecore.resources.textures.DeferredTexture; |
||||
import mightypork.gamecore.graphics.textures.DeferredTexture; |
||||
import mightypork.gamecore.resources.loading.MustLoadInRenderingContext; |
||||
import mightypork.utils.annotations.Alias; |
||||
import mightypork.utils.exceptions.IllegalValueException; |
||||
import mightypork.utils.files.FileUtil; |
@ -0,0 +1,37 @@ |
||||
package mightypork.gamecore.backends.lwjgl.graphics.font; |
||||
|
||||
|
||||
import java.awt.Font; |
||||
import java.io.IOException; |
||||
|
||||
import mightypork.gamecore.graphics.textures.FilterMode; |
||||
import mightypork.utils.annotations.Alias; |
||||
|
||||
|
||||
/** |
||||
* Font obtained from the OS |
||||
* |
||||
* @author Ondřej Hruška (MightyPork) |
||||
*/ |
||||
@Alias(name = "FontNative") |
||||
public class DeferredLwjglFontFromSystem extends DeferredLwjglFont { |
||||
|
||||
/** |
||||
* A font from OS, found by name |
||||
* |
||||
* @param fontName font family name |
||||
* @param chars chars to load; null to load basic chars only |
||||
* @param size size (pt) |
||||
*/ |
||||
public DeferredLwjglFontFromSystem(String fontName, String chars, double size) { |
||||
super(fontName, chars, size); |
||||
} |
||||
|
||||
|
||||
@Override |
||||
protected Font getAwtFont(String resource, float size, int style) throws IOException |
||||
{ |
||||
return new Font(resource, style, (int) size); |
||||
} |
||||
|
||||
} |
@ -1,4 +1,4 @@ |
||||
package mightypork.gamecore.backend; |
||||
package mightypork.gamecore.core; |
||||
|
||||
|
||||
import mightypork.utils.annotations.Stub; |
@ -0,0 +1,19 @@ |
||||
package mightypork.gamecore.core; |
||||
|
||||
|
||||
import java.lang.annotation.*; |
||||
|
||||
|
||||
/** |
||||
* Indicates that an {@link InitTask} can safely be ignored if it's dependencies |
||||
* are not satisfied. |
||||
* |
||||
* @author Ondřej Hruška (MightyPork) |
||||
*/ |
||||
@Retention(RetentionPolicy.RUNTIME) |
||||
@Target(ElementType.TYPE) |
||||
@Documented |
||||
@Inherited |
||||
public @interface OptionalInitTask { |
||||
|
||||
} |
@ -1,10 +1,10 @@ |
||||
package mightypork.gamecore.core.init.impl; |
||||
package mightypork.gamecore.core.init; |
||||
|
||||
|
||||
import java.lang.Thread.UncaughtExceptionHandler; |
||||
|
||||
import mightypork.gamecore.core.App; |
||||
import mightypork.gamecore.core.init.InitTask; |
||||
import mightypork.gamecore.core.InitTask; |
||||
import mightypork.utils.annotations.Stub; |
||||
import mightypork.utils.logging.Log; |
||||
|
@ -1,8 +1,8 @@ |
||||
package mightypork.gamecore.core.init.impl; |
||||
package mightypork.gamecore.core.init; |
||||
|
||||
|
||||
import mightypork.gamecore.core.init.InitTask; |
||||
import mightypork.gamecore.render.GraphicsModule; |
||||
import mightypork.gamecore.core.InitTask; |
||||
import mightypork.gamecore.graphics.GraphicsModule; |
||||
|
||||
|
||||
/** |
@ -1,9 +1,9 @@ |
||||
package mightypork.gamecore.core.init.impl; |
||||
package mightypork.gamecore.core.init; |
||||
|
||||
|
||||
import java.io.IOException; |
||||
|
||||
import mightypork.gamecore.core.init.InitTask; |
||||
import mightypork.gamecore.core.InitTask; |
||||
import mightypork.utils.ion.Ion; |
||||
import mightypork.utils.ion.IonInput; |
||||
import mightypork.utils.ion.IonOutput; |
@ -1,11 +1,11 @@ |
||||
package mightypork.gamecore.core.init.impl; |
||||
package mightypork.gamecore.core.init; |
||||
|
||||
|
||||
import java.io.File; |
||||
import java.util.logging.Level; |
||||
|
||||
import mightypork.gamecore.core.InitTask; |
||||
import mightypork.gamecore.core.WorkDir; |
||||
import mightypork.gamecore.core.init.InitTask; |
||||
import mightypork.utils.logging.Log; |
||||
import mightypork.utils.logging.writers.LogWriter; |
||||
import mightypork.utils.string.StringUtil; |
@ -1,4 +1,4 @@ |
||||
package mightypork.gamecore.render; |
||||
package mightypork.gamecore.graphics; |
||||
|
||||
|
||||
import mightypork.utils.eventbus.BusEvent; |
@ -1,9 +1,9 @@ |
||||
package mightypork.gamecore.render; |
||||
package mightypork.gamecore.graphics; |
||||
|
||||
|
||||
import mightypork.gamecore.backend.BackendModule; |
||||
import mightypork.gamecore.resources.textures.DeferredTexture; |
||||
import mightypork.gamecore.resources.textures.TxQuad; |
||||
import mightypork.gamecore.core.BackendModule; |
||||
import mightypork.gamecore.graphics.textures.DeferredTexture; |
||||
import mightypork.gamecore.graphics.textures.TxQuad; |
||||
import mightypork.utils.math.color.Color; |
||||
import mightypork.utils.math.color.Grad; |
||||
import mightypork.utils.math.constraints.rect.Rect; |
@ -1,4 +1,4 @@ |
||||
package mightypork.gamecore.render; |
||||
package mightypork.gamecore.graphics; |
||||
|
||||
|
||||
/** |
@ -1,4 +1,4 @@ |
||||
package mightypork.gamecore.render; |
||||
package mightypork.gamecore.graphics; |
||||
|
||||
|
||||
import java.io.File; |
@ -0,0 +1,98 @@ |
||||
package mightypork.gamecore.graphics.fonts; |
||||
|
||||
|
||||
import mightypork.gamecore.graphics.textures.FilterMode; |
||||
import mightypork.gamecore.resources.BaseDeferredResource; |
||||
|
||||
|
||||
/** |
||||
* Abstract deferred font stub. |
||||
* |
||||
* @author Ondřej Hruška (MightyPork) |
||||
*/ |
||||
public abstract class DeferredFont extends BaseDeferredResource implements IFont { |
||||
|
||||
public static enum FontStyle |
||||
{ |
||||
PLAIN(0), BOLD(1), ITALIC(2), BOLD_ITALIC(3); |
||||
|
||||
public int numval; |
||||
|
||||
|
||||
/** |
||||
* Font style |
||||
* |
||||
* @param style style index as in awt Font. Not using constants to be |
||||
* independent on awt. |
||||
*/ |
||||
private FontStyle(int style) { |
||||
this.numval = style; |
||||
} |
||||
} |
||||
|
||||
protected double size = 12; |
||||
protected FontStyle style = FontStyle.PLAIN; |
||||
protected String chars = Glyphs.basic; |
||||
protected FilterMode filter = FilterMode.NEAREST; |
||||
protected boolean antialias = false; |
||||
protected double discardTop = 0; |
||||
protected double discardBottom = 0; |
||||
|
||||
|
||||
public DeferredFont(String resource) { |
||||
super(resource); |
||||
} |
||||
|
||||
|
||||
public void setSize(double size) |
||||
{ |
||||
this.size = size; |
||||
} |
||||
|
||||
|
||||
public void setStyle(FontStyle style) |
||||
{ |
||||
this.style = style; |
||||
} |
||||
|
||||
|
||||
public void setChars(String chars) |
||||
{ |
||||
this.chars = chars; |
||||
} |
||||
|
||||
|
||||
public void setFilter(FilterMode filter) |
||||
{ |
||||
this.filter = filter; |
||||
} |
||||
|
||||
|
||||
public void setAntialias(boolean antialias) |
||||
{ |
||||
this.antialias = antialias; |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public void setDiscardRatio(double top, double bottom) |
||||
{ |
||||
discardTop = top; |
||||
discardBottom = bottom; |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public double getTopDiscardRatio() |
||||
{ |
||||
return discardTop; |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public double getBottomDiscardRatio() |
||||
{ |
||||
return discardBottom; |
||||
} |
||||
|
||||
} |
@ -1,4 +1,4 @@ |
||||
package mightypork.gamecore.resources.fonts; |
||||
package mightypork.gamecore.graphics.fonts; |
||||
|
||||
|
||||
import mightypork.gamecore.core.App; |
@ -1,4 +1,4 @@ |
||||
package mightypork.gamecore.resources.fonts; |
||||
package mightypork.gamecore.graphics.fonts; |
||||
|
||||
|
||||
/** |
@ -1,4 +1,4 @@ |
||||
package mightypork.gamecore.resources.fonts; |
||||
package mightypork.gamecore.graphics.fonts; |
||||
|
||||
|
||||
import mightypork.utils.math.color.Color; |
@ -1,8 +1,8 @@ |
||||
package mightypork.gamecore.resources.textures; |
||||
package mightypork.gamecore.graphics.textures; |
||||
|
||||
|
||||
import mightypork.gamecore.resources.BaseDeferredResource; |
||||
import mightypork.gamecore.resources.MustLoadInRenderingContext; |
||||
import mightypork.gamecore.resources.loading.MustLoadInRenderingContext; |
||||
import mightypork.utils.annotations.Alias; |
||||
import mightypork.utils.math.constraints.rect.Rect; |
||||
|
@ -1,4 +1,4 @@ |
||||
package mightypork.gamecore.resources.textures; |
||||
package mightypork.gamecore.graphics.textures; |
||||
|
||||
|
||||
/** |
@ -1,4 +1,4 @@ |
||||
package mightypork.gamecore.resources.textures; |
||||
package mightypork.gamecore.graphics.textures; |
||||
|
||||
|
||||
import mightypork.utils.interfaces.Destroyable; |
@ -1,4 +1,4 @@ |
||||
package mightypork.gamecore.resources.textures; |
||||
package mightypork.gamecore.graphics.textures; |
||||
|
||||
|
||||
import mightypork.utils.math.constraints.rect.Rect; |
@ -1,11 +1,11 @@ |
||||
package mightypork.gamecore.resources.textures; |
||||
package mightypork.gamecore.graphics.textures; |
||||
|
||||
|
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
import mightypork.gamecore.core.App; |
||||
import mightypork.gamecore.resources.ResourceLoadRequest; |
||||
import mightypork.gamecore.resources.loading.ResourceLoadRequest; |
||||
import mightypork.utils.exceptions.KeyAlreadyExistsException; |
||||
import mightypork.utils.math.constraints.rect.Rect; |
||||
|
@ -1,4 +1,4 @@ |
||||
package mightypork.gamecore.resources.textures; |
||||
package mightypork.gamecore.graphics.textures; |
||||
|
||||
|
||||
import mightypork.utils.math.constraints.rect.Rect; |
@ -1,4 +1,4 @@ |
||||
package mightypork.gamecore.resources.textures; |
||||
package mightypork.gamecore.graphics.textures; |
||||
|
||||
|
||||
import java.util.Random; |
@ -1,4 +1,4 @@ |
||||
package mightypork.gamecore.resources.textures; |
||||
package mightypork.gamecore.graphics.textures; |
||||
|
||||
|
||||
/** |
@ -1,40 +0,0 @@ |
||||
package mightypork.gamecore.resources.fonts.impl; |
||||
|
||||
|
||||
import java.awt.Font; |
||||
import java.io.IOException; |
||||
|
||||
import mightypork.gamecore.resources.textures.FilterMode; |
||||
import mightypork.utils.annotations.Alias; |
||||
|
||||
|
||||
/** |
||||
* Font obtained from the OS |
||||
* |
||||
* @author Ondřej Hruška (MightyPork) |
||||
*/ |
||||
@Alias(name = "FontNative") |
||||
public class LazyFontNative extends LazyFont { |
||||
|
||||
/** |
||||
* A font from OS, found by name |
||||
* |
||||
* @param fontName font family name |
||||
* @param extraChars extra chars (0-255 loaded by default) |
||||
* @param size size (pt) |
||||
* @param style font style |
||||
* @param antialias use antialiasing when drawn on the cache texture |
||||
* @param filter GL filtering mode |
||||
*/ |
||||
public LazyFontNative(String fontName, String extraChars, double size, FontStyle style, boolean antialias, FilterMode filter) { |
||||
super(fontName, extraChars, size, style, antialias, filter); |
||||
} |
||||
|
||||
|
||||
@Override |
||||
protected Font getAwtFont(String resource, float size, int style) throws IOException |
||||
{ |
||||
return new Font(resource, style, (int) size); |
||||
} |
||||
|
||||
} |
@ -1,4 +1,4 @@ |
||||
package mightypork.gamecore.resources; |
||||
package mightypork.gamecore.resources.loading; |
||||
|
||||
|
||||
import java.lang.annotation.*; |
@ -1,6 +1,7 @@ |
||||
package mightypork.gamecore.resources; |
||||
package mightypork.gamecore.resources.loading; |
||||
|
||||
|
||||
import mightypork.gamecore.resources.DeferredResource; |
||||
import mightypork.utils.eventbus.BusEvent; |
||||
import mightypork.utils.eventbus.events.flags.SingleReceiverEvent; |
||||
|
@ -1,4 +1,6 @@ |
||||
package mightypork.gamecore.resources; |
||||
package mightypork.gamecore.resources.loading; |
||||
|
||||
import mightypork.gamecore.resources.DeferredResource; |
||||
|
||||
|
||||
/** |
Loading…
Reference in new issue