diff --git a/out/production/Terrarum_renewed/com/Torvald/JsonWriter.class b/out/production/Terrarum_renewed/com/Torvald/JsonWriter.class new file mode 100644 index 000000000..1c0b83093 Binary files /dev/null and b/out/production/Terrarum_renewed/com/Torvald/JsonWriter.class differ diff --git a/out/production/Terrarum_renewed/com/Torvald/RasterWriter.class b/out/production/Terrarum_renewed/com/Torvald/RasterWriter.class new file mode 100644 index 000000000..f52f52911 Binary files /dev/null and b/out/production/Terrarum_renewed/com/Torvald/RasterWriter.class differ diff --git a/out/production/Terrarum_renewed/com/Torvald/Terrarum/Actors/ActorWithBody.class b/out/production/Terrarum_renewed/com/Torvald/Terrarum/Actors/ActorWithBody.class index e7f10bba6..f8f02a082 100644 Binary files a/out/production/Terrarum_renewed/com/Torvald/Terrarum/Actors/ActorWithBody.class and b/out/production/Terrarum_renewed/com/Torvald/Terrarum/Actors/ActorWithBody.class differ diff --git a/out/production/Terrarum_renewed/com/Torvald/Terrarum/Actors/PBFSigrid.class b/out/production/Terrarum_renewed/com/Torvald/Terrarum/Actors/PBFSigrid.class index c19c5bd60..518807b02 100644 Binary files a/out/production/Terrarum_renewed/com/Torvald/Terrarum/Actors/PBFSigrid.class and b/out/production/Terrarum_renewed/com/Torvald/Terrarum/Actors/PBFSigrid.class differ diff --git a/out/production/Terrarum_renewed/com/Torvald/Terrarum/ConsoleCommand/ExportAV.class b/out/production/Terrarum_renewed/com/Torvald/Terrarum/ConsoleCommand/ExportAV.class index ceb8a3b93..ec3cf88a5 100644 Binary files a/out/production/Terrarum_renewed/com/Torvald/Terrarum/ConsoleCommand/ExportAV.class and b/out/production/Terrarum_renewed/com/Torvald/Terrarum/ConsoleCommand/ExportAV.class differ diff --git a/out/production/Terrarum_renewed/com/Torvald/Terrarum/ConsoleCommand/ExportMap.class b/out/production/Terrarum_renewed/com/Torvald/Terrarum/ConsoleCommand/ExportMap.class index eeb3fa38d..012e5c6d2 100644 Binary files a/out/production/Terrarum_renewed/com/Torvald/Terrarum/ConsoleCommand/ExportMap.class and b/out/production/Terrarum_renewed/com/Torvald/Terrarum/ConsoleCommand/ExportMap.class differ diff --git a/out/production/Terrarum_renewed/com/Torvald/Terrarum/Game.class b/out/production/Terrarum_renewed/com/Torvald/Terrarum/Game.class index 2d8a40a78..1033bb3e5 100644 Binary files a/out/production/Terrarum_renewed/com/Torvald/Terrarum/Game.class and b/out/production/Terrarum_renewed/com/Torvald/Terrarum/Game.class differ diff --git a/out/production/Terrarum_renewed/com/Torvald/Terrarum/MapDrawer/LightmapLantern.class b/out/production/Terrarum_renewed/com/Torvald/Terrarum/MapDrawer/LightmapLantern.class index cb42f86c9..a63e08542 100644 Binary files a/out/production/Terrarum_renewed/com/Torvald/Terrarum/MapDrawer/LightmapLantern.class and b/out/production/Terrarum_renewed/com/Torvald/Terrarum/MapDrawer/LightmapLantern.class differ diff --git a/out/production/Terrarum_renewed/com/Torvald/Terrarum/MapDrawer/LightmapRenderer.class b/out/production/Terrarum_renewed/com/Torvald/Terrarum/MapDrawer/LightmapRenderer.class index b53845f7b..1b14624f0 100644 Binary files a/out/production/Terrarum_renewed/com/Torvald/Terrarum/MapDrawer/LightmapRenderer.class and b/out/production/Terrarum_renewed/com/Torvald/Terrarum/MapDrawer/LightmapRenderer.class differ diff --git a/out/production/Terrarum_renewed/com/Torvald/Terrarum/Terrarum.class b/out/production/Terrarum_renewed/com/Torvald/Terrarum/Terrarum.class index f5f409ca3..ea8088d60 100644 Binary files a/out/production/Terrarum_renewed/com/Torvald/Terrarum/Terrarum.class and b/out/production/Terrarum_renewed/com/Torvald/Terrarum/Terrarum.class differ diff --git a/out/production/Terrarum_renewed/com/Torvald/Terrarum/UserInterface/BasicDebugInfoWindow.class b/out/production/Terrarum_renewed/com/Torvald/Terrarum/UserInterface/BasicDebugInfoWindow.class index ea10ee23f..865381af7 100644 Binary files a/out/production/Terrarum_renewed/com/Torvald/Terrarum/UserInterface/BasicDebugInfoWindow.class and b/out/production/Terrarum_renewed/com/Torvald/Terrarum/UserInterface/BasicDebugInfoWindow.class differ diff --git a/src/com/Torvald/JsonWriter.java b/src/com/Torvald/JsonWriter.java new file mode 100644 index 000000000..3b615a4a6 --- /dev/null +++ b/src/com/Torvald/JsonWriter.java @@ -0,0 +1,22 @@ +package com.Torvald; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; + +import java.io.FileWriter; +import java.io.IOException; + +/** + * Created by minjaesong on 16-03-04. + */ +public class JsonWriter { + + public static void writeFile(Object c, String path) throws IOException { + JsonElement classElem = new Gson().toJsonTree(c); + String jsonString = classElem.toString(); + FileWriter writer = new FileWriter(path); + writer.write(jsonString); + writer.close(); + } + +} diff --git a/src/com/Torvald/RasterWriter.java b/src/com/Torvald/RasterWriter.java new file mode 100644 index 000000000..d861dedd1 --- /dev/null +++ b/src/com/Torvald/RasterWriter.java @@ -0,0 +1,55 @@ +package com.Torvald; + +import com.Torvald.Terrarum.Terrarum; + +import javax.imageio.ImageIO; +import java.awt.*; +import java.awt.color.ColorSpace; +import java.awt.image.*; +import java.io.File; +import java.io.IOException; + +/** + * Created by minjaesong on 16-03-04. + */ +public class RasterWriter { + + public static final int[] BANDOFFSET_RGB = {0, 1, 2}; + public static final int[] BANDOFFSET_RGBA = {0, 1, 2, 3}; + public static final int[] BANDOFFSET_ARGB = {3, 0, 1, 2}; + public static final int[] BANDOFFSET_MONO = {0}; + + public static final int COLORSPACE_SRGB = ColorSpace.CS_sRGB; + public static final int COLORSPACE_GRAY = ColorSpace.CS_GRAY; + public static final int COLORSPACE_GREY = COLORSPACE_GRAY; + public static final int COLORSPACE_CIEXYZ = ColorSpace.CS_CIEXYZ; + public static final int COLORSPACE_RGB_LINEAR_GAMMA = ColorSpace.CS_LINEAR_RGB; + + public static void writePNG_RGB(int w, int h, byte[] rasterData, String path) throws IOException { + writePNG(w, h, rasterData, BANDOFFSET_RGB, COLORSPACE_SRGB, path); + } + + public static void writePNG_Mono(int w, int h, byte[] rasterData, String path) throws IOException { + writePNG(w, h, rasterData, BANDOFFSET_MONO, COLORSPACE_GREY, path); + } + + public static void writePNG(int w, int h, byte[] rasterData, int[] bandOffsets, int awt_colorspace, String path) throws IOException { + DataBuffer buffer = new DataBufferByte(rasterData, rasterData.length); + WritableRaster raster = Raster.createInterleavedRaster( + buffer + , w + , h + , bandOffsets.length * w + , bandOffsets.length + , bandOffsets + , null + ); + + ColorModel colorModel = new ComponentColorModel(ColorSpace.getInstance(awt_colorspace), false, false, Transparency.TRANSLUCENT, DataBuffer.TYPE_BYTE); + + BufferedImage image = new BufferedImage(colorModel, raster, colorModel.isAlphaPremultiplied(), null); + + ImageIO.write(image, "PNG", new File(path)); + } + +} diff --git a/src/com/Torvald/Terrarum/Actors/ActorWithBody.java b/src/com/Torvald/Terrarum/Actors/ActorWithBody.java index c65a8dee8..d9ab602ff 100644 --- a/src/com/Torvald/Terrarum/Actors/ActorWithBody.java +++ b/src/com/Torvald/Terrarum/Actors/ActorWithBody.java @@ -106,7 +106,7 @@ public class ActorWithBody implements Actor, Visible, Glowing { /** * in milliseconds */ - public final int COOLTIME = 500; + public final int INVINCIBILITY_TIME = 500; /** * Give new random ReferenceID and initialise ActorValue @@ -180,7 +180,8 @@ public class ActorWithBody implements Actor, Visible, Glowing { updateNextHitboxFromVelo(); - if (Math.abs(veloX) < 0.5) { + // if not horizontally moving then ... + if (Math.abs(veloX) < 0.5) { // fix for special situations (see fig. 1 at the bottom of the source) updateVerticalPos(); updateHorizontalPos(); } @@ -227,7 +228,7 @@ public class ActorWithBody implements Actor, Visible, Glowing { private void updateVerticalPos() { if (!isPlayerNoClip()) { // check downward - if (veloY >= 0) { // use TERNARY for L/R! + if (veloY >= 0) { // order of the if-elseif chain is IMPORTANT if (isColliding(CONTACT_AREA_BOTTOM)) { adjustHitBottom(); @@ -273,7 +274,7 @@ public class ActorWithBody implements Actor, Visible, Glowing { } while (colliding); float newY = nextHitbox.getPointedY() - newYOff; - nextHitbox.setPositionFromPoint(newX - 1, newY); + nextHitbox.setPositionFromPoint(newX, newY); } private void adjustHitTop() { @@ -290,13 +291,13 @@ public class ActorWithBody implements Actor, Visible, Glowing { } while (colliding); float newY = nextHitbox.getPosY() + newYOff; - nextHitbox.setPosition(newX + 1, newY); + nextHitbox.setPosition(newX, newY); } private void updateHorizontalPos() { if (!isPlayerNoClip()) { // check right - if (veloX > 0) { // use TERNARY for L/R! + if (veloX > 0) { // order of the if-elseif chain is IMPORTANT if (isColliding(CONTACT_AREA_RIGHT) && !isColliding(CONTACT_AREA_LEFT)) { adjustHitRight(); @@ -309,8 +310,7 @@ public class ActorWithBody implements Actor, Visible, Glowing { else { } } - else if (veloX < 0) { - + else { // fix for float-point rounding; veloX of zero should be treated as moving left // order of the if-elseif chain is IMPORTANT if (isColliding(CONTACT_AREA_LEFT) && !isColliding(CONTACT_AREA_RIGHT)) { adjustHitLeft(); @@ -323,9 +323,7 @@ public class ActorWithBody implements Actor, Visible, Glowing { else { } } - else { - } } } @@ -362,7 +360,7 @@ public class ActorWithBody implements Actor, Visible, Glowing { } while (newXOff < TSIZE && colliding); float newX = nextHitbox.getPosX() + newXOff; - nextHitbox.setPosition(newX + 1, newY); + nextHitbox.setPosition(newX, newY); // + 1; float-point rounding compensation (i think...) } private boolean isColliding(int side) { @@ -721,3 +719,16 @@ public class ActorWithBody implements Actor, Visible, Glowing { return FastMath.floor(v / TSIZE) * TSIZE; } } + +/** + + = = ↑ + === ===@! + =↑ =↑ + =↑ = + =↑ = + =@ (pressing R) = +================== ================== + + Fig. 1: the fix was not applied + */ \ No newline at end of file diff --git a/src/com/Torvald/Terrarum/Actors/PBFSigrid.java b/src/com/Torvald/Terrarum/Actors/PBFSigrid.java index 21086a521..fb8026a9f 100644 --- a/src/com/Torvald/Terrarum/Actors/PBFSigrid.java +++ b/src/com/Torvald/Terrarum/Actors/PBFSigrid.java @@ -53,7 +53,7 @@ public class PBFSigrid { * fixed value, or 'base value', from creature strength of Dwarf Fortress. * Human race uses 1000. (see CreatureHuman.json) */ - p.actorValue.set("strength", 1250); + p.actorValue.set("strength", 1414); p.actorValue.set("encumbrance", 1000); p.actorValue.set("name", "Sigrid"); diff --git a/src/com/Torvald/Terrarum/ConsoleCommand/ExportAV.java b/src/com/Torvald/Terrarum/ConsoleCommand/ExportAV.java index c8398f85c..6b6f9438a 100644 --- a/src/com/Torvald/Terrarum/ConsoleCommand/ExportAV.java +++ b/src/com/Torvald/Terrarum/ConsoleCommand/ExportAV.java @@ -1,5 +1,6 @@ package com.Torvald.Terrarum.ConsoleCommand; +import com.Torvald.JsonWriter; import com.Torvald.Terrarum.Terrarum; import com.google.gson.Gson; import com.google.gson.JsonElement; @@ -16,14 +17,10 @@ public class ExportAV implements ConsoleCommand { @Override public void execute(String[] args) { if (args.length == 2) { - JsonElement avelem = new Gson().toJsonTree(Terrarum.game.getPlayer().getActorValue()); - String jsonString = avelem.toString(); - - FileWriter writer; try { - writer = new FileWriter(Terrarum.defaultDir + "/Exports/" + args[1] + ".json"); - writer.write(jsonString); - writer.close(); + JsonWriter.writeFile(Terrarum.game.getPlayer().getActorValue() + , Terrarum.defaultDir + "/Exports/" + args[1] + ".json" + ); new Echo().execute("ExportAV: exported to " + args[1] + ".json"); } diff --git a/src/com/Torvald/Terrarum/ConsoleCommand/ExportMap.java b/src/com/Torvald/Terrarum/ConsoleCommand/ExportMap.java index 062c49626..c958ecf29 100644 --- a/src/com/Torvald/Terrarum/ConsoleCommand/ExportMap.java +++ b/src/com/Torvald/Terrarum/ConsoleCommand/ExportMap.java @@ -1,6 +1,7 @@ package com.Torvald.Terrarum.ConsoleCommand; import com.Torvald.ColourUtil.Col4096; +import com.Torvald.RasterWriter; import com.Torvald.Terrarum.Terrarum; import javax.imageio.ImageIO; @@ -76,23 +77,12 @@ public class ExportMap implements ConsoleCommand { } try { - int[] bandOffsets = {0, 1, 2}; // RGB - DataBuffer buffer = new DataBufferByte(mapData, mapData.length); - WritableRaster raster = Raster.createInterleavedRaster( - buffer - , Terrarum.game.map.width + RasterWriter.writePNG_RGB( + Terrarum.game.map.width , Terrarum.game.map.height - , 3 * Terrarum.game.map.width - , 3 - , bandOffsets - , null); - - ColorModel colorModel = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB), false, false, Transparency.TRANSLUCENT, DataBuffer.TYPE_BYTE); - - BufferedImage image = new BufferedImage(colorModel, raster, colorModel.isAlphaPremultiplied(), null); - - ImageIO.write(image, "PNG", new File(dir + args[1] + ".png")); - + , mapData + , dir + args[1] + ".png" + ); new Echo().execute("ExportMap: exported to " + args[1] + ".png"); } catch (IOException e) { diff --git a/src/com/Torvald/Terrarum/Game.java b/src/com/Torvald/Terrarum/Game.java index d3e858eeb..ea12707e5 100644 --- a/src/com/Torvald/Terrarum/Game.java +++ b/src/com/Torvald/Terrarum/Game.java @@ -145,6 +145,9 @@ public class Game extends BasicGameState { TileStat.update(); + MapDrawer.update(gc, delta_t); + MapCamera.update(gc, delta_t); + actorContainer.forEach(actor -> actor.update(gc, delta_t)); actorContainer.forEach( actor -> { @@ -157,12 +160,11 @@ public class Game extends BasicGameState { } ); - MapDrawer.update(gc, delta_t); - MapCamera.update(gc, delta_t); - uiContainer.forEach(ui -> ui.update(gc, delta_t)); //bulletin.update(gc, delta_t); + + Terrarum.appgc.setVSync(Terrarum.appgc.getFPS() >= 59); } private void setAppTitle() { @@ -200,11 +202,11 @@ public class Game extends BasicGameState { actor -> { if (actor instanceof Glowing) ((Glowing) actor).drawGlow(gc, g); } ); + LightmapRenderer.renderLightMap(); + MapCamera.renderFront(gc, g); MapDrawer.render(gc, g); - LightmapRenderer.renderLightMap(); - setBlendModeMul(); MapDrawer.drawEnvOverlay(g); LightmapRenderer.draw(g); diff --git a/src/com/Torvald/Terrarum/MapDrawer/LightmapRenderer.java b/src/com/Torvald/Terrarum/MapDrawer/LightmapRenderer.java index cd7a1f859..dc4751d6e 100644 --- a/src/com/Torvald/Terrarum/MapDrawer/LightmapRenderer.java +++ b/src/com/Torvald/Terrarum/MapDrawer/LightmapRenderer.java @@ -87,11 +87,11 @@ public class LightmapRenderer { } - int for_y_start = div16(MapCamera.getCameraY()) - 1; - int for_x_start = div16(MapCamera.getCameraX()) - 1; + int for_y_start = div16(MapCamera.getCameraY()) - 1; // fix for premature lightmap rendering + int for_x_start = div16(MapCamera.getCameraX()) - 1; // on topmost/leftmost side - int for_y_end = clampHTile(for_y_start + div16(MapCamera.getRenderHeight()) + 2) + 1; - int for_x_end = clampWTile(for_x_start + div16(MapCamera.getRenderWidth()) + 2) + 1; + int for_y_end = clampHTile(for_y_start + div16(MapCamera.getRenderHeight()) + 2) + 1; // same fix as above + int for_x_end = clampWTile(for_x_start + div16(MapCamera.getRenderWidth()) + 2) + 1; /** * Updating order: @@ -104,7 +104,7 @@ public class LightmapRenderer { * for all staticLightMap[y][x] */ - purgePartOfLightmap(for_x_start - 1, for_y_start - 1, for_x_end + 1, for_y_end + 1); + purgePartOfLightmap(for_x_start, for_y_start, for_x_end, for_y_end); // if wider purge were not applied, GL changing (sunset, sunrise) will behave incorrectly // ("leakage" of non-updated sunlight) @@ -269,11 +269,11 @@ public class LightmapRenderer { catch (ArrayIndexOutOfBoundsException e) {} } - private static Color toTargetColour(char raw) { - return new Col40().createSlickColor(raw); + private static char calculate(int x, int y) { + return calculate(x, y, false); } - private static char calculate(int x, int y){ + private static char calculate(int x, int y, boolean doNotCalculateAmbient){ char lightLevelThis = 0; int thisTerrain = Terrarum.game.map.getTileFromTerrain(x, y); int thisWall = Terrarum.game.map.getTileFromWall(x, y); @@ -316,46 +316,54 @@ public class LightmapRenderer { } - // calculate ambient - char ambient = 0; char nearby = 0; - findNearbyBrightest: - for (int yoff = -1; yoff <= 1; yoff++) { - for (int xoff = -1; xoff <= 1; xoff++) { - /** - * filter for 'v's as: - * +-+-+-+ - * |a|v|a| - * +-+-+-+ - * |v| |v| - * +-+-+-+ - * |a|v|a| - * +-+-+-+ - */ - if (xoff != yoff && -xoff != yoff) { // 'v' tiles - if (!outOfMapBounds(x + xoff, y + yoff)) { - nearby = staticLightMap[y + yoff][x + xoff]; + if (!doNotCalculateAmbient) { + // calculate ambient + char ambient = 0; + char nearby = 0; + findNearbyBrightest: + for (int yoff = -1; yoff <= 1; yoff++) { + for (int xoff = -1; xoff <= 1; xoff++) { + /** + * filter for 'v's as: + * +-+-+-+ + * |a|v|a| + * +-+-+-+ + * |v| |v| + * +-+-+-+ + * |a|v|a| + * +-+-+-+ + */ + if (xoff != yoff && -xoff != yoff) { // 'v' tiles + if (!outOfMapBounds(x + xoff, y + yoff)) { + nearby = staticLightMap[y + yoff][x + xoff]; + } } - } - else if (xoff != 0 && yoff != 0) { // 'a' tiles - if (!outOfMapBounds(x + xoff, y + yoff)) { - nearby = darkenUniformInt(staticLightMap[y + yoff][x + xoff] - , 2); //2 - // mix some to have more 'spreading' - // so that light spreads in a shape of an octagon instead of a diamond + else if (xoff != 0 && yoff != 0) { // 'a' tiles + if (!outOfMapBounds(x + xoff, y + yoff)) { + nearby = darkenUniformInt(staticLightMap[y + yoff][x + xoff] + , 2); //2 + // mix some to have more 'spreading' + // so that light spreads in a shape of an octagon instead of a diamond + } + } + else { + nearby = 0; // exclude 'me' tile } - } - else { - nearby = 0; // exclude 'me' tile - } - ambient = maximiseRGB(ambient, nearby); // keep base value as brightest nearby + ambient = maximiseRGB(ambient, nearby); // keep base value as brightest nearby + } } + + ambient = darkenColoured(ambient, + thisTileOpacity + ); // get real ambient by appling opacity value + + // mix and return lightlevel and ambient + return maximiseRGB(lightLevelThis, ambient); + } + else { + return lightLevelThis; } - - ambient = darkenColoured(ambient, thisTileOpacity); // get real ambient by appling opacity value - - // mix and return lightlevel and ambient - return maximiseRGB(lightLevelThis, ambient); } /** @@ -582,13 +590,45 @@ public class LightmapRenderer { } private static void purgePartOfLightmap(int x1, int y1, int x2, int y2) { - for (int y = y1; y < y2; y++) { - for (int x = x1; x < x2; x++) { - if (!outOfMapBounds(x, y)) { - staticLightMap[y][x] = 0; + try { + for (int y = y1 - 1; y < y2 + 1; y++) { + for (int x = x1 - 1; x < x2 + 1; x++) { + if (y == y1 - 1 || y == y2 || x == x1 - 1 || x == x2) { + // fill the rim with (pre) calculation + staticLightMap[y][x] = preCalculateUpdateGLOnly(x, y); + } + else { + staticLightMap[y][x] = 0; + } } } } + catch (ArrayIndexOutOfBoundsException e) {} + } + + private static char preCalculateUpdateGLOnly(int x, int y) { + int thisWall = Terrarum.game.map.getTileFromWall(x, y); + int thisTerrain = Terrarum.game.map.getTileFromTerrain(x, y); + char thisTileLuminosity = TilePropCodex.getProp(thisTerrain).getLuminosity(); + char thisTileOpacity = TilePropCodex.getProp(thisTerrain).getOpacity(); + char sunLight = Terrarum.game.map.getGlobalLight(); + + char lightLevelThis; + + // MIX TILE + // open air + if (thisTerrain == AIR && thisWall == AIR) { + lightLevelThis = sunLight; + } + // luminous tile transparent (allows sunlight to pass) + else if (thisWall == AIR && thisTileLuminosity > 0) { + char darkenSunlight = darkenColoured(sunLight, thisTileOpacity); + lightLevelThis = screenBlend(darkenSunlight, thisTileLuminosity); + } + else { + lightLevelThis = getValueFromMap(x, y); + } + return lightLevelThis; } private static int clampWTile(int x) { @@ -622,6 +662,10 @@ public class LightmapRenderer { } return Math.round(sum / (float) i.length); } + + private static Color toTargetColour(char raw) { + return new Col40().createSlickColor(raw); + } } class LightmapLantern { diff --git a/src/com/Torvald/Terrarum/Terrarum.java b/src/com/Torvald/Terrarum/Terrarum.java index afb0a9046..2b88cd930 100644 --- a/src/com/Torvald/Terrarum/Terrarum.java +++ b/src/com/Torvald/Terrarum/Terrarum.java @@ -31,7 +31,7 @@ public class Terrarum extends StateBasedGame { * * TARGET_INTERNAL_FPS > TARGET_FPS for smooth frame drawing * - * Must choose a value so that 1000 / VAL is still integer + * Must choose a value so that (1000 / VAL) is still integer */ public static final int TARGET_INTERNAL_FPS = 100; @@ -116,6 +116,7 @@ public class Terrarum extends StateBasedGame { appgc.setTargetFrameRate(TARGET_INTERNAL_FPS); appgc.setVSync(VSYNC); appgc.setMaximumLogicUpdateInterval(1000 / TARGET_INTERNAL_FPS); + appgc.setMinimumLogicUpdateInterval(1000 / TARGET_INTERNAL_FPS - 1); appgc.setShowFPS(false); appgc.setUpdateOnlyWhenVisible(false); diff --git a/src/com/Torvald/Terrarum/UserInterface/BasicDebugInfoWindow.java b/src/com/Torvald/Terrarum/UserInterface/BasicDebugInfoWindow.java index c3f0a864e..8fe543749 100644 --- a/src/com/Torvald/Terrarum/UserInterface/BasicDebugInfoWindow.java +++ b/src/com/Torvald/Terrarum/UserInterface/BasicDebugInfoWindow.java @@ -103,10 +103,8 @@ public class BasicDebugInfoWindow implements UICanvas { * Second column */ - String[] collisionFlagKey = {"top", "right", "bottom", "left"}; int collisonFlag = playerDbg.eventMoving(); - printLineColumn(g, 2, 1, "CollisionFlag : " - + ((collisonFlag == -1) ? "none" : collisionFlagKey[collisonFlag])); + printLineColumn(g, 2, 1, "Vsync : " + Terrarum.appgc.isVSyncRequested()); printLineColumn(g, 2, 2, "Env colour temp : " + MapDrawer.getColTemp()); /** diff --git a/work_files/Attack momentum calculator.numbers b/work_files/Attack momentum calculator.numbers index 20e9cc32f..3c0a00961 100644 Binary files a/work_files/Attack momentum calculator.numbers and b/work_files/Attack momentum calculator.numbers differ