commit b6ac4339c71b28cc66a4877b7c318c74b19da396
parent 072d24f0f96a6a3c9679116f862671a7059f94f0
Author: Oshgnacknak <osh@oshgnacknak.de>
Date: Fri, 9 Apr 2021 16:27:50 +0200
Higher quality + remove frame
Diffstat:
2 files changed, 7 insertions(+), 40 deletions(-)
diff --git a/src/main/java/de/oshgnacknak/create_ponder_wonder/RenderUtils.java b/src/main/java/de/oshgnacknak/create_ponder_wonder/RenderUtils.java
@@ -15,10 +15,9 @@ import java.util.function.Consumer;
public class RenderUtils {
private static final double SCALE = 1;
- private static final int WIDTH = 720;
- private static final int HEIGHT = 480;
- private static final double Z_DISTANCE = 1500;
- private static final boolean INCLUDE_FRAME = false;
+ private static final int WIDTH = 1920;
+ private static final int HEIGHT = 1080;
+ private static final double Z_DISTANCE = 1400;
private RenderUtils() {}
@@ -61,13 +60,7 @@ public class RenderUtils {
RenderSystem.disableBlend();
RenderSystem.popMatrix();
- NativeImage img = ScreenShotHelper.createScreenshot(realWidth, realHeight, fb);
-
- if (INCLUDE_FRAME) {
- applyFrame(img);
- }
-
- return img;
+ return ScreenShotHelper.createScreenshot(realWidth, realHeight, fb);
}
private static void testForValidSize(int realWidth, int realHeight) {
@@ -81,32 +74,6 @@ public class RenderUtils {
}
}
- private static void applyFrame(NativeImage img) {
- img.fillAreaRGBA(scale(0), scale(0), scale(2), scale(1), 0x00000000);
- img.fillAreaRGBA(scale(0), scale(1), scale(1), scale(1), 0x00000000);
- img.fillAreaRGBA(scale(WIDTH - 2), scale(0), scale(2), scale(1), 0x00000000);
- img.fillAreaRGBA(scale(WIDTH - 1), scale(1), scale(1), scale(1), 0x00000000);
- img.fillAreaRGBA(scale(0), scale(HEIGHT - 1), scale(2), scale(1), 0x00000000);
- img.fillAreaRGBA(scale(0), scale(HEIGHT - 2), scale(1), scale(1), 0x00000000);
- img.fillAreaRGBA(scale(WIDTH - 2), scale(HEIGHT - 1), scale(2), scale(1), 0x00000000);
- img.fillAreaRGBA(scale(WIDTH - 1), scale(HEIGHT - 2), scale(1), scale(1), 0x00000000);
-
- img.fillAreaRGBA(scale(1), scale(1), scale(1), scale(1), 0xFF999999);
- img.fillAreaRGBA(scale(WIDTH - 2), scale(1), scale(1), scale(1), 0xFF999999);
- img.fillAreaRGBA(scale(1), scale(HEIGHT - 2), scale(1), scale(1), 0xFF999999);
- img.fillAreaRGBA(scale(WIDTH - 2), scale(HEIGHT - 2), scale(1), scale(1), 0xFF999999);
-
- img.fillAreaRGBA(scale(2), scale(0), scale(WIDTH - 4), scale(1), 0xFF999999);
- img.fillAreaRGBA(scale(2), scale(HEIGHT - 1), scale(WIDTH - 4), scale(1), 0xFF999999);
- img.fillAreaRGBA(scale(0), scale(2), scale(1), scale(HEIGHT - 4), 0xFF999999);
- img.fillAreaRGBA(scale(WIDTH - 1), scale(2), scale(1), scale(HEIGHT - 4), 0xFF999999);
-
- img.fillAreaRGBA(scale(2), scale(1), scale(WIDTH - 4), scale(1), 0xFFD8D8D8);
- img.fillAreaRGBA(scale(2), scale(HEIGHT - 2), scale(WIDTH - 4), scale(1), 0xFFB3B3B3);
- img.fillAreaRGBA(scale(1), scale(2), scale(1), scale(HEIGHT - 4), 0xFFD8D8D8);
- img.fillAreaRGBA(scale(WIDTH - 2), scale(2), scale(1), scale(HEIGHT - 4), 0xFFB3B3B3);
- }
-
private static int scale(int value) {
return (int) Math.round(value * SCALE);
}
diff --git a/src/main/java/de/oshgnacknak/create_ponder_wonder/commands/DumpPonsersCommand.java b/src/main/java/de/oshgnacknak/create_ponder_wonder/commands/DumpPonsersCommand.java
@@ -23,7 +23,7 @@ import java.util.concurrent.ExecutionException;
public class DumpPonsersCommand implements Command<CommandSource> {
private static final int FPS = 60;
- private static final int MAX_FRAMES = FPS*3;
+ private static final int MAX_FRAMES = 3;
private static final long MAX_PONDERS = 1;
@Override
@@ -42,7 +42,7 @@ public class DumpPonsersCommand implements Command<CommandSource> {
private void renderPonderUI(String basePath, PonderWonderUI ponderWonderUI) {
try {
for (int frame = 0; frame < MAX_FRAMES; frame++) {
- Promise<NativeImage> promise = renderUI(ponderWonderUI, frame);
+ Promise<NativeImage> promise = renderFrame(ponderWonderUI, frame);
NativeImage img = promise.get();
Path path = Paths.get(
@@ -63,7 +63,7 @@ public class DumpPonsersCommand implements Command<CommandSource> {
}
}
- private Promise<NativeImage> renderUI(PonderWonderUI ponderWonderUI, int frame) {
+ private Promise<NativeImage> renderFrame(PonderWonderUI ponderWonderUI, int frame) {
Promise<NativeImage> promise = GlobalEventExecutor.INSTANCE.newPromise();
float pt = (frame % FPS) / (FPS / 3.0f);