diff --git a/src/main/java/ru/windcorp/progressia/client/graphics/backend/InputHandler.java b/src/main/java/ru/windcorp/progressia/client/graphics/backend/InputHandler.java index 2f725d7..285f6f3 100644 --- a/src/main/java/ru/windcorp/progressia/client/graphics/backend/InputHandler.java +++ b/src/main/java/ru/windcorp/progressia/client/graphics/backend/InputHandler.java @@ -101,6 +101,7 @@ public class InputHandler { double x, double y ) { if (GraphicsBackend.getWindowHandle() != window) return; + y = GraphicsInterface.getFrameHeight() - y; // Flip y axis InputTracker.initializeCursorPosition(x, y); diff --git a/src/main/java/ru/windcorp/progressia/client/graphics/flat/FlatRenderHelper.java b/src/main/java/ru/windcorp/progressia/client/graphics/flat/FlatRenderHelper.java old mode 100644 new mode 100755 index 1f99721..11b2f9e --- a/src/main/java/ru/windcorp/progressia/client/graphics/flat/FlatRenderHelper.java +++ b/src/main/java/ru/windcorp/progressia/client/graphics/flat/FlatRenderHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Progressia + * Optica * Copyright (C) 2020 Wind Corporation * * This program is free software: you can redistribute it and/or modify @@ -36,8 +36,8 @@ public abstract class FlatRenderHelper extends ShapeRenderHelper { float width = GraphicsInterface.getFrameWidth(); float height = GraphicsInterface.getFrameHeight(); - return finalTransform.identity().translate(-1, +1, 0) - .scale(2 / width, -2 / height, 1 / MAX_DEPTH) + return finalTransform.identity().translate(-1, -1, 0) + .scale(2 / width, 2 / height, 1 / MAX_DEPTH) .mul(getTransform()); } diff --git a/src/main/java/ru/windcorp/progressia/client/graphics/flat/FlatRenderProgram.java b/src/main/java/ru/windcorp/progressia/client/graphics/flat/FlatRenderProgram.java old mode 100644 new mode 100755 index 2953901..884b2ed --- a/src/main/java/ru/windcorp/progressia/client/graphics/flat/FlatRenderProgram.java +++ b/src/main/java/ru/windcorp/progressia/client/graphics/flat/FlatRenderProgram.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Progressia + * Optica * Copyright (C) 2020 Wind Corporation * * This program is free software: you can redistribute it and/or modify @@ -104,14 +104,6 @@ public class FlatRenderProgram extends ShapeRenderProgram { masks.flip(); masksUniform.set(masks); -// for (int i = 0; i < pos; ++i) { -// if (i % TransformedMask.SIZE_IN_FLOATS == 0) { -// System.out.print(" | "); -// } -// System.out.print(masks.get(i) + "; "); -// } -// System.out.println(); - masks.limit(limit); masks.position(pos); } diff --git a/src/main/java/ru/windcorp/progressia/client/graphics/flat/LayerTestUI.java b/src/main/java/ru/windcorp/progressia/client/graphics/flat/LayerTestUI.java old mode 100644 new mode 100755 index 4586f12..8fbffcc --- a/src/main/java/ru/windcorp/progressia/client/graphics/flat/LayerTestUI.java +++ b/src/main/java/ru/windcorp/progressia/client/graphics/flat/LayerTestUI.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Progressia + * Optica * Copyright (C) 2020 Wind Corporation * * This program is free software: you can redistribute it and/or modify @@ -52,9 +52,9 @@ public class LayerTestUI extends AssembledFlatLayer { final int boxShadowColor = flag ? 0x440000 : 0x444400; int x = (getWidth() - WIDTH) / 2; - int y = getHeight() - HEIGHT - 2*BORDER; + int y = 2*BORDER; - target.fill(x + BORDER, y + BORDER, WIDTH, HEIGHT, boxShadowColor); + target.fill(x + BORDER, y - BORDER, WIDTH, HEIGHT, boxShadowColor); target.fill(x - 1, y - 1, WIDTH + 2, HEIGHT + 2, boxShadowColor); target.fill(x, y, WIDTH, HEIGHT, borderColor); target.fill(x + BORDER, y + BORDER, WIDTH - 2*BORDER, HEIGHT - 2*BORDER, boxColor); @@ -67,7 +67,7 @@ public class LayerTestUI extends AssembledFlatLayer { final Texture compassBg = SimpleTextures.get("compass_icon"); final Texture compassFg = SimpleTextures.get("compass_icon_arrow"); - target.drawTexture(texShadow, texShadow, texSize, texSize, Colors.BLACK, compassBg); + target.drawTexture(texShadow, -texShadow, texSize, texSize, Colors.BLACK, compassBg); target.drawTexture(0, 0, texSize, texSize, compassBg); target.addCustomRenderer(new LambdaModel(LambdaModel.lambdaBuilder() diff --git a/src/main/java/ru/windcorp/progressia/client/graphics/flat/RenderTarget.java b/src/main/java/ru/windcorp/progressia/client/graphics/flat/RenderTarget.java old mode 100644 new mode 100755 index dd24d33..fe018c7 --- a/src/main/java/ru/windcorp/progressia/client/graphics/flat/RenderTarget.java +++ b/src/main/java/ru/windcorp/progressia/client/graphics/flat/RenderTarget.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Progressia + * Optica * Copyright (C) 2020 Wind Corporation * * This program is free software: you can redistribute it and/or modify @@ -228,9 +228,9 @@ public class RenderTarget { FlatRenderProgram.getDefault(), texture, createVectorFromRGBInt(color), - new Vec3(x, y + height, depth), // Flip + new Vec3(x, y, depth), new Vec3(width, 0, 0), - new Vec3(0, -height, 0) + new Vec3(0, height, 0) ); } diff --git a/src/main/java/ru/windcorp/progressia/client/graphics/flat/TransformedMask.java b/src/main/java/ru/windcorp/progressia/client/graphics/flat/TransformedMask.java old mode 100644 new mode 100755 index 4916b95..f02e171 --- a/src/main/java/ru/windcorp/progressia/client/graphics/flat/TransformedMask.java +++ b/src/main/java/ru/windcorp/progressia/client/graphics/flat/TransformedMask.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Progressia + * Optica * Copyright (C) 2020 Wind Corporation * * This program is free software: you can redistribute it and/or modify @@ -22,7 +22,6 @@ import java.nio.FloatBuffer; import glm.mat._4.Mat4; import glm.vec._2.Vec2; import glm.vec._4.Vec4; -import ru.windcorp.progressia.client.graphics.backend.GraphicsInterface; public class TransformedMask { @@ -92,8 +91,6 @@ public class TransformedMask { transform.mul(startXendY); transform.mul(endXstartY); transform.mul(endXendY); - - flipY(); } private void ensureTemporaryVariablesExist() { @@ -105,15 +102,6 @@ public class TransformedMask { } } - private void flipY() { - float height = GraphicsInterface.getFrameHeight(); - - startXstartY.y = height - startXstartY.y; - startXendY.y = height - startXendY.y; - endXstartY.y = height - endXstartY.y; - endXendY.y = height - endXendY.y; - } - private void setFields() { origin.set( startXstartY.x, diff --git a/src/main/java/ru/windcorp/progressia/client/graphics/world/LayerWorld.java b/src/main/java/ru/windcorp/progressia/client/graphics/world/LayerWorld.java index bc213d1..5ea8650 100644 --- a/src/main/java/ru/windcorp/progressia/client/graphics/world/LayerWorld.java +++ b/src/main/java/ru/windcorp/progressia/client/graphics/world/LayerWorld.java @@ -190,7 +190,7 @@ public class LayerWorld extends Layer { if (!flag) return; final float yawScale = 0.002f; - final float pitchScale = yawScale; + final float pitchScale = -yawScale; camera.turn( (float) (event.getChangeY() * pitchScale),