projects
/
sixth-3d.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated readability of the code.
[sixth-3d.git]
/
src
/
main
/
java
/
eu
/
svjatoslav
/
sixth
/
e3d
/
renderer
/
raster
/
shapes
/
composite
/
textcanvas
/
TextCanvas.java
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/textcanvas/TextCanvas.java
b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/textcanvas/TextCanvas.java
index
7945a54
..
854d756
100644
(file)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/textcanvas/TextCanvas.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/textcanvas/TextCanvas.java
@@
-1,5
+1,5
@@
/*
/*
- * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
* This project is released under Creative Commons Zero (CC0) license.
*/
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.textcanvas;
* This project is released under Creative Commons Zero (CC0) license.
*/
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.textcanvas;
@@
-8,7
+8,7
@@
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
import eu.svjatoslav.sixth.e3d.gui.RenderingContext;
import eu.svjatoslav.sixth.e3d.gui.TextPointer;
import eu.svjatoslav.sixth.e3d.math.Transform;
import eu.svjatoslav.sixth.e3d.gui.RenderingContext;
import eu.svjatoslav.sixth.e3d.gui.TextPointer;
import eu.svjatoslav.sixth.e3d.math.Transform;
-import eu.svjatoslav.sixth.e3d.math.Transform
Pipe
;
+import eu.svjatoslav.sixth.e3d.math.Transform
sStack
;
import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.TexturedRectangle;
import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.TexturedRectangle;
@@
-22,7
+22,7
@@
import static eu.svjatoslav.sixth.e3d.renderer.raster.Color.WHITE;
public class TextCanvas extends TexturedRectangle {
public class TextCanvas extends TexturedRectangle {
- // character size in world coordiates
+ // character size in world coordi
n
ates
public static final int FONT_CHAR_WIDTH = 8;
public static final int FONT_CHAR_HEIGHT = 16;
public static final int FONT_CHAR_WIDTH = 8;
public static final int FONT_CHAR_HEIGHT = 16;
@@
-31,12
+31,12
@@
public class TextCanvas extends TexturedRectangle {
public static final int FONT_CHAR_HEIGHT_TEXTURE_PIXELS = 32;
public static final int FONT_CHAR_HEIGHT_TEXTURE_PIXELS = 32;
- public static final Font FONT = CanvasCharacter.getFont((int)(FONT_CHAR_HEIGHT_TEXTURE_PIXELS / 1.066));
+ public static final Font FONT = CanvasCharacter.getFont((int)
(FONT_CHAR_HEIGHT_TEXTURE_PIXELS / 1.066));
private static final String GROUP_TEXTURE = "texture";
private static final String GROUP_CHARACTERS = "characters";
private final TextPointer size;
private final TextPointer cursorLocation = new TextPointer();
private static final String GROUP_TEXTURE = "texture";
private static final String GROUP_CHARACTERS = "characters";
private final TextPointer size;
private final TextPointer cursorLocation = new TextPointer();
- CanvasCharacter
lines[][]
;
+ CanvasCharacter
[][] lines
;
private RenderMode renderMode = null;
private Color backgroundColor = BLACK;
private Color foregroundColor = WHITE;
private RenderMode renderMode = null;
private Color backgroundColor = BLACK;
private Color foregroundColor = WHITE;
@@
-118,7
+118,7
@@
public class TextCanvas extends TexturedRectangle {
}
@Override
}
@Override
- public void beforeTransformHook(final Transform
Pipe
transformPipe,
+ public void beforeTransformHook(final Transform
sStack
transformPipe,
final RenderingContext context) {
final double textRelativeSize = context.width
final RenderingContext context) {
final double textRelativeSize = context.width
@@
-145,7
+145,7
@@
public class TextCanvas extends TexturedRectangle {
setRenderMode(RenderMode.CHARACTERS);
}
setRenderMode(RenderMode.CHARACTERS);
}
- public void cl
s
() {
+ public void cl
ear
() {
for (final CanvasCharacter[] line : lines)
for (final CanvasCharacter character : line) {
character.setValue(' ');
for (final CanvasCharacter[] line : lines)
for (final CanvasCharacter character : line) {
character.setValue(' ');
@@
-173,8
+173,8
@@
public class TextCanvas extends TexturedRectangle {
graphics.setColor(foreground.toAwtColor());
graphics.drawChars(
new char[]{character,}, 0, 1,
graphics.setColor(foreground.toAwtColor());
graphics.drawChars(
new char[]{character,}, 0, 1,
- (column * FONT_CHAR_WIDTH_TEXTURE_PIXELS)
- 0
,
- (row * FONT_CHAR_HEIGHT_TEXTURE_PIXELS) + (int)(FONT_CHAR_HEIGHT_TEXTURE_PIXELS / 1.23f));
+ (column * FONT_CHAR_WIDTH_TEXTURE_PIXELS),
+ (row * FONT_CHAR_HEIGHT_TEXTURE_PIXELS) + (int)
(FONT_CHAR_HEIGHT_TEXTURE_PIXELS / 1.23f));
getTexture().resetResampledBitmapCache();
}
getTexture().resetResampledBitmapCache();
}
@@
-295,11
+295,4
@@
public class TextCanvas extends TexturedRectangle {
character.setForegroundColor(color);
}
character.setForegroundColor(color);
}
- // @Override
- // public void transform(final TransformPipe transformPipe,
- // final RenderAggregator aggregator, final RenderingContext buffer) {
- //
- // super.transform(transformPipe, aggregator, buffer);
- //
- // }
}
}