From 42623b4583638122e34111fb82fbde6b165353e2 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 18 Feb 2023 13:48:30 -0600 Subject: [PATCH] improve FullDataPointUtil and RenderDataPointUtil header comments --- .../lod/core/util/FullDataPointUtil.java | 19 +++++--- .../lod/core/util/RenderDataPointUtil.java | 46 ++++++++++++------- 2 files changed, 42 insertions(+), 23 deletions(-) diff --git a/core/src/main/java/com/seibel/lod/core/util/FullDataPointUtil.java b/core/src/main/java/com/seibel/lod/core/util/FullDataPointUtil.java index c771ae233..0552297db 100644 --- a/core/src/main/java/com/seibel/lod/core/util/FullDataPointUtil.java +++ b/core/src/main/java/com/seibel/lod/core/util/FullDataPointUtil.java @@ -7,17 +7,21 @@ import org.jetbrains.annotations.Contract; import static com.seibel.lod.core.util.RenderDataPointUtil.MAX_WORLD_Y_SIZE; /** - * - * Static class used to format the full binary Distant Horizons data format.
- * Contains all the data we save. + * A helper class that is used to access the data from a long + * formatted as a full data point.
+ * A full data point contains the most information and is the + * base truth used when creating render data.

* - *

+ * To access data from a long formatted as a render data point see: {@link RenderDataPointUtil}

+ * + * DataPoint Format:
+ * * ID: blockState id
* Y: Height(signed)
- * DP: Depth(signed?) (Depth means the length of the block!)
+ * DP: Depth (Depth means the length of the block!)
* BL: Block light
* SL: Sky light

- * + * * =======Bit layout=======
* BL BL BL BL SL SL SL SL <-- Top bits
* YY YY YY YY YY YY YY YY
@@ -28,7 +32,8 @@ import static com.seibel.lod.core.util.RenderDataPointUtil.MAX_WORLD_Y_SIZE; * ID ID ID ID ID ID IO ID
* ID ID ID ID ID ID IO ID <-- Bottom bits
*
- * + * + * @see RenderDataPointUtil */ public class FullDataPointUtil { diff --git a/core/src/main/java/com/seibel/lod/core/util/RenderDataPointUtil.java b/core/src/main/java/com/seibel/lod/core/util/RenderDataPointUtil.java index afcffd04e..b87ddd3d0 100644 --- a/core/src/main/java/com/seibel/lod/core/util/RenderDataPointUtil.java +++ b/core/src/main/java/com/seibel/lod/core/util/RenderDataPointUtil.java @@ -27,25 +27,39 @@ import java.util.Arrays; /** - * A helper class that is used to access the data in a RenderColumn - * long datapoint. + * A helper class that is used to access the data from a long + * formatted as a render data point.

+ * + * To access data from a long formatted as a full data point see: {@link FullDataPointUtil} + * + * DataPoint Format:
+ * + * GM: generation mode
+ * A: color alpha
+ * R: color red
+ * G: color green
+ * B: color blue
+ * H: column height
+ * D: column depth (what Y value the column starts at)
+ * BL: block light
+ * SL: sky light
+ * + * =======Bit layout=======
+ * _ GM GM GM A A A A |
+ * R R R R R R R R |
+ * G G G G G G G G |
+ * B B B B B B B B |

+ * + * H H H H H H H H |
+ * H H H H D D D D |
+ * D D D D D D D D |
+ * BL BL BL BL SL SL SL SL |
+ *
+ * + * @see FullDataPointUtil */ public class RenderDataPointUtil { - /* - - |_ |g |g |g |a |a |a |a | - |r |r |r |r |r |r |r |r | - |g |g |g |g |g |g |g |g | - |b |b |b |b |b |b |b |b | - - |h |h |h |h |h |h |h |h | - |h |h |h |h |d |d |d |d | - |d |d |d |d |d |d |d |d | - |bl |bl |bl |bl |sl |sl |sl |sl | - - */ - // Reminder: bytes have range of [-128, 127]. // When converting to or from an int a 128 should be added or removed. // If there is a bug with color then it's probably caused by this.