Added NumBound & friends. Mutable is now a view. Much nicer!!

This commit is contained in:
Ondřej Hruška
2014-04-13 23:15:42 +02:00
parent a5c32834c0
commit 3320678f36
56 changed files with 652 additions and 431 deletions
@@ -4,7 +4,6 @@ package mightypork.gamecore.control.bus.events;
import mightypork.gamecore.control.bus.events.types.UnloggedEvent;
import mightypork.utils.math.vect.Vect;
import mightypork.utils.math.vect.VectVal;
import mightypork.utils.math.vect.VectView;
/**
@@ -3,26 +3,27 @@ package mightypork.gamecore.gui.components;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.control.AppSubModule;
import mightypork.gamecore.control.bus.BusAccess;
import mightypork.gamecore.control.bus.clients.BusNode;
import mightypork.utils.math.constraints.RectBound;
import mightypork.utils.math.rect.RectView;
public abstract class AbstractComponent extends AppSubModule implements PluggableRenderable {
private RectBound context;
private RectBound context;
public AbstractComponent(AppAccess app) {
super(app);
}
@Override
public void setContext(RectBound context)
{
this.context = context;
}
@Override
public RectView getRect()
{
@@ -20,7 +20,7 @@ import mightypork.utils.math.constraints.RectBound;
*/
public abstract class AbstractLayout extends AbstractComponent {
final LinkedList<PluggableRenderable> elements = new LinkedList<>();
final LinkedList<PluggableRenderable> elements = new LinkedList<>();
/**
@@ -1,7 +1,6 @@
package mightypork.gamecore.gui.components.layout;
import static mightypork.utils.math.constraints.ConstraintFactory.*;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.gui.components.PluggableRenderable;
import mightypork.utils.math.constraints.RectBound;
@@ -1,7 +1,6 @@
package mightypork.gamecore.gui.components.layout;
import static mightypork.utils.math.constraints.ConstraintFactory.*;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.gui.components.PluggableRenderable;
import mightypork.utils.math.constraints.RectBound;
@@ -3,8 +3,8 @@ package mightypork.gamecore.gui.components.painters;
import mightypork.gamecore.gui.components.PluggableRenderable;
import mightypork.gamecore.gui.components.Renderable;
import mightypork.utils.math.constraints.RectBoundAdapter;
import mightypork.utils.math.constraints.RectBound;
import mightypork.utils.math.constraints.RectBoundAdapter;
import mightypork.utils.math.rect.RectView;
@@ -54,14 +54,14 @@ public class QuadPainter extends AbstractPainter {
Render.quadColor(getRect(), colorHMinVMin, colorHMaxVMin, colorHMaxVMax, colorHMinVMax);
}
@FactoryMethod
public static QuadPainter gradH(RGB colorLeft, RGB colorRight)
{
return new QuadPainter(colorLeft, colorRight, colorRight, colorLeft);
}
@FactoryMethod
public static QuadPainter gradV(RGB colorTop, RGB colorBottom)
{
+1 -1
View File
@@ -352,7 +352,7 @@ public class Render {
*/
public static void quad(Rect quad)
{
RectView rv = quad.view();
final RectView rv = quad.view();
final double x1 = rv.left().value();
final double y1 = rv.top().value();
@@ -294,7 +294,8 @@ public class CachedFont implements GLFont {
byteBuffer = ByteBuffer.allocateDirect(width * height * (bpp / 8)).order(ByteOrder.nativeOrder()).put(newI);
} else {
byteBuffer = ByteBuffer.allocateDirect(width * height * (bpp / 8)).order(ByteOrder.nativeOrder()).put(((DataBufferByte) (bufferedImage.getData().getDataBuffer())).getData());
byteBuffer = ByteBuffer.allocateDirect(width * height * (bpp / 8)).order(ByteOrder.nativeOrder())
.put(((DataBufferByte) (bufferedImage.getData().getDataBuffer())).getData());
}
byteBuffer.flip();
@@ -411,7 +412,8 @@ public class CachedFont implements GLFont {
chtx = chars.get(charCurrent);
if (chtx != null) {
drawQuad((totalwidth), 0, (totalwidth + chtx.width), (chtx.height), chtx.texPosX, chtx.texPosY, chtx.texPosX + chtx.width, chtx.texPosY + chtx.height);
drawQuad((totalwidth), 0, (totalwidth + chtx.width), (chtx.height), chtx.texPosX, chtx.texPosY, chtx.texPosX + chtx.width, chtx.texPosY
+ chtx.height);
totalwidth += chtx.width;
}
}