Formatting, added eclipse prefs file

This commit is contained in:
Ondřej Hruška
2014-04-01 09:43:36 +02:00
parent d8530f2f1a
commit 33b329486b
105 changed files with 1119 additions and 1691 deletions
+1
View File
@@ -1,5 +1,6 @@
package mightypork.rogue;
import java.io.File;
import java.io.RandomAccessFile;
import java.nio.channels.FileLock;
+1
View File
@@ -1,5 +1,6 @@
package mightypork.rogue;
import mightypork.rogue.display.DisplaySystem;
import mightypork.rogue.input.InputSystem;
import mightypork.rogue.sounds.SoundSystem;
+1
View File
@@ -1,5 +1,6 @@
package mightypork.rogue;
import mightypork.rogue.display.DisplaySystem;
import mightypork.rogue.input.InputSystem;
import mightypork.rogue.sounds.SoundSystem;
+1
View File
@@ -1,5 +1,6 @@
package mightypork.rogue;
import mightypork.utils.files.PropertyManager;
import mightypork.utils.logging.Log;
+1
View File
@@ -1,5 +1,6 @@
package mightypork.rogue;
/**
* Application constants
*
+1
View File
@@ -1,5 +1,6 @@
package mightypork.rogue;
import java.lang.Thread.UncaughtExceptionHandler;
+1
View File
@@ -1,5 +1,6 @@
package mightypork.rogue;
import java.io.File;
import mightypork.utils.files.OsUtils;
@@ -1,5 +1,6 @@
package mightypork.rogue.bus;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
@@ -60,8 +61,7 @@ public abstract class DelegatingBusClient extends AppAdapter implements Delegati
/**
* Remove a child subscriber
*
* @param client
* subscriber to remove
* @param client subscriber to remove
*/
public final void removeChildSubscriber(Object client)
{
@@ -1,5 +1,6 @@
package mightypork.rogue.bus;
import mightypork.rogue.AppAccess;
import mightypork.rogue.AppAdapter;
@@ -12,8 +13,7 @@ import mightypork.rogue.AppAdapter;
public class SimpleBusClient extends AppAdapter {
/**
* @param app
* app access
* @param app app access
*/
public SimpleBusClient(AppAccess app) {
super(app);
@@ -1,5 +1,6 @@
package mightypork.rogue.bus;
import mightypork.rogue.AppAccess;
import mightypork.rogue.bus.events.UpdateEvent;
import mightypork.utils.time.Updateable;
@@ -1,5 +1,6 @@
package mightypork.rogue.bus.events;
import mightypork.utils.patterns.subscription.Handleable;
import org.lwjgl.input.Keyboard;
@@ -66,14 +67,12 @@ public class KeyboardEvent implements Handleable<KeyboardEvent.Listener> {
keh.receive(this);
}
public interface Listener {
/**
* Handle an event
*
* @param event
* event
* @param event event
*/
public void receive(KeyboardEvent event);
}
@@ -1,5 +1,6 @@
package mightypork.rogue.bus.events;
import mightypork.utils.math.coord.Coord;
import mightypork.utils.patterns.subscription.Handleable;
@@ -24,14 +25,10 @@ public class MouseButtonEvent implements Handleable<MouseButtonEvent.Listener> {
/**
* Mouse button event
*
* @param pos
* event position
* @param button
* button id
* @param down
* button pressed
* @param wheeld
* wheel change
* @param pos event position
* @param button button id
* @param down button pressed
* @param wheeld wheel change
*/
public MouseButtonEvent(Coord pos, int button, boolean down, int wheeld) {
this.button = button;
@@ -110,14 +107,12 @@ public class MouseButtonEvent implements Handleable<MouseButtonEvent.Listener> {
handler.receive(this);
}
public interface Listener {
/**
* Handle an event
*
* @param event
* event
* @param event event
*/
public void receive(MouseButtonEvent event);
}
@@ -1,5 +1,6 @@
package mightypork.rogue.bus.events;
import mightypork.utils.math.coord.Coord;
import mightypork.utils.patterns.subscription.Handleable;
@@ -40,14 +41,12 @@ public class MouseMotionEvent implements Handleable<MouseMotionEvent.Listener> {
keh.receive(this);
}
public interface Listener {
/**
* Handle an event
*
* @param event
* event
* @param event event
*/
public void receive(MouseMotionEvent event);
}
@@ -1,5 +1,6 @@
package mightypork.rogue.bus.events;
import mightypork.utils.math.coord.Coord;
import mightypork.utils.patterns.subscription.Handleable;
@@ -42,7 +43,6 @@ public class ScreenChangeEvent implements Handleable<ScreenChangeEvent.Listener>
handler.receive(this);
}
public interface Listener {
public void receive(ScreenChangeEvent event);
@@ -1,5 +1,6 @@
package mightypork.rogue.bus.events;
import mightypork.utils.patterns.subscription.Handleable;
@@ -25,7 +26,6 @@ public class UpdateEvent implements Handleable<UpdateEvent.Listener> {
handler.receive(this);
}
public interface Listener {
public void receive(UpdateEvent event);
@@ -1,5 +1,6 @@
package mightypork.rogue.display;
import static org.lwjgl.opengl.GL11.*;
import java.awt.image.BufferedImage;
+4 -6
View File
@@ -1,5 +1,6 @@
package mightypork.rogue.display;
import static org.lwjgl.opengl.GL11.*;
import mightypork.rogue.AppAccess;
import mightypork.rogue.bus.DelegatingBusClient;
@@ -51,8 +52,7 @@ public abstract class Screen extends DelegatingBusClient implements KeyBinder, B
/**
* Prepare for being shown
*
* @param shown
* true to show, false to hide
* @param shown true to show, false to hide
*/
public final void setActive(boolean shown)
{
@@ -161,8 +161,7 @@ public abstract class Screen extends DelegatingBusClient implements KeyBinder, B
/**
* Update GUI for new screen size
*
* @param size
* screen size
* @param size screen size
*/
protected void onSizeChanged(Coord size)
{
@@ -179,8 +178,7 @@ public abstract class Screen extends DelegatingBusClient implements KeyBinder, B
/**
* Update animations and timing
*
* @param delta
* time elapsed
* @param delta time elapsed
*/
protected abstract void updateScreen(double delta);
@@ -1,5 +1,6 @@
package mightypork.rogue.display;
import java.util.Random;
import mightypork.rogue.AppAccess;
@@ -1,5 +1,6 @@
package mightypork.rogue.display.constraints;
import mightypork.utils.math.coord.Rect;
@@ -1,5 +1,6 @@
package mightypork.rogue.display.constraints;
import mightypork.utils.math.coord.Coord;
import mightypork.utils.math.coord.Rect;
@@ -1,5 +1,6 @@
package mightypork.rogue.display.rendering;
public interface Renderable {
public void render();
@@ -1,5 +1,6 @@
package mightypork.rogue.display.rendering;
import mightypork.rogue.AppAccess;
import mightypork.rogue.bus.DelegatingBusClient;
+1
View File
@@ -1,5 +1,6 @@
package mightypork.rogue.fonts;
/**
* Alignment
*
+20 -36
View File
@@ -1,5 +1,6 @@
package mightypork.rogue.fonts;
import java.awt.Font;
import java.io.InputStream;
import java.util.HashMap;
@@ -20,7 +21,6 @@ public class FontManager {
private static final boolean DEBUG = Config.LOG_FONTS;
/**
* Glyph tables.
*
@@ -75,13 +75,13 @@ public class FontManager {
//@formatter:on
}
/**
* Font style
*
* @author MightyPork
*/
public static enum Style {
public static enum Style
{
/** Normal */
NORMAL,
/** Italic */
@@ -112,7 +112,6 @@ public class FontManager {
OUTLINE;
}
// /**
// * Preloaded font identifier [name, size, style]
// *
@@ -224,12 +223,9 @@ public class FontManager {
/**
* Register font file.
*
* @param path
* resource path (res/fonts/...)
* @param name
* font name (for binding)
* @param style
* font style in this file
* @param path resource path (res/fonts/...)
* @param name font name (for binding)
* @param style font style in this file
*/
public static void registerFile(String path, String name, Style style)
{
@@ -254,14 +250,10 @@ public class FontManager {
* Preload font if needed, get preloaded font.<br>
* If needed file is not available, throws runtime exception.
*
* @param name
* font name (registerFile)
* @param size
* font size (pt)
* @param style
* font style
* @param glyphs
* glyphs needed
* @param name font name (registerFile)
* @param size font size (pt)
* @param style font style
* @param glyphs glyphs needed
* @return the loaded font.
*/
public static LoadedFont loadFont(String name, double size, Style style, String glyphs)
@@ -274,24 +266,16 @@ public class FontManager {
* Preload font if needed, get preloaded font.<br>
* If needed file is not available, throws runtime exception.
*
* @param name
* font name (registerFile)
* @param size
* font size (pt)
* @param style
* font style
* @param glyphs
* glyphs needed
* @param correctLeft
* left horizontal correction
* @param correctRight
* right horizontal correction
* @param scale
* font scale (changing aspect ratio)
* @param clipTop
* top clip (0-1) - top part of the font to be cut off
* @param clipBottom
* bottom clip (0-1) - bottom part of the font to be cut off
* @param name font name (registerFile)
* @param size font size (pt)
* @param style font style
* @param glyphs glyphs needed
* @param correctLeft left horizontal correction
* @param correctRight right horizontal correction
* @param scale font scale (changing aspect ratio)
* @param clipTop top clip (0-1) - top part of the font to be cut off
* @param clipBottom bottom clip (0-1) - bottom part of the font to be cut
* off
* @return the loaded font.
*/
public static LoadedFont loadFont(String name, double size, Style style, String glyphs, int correctLeft, int correctRight, Coord scale, double clipTop, double clipBottom)
+1
View File
@@ -1,5 +1,6 @@
package mightypork.rogue.fonts;
import static mightypork.rogue.fonts.FontManager.Style.*;
import mightypork.rogue.fonts.FontManager.Glyphs;
import mightypork.utils.logging.Log;
+10 -19
View File
@@ -1,5 +1,6 @@
package mightypork.rogue.fonts;
import static mightypork.rogue.fonts.Align.*;
import static org.lwjgl.opengl.GL11.*;
@@ -74,7 +75,6 @@ public class LoadedFont {
private double clipVerticalT = 0;
private double clipVerticalB = 0;
private class CharStorageEntry {
/** Character's width */
@@ -572,16 +572,11 @@ public class LoadedFont {
/**
* Draw string with font.
*
* @param x
* x coord
* @param y
* y coord
* @param text
* text to draw
* @param color
* render color
* @param align
* (-1,0,1)
* @param x x coord
* @param y y coord
* @param text text to draw
* @param color render color
* @param align (-1,0,1)
*/
public void draw(double x, double y, String text, RGB color, int align)
{
@@ -592,14 +587,10 @@ public class LoadedFont {
/**
* Draw string with font.
*
* @param pos
* coord
* @param text
* text to draw
* @param color
* render color
* @param align
* (-1,0,1)
* @param pos coord
* @param text text to draw
* @param color render color
* @param align (-1,0,1)
*/
public void draw(Coord pos, String text, RGB color, int align)
{
@@ -1,5 +1,6 @@
package mightypork.rogue.input;
import mightypork.rogue.AppAccess;
import mightypork.rogue.bus.DelegatingBusClient;
import mightypork.rogue.bus.events.KeyboardEvent;
+4 -6
View File
@@ -1,14 +1,13 @@
package mightypork.rogue.input;
public interface KeyBinder {
/**
* Bind handler to a keystroke, replace current handler if any
*
* @param stroke
* trigger keystroke
* @param task
* handler
* @param stroke trigger keystroke
* @param task handler
*/
abstract void bindKeyStroke(KeyStroke stroke, Runnable task);
@@ -16,8 +15,7 @@ public interface KeyBinder {
/**
* Remove handler from a keystroke (id any)
*
* @param stroke
* stroke
* @param stroke stroke
*/
abstract void unbindKeyStroke(KeyStroke stroke);
@@ -1,5 +1,6 @@
package mightypork.rogue.input;
import mightypork.rogue.bus.events.KeyboardEvent;
@@ -1,5 +1,6 @@
package mightypork.rogue.input;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
@@ -21,10 +22,8 @@ public class KeyBindingPool implements KeyBinder, KeyboardEvent.Listener {
/**
* Bind handler to a keystroke, replace current handler if any
*
* @param stroke
* trigger keystroke
* @param task
* handler
* @param stroke trigger keystroke
* @param task handler
*/
@Override
public void bindKeyStroke(KeyStroke stroke, Runnable task)
@@ -44,8 +43,7 @@ public class KeyBindingPool implements KeyBinder, KeyboardEvent.Listener {
/**
* Remove handler from keystroke (id any)
*
* @param stroke
* stroke
* @param stroke stroke
*/
@Override
public void unbindKeyStroke(KeyStroke stroke)
+3 -4
View File
@@ -1,5 +1,6 @@
package mightypork.rogue.input;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;
@@ -16,10 +17,8 @@ public class KeyStroke {
/**
* KeyStroke
*
* @param down
* true for falling edge, up for rising edge
* @param keys
* keys that must be pressed
* @param down true for falling edge, up for rising edge
* @param keys keys that must be pressed
*/
public KeyStroke(boolean down, int... keys) {
this.down = down;
+20 -35
View File
@@ -1,5 +1,6 @@
package mightypork.rogue.sounds;
import mightypork.utils.files.FileUtils;
import mightypork.utils.logging.Log;
import mightypork.utils.math.coord.Coord;
@@ -16,7 +17,8 @@ import org.newdawn.slick.openal.SoundStore;
*/
public class AudioX implements Destroyable {
private enum PlayMode {
private enum PlayMode
{
EFFECT, MUSIC;
};
@@ -35,8 +37,7 @@ public class AudioX implements Destroyable {
/**
* Create deferred primitive audio player
*
* @param resourceName
* resource to load when needed
* @param resourceName resource to load when needed
*/
public AudioX(String resourceName) {
this.audio = null;
@@ -160,12 +161,9 @@ public class AudioX implements Destroyable {
/**
* Play as sound effect at listener position
*
* @param pitch
* pitch (1 = default)
* @param gain
* gain (0-1)
* @param loop
* looping
* @param pitch pitch (1 = default)
* @param gain gain (0-1)
* @param loop looping
* @return source id
*/
public int playAsEffect(double pitch, double gain, boolean loop)
@@ -177,12 +175,9 @@ public class AudioX implements Destroyable {
/**
* Play as sound effect at given X-Y position
*
* @param pitch
* pitch (1 = default)
* @param gain
* gain (0-1)
* @param loop
* looping
* @param pitch pitch (1 = default)
* @param gain gain (0-1)
* @param loop looping
* @param x
* @param y
* @return source id
@@ -196,12 +191,9 @@ public class AudioX implements Destroyable {
/**
* Play as sound effect at given position
*
* @param pitch
* pitch (1 = default)
* @param gain
* gain (0-1)
* @param loop
* looping
* @param pitch pitch (1 = default)
* @param gain gain (0-1)
* @param loop looping
* @param x
* @param y
* @param z
@@ -222,14 +214,10 @@ public class AudioX implements Destroyable {
/**
* Play as sound effect at given position
*
* @param pitch
* pitch (1 = default)
* @param gain
* gain (0-1)
* @param loop
* looping
* @param pos
* coord
* @param pitch pitch (1 = default)
* @param gain gain (0-1)
* @param loop looping
* @param pos coord
* @return source id
*/
public int playAsEffect(double pitch, double gain, boolean loop, Coord pos)
@@ -244,12 +232,9 @@ public class AudioX implements Destroyable {
* Play as music using source 0.<br>
* Discouraged, since this does not allow cross-fading.
*
* @param pitch
* play pitch
* @param gain
* play gain
* @param loop
* looping
* @param pitch play pitch
* @param gain play gain
* @param loop looping
* @return source
*/
public int playAsMusic(double pitch, double gain, boolean loop)
@@ -1,5 +1,6 @@
package mightypork.rogue.sounds;
import mightypork.utils.objects.Mutable;
@@ -1,5 +1,6 @@
package mightypork.rogue.sounds;
import mightypork.utils.math.coord.Coord;
import mightypork.utils.objects.Mutable;
+2 -2
View File
@@ -1,5 +1,6 @@
package mightypork.rogue.sounds;
import mightypork.utils.math.Calc;
import mightypork.utils.objects.Mutable;
@@ -17,8 +18,7 @@ public class JointVolume extends Mutable<Double> {
/**
* Create joint volume with master gain of 1
*
* @param volumes
* individual volumes to join
* @param volumes individual volumes to join
*/
public JointVolume(Mutable<Double>... volumes) {
super(1D);
@@ -1,5 +1,6 @@
package mightypork.rogue.sounds;
import mightypork.utils.objects.Mutable;
import mightypork.utils.time.Pauseable;
import mightypork.utils.time.Updateable;
@@ -1,5 +1,6 @@
package mightypork.rogue.sounds;
public class NullAudio extends AudioX {
public NullAudio() {
+26 -50
View File
@@ -1,5 +1,6 @@
package mightypork.rogue.sounds;
import java.nio.FloatBuffer;
import java.util.HashMap;
import java.util.HashSet;
@@ -118,14 +119,10 @@ public class SoundSystem extends DelegatingBusClient {
/**
* Register effect resource
*
* @param key
* sound key
* @param resource
* resource path
* @param pitch
* default pitch (1 = unchanged)
* @param gain
* default gain (0-1)
* @param key sound key
* @param resource resource path
* @param pitch default pitch (1 = unchanged)
* @param gain default gain (0-1)
*/
public void addEffect(String key, String resource, double pitch, double gain)
{
@@ -137,18 +134,12 @@ public class SoundSystem extends DelegatingBusClient {
/**
* Register loop resource (music / effect loop)
*
* @param key
* sound key
* @param resource
* resource path
* @param pitch
* default pitch (1 = unchanged)
* @param gain
* default gain (0-1)
* @param fadeIn
* default time for fadeIn
* @param fadeOut
* default time for fadeOut
* @param key sound key
* @param resource resource path
* @param pitch default pitch (1 = unchanged)
* @param gain default gain (0-1)
* @param fadeIn default time for fadeIn
* @param fadeOut default time for fadeOut
*/
public void addLoop(String key, String resource, double pitch, double gain, double fadeIn, double fadeOut)
{
@@ -161,11 +152,9 @@ public class SoundSystem extends DelegatingBusClient {
/**
* Create {@link AudioX} for a resource
*
* @param res
* a resource name
* @param res a resource name
* @return the resource
* @throws IllegalArgumentException
* if resource is already registered
* @throws IllegalArgumentException if resource is already registered
*/
private AudioX getResource(String res)
{
@@ -179,8 +168,7 @@ public class SoundSystem extends DelegatingBusClient {
/**
* Get a loop player for key
*
* @param key
* sound key
* @param key sound key
* @return loop player
*/
public LoopPlayer getLoop(String key)
@@ -197,8 +185,7 @@ public class SoundSystem extends DelegatingBusClient {
/**
* Get a effect player for key
*
* @param key
* sound key
* @param key sound key
* @return effect player
*/
public EffectPlayer getEffect(String key)
@@ -226,8 +213,7 @@ public class SoundSystem extends DelegatingBusClient {
/**
* Fade in a loop (with default time)
*
* @param key
* sound key
* @param key sound key
*/
public void fadeInLoop(String key)
{
@@ -238,10 +224,8 @@ public class SoundSystem extends DelegatingBusClient {
/**
* Fade in a loop
*
* @param key
* sound key
* @param seconds
* fade-in duration
* @param key sound key
* @param seconds fade-in duration
*/
public void fadeInLoop(String key, double seconds)
{
@@ -252,8 +236,7 @@ public class SoundSystem extends DelegatingBusClient {
/**
* Fade out a loop (with default time)
*
* @param key
* sound key
* @param key sound key
*/
public void fadeOutLoop(String key)
{
@@ -264,10 +247,8 @@ public class SoundSystem extends DelegatingBusClient {
/**
* Fade out a loop
*
* @param key
* sound key
* @param seconds
* fade-out duration
* @param key sound key
* @param seconds fade-out duration
*/
public void fadeOutLoop(String key, double seconds)
{
@@ -278,8 +259,7 @@ public class SoundSystem extends DelegatingBusClient {
/**
* Pause a loop
*
* @param key
* sound key
* @param key sound key
*/
public void pauseLoop(String key)
{
@@ -301,8 +281,7 @@ public class SoundSystem extends DelegatingBusClient {
/**
* Resume a loop
*
* @param key
* sound key
* @param key sound key
*/
public void resumeLoop(String key)
{
@@ -313,8 +292,7 @@ public class SoundSystem extends DelegatingBusClient {
/**
* Set level of master volume
*
* @param d
* level
* @param d level
*/
public void setMasterVolume(double d)
{
@@ -325,8 +303,7 @@ public class SoundSystem extends DelegatingBusClient {
/**
* Set level of effects volume
*
* @param d
* level
* @param d level
*/
public void setEffectsVolume(double d)
{
@@ -337,8 +314,7 @@ public class SoundSystem extends DelegatingBusClient {
/**
* Set level of music volume
*
* @param d
* level
* @param d level
*/
public void setMusicVolume(double d)
{
@@ -1,5 +1,6 @@
package mightypork.rogue.tasks;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
@@ -1,5 +1,6 @@
package mightypork.rogue.testing;
import mightypork.rogue.display.constraints.Bounding;
import mightypork.rogue.display.constraints.Constraint;
import mightypork.utils.math.coord.Coord;
+1 -2
View File
@@ -1,5 +1,6 @@
package mightypork.rogue.testing;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
@@ -181,7 +182,6 @@ class StringMessage implements Handleable<StringMessage.Listener> {
this.s = str;
}
public interface Listener {
public void receive(StringMessage message);
@@ -205,7 +205,6 @@ class IntMessage implements Handleable<IntMessage.Listener> {
this.i = i;
}
public interface Listener {
public void receive(IntMessage message);
@@ -1,5 +1,6 @@
package mightypork.rogue.textures;
import static org.lwjgl.opengl.GL11.*;
import java.io.IOException;
@@ -51,10 +52,8 @@ public class TextureManager {
/**
* Bind texture
*
* @param texture
* the texture
* @throws RuntimeException
* if not loaded yet
* @param texture the texture
* @throws RuntimeException if not loaded yet
*/
public static void bind(Texture texture) throws RuntimeException
{
@@ -1,5 +1,6 @@
package mightypork.rogue.textures;
import static org.lwjgl.opengl.GL11.*;
import org.newdawn.slick.opengl.Texture;
+1
View File
@@ -1,5 +1,6 @@
package mightypork.rogue.textures;
// TODO rewrite
/**
+13 -24
View File
@@ -1,5 +1,6 @@
package mightypork.rogue.textures;
import mightypork.utils.math.coord.Coord;
import mightypork.utils.math.coord.Rect;
@@ -24,16 +25,11 @@ public class TxQuad {
/**
* Create TxQuad from left top coord and rect size
*
* @param tx
* texture
* @param x1
* left top X
* @param y1
* left top Y
* @param width
* area width
* @param height
* area height
* @param tx texture
* @param x1 left top X
* @param y1 left top Y
* @param width area width
* @param height area height
* @return new TxQuad
*/
public static TxQuad fromSize(Texture tx, int x1, int y1, int width, int height)
@@ -43,10 +39,8 @@ public class TxQuad {
/**
* @param tx
* Texture
* @param uvs
* Rect of texturwe UVs (pixels - from left top)
* @param tx Texture
* @param uvs Rect of texturwe UVs (pixels - from left top)
*/
public TxQuad(Texture tx, Rect uvs) {
this.tx = tx;
@@ -58,16 +52,11 @@ public class TxQuad {
/**
* Make of coords
*
* @param tx
* texture
* @param x1
* x1
* @param y1
* y1
* @param x2
* x2
* @param y2
* y2
* @param tx texture
* @param x1 x1
* @param y1 y1
* @param x2 x2
* @param y2 y2
*/
public TxQuad(Texture tx, int x1, int y1, int x2, int y2) {
this.tx = tx;
+169 -336
View File
@@ -1,5 +1,6 @@
package mightypork.rogue.util;
import static org.lwjgl.opengl.GL11.*;
import mightypork.rogue.textures.TextureManager;
import mightypork.rogue.textures.TxQuad;
@@ -26,10 +27,8 @@ public class RenderUtils {
/**
* Render quad 2D
*
* @param min
* min coord
* @param max
* max coord
* @param min min coord
* @param max max coord
*/
public static void quadCoord(Coord min, Coord max)
{
@@ -40,14 +39,10 @@ public class RenderUtils {
/**
* Render quad with absolute coords (from screen bottom)
*
* @param left
* left x
* @param bottom
* bottom y
* @param right
* right x
* @param top
* top y
* @param left left x
* @param bottom bottom y
* @param right right x
* @param top top y
*/
public static void quadCoord(double left, double bottom, double right, double top)
{
@@ -63,16 +58,11 @@ public class RenderUtils {
/**
* Render quad with coloured border
*
* @param min
* min
* @param max
* max
* @param border
* border width
* @param borderColor
* border color
* @param insideColor
* filling color
* @param min min
* @param max max
* @param border border width
* @param borderColor border color
* @param insideColor filling color
*/
public static void quadCoordBorder(Coord min, Coord max, double border, RGB borderColor, RGB insideColor)
{
@@ -83,20 +73,13 @@ public class RenderUtils {
/**
* Render quad with coloured border
*
* @param minX
* min x
* @param minY
* min y
* @param maxX
* max x
* @param maxY
* max y
* @param border
* border width
* @param borderColor
* border color
* @param insideColor
* filling color
* @param minX min x
* @param minY min y
* @param maxX max x
* @param maxY max y
* @param border border width
* @param borderColor border color
* @param insideColor filling color
*/
public static void quadCoordBorder(double minX, double minY, double maxX, double maxY, double border, RGB borderColor, RGB insideColor)
{
@@ -121,14 +104,10 @@ public class RenderUtils {
/**
* Render quad 2D with gradient horizontal
*
* @param min
* min coord
* @param max
* max coord
* @param colorLeft
* color left
* @param colorRight
* color right
* @param min min coord
* @param max max coord
* @param colorLeft color left
* @param colorRight color right
*/
public static void quadCoordGradH(Coord min, Coord max, RGB colorLeft, RGB colorRight)
{
@@ -139,18 +118,12 @@ public class RenderUtils {
/**
* Render quad 2D with gradient horizontal
*
* @param minX
* units from left
* @param minY
* units from bottom
* @param maxX
* quad width
* @param maxY
* quad height
* @param colorLeft
* color left
* @param colorRight
* color right
* @param minX units from left
* @param minY units from bottom
* @param maxX quad width
* @param maxY quad height
* @param colorLeft color left
* @param colorRight color right
*/
public static void quadCoordGradH(double minX, double minY, double maxX, double maxY, RGB colorLeft, RGB colorRight)
{
@@ -171,14 +144,10 @@ public class RenderUtils {
/**
* Render quad 2D with gradient horizontal
*
* @param min
* min coord
* @param max
* max coord
* @param colorOuter
* color outer
* @param colorMiddle
* color inner
* @param min min coord
* @param max max coord
* @param colorOuter color outer
* @param colorMiddle color inner
*/
public static void quadCoordGradHBilinear(Coord min, Coord max, RGB colorOuter, RGB colorMiddle)
{
@@ -189,18 +158,12 @@ public class RenderUtils {
/**
* Render quad 2D with gradient horizontal
*
* @param minX
* min x
* @param minY
* min y
* @param maxX
* max x
* @param maxY
* max y
* @param colorOuter
* color outer
* @param colorMiddle
* color inner
* @param minX min x
* @param minY min y
* @param maxX max x
* @param maxY max y
* @param colorOuter color outer
* @param colorMiddle color inner
*/
public static void quadCoordGradHBilinear(double minX, double minY, double maxX, double maxY, RGB colorOuter, RGB colorMiddle)
{
@@ -231,14 +194,10 @@ public class RenderUtils {
/**
* Render quad 2D with gradient vertical
*
* @param min
* min coord
* @param max
* max coord
* @param colorTop
* top color
* @param colorBottom
* bottom color
* @param min min coord
* @param max max coord
* @param colorTop top color
* @param colorBottom bottom color
*/
public static void quadCoordGradV(Coord min, Coord max, RGB colorTop, RGB colorBottom)
{
@@ -249,18 +208,12 @@ public class RenderUtils {
/**
* Render quad 2D with gradient vertical
*
* @param minX
* min X
* @param minY
* min Y
* @param maxX
* max X
* @param maxY
* max Y
* @param colorTop
* top color
* @param colorBottom
* bottom color
* @param minX min X
* @param minY min Y
* @param maxX max X
* @param maxY max Y
* @param colorTop top color
* @param colorBottom bottom color
*/
public static void quadCoordGradV(double minX, double minY, double maxX, double maxY, RGB colorTop, RGB colorBottom)
{
@@ -280,14 +233,10 @@ public class RenderUtils {
/**
* Render quad 2D with gradient vertical
*
* @param min
* min coord
* @param max
* max coord
* @param colorOuter
* outer color
* @param colorMiddle
* middle color
* @param min min coord
* @param max max coord
* @param colorOuter outer color
* @param colorMiddle middle color
*/
public static void quadCoordGradVBilinear(Coord min, Coord max, RGB colorOuter, RGB colorMiddle)
{
@@ -298,18 +247,12 @@ public class RenderUtils {
/**
* Render quad 2D with gradient vertical
*
* @param minX
* min X
* @param minY
* min Y
* @param maxX
* max X
* @param maxY
* max Y
* @param colorOuter
* outer color
* @param colorMiddle
* middle color
* @param minX min X
* @param minY min Y
* @param maxX max X
* @param maxY max Y
* @param colorOuter outer color
* @param colorMiddle middle color
*/
public static void quadCoordGradVBilinear(double minX, double minY, double maxX, double maxY, RGB colorOuter, RGB colorMiddle)
{
@@ -338,16 +281,11 @@ public class RenderUtils {
/**
* Render quad with coloured border with outset effect
*
* @param min
* min coord
* @param max
* max coord
* @param border
* border width
* @param fill
* fill color
* @param inset
* true for inset, false for outset
* @param min min coord
* @param max max coord
* @param border border width
* @param fill fill color
* @param inset true for inset, false for outset
*/
public static void quadCoordOutset(Coord min, Coord max, double border, RGB fill, boolean inset)
{
@@ -358,20 +296,13 @@ public class RenderUtils {
/**
* Render quad with coloured border with outset effect
*
* @param minX
* left X
* @param minY
* bottom Y
* @param maxX
* right X
* @param maxY
* top Y
* @param border
* border width
* @param fill
* fill color
* @param inset
* true for inset, false for outset
* @param minX left X
* @param minY bottom Y
* @param maxX right X
* @param maxY top Y
* @param border border width
* @param fill fill color
* @param inset true for inset, false for outset
*/
public static void quadCoordOutset(double minX, double minY, double maxX, double maxY, double border, RGB fill, boolean inset)
{
@@ -436,8 +367,7 @@ public class RenderUtils {
/**
* Render quad 2D
*
* @param rect
* rectangle
* @param rect rectangle
*/
public static void quadRect(Rect rect)
{
@@ -448,10 +378,8 @@ public class RenderUtils {
/**
* Render quad 2D
*
* @param rect
* rectangle
* @param color
* draw color
* @param rect rectangle
* @param color draw color
*/
public static void quadRect(Rect rect, RGB color)
{
@@ -463,14 +391,10 @@ public class RenderUtils {
/**
* Render quad with coloured border
*
* @param rect
* rect
* @param border
* border width
* @param borderColor
* border color
* @param insideColor
* filling color
* @param rect rect
* @param border border width
* @param borderColor border color
* @param insideColor filling color
*/
public static void quadBorder(Rect rect, double border, RGB borderColor, RGB insideColor)
{
@@ -481,12 +405,9 @@ public class RenderUtils {
/**
* Render quad 2D with gradient horizontal
*
* @param rect
* rect
* @param colorLeft
* color left
* @param colorRight
* color right
* @param rect rect
* @param colorLeft color left
* @param colorRight color right
*/
public static void quadGradH(Rect rect, RGB colorLeft, RGB colorRight)
{
@@ -497,12 +418,9 @@ public class RenderUtils {
/**
* Render quad 2D with gradient horizontal
*
* @param rect
* rect
* @param colorOuter
* color outer
* @param colorMiddle
* color inner
* @param rect rect
* @param colorOuter color outer
* @param colorMiddle color inner
*/
public static void quadGradHBilinear(Rect rect, RGB colorOuter, RGB colorMiddle)
{
@@ -513,12 +431,9 @@ public class RenderUtils {
/**
* Render quad 2D with gradient vertical
*
* @param rect
* rect
* @param colorTop
* top color
* @param colorBottom
* bottom color
* @param rect rect
* @param colorTop top color
* @param colorBottom bottom color
*/
public static void quadGradV(Rect rect, RGB colorTop, RGB colorBottom)
{
@@ -529,12 +444,9 @@ public class RenderUtils {
/**
* Render quad 2D with gradient vertical
*
* @param rect
* rect
* @param colorOuter
* outer color
* @param colorMiddle
* middle color
* @param rect rect
* @param colorOuter outer color
* @param colorMiddle middle color
*/
public static void quadGradVBilinear(Rect rect, RGB colorOuter, RGB colorMiddle)
{
@@ -545,14 +457,10 @@ public class RenderUtils {
/**
* Render quad with coloured border with outset effect
*
* @param rect
* rectangle
* @param border
* border width
* @param fill
* fill color
* @param inset
* true for inset, false for outset
* @param rect rectangle
* @param border border width
* @param fill fill color
* @param inset true for inset, false for outset
*/
public static void quadRectOutset(Rect rect, double border, RGB fill, boolean inset)
{
@@ -563,10 +471,8 @@ public class RenderUtils {
/**
* Render textured rect (texture must be binded already)
*
* @param quad
* rectangle (px)
* @param textureCoords
* texture coords (0-1)
* @param quad rectangle (px)
* @param textureCoords texture coords (0-1)
*/
public static void quadTexturedAbs(Rect quad, Rect textureCoords)
{
@@ -596,12 +502,9 @@ public class RenderUtils {
/**
* Render textured rect
*
* @param quad
* rectangle (px)
* @param txCoords
* texture coords rectangle (px)
* @param texture
* texture instance
* @param quad rectangle (px)
* @param txCoords texture coords rectangle (px)
* @param texture texture instance
*/
public static void quadTextured(Rect quad, Rect txCoords, Texture texture)
{
@@ -612,14 +515,10 @@ public class RenderUtils {
/**
* Render textured rect
*
* @param quad
* rectangle (px)
* @param txCoords
* texture coords rectangle (px)
* @param texture
* texture instance
* @param tint
* color tint
* @param quad rectangle (px)
* @param txCoords texture coords rectangle (px)
* @param texture texture instance
* @param tint color tint
*/
public static void quadTextured(Rect quad, Rect txCoords, Texture texture, RGB tint)
{
@@ -637,10 +536,8 @@ public class RenderUtils {
/**
* Render textured rect
*
* @param quad
* rectangle (px)
* @param txquad
* texture quad
* @param quad rectangle (px)
* @param txquad texture quad
*/
public static void quadTextured(Rect quad, TxQuad txquad)
{
@@ -651,12 +548,9 @@ public class RenderUtils {
/**
* Render textured rect
*
* @param quad
* rectangle (px)
* @param txquad
* texture instance
* @param tint
* color tint
* @param quad rectangle (px)
* @param txquad texture instance
* @param tint color tint
*/
public static void quadTextured(Rect quad, TxQuad txquad, RGB tint)
{
@@ -667,14 +561,10 @@ public class RenderUtils {
/**
* Render textured frame with borders
*
* @param quadRect
* drawn rectangle (px)
* @param textureRect
* rectangle in texture with the basic frame (px)
* @param yOffsetTimes
* offset count (move frame down n times)
* @param texture
* the texture
* @param quadRect drawn rectangle (px)
* @param textureRect rectangle in texture with the basic frame (px)
* @param yOffsetTimes offset count (move frame down n times)
* @param texture the texture
*/
public static void quadTexturedFrame(Rect quadRect, Rect textureRect, int yOffsetTimes, Texture texture)
{
@@ -685,16 +575,11 @@ public class RenderUtils {
/**
* Render textured frame with borders
*
* @param quadRect
* drawn rectangle (px)
* @param textureRect
* rectangle in texture with the basic frame (px)
* @param yOffsetTimes
* offset count (move frame down n times)
* @param texture
* the texture
* @param tint
* color tint
* @param quadRect drawn rectangle (px)
* @param textureRect rectangle in texture with the basic frame (px)
* @param yOffsetTimes offset count (move frame down n times)
* @param texture the texture
* @param tint color tint
*/
public static void quadTexturedFrame(Rect quadRect, Rect textureRect, int yOffsetTimes, Texture texture, RGB tint)
{
@@ -755,12 +640,9 @@ public class RenderUtils {
/**
* Render textured frame with borders
*
* @param quadRect
* drawn rectangle (px)
* @param textureRect
* rectangle in texture with the basic frame (px)
* @param texture
* the texture
* @param quadRect drawn rectangle (px)
* @param textureRect rectangle in texture with the basic frame (px)
* @param texture the texture
*/
public static void quadTexturedFrame(Rect quadRect, Rect textureRect, Texture texture)
{
@@ -771,10 +653,8 @@ public class RenderUtils {
/**
* Render textured frame with borders
*
* @param quadRect
* drawn rectangle (px)
* @param txquad
* texture quad
* @param quadRect drawn rectangle (px)
* @param txquad texture quad
*/
public static void quadTexturedFrame(Rect quadRect, TxQuad txquad)
{
@@ -785,12 +665,9 @@ public class RenderUtils {
/**
* Render textured frame with borders
*
* @param quadRect
* drawn rectangle (px)
* @param txquad
* texture quad
* @param yOffsetTimes
* offset count (move frame down n times)
* @param quadRect drawn rectangle (px)
* @param txquad texture quad
* @param yOffsetTimes offset count (move frame down n times)
*/
public static void quadTexturedFrame(Rect quadRect, TxQuad txquad, int yOffsetTimes)
{
@@ -801,14 +678,10 @@ public class RenderUtils {
/**
* Render textured frame with borders
*
* @param quadRect
* drawn rectangle (px)
* @param txquad
* texture quad
* @param yOffsetTimes
* offset count (move frame down n times)
* @param tint
* color tint
* @param quadRect drawn rectangle (px)
* @param txquad texture quad
* @param yOffsetTimes offset count (move frame down n times)
* @param tint color tint
*/
public static void quadTexturedFrame(Rect quadRect, TxQuad txquad, int yOffsetTimes, RGB tint)
{
@@ -820,14 +693,10 @@ public class RenderUtils {
* Render textured frame stretching horizontally (rect height = texture rect
* height)
*
* @param quadRect
* drawn rectangle (px)
* @param textureRect
* rectangle in texture with the basic frame (px)
* @param borderSize
* size of the unstretched horizontal border
* @param texture
* the texture
* @param quadRect drawn rectangle (px)
* @param textureRect rectangle in texture with the basic frame (px)
* @param borderSize size of the unstretched horizontal border
* @param texture the texture
*/
public static void quadTexturedStretchH(Rect quadRect, Rect textureRect, int borderSize, Texture texture)
{
@@ -839,16 +708,11 @@ public class RenderUtils {
* Render textured frame stretching horizontally (rect height = texture rect
* height)
*
* @param quadRect
* drawn rectangle (px)
* @param textureRect
* rectangle in texture with the basic frame (px)
* @param borderSize
* size of the unstretched horizontal border
* @param texture
* the texture
* @param tint
* color tint
* @param quadRect drawn rectangle (px)
* @param textureRect rectangle in texture with the basic frame (px)
* @param borderSize size of the unstretched horizontal border
* @param texture the texture
* @param tint color tint
*/
public static void quadTexturedStretchH(Rect quadRect, Rect textureRect, int borderSize, Texture texture, RGB tint)
{
@@ -889,12 +753,9 @@ public class RenderUtils {
* Render textured frame stretching horizontally (rect height = texture rect
* height)
*
* @param quadRect
* drawn rectangle (px)
* @param txquad
* texture quad
* @param borderSize
* size of the unstretched horizontal border
* @param quadRect drawn rectangle (px)
* @param txquad texture quad
* @param borderSize size of the unstretched horizontal border
*/
public static void quadTexturedStretchH(Rect quadRect, TxQuad txquad, int borderSize)
{
@@ -906,14 +767,10 @@ public class RenderUtils {
* Render textured frame stretching horizontally (rect height = texture rect
* height)
*
* @param quadRect
* drawn rectangle (px)
* @param txquad
* texture quad
* @param borderSize
* size of the unstretched horizontal border
* @param tint
* color tint
* @param quadRect drawn rectangle (px)
* @param txquad texture quad
* @param borderSize size of the unstretched horizontal border
* @param tint color tint
*/
public static void quadTexturedStretchH(Rect quadRect, TxQuad txquad, int borderSize, RGB tint)
{
@@ -925,14 +782,10 @@ public class RenderUtils {
* Render textured frame stretching vertically (rect width = texture rect
* width)
*
* @param quadRect
* drawn rectangle (px)
* @param textureRect
* rectangle in texture with the basic frame (px)
* @param borderSize
* size of the unstretched horizontal border
* @param texture
* the texture
* @param quadRect drawn rectangle (px)
* @param textureRect rectangle in texture with the basic frame (px)
* @param borderSize size of the unstretched horizontal border
* @param texture the texture
*/
public static void quadTexturedStretchV(Rect quadRect, Rect textureRect, int borderSize, Texture texture)
{
@@ -944,16 +797,11 @@ public class RenderUtils {
* Render textured frame stretching vertically (rect width = texture rect
* width)
*
* @param quadRect
* drawn rectangle (px)
* @param textureRect
* rectangle in texture with the basic frame (px)
* @param borderSize
* size of the unstretched horizontal border
* @param texture
* the texture
* @param tint
* color tint
* @param quadRect drawn rectangle (px)
* @param textureRect rectangle in texture with the basic frame (px)
* @param borderSize size of the unstretched horizontal border
* @param texture the texture
* @param tint color tint
*/
public static void quadTexturedStretchV(Rect quadRect, Rect textureRect, int borderSize, Texture texture, RGB tint)
{
@@ -996,12 +844,9 @@ public class RenderUtils {
* Render textured frame stretching vertically (rect width = texture rect
* width)
*
* @param quadRect
* drawn rectangle (px)
* @param txquad
* texture quad
* @param borderSize
* size of the unstretched horizontal border
* @param quadRect drawn rectangle (px)
* @param txquad texture quad
* @param borderSize size of the unstretched horizontal border
*/
public static void quadTexturedStretchV(Rect quadRect, TxQuad txquad, int borderSize)
{
@@ -1013,14 +858,10 @@ public class RenderUtils {
* Render textured frame stretching vertically (rect width = texture rect
* width)
*
* @param quadRect
* drawn rectangle (px)
* @param txquad
* texture quad
* @param borderSize
* size of the unstretched horizontal border
* @param tint
* color tint
* @param quadRect drawn rectangle (px)
* @param txquad texture quad
* @param borderSize size of the unstretched horizontal border
* @param tint color tint
*/
public static void quadTexturedStretchV(Rect quadRect, TxQuad txquad, int borderSize, RGB tint)
{
@@ -1032,14 +873,10 @@ public class RenderUtils {
/**
* Render quad 2D
*
* @param left
* units from left
* @param bottom
* units from bottom
* @param width
* quad width
* @param height
* quad height
* @param left units from left
* @param bottom units from bottom
* @param width quad width
* @param height quad height
*/
public static void quadSize(double left, double bottom, double width, double height)
{
@@ -1055,8 +892,7 @@ public class RenderUtils {
/**
* Bind GL color
*
* @param color
* RGB color
* @param color RGB color
*/
public static void setColor(RGB color)
{
@@ -1067,10 +903,8 @@ public class RenderUtils {
/**
* Bind GL color
*
* @param color
* RGB color
* @param alpha
* alpha multiplier
* @param color RGB color
* @param alpha alpha multiplier
*/
public static void setColor(RGB color, double alpha)
{
@@ -1081,8 +915,7 @@ public class RenderUtils {
/**
* Translate with coord
*
* @param coord
* coord
* @param coord coord
*/
public static void translate(Coord coord)
{
+1
View File
@@ -1,5 +1,6 @@
package mightypork.rogue.util;
/**
* Utils class
*