mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +09:00
reconfiguring docs and libs
- Targeting Java 10 - Gdx nightly 20181111 (1.9.9)
This commit is contained in:
2
.idea/compiler.xml
generated
2
.idea/compiler.xml
generated
@@ -4,7 +4,7 @@
|
||||
<annotationProcessing>
|
||||
<profile default="true" name="Default" enabled="true" />
|
||||
</annotationProcessing>
|
||||
<bytecodeTargetLevel target="8" />
|
||||
<bytecodeTargetLevel target="10" />
|
||||
</component>
|
||||
<component name="JavacSettings">
|
||||
<option name="PREFER_TARGET_JDK_COMPILER" value="false" />
|
||||
|
||||
3
.idea/kotlinc.xml
generated
3
.idea/kotlinc.xml
generated
@@ -1,5 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Kotlin2JsCompilerArguments">
|
||||
<option name="sourceMapEmbedSources" />
|
||||
</component>
|
||||
<component name="Kotlin2JvmCompilerArguments">
|
||||
<option name="jvmTarget" value="1.8" />
|
||||
</component>
|
||||
|
||||
3
.idea/libraries/lib.xml
generated
3
.idea/libraries/lib.xml
generated
@@ -4,9 +4,10 @@
|
||||
<root url="file://$PROJECT_DIR$/lib" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="http://slick.ninjacave.com/javadoc/" />
|
||||
<root url="file://$PROJECT_DIR$/lib/javadoc" />
|
||||
<root url="http://libgdx.badlogicgames.com/nightlies/docs/api/" />
|
||||
<root url="https://libgdx.badlogicgames.com/ci/nightlies/docs/api/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/javadoc/gdx-docs.zip!/" />
|
||||
</JAVADOC>
|
||||
<NATIVE>
|
||||
<root url="file://$PROJECT_DIR$/lib" />
|
||||
|
||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -38,7 +38,7 @@
|
||||
<property name="caretWidth" class="java.lang.Integer" />
|
||||
</properties>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_10" default="true" project-jdk-name="OpenJDK 10" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_10" default="false" project-jdk-name="11" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -65,32 +65,34 @@ void main() {
|
||||
|
||||
vec2 pxCoord = flippedFragCoord.xy;
|
||||
|
||||
mediump vec4 tileFromMap = texture2D(tilemap, flippedFragCoord / overscannedScreenDimension); // <- THE CULPRIT
|
||||
// TODO do I really need mediump for this thing ? (default to smapler2D is lowp)
|
||||
vec4 tileFromMap = texture2D(tilemap, flippedFragCoord / overscannedScreenDimension); // <- THE CULPRIT
|
||||
int tile = getTileFromColor(tileFromMap);
|
||||
int breakage = getBreakageFromColor(tileFromMap);
|
||||
|
||||
|
||||
ivec2 tileXY = getTileXY(tile);
|
||||
ivec2 breakageXY = getTileXY(breakage + 5);
|
||||
ivec2 breakageXY = getTileXY(breakage + 5); // +5 is hard-coded constant that depends on the atlas
|
||||
|
||||
|
||||
vec2 coordInTile = mod(pxCoord, tileSizeInPx) / tileSizeInPx; // 0..1 regardless of tile position in atlas
|
||||
mediump vec2 coordInTile = mod(pxCoord, tileSizeInPx) / tileSizeInPx; // 0..1 regardless of tile position in atlas
|
||||
|
||||
highp vec2 singleTileSizeInUV = vec2(1) / tilesInAtlas; // constant 0.00390625
|
||||
// don't really need highp here; read the GLES spec
|
||||
mediump vec2 singleTileSizeInUV = vec2(1) / tilesInAtlas; // constant 0.00390625 for unmodified default uniforms
|
||||
|
||||
highp vec2 uvCoordForTile = coordInTile * singleTileSizeInUV; // 0..0.00390625 regardless of tile position in atlas
|
||||
mediump vec2 uvCoordForTile = coordInTile * singleTileSizeInUV; // 0..0.00390625 regardless of tile position in atlas
|
||||
|
||||
highp vec2 uvCoordOffset = tileXY * singleTileSizeInUV; // where the tile starts in the atlas, using uv coord (0..1)
|
||||
highp vec2 uvCoordOffsetBreakage = breakageXY * singleTileSizeInUV;
|
||||
mediump vec2 uvCoordOffsetTile = tileXY * singleTileSizeInUV; // where the tile starts in the atlas, using uv coord (0..1)
|
||||
mediump vec2 uvCoordOffsetBreakage = breakageXY * singleTileSizeInUV;
|
||||
|
||||
highp vec2 finalUVCoordForTile = uvCoordForTile + uvCoordOffset;// where we should be actually looking for in atlas, using UV coord (0..1)
|
||||
highp vec2 finalUVCoordForBreakage = uvCoordForTile + uvCoordOffsetBreakage;
|
||||
mediump vec2 finalUVCoordForTile = uvCoordForTile + uvCoordOffsetTile;// where we should be actually looking for in atlas, using UV coord (0..1)
|
||||
mediump vec2 finalUVCoordForBreakage = uvCoordForTile + uvCoordOffsetBreakage;
|
||||
|
||||
|
||||
// TODO finally "blend" a breakage (0xrrggbb where 0xr00000 -- upper 4 bits of int_red component)
|
||||
// blending a breakage tex with main tex
|
||||
|
||||
mediump vec4 finalTile = texture2D(tilesAtlas, finalUVCoordForTile);
|
||||
mediump vec4 finalBreakage = texture2D(tilesAtlas, finalUVCoordForBreakage);
|
||||
vec4 finalTile = texture2D(tilesAtlas, finalUVCoordForTile);
|
||||
vec4 finalBreakage = texture2D(tilesAtlas, finalUVCoordForBreakage);
|
||||
|
||||
gl_FragColor = colourFilter * (mix(finalTile, finalBreakage, finalBreakage.a));
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
lib/gdx-nightly-20170610.zip
Normal file
BIN
lib/gdx-nightly-20170610.zip
Normal file
Binary file not shown.
BIN
lib/gdx.jar
BIN
lib/gdx.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
lib/javadoc/gdx-docs.zip
Normal file
BIN
lib/javadoc/gdx-docs.zip
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -237,6 +237,7 @@ object Terrarum : Screen {
|
||||
init {
|
||||
println("$NAME version ${AppLoader.getVERSION_STRING()}")
|
||||
println("Java Runtime version ${System.getProperty("java.version")}")
|
||||
println("LibGDX version ${com.badlogic.gdx.Version.VERSION}")
|
||||
|
||||
|
||||
getDefaultDirectory()
|
||||
|
||||
@@ -38,7 +38,7 @@ class UIItemInventoryCatBar(
|
||||
// set up all the buttons
|
||||
init {
|
||||
// place sub UIs: Image Buttons
|
||||
mainButtons = Array(catArrangement.size, { index ->
|
||||
mainButtons = Array(catArrangement.size) { index ->
|
||||
val iconPosX = ((buttonGapSize / 2) + index * (catIcons.tileW + buttonGapSize)).roundInt()
|
||||
val iconPosY = 0
|
||||
|
||||
@@ -51,7 +51,7 @@ class UIItemInventoryCatBar(
|
||||
posY = posY + iconPosY,
|
||||
highlightable = true
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// side buttons
|
||||
@@ -65,7 +65,7 @@ class UIItemInventoryCatBar(
|
||||
println("[UIItemInventoryCatBar] relativeStartX: $relativeStartX")
|
||||
println("[UIItemInventoryCatBar] posX: $posX")
|
||||
|
||||
sideButtons = Array(iconIndex.size, { index ->
|
||||
sideButtons = Array(iconIndex.size) { index ->
|
||||
val iconPosX = if (index < 2)
|
||||
(relativeStartX + sideButtonsGap + (sideButtonsGap + catIcons.tileW) * index).roundInt()
|
||||
else
|
||||
@@ -83,7 +83,7 @@ class UIItemInventoryCatBar(
|
||||
activeCol = if (index == 0 || index == 3) Color(0xfff066_ff.toInt()) else Color(0xffffff7f.toInt()),
|
||||
highlightable = (index == 0 || index == 3)
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -46,24 +46,24 @@ internal object BlocksDrawer {
|
||||
|
||||
val wallOverlayColour = Color(2f/3f, 2f/3f, 2f/3f, 1f)
|
||||
|
||||
val breakAnimSteps = 10
|
||||
const val breakAnimSteps = 10
|
||||
|
||||
val WALL = GameWorld.WALL
|
||||
val TERRAIN = GameWorld.TERRAIN
|
||||
val WIRE = GameWorld.WIRE
|
||||
|
||||
private val NEARBY_TILE_KEY_UP = 0
|
||||
private val NEARBY_TILE_KEY_RIGHT = 1
|
||||
private val NEARBY_TILE_KEY_DOWN = 2
|
||||
private val NEARBY_TILE_KEY_LEFT = 3
|
||||
private const val NEARBY_TILE_KEY_UP = 0
|
||||
private const val NEARBY_TILE_KEY_RIGHT = 1
|
||||
private const val NEARBY_TILE_KEY_DOWN = 2
|
||||
private const val NEARBY_TILE_KEY_LEFT = 3
|
||||
|
||||
private val NEARBY_TILE_CODE_UP = 1
|
||||
private val NEARBY_TILE_CODE_RIGHT = 2
|
||||
private val NEARBY_TILE_CODE_DOWN = 4
|
||||
private val NEARBY_TILE_CODE_LEFT = 8
|
||||
private const val NEARBY_TILE_CODE_UP = 1
|
||||
private const val NEARBY_TILE_CODE_RIGHT = 2
|
||||
private const val NEARBY_TILE_CODE_DOWN = 4
|
||||
private const val NEARBY_TILE_CODE_LEFT = 8
|
||||
|
||||
|
||||
private val GZIP_READBUF_SIZE = 8192
|
||||
private const val GZIP_READBUF_SIZE = 8192
|
||||
|
||||
|
||||
private lateinit var terrainTilesBuffer: Array<IntArray>
|
||||
|
||||
Reference in New Issue
Block a user