Compare commits

...

48 Commits

Author SHA1 Message Date
minjaesong
e0fcf35f5b fix: inventory cells not tangible 2020-09-17 11:22:03 +09:00
minjaesong
b2ad541355 transition works as intended but ui is not tangible 2020-09-14 15:19:34 +09:00
minjaesong
eb2e47e2a5 fix: inventory panels and their indices are mutually inversed 2020-09-14 14:04:46 +09:00
minjaesong
b07e7f5fdd q&d hack for ui opacity control using a shader 2020-09-12 11:24:32 +09:00
minjaesong
ac144da0b4 index is reversed, transparency not working 2020-09-09 16:58:35 +09:00
minjaesong
f5624af47c UI is now rendered in correct pos 2020-09-09 16:05:56 +09:00
minjaesong
299e10a381 UI visible and render is offsetted but update is ok 2020-09-09 15:38:21 +09:00
minjaesong
de164f6516 inventory ui transition wip 2020-08-30 16:09:42 +09:00
minjaesong
7f99bb4f4f less fancy inventory transition WIP 2020-08-22 18:23:17 +09:00
minjaesong
619352e915 lfs: tracking .kra files 2020-08-22 16:47:20 +09:00
minjaesong
8469d22f93 adding title menu element for mod options 2020-08-22 16:44:37 +09:00
minjaesong
c849669845 collision code for staircasing 2020-08-04 12:23:46 +09:00
minjaesong
be6cddb1d6 replacing all nonstaircasing collistion function usage into staircasing one 2020-07-24 14:41:54 +09:00
minjaesong
2faebfcd27 added a todo message 2020-07-22 22:40:12 +09:00
minjaesong
64e9d3c0e4 phys: wip staircasing modification is still compatible with old code 2020-07-20 21:24:22 +09:00
minjaesong
4d46a44c51 phys: making colliding side indices more sensible 2020-07-17 22:50:24 +09:00
minjaesong
87ce59194c phys arguments are now single PhysProperties object 2020-07-15 21:58:44 +09:00
minjaesong
4feb889aa8 new tonemapping lut using some random fibseq 2020-07-12 10:29:39 +09:00
minjaesong
f3e1cc53f8 new properties in apploader: aspectRatio 2020-06-21 13:56:50 +09:00
minjaesong
37bc8a6aff biome in worldgen 2020-06-12 15:21:55 +09:00
minjaesong
04cf817303 default screen size to be exact 3:2 again (and obs-linux compatible) 2020-05-13 22:33:32 +09:00
minjaesong
f7ff220967 terragen: making sky-to-ground ratio to be constant 2020-05-03 10:43:31 +09:00
minjaesong
ccb9d33a36 more hangul improvements 2020-05-01 17:13:46 +09:00
minjaesong
096a34c6a6 implementing working multithreading Terragen to the game 2020-04-29 11:26:59 +09:00
minjaesong
4076e6d74e more testing on skydome / font change 2020-04-29 08:48:06 +09:00
minjaesong
b5da05c9a0 both idea works 2020-04-29 08:47:27 +09:00
minjaesong
25043cb36e more testing on resolving noisy artefact in worldgen 2020-04-29 08:15:40 +09:00
minjaesong
1a98292b92 using Coroutines instead of Threadpool but the artefact is still there :( 2020-04-27 03:36:34 +09:00
minjaesong
f469772c86 reverting Unsafe usage of worldgennoisesandbox 2020-04-27 03:05:19 +09:00
minjaesong
0bc52a7351 major hangul font update 2020-04-23 01:04:58 +09:00
minjaesong
9670b5771f Hosek skylight model translated from C to Kotlin 2020-04-20 04:47:40 +09:00
minjaesong
9e3008d6fe adding the missing pdf file 2020-04-19 01:21:03 +09:00
minjaesong
ae390fe6f5 updating LibGDX to 1.9.10 2020-04-19 01:06:25 +09:00
minjaesong
02ad64487b minor improvement on rotund r 2020-04-14 07:25:47 +09:00
minjaesong
8f08609d65 font support for LatinExt-D 2020-04-14 06:31:05 +09:00
minjaesong
42b26597b4 comment 2020-04-13 05:03:53 +09:00
minjaesong
9e082e914d simplified the tiling shader a bit 2020-04-13 02:13:24 +09:00
minjaesong
a08d09b1b8 Reducing hierarchy by merging ActorWithBody with ActorWBMovable 2020-03-20 19:30:17 +09:00
minjaesong
3982933aad closing issue #34, it was just hitbox not properly being updated 2020-03-10 23:34:36 +09:00
minjaesong
ed5c823154 fixing bug where the hitbox won't change when actor is rescaled, wip issue #34 2020-03-10 06:52:40 +09:00
minjaesong
8589f1f8fa Fixing bad quickslot behaviour where it would unequip things when the selection changed 2020-03-09 04:01:03 +09:00
minjaesong
16f85f6bfa some code pruning 2020-03-07 03:39:26 +09:00
minjaesong
6b2970cbfd Tentatively fixed the issue #35
if it's truly been fixed, the culprit was the mixed use of lx/ly and worldx/worldy
2020-03-07 02:39:01 +09:00
minjaesong
a501a353dd Pre-calculation. Plagued with segfaults. Feel free to roll back. 2020-03-06 21:52:06 +09:00
minjaesong
47d5d9c1b2 more functions 2020-03-06 21:51:06 +09:00
minjaesong
9ddfa48cd9 commenting out the assert code that is called ~50 000 times per frame 2020-03-06 01:54:18 +09:00
minjaesong
3b793d5ad4 fixing bug where blocks cant be placed if mouse is over quickslot and watch 2020-03-06 01:30:33 +09:00
minjaesong
82514180ea stupid idea that didnt work 2020-03-04 10:32:05 +09:00
250 changed files with 48942 additions and 3488 deletions

1
.gitattributes vendored
View File

@@ -5,3 +5,4 @@
*.opus filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.kra filter=lfs diff=lfs merge=lfs -text

3
.gitignore vendored
View File

@@ -13,6 +13,8 @@ replay_pid*
Thumbs.db
.DS_Store
desktop.ini
.directory
*/.directory
# Resources that should not be tracked
assets/mods/basegame/demoworld
@@ -26,6 +28,7 @@ workspace.xml
# Temporary files
.tmp*
tmp_*
*.bak
## Microsoft Office
~$*
## Generic temp files in Linux

View File

@@ -4,6 +4,9 @@
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-stdlib.jar!/" />
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-reflect.jar!/" />
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-test.jar!/" />
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlinx-coroutines-core-1.0.1.jar!/" />
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlinx-coroutines-io-jvm-0.1.1.jar!/" />
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlinx-coroutines-jdk8-1.0.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>

View File

@@ -0,0 +1,53 @@
<component name="libraryTable">
<library name="com.badlogicgames.gdx:gdx-backend-lwjgl3:1.9.10" type="repository">
<properties maven-id="com.badlogicgames.gdx:gdx-backend-lwjgl3:1.9.10" />
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/gdx-backend-lwjgl3-1.9.10.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/gdx-1.9.10.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-3.2.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-3.2.1-natives-windows.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-3.2.1-natives-linux.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-3.2.1-natives-macos.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-glfw-3.2.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-glfw-3.2.1-natives-windows.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-glfw-3.2.1-natives-linux.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-glfw-3.2.1-natives-macos.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-jemalloc-3.2.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-jemalloc-3.2.1-natives-windows.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-jemalloc-3.2.1-natives-linux.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-jemalloc-3.2.1-natives-macos.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-opengl-3.2.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-opengl-3.2.1-natives-windows.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-opengl-3.2.1-natives-linux.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-opengl-3.2.1-natives-macos.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-openal-3.2.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-openal-3.2.1-natives-windows.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-openal-3.2.1-natives-linux.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-openal-3.2.1-natives-macos.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jlayer-1.0.1-gdx.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jorbis-0.0.17.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$PROJECT_DIR$/lib/gdx-backend-lwjgl3-1.9.10-javadoc.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/gdx-1.9.10-javadoc.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-3.2.1-javadoc.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-glfw-3.2.1-javadoc.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-jemalloc-3.2.1-javadoc.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-opengl-3.2.1-javadoc.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-openal-3.2.1-javadoc.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jlayer-1.0.1-gdx-javadoc.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jorbis-0.0.17-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$PROJECT_DIR$/lib/gdx-backend-lwjgl3-1.9.10-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/gdx-1.9.10-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-3.2.1-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-glfw-3.2.1-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-jemalloc-3.2.1-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-opengl-3.2.1-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-openal-3.2.1-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jlayer-1.0.1-gdx-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jorbis-0.0.17-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,41 @@
<component name="libraryTable">
<library name="com.badlogicgames.gdx:gdx-backend-lwjgl:1.9.10" type="repository">
<properties maven-id="com.badlogicgames.gdx:gdx-backend-lwjgl:1.9.10" />
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/gdx-backend-lwjgl-1.9.10.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/gdx-1.9.10.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-2.9.3.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-platform-2.9.3-natives-windows.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-platform-2.9.3-natives-linux.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-platform-2.9.3-natives-osx.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jinput-2.0.5.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jutils-1.0.0.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jinput-platform-2.0.5-natives-linux.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jinput-platform-2.0.5-natives-windows.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jinput-platform-2.0.5-natives-osx.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl_util-2.9.3.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jlayer-1.0.1-gdx.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jorbis-0.0.17.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$PROJECT_DIR$/lib/gdx-backend-lwjgl-1.9.10-javadoc.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/gdx-1.9.10-javadoc.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-2.9.3-javadoc.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jinput-2.0.5-javadoc.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jutils-1.0.0-javadoc.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl_util-2.9.3-javadoc.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jlayer-1.0.1-gdx-javadoc.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jorbis-0.0.17-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$PROJECT_DIR$/lib/gdx-backend-lwjgl-1.9.10-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/gdx-1.9.10-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl-2.9.3-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jinput-2.0.5-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jutils-1.0.0-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lwjgl_util-2.9.3-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jlayer-1.0.1-gdx-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jorbis-0.0.17-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,20 @@
<component name="libraryTable">
<library name="com.badlogicgames.gdx:gdx-controllers-desktop:1.9.10" type="repository">
<properties maven-id="com.badlogicgames.gdx:gdx-controllers-desktop:1.9.10" />
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/gdx-controllers-desktop-1.9.10.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/gdx-1.9.10.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/gdx-controllers-1.9.10.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$PROJECT_DIR$/lib/gdx-controllers-desktop-1.9.10-javadoc.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/gdx-1.9.10-javadoc.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/gdx-controllers-1.9.10-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$PROJECT_DIR$/lib/gdx-controllers-desktop-1.9.10-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/gdx-1.9.10-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/gdx-controllers-1.9.10-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,18 @@
<component name="libraryTable">
<library name="com.badlogicgames.gdx:gdx-controllers-platform:1.9.10" type="repository">
<properties maven-id="com.badlogicgames.gdx:gdx-controllers-platform:1.9.10" />
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/gdx-controllers-platform-1.9.10.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/gdx-controllers-1.9.10.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/gdx-1.9.10.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$PROJECT_DIR$/lib/gdx-controllers-1.9.10-javadoc.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/gdx-1.9.10-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$PROJECT_DIR$/lib/gdx-controllers-1.9.10-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/gdx-1.9.10-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="com.badlogicgames.gdx:gdx-platform:1.9.10" type="repository">
<properties maven-id="com.badlogicgames.gdx:gdx-platform:1.9.10" />
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/gdx-platform-1.9.10.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -4,24 +4,17 @@
<root url="file://$PROJECT_DIR$/lib" />
</CLASSES>
<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" />
<root url="file://$PROJECT_DIR$/lib/x86" />
<root url="file://$PROJECT_DIR$/lib/x86_64" />
</NATIVE>
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/source" />
<root url="jar://$PROJECT_DIR$/lib/Terrarum_Joise.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/source/gdx-backend-lwjgl-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/TerrarumSansBitmap.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/prtree.jar!/" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/lib/source" recursive="false" type="SOURCES" />
</library>
</component>

View File

@@ -7,7 +7,7 @@
|0x10_0000..0x0FFF_FFFF|Items (dynamic\*) (267M possible)|
|0x1000_0000..0x7FFF_FFFF|Actors (1879M possible)|
|-1..-65536|Virtual Tiles|
|-2147483648..-1 (all negative numbers)|Faction (2147M possible)|
|-2147483648..-65537 (all negative numbers)|Faction (2147M possible)|
* dynamic items have own properties that will persist through savegame.
@@ -19,4 +19,6 @@ Actors range in-depth
|0x2000_0000..0x4FFF_FFFF|Regular actors (e.g. almost all of them)|
|0x5000_0000..0x5FFF_FFFF|Special (e.g. weapon swung, bullets, dropped item, particles)|
|0x6000_0000..0x6FFF_FFFF|Rendered front (e.g. fake tile)|
|0x7000_0000..0x7FFF_FFFF|Rendered as screen overlay, not affected by light nor environment overlays|
|0x7000_0000..0x7FFF_FFFF|Rendered as screen overlay, not affected by light nor environment overlays|
Actor IDs are assigned in 256 groups, single actor can have 256 sub-actors

BIN
assets/graphics/fonts/terrarum-sans-bitmap/insular_variable.tga LFS Normal file → Executable file

Binary file not shown.

View File

@@ -8,7 +8,7 @@
"EAUR"; "768"; "0";"8192"; "21"; "1.36"; "1.0";"elven aurichalcum"
"TIAL"; "900"; "0";"4420"; "33"; "2.16"; "1.0";"titanium alloy (Ti6Al4V)"
"ADMT";"2000";"4090";"2700"; "71"; "3.42"; "1.0";"adamant"
"OOZE"; "20"; "0";"1000"; "1"; "N/A"; "0.5";"genetic ooze; data is about human skin"
"OOZE"; "20"; "0";"1000"; "1"; "0.08"; "0.5";"genetic ooze; data is about human skin"
"BONE"; "130"; "0";"2000"; "1"; "0.23"; "0.55";"data is that of bovine bone"
# idst: ID_STRING, ALL CAPS
1 idst tens impf dsty fmod endurance tcond comments
8 EAUR 768 0 8192 21 1.36 1.0 elven aurichalcum
9 TIAL 900 0 4420 33 2.16 1.0 titanium alloy (Ti6Al4V)
10 ADMT 2000 4090 2700 71 3.42 1.0 adamant
11 OOZE 20 0 1000 1 N/A 0.08 0.5 genetic ooze; data is about human skin
12 BONE 130 0 2000 1 0.23 0.55 data is that of bovine bone
13 # idst: ID_STRING, ALL CAPS
14 #

View File

@@ -17,27 +17,24 @@ uniform sampler2D u_texture;
uniform vec2 screenDimension;
uniform vec2 tilesInAxes; // basically a screen dimension; vec2(tiles_in_horizontal, tiles_in_vertical)
uniform vec2 tilesInAxes; // size of the tilemap texture; vec2(tiles_in_horizontal, tiles_in_vertical)
uniform ivec2 tilemapDimension;
uniform sampler2D tilemap; // RGBA8888
uniform sampler2D tilesAtlas; // terrain, wire, fluids, etc.
uniform sampler2D tilesBlendAtlas; // alternative terrain for the weather mix (e.g. yellowed grass)
uniform float tilesBlend = 0.0; // percentage of blending [0f..1f]. 0: draws tilesAtlas, 1: draws tilesBlendAtlas
uniform ivec2 tilesInAtlas = ivec2(256, 256);
uniform ivec2 atlasTexSize = ivec2(4096, 4096);
ivec2 tileSizeInPx = atlasTexSize / tilesInAtlas; // should be like ivec2(16, 16)
uniform vec2 tilesInAtlas = ivec2(256.0, 256.0);
uniform vec2 atlasTexSize = ivec2(4096.0, 4096.0);
vec2 tileSizeInPx = atlasTexSize / tilesInAtlas; // should be like ivec2(16.0, 16.0)
uniform vec4 colourFilter = vec4(1, 1, 1, 1); // used by WALL to darken it
uniform ivec2 cameraTranslation = ivec2(0, 0); // used to offset the drawing
uniform ivec2 cameraTranslation = ivec2(0, 0); // used to offset the drawing; it's integer because we want the drawing to be pixel-aligned
uniform float drawBreakage = 1.0; // set it to 0f to not draw breakage, 1f to draw it; NEVER set to any other values.
uniform float zoom = 1.0;
ivec2 getTileXY(int tileNumber) {
return ivec2(tileNumber % int(tilesInAtlas.x), tileNumber / int(tilesInAtlas.x));
@@ -70,10 +67,8 @@ void main() {
// default gl_FragCoord takes half-integer (represeting centre of the pixel) -- could be useful for phys solver?
// This one, however, takes exact integer by rounding down. //
vec2 overscannedScreenDimension = tilesInAxes * tileSizeInPx; // how many tiles will fit into a screen; one used by the tileFromMap
vec2 overscannedScreenDimension = tilesInAxes * tileSizeInPx; // how many tiles will fit into a screen; one used by the tileFromMap; we need this because screen size is not integer multiple of the tile size
vec2 flippedFragCoord = vec2(gl_FragCoord.x, screenDimension.y - gl_FragCoord.y) + cameraTranslation; // NO IVEC2!!; this flips Y
//vec2 pxCoord = flippedFragCoord.xy; // TODO do I actually need 'pxCoord'?
vec2 zoomVec = vec2(zoom);
// get required tile numbers //
@@ -83,23 +78,17 @@ void main() {
ivec2 tileXY = getTileXY(tile);
ivec2 breakageXY = getTileXY(breakage + 5); // +5 is hard-coded constant that depends on the atlas
// cauculate the UV coord value for texture sampling //
//vec2 coordInTile = mod(pxCoord, tileSizeInPx) / tileSizeInPx; // 0..1 regardless of tile position in atlas // TODO do I actually need 'pxCoord'?
vec2 coordInTile = mod(flippedFragCoord, tileSizeInPx) / tileSizeInPx; // 0..1 regardless of tile position in atlas
// calculate the UV coord value for texture sampling //
// don't really need highp here; read the GLES spec
vec2 singleTileSizeInUV = vec2(1) / tilesInAtlas; // constant 0.00390625 for unmodified default uniforms
vec2 uvCoordForTile = coordInTile * singleTileSizeInUV; // 0..0.00390625 regardless of tile position in atlas
vec2 uvCoordOffsetTile = tileXY * singleTileSizeInUV; // where the tile starts in the atlas, using uv coord (0..1)
vec2 uvCoordOffsetBreakage = breakageXY * singleTileSizeInUV;
vec2 uvCoordForTile = (mod(flippedFragCoord, tileSizeInPx) / tileSizeInPx) / tilesInAtlas; // 0..0.00390625 regardless of tile position in atlas
vec2 uvCoordOffsetTile = tileXY / tilesInAtlas; // where the tile starts in the atlas, using uv coord (0..1)
vec2 uvCoordOffsetBreakage = breakageXY / tilesInAtlas;
// get final UV coord for the actual sampling //
vec2 finalUVCoordForTile = (uvCoordForTile + uvCoordOffsetTile);// where we should be actually looking for in atlas, using UV coord (0..1)
vec2 finalUVCoordForBreakage = (uvCoordForTile + uvCoordOffsetBreakage);
vec2 finalUVCoordForTile = uvCoordForTile + uvCoordOffsetTile;// where we should be actually looking for in atlas, using UV coord (0..1)
vec2 finalUVCoordForBreakage = uvCoordForTile + uvCoordOffsetBreakage;
// blending a breakage tex with main tex //

View File

@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.3.10'
ext.kotlin_version = '1.3.72'
repositories {
mavenCentral()
@@ -27,6 +27,7 @@ repositories {
}
dependencies {
compile "org.jetbrains.kotlin:kotlinx-coroutines-core"
compile "org.jetbrains.kotlin:kotlin-stdlib"
compile fileTree(dir: 'lib', include: ['*.jar'])
implementation 'org.junit:junit-bom:5.2.0'

View File

@@ -8,5 +8,10 @@
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="lib" level="project" />
<orderEntry type="library" name="com.badlogicgames.gdx:gdx-backend-lwjgl:1.9.10" level="project" />
<orderEntry type="library" name="com.badlogicgames.gdx:gdx-backend-lwjgl3:1.9.10" level="project" />
<orderEntry type="library" name="com.badlogicgames.gdx:gdx-controllers-platform:1.9.10" level="project" />
<orderEntry type="library" name="com.badlogicgames.gdx:gdx-controllers-desktop:1.9.10" level="project" />
<orderEntry type="library" name="com.badlogicgames.gdx:gdx-platform:1.9.10" level="project" />
</component>
</module>

Binary file not shown.

BIN
lib/gdx-1.9.10-javadoc.jar Normal file

Binary file not shown.

BIN
lib/gdx-1.9.10-sources.jar 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.

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.

BIN
lib/gdx-platform-1.9.10.jar 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.

BIN
lib/jinput-2.0.5.jar 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.

BIN
lib/jlayer-1.0.1-gdx.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
lib/jorbis-0.0.17.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
lib/jutils-1.0.0.jar Normal file

Binary file not shown.

Binary file not shown.

BIN
lib/lwjgl-2.9.3-javadoc.jar Normal file

Binary file not shown.

BIN
lib/lwjgl-2.9.3-sources.jar Normal file

Binary file not shown.

BIN
lib/lwjgl-3.2.1-javadoc.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
lib/lwjgl-3.2.1-sources.jar Normal file

Binary file not shown.

BIN
lib/lwjgl-3.2.1.jar 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.

BIN
lib/lwjgl-glfw-3.2.1.jar 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.

Some files were not shown because too many files have changed in this diff Show More