Compare commits

..

130 Commits

Author SHA1 Message Date
minjaesong
81ebf7a8ef world code placeholder to match the code struct 2023-09-08 19:32:41 +09:00
minjaesong
d5a8d098bb teleporter: list loading on separate thread 2023-09-08 18:51:53 +09:00
minjaesong
cc55e563f0 ModLoader: load IME unconditionally when found 2023-09-08 15:31:11 +09:00
minjaesong
64ef30e445 shorter share code if allowed; flickering teleporter beams 2023-09-08 02:14:36 +09:00
minjaesong
fbc700508f season variable moved to worldtime 2023-09-07 17:21:34 +09:00
minjaesong
37492dc8a0 six ecological seasons for terrain tiles 2023-09-07 13:19:32 +09:00
minjaesong
b0e4bd31eb temporary setup for picking next weather 2023-09-06 22:33:42 +09:00
minjaesong
0b5e3d7b77 skybox: old-current weather turbidity blend 2023-09-06 21:07:39 +09:00
minjaesong
b47cc17afd choosing next weather as its own function 2023-09-06 19:30:08 +09:00
minjaesong
6c97a9d5ab cloud stage has more depth 2023-09-06 18:01:33 +09:00
minjaesong
7259ca616c modloader: locale autoloader 2023-09-06 02:15:04 +09:00
minjaesong
70b9cebbd0 working sledgehammer item to take down walls 2023-09-05 22:47:40 +09:00
minjaesong
274be20e25 new texture for the teleporter 2023-09-05 20:40:55 +09:00
minjaesong
c576d087b4 newborn clouds will fade-in 2023-09-05 14:24:02 +09:00
minjaesong
699cc4dd74 another failed experiment 2023-09-05 13:45:02 +09:00
minjaesong
8fa9ddeec1 portalPoint to the world 2023-09-05 01:40:20 +09:00
minjaesong
c4deba14da cloud rendering: gamma change 2023-09-05 01:04:09 +09:00
minjaesong
cf98c13111 fix: 'q' would close the ui when you're typing in something 2023-09-05 00:41:43 +09:00
minjaesong
d0e1555ad0 sprite update 2023-09-04 22:40:48 +09:00
minjaesong
50eac69e3e working invitation code for new character 2023-09-04 22:16:51 +09:00
minjaesong
c45cab388e working invitation code via portal 2023-09-04 21:48:28 +09:00
minjaesong
7b3ac9cd06 weatherbox is now owned by the world 2023-09-04 14:59:12 +09:00
minjaesong
08b1d93d54 fix: double typing on world portal ui 2023-09-04 14:04:19 +09:00
minjaesong
da7ecaa75b share code ui wall of text 2023-09-03 20:30:23 +09:00
minjaesong
65b610ce01 world portal share code 2023-09-03 17:06:02 +09:00
minjaesong
6a78cf6a41 reverting akima intp: derivatives are not being preserved at the sample points 2023-09-02 23:43:50 +09:00
minjaesong
1e98353b50 akima interpolation to the WeatherBox 2023-09-02 22:37:07 +09:00
minjaesong
38c91bd8ec weatherbox: nonlinearity to the intp to remove overshoot-to-minus 2023-09-02 17:18:47 +09:00
minjaesong
78075d779b each cloud now carry its own gamma value 2023-09-02 02:40:27 +09:00
minjaesong
721a24d9dc commenting out some debug prints 2023-09-02 00:24:38 +09:00
minjaesong
66a103bd3a weather sched progression wip 2023-09-01 23:56:48 +09:00
minjaesong
abee176ef4 fix: graph rules not drawing if ymax < 1 2023-09-01 16:30:09 +09:00
minjaesong
ae078024cb angular modulo for wind dir 2023-09-01 15:51:46 +09:00
minjaesong
96af39ab4a changing the way weatherbox gets updated 2023-09-01 00:50:24 +09:00
minjaesong
c75fa73bac scrolling weatherbox; new skybox clut 2023-08-31 22:32:55 +09:00
minjaesong
5eed921288 debugwin: drawing ingame weatherboxes 2023-08-31 17:03:27 +09:00
minjaesong
7f3f94e01a gui-theme: cell colour change 2023-08-31 12:20:31 +09:00
minjaesong
1fe0ca9e2e debug window: weather box drawing 2023-08-31 12:19:56 +09:00
minjaesong
7cc985b627 debug info: timer toggle is now Ctrl+T 2023-08-31 10:56:32 +09:00
minjaesong
d17d576e15 sunlight and clouds changes 2023-08-30 19:57:11 +09:00
minjaesong
ced7cf99fc more cloud textures 2023-08-30 17:54:34 +09:00
minjaesong
c290d5dee7 minor phys fix 2023-08-30 14:39:20 +09:00
minjaesong
d32d6b8d1c torch should flicker less erratic now 2023-08-30 12:39:56 +09:00
minjaesong
9d118aebb0 todo weather example 2023-08-29 15:39:24 +09:00
minjaesong
0646425b76 build: removing unused files, instruction update 2023-08-29 14:29:25 +09:00
minjaesong
a348bac397 . 2023-08-29 14:04:17 +09:00
minjaesong
a9bd032c32 yet another cloud colour changes 2023-08-28 14:48:14 +09:00
minjaesong
349488376d sunrise/sunset transition is now longer 2023-08-28 14:30:24 +09:00
minjaesong
ce8c53f740 clut for cloud colours 2023-08-28 03:28:27 +09:00
minjaesong
7845146718 cloud spawn: fixing my bad maths 2023-08-28 00:04:00 +09:00
minjaesong
3cce1c0b65 faster import process 2023-08-27 21:13:52 +09:00
minjaesong
2bbf92d056 build script update 2023-08-27 21:01:13 +09:00
minjaesong
3d5713cd31 new test sprite/display screencaps for imported avatars if available 2023-08-27 17:38:43 +09:00
minjaesong
f8b6493cdc temporarily disabling evening-mustard :p 2023-08-25 21:28:20 +09:00
minjaesong
b69689a6be higher alpha-gamma makes it look better 2023-08-25 21:27:17 +09:00
minjaesong
cc2c841f76 app version string for .plist 2023-08-25 21:26:51 +09:00
minjaesong
89846db5d3 fix: using wrong method for retrieving mouse coord 2023-08-25 18:46:24 +09:00
minjaesong
bfd926d7fe avatar import error handling 2023-08-25 17:38:15 +09:00
minjaesong
602d5e046b fix: newly created world did not get clouds 2023-08-25 16:50:41 +09:00
minjaesong
72029ed458 new world screen for loading imported players 2023-08-25 16:47:00 +09:00
minjaesong
a4672a131d some gui stuff for imported players 2023-08-25 16:04:12 +09:00
minjaesong
75fcb5be5b new import screen 2023-08-25 15:49:35 +09:00
minjaesong
eeee1ebdbc F4 to hide GUI 2023-08-25 09:11:56 +09:00
minjaesong
32e750eb6a generating version number on build 2023-08-25 08:54:32 +09:00
minjaesong
a2ced31f8f removing os files on making assets_release 2023-08-25 08:40:06 +09:00
minjaesong
b1e45f1743 character import wip 2023-08-25 00:24:12 +09:00
minjaesong
8dda7ac79b linear filter for clouds 2023-08-24 20:27:10 +09:00
minjaesong
74b8cc20b7 fix: bad cloud spawn position on certain directions 2023-08-24 17:59:55 +09:00
minjaesong
f75a7dd812 control presets 2023-08-24 17:24:39 +09:00
minjaesong
b2454e4ca2 changing ui toggle keys in-world should work now 2023-08-24 16:08:18 +09:00
minjaesong
45af955488 wide cloud for overcast weather 2023-08-24 15:08:30 +09:00
minjaesong
1f39b9d448 cloud texture touchups 2023-08-23 22:38:01 +09:00
minjaesong
26a4cdbce1 clouds will despawn of old age 2023-08-23 21:22:46 +09:00
minjaesong
bf87dc04cb randomised weather but i'm just faking it rn 2023-08-23 18:12:32 +09:00
minjaesong
8535b0ce13 forgot to enable the initial clouds spawning 2023-08-23 13:01:20 +09:00
minjaesong
6e0004f165 clouds can spawn and drift in any direction 2023-08-23 12:49:33 +09:00
minjaesong
845333f33d timeflow on the titlescreen need not be that complex 2023-08-23 10:10:01 +09:00
minjaesong
6988feb731 day-night cycle on the titlescreen 2023-08-22 23:39:09 +09:00
minjaesong
ac2c7b1148 clouds on titlescreen 2023-08-22 23:17:49 +09:00
minjaesong
d6145fd0da even more clouds 2023-08-22 22:27:39 +09:00
minjaesong
194089827c more cloud texture 2023-08-22 21:27:33 +09:00
minjaesong
d69d032f74 more cloud texture 2023-08-22 20:27:25 +09:00
minjaesong
a9dbea3d16 more clouds 2023-08-22 20:06:22 +09:00
minjaesong
52938a4b60 improved cloud draw perf 2023-08-22 17:43:53 +09:00
minjaesong
a21f986f30 cloud spawn z-pos probability change 2023-08-22 16:33:39 +09:00
minjaesong
547158a313 more depth to the distant clouds 2023-08-22 16:20:35 +09:00
minjaesong
0a8b5f33f4 clouds parallax and can drift in 3D 2023-08-22 09:50:03 +09:00
minjaesong
da8d620766 clouds with just right depths 2023-08-22 02:55:31 +09:00
minjaesong
7dd520393c more clouds 2023-08-22 00:06:03 +09:00
minjaesong
dc83e12170 more clouds 2023-08-21 21:39:11 +09:00
minjaesong
d6b2940d8f more clouds 2023-08-21 01:26:16 +09:00
minjaesong
c5dfe46b76 cloud wip 2023-08-20 19:10:43 +09:00
minjaesong
3d3926c08b windows build 2023-08-18 20:30:57 +09:00
minjaesong
9a90bf69d4 trying to use the proper method of running exe on exe 2023-08-18 10:57:40 +09:00
minjaesong
0ed5472d8a adjusting pos for 'save will be deleted' msg 2023-08-18 00:05:03 +09:00
minjaesong
97a7a36030 version tag on app configuration 2023-08-17 15:47:31 +09:00
minjaesong
662069466a skybox size adjustment 2023-08-17 02:04:05 +09:00
minjaesong
52cff00338 commit 2023-08-16 22:39:31 +09:00
minjaesong
1a40334f8e auto zip for .app packaging 2023-08-16 22:26:27 +09:00
minjaesong
763f512419 script for assets_release 2023-08-16 22:17:09 +09:00
minjaesong
620a1c6956 GL_UNSIGNED_SHORT works just fine on macOS?! 2023-08-16 21:56:04 +09:00
minjaesong
5f4fcdba69 apple m chip workaround (2) 2023-08-16 21:46:54 +09:00
minjaesong
7a79f444b2 apple m chip workaround 2023-08-16 21:38:23 +09:00
minjaesong
e4b947ce69 Float16FrameBuffer 2023-08-16 17:51:31 +09:00
minjaesong
fdfec960ca reverse gravity adaptation of the last commit 2023-08-16 16:33:53 +09:00
minjaesong
75021ecfa2 fixing issue #48 2023-08-16 16:03:54 +09:00
minjaesong
c90ef21bfa calendar UI mouseover 2023-08-15 19:02:25 +09:00
minjaesong
3fce5d7e95 calendar UI 2023-08-15 14:58:50 +09:00
minjaesong
8db1228e70 calendar wip 2023-08-15 04:54:43 +09:00
minjaesong
5f7f724058 tileatlas: atlas size will automatically expand if it's too small 2023-08-14 18:47:39 +09:00
minjaesong
fab4179068 fixing issue #47 using new tag on blocks.csv 2023-08-14 18:16:05 +09:00
minjaesong
32803b6f18 incomplete fix for horizontal bouncing on T-shaped platform arrangement 2023-08-14 04:10:10 +09:00
minjaesong
f8f75fb7b6 options to change atlas texture size 2023-08-14 03:53:25 +09:00
minjaesong
9919a99032 fix: phys ccd would only trigger on its last iteration due to a stupid oversight 2023-08-13 16:54:46 +09:00
minjaesong
6a43d1a5bd calendar sprite removing a spring 2023-08-13 15:36:24 +09:00
minjaesong
24c971e4b8 oh wait thats not it 2023-08-11 21:08:35 +09:00
minjaesong
62f0fd7c68 hiding the phys artefact by forcefully holding down-key for long enough 2023-08-11 21:05:47 +09:00
minjaesong
3dec312989 phys glitch kinda fixed but i'm no longer sure about that 2023-08-11 17:03:51 +09:00
minjaesong
77b51a45dd no highp on blur shader 2023-08-11 13:03:45 +09:00
minjaesong
d1b4ce3404 something's fixed but have no idea what 2023-08-11 12:35:36 +09:00
minjaesong
fd7b88307c . 2023-08-11 09:29:30 +09:00
minjaesong
579b6b5b29 somehow fixed but now jumping while walking against wall changes jump behav 2023-08-11 01:04:34 +09:00
minjaesong
cef58f6a73 phys debugging; see L818@ActorWithBody.kt 2023-08-10 23:49:43 +09:00
minjaesong
c0c98c3b80 some locale changes; remoCon changes on load menu 2023-08-08 17:44:23 +09:00
minjaesong
88d844cc09 actor draw planting offset 2023-08-08 17:14:13 +09:00
minjaesong
2411db17a7 calendar fixture wip 2023-08-08 16:41:40 +09:00
minjaesong
53d372be38 there's no way #33 is fixed so easily but im committing it anyway 2023-08-08 12:09:22 +09:00
minjaesong
88831051c8 revised ingame date format 2023-08-08 09:01:34 +09:00
minjaesong
87d92ecb74 some random ideas for future self 2023-08-08 01:39:33 +09:00
minjaesong
6672dffdbc new passwd for new version 2023-08-07 14:45:07 +09:00
261 changed files with 5948 additions and 1791 deletions

View File

@@ -87,6 +87,7 @@
<element id="extracted-dir" path="$PROJECT_DIR$/lib/regex-22.3.1-edit.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/js-22.3.1-edit.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/graal-sdk-22.3.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/commons-math3-3.6.1.jar" path-in-jar="/" />
</root>
</artifact>
</component>

14
.idea/libraries/apache_commons_math3.xml generated Normal file
View File

@@ -0,0 +1,14 @@
<component name="libraryTable">
<library name="apache.commons.math3" type="repository">
<properties maven-id="org.apache.commons:commons-math3:3.6.1" />
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/commons-math3-3.6.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$PROJECT_DIR$/lib/commons-math3-3.6.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$PROJECT_DIR$/lib/commons-math3-3.6.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,11 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Build Version Number" type="Application" factoryName="Application">
<option name="ALTERNATIVE_JRE_PATH" value="17" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="MAIN_CLASS_NAME" value="net.torvald.terrarum.PrebuildKt" />
<module name="TerrarumBuild" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>

View File

@@ -7,6 +7,7 @@
<option name="ALTERNATIVE_JRE_PATH" value="17" />
<module name="TerrarumBuild" />
<method v="2">
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Build Version Number" run_configuration_type="Application" />
<option name="BuildArtifacts" enabled="true">
<artifact name="ModuleComputers" />
<artifact name="TerrarumBuild" />

View File

@@ -7,6 +7,7 @@
<option name="ALTERNATIVE_JRE_PATH" value="17" />
<module name="TerrarumBuild" />
<method v="2">
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Build Version Number" run_configuration_type="Application" />
<option name="BuildArtifacts" enabled="true">
<artifact name="ModuleComputers" />
<artifact name="TerrarumBuild" />

View File

@@ -1,26 +1,17 @@
package net.torvald.terrarum.modulecomputers.gameactors
import com.badlogic.gdx.Gdx
import com.badlogic.gdx.Input
import com.badlogic.gdx.graphics.*
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.graphics.glutils.FrameBuffer
import com.badlogic.gdx.utils.Disposable
import kotlin.coroutines.*
import net.torvald.terrarum.*
import net.torvald.terrarum.TerrarumAppConfiguration.TILE_SIZE
import net.torvald.terrarum.gameactors.AVKey
import net.torvald.terrarum.langpack.Lang
import net.torvald.terrarum.modulebasegame.gameactors.BlockBox
import net.torvald.terrarum.modulebasegame.gameactors.FixtureBase
import net.torvald.terrarum.modulebasegame.gameactors.FixtureInventory
import net.torvald.terrarum.ui.Toolkit
import net.torvald.terrarum.ui.UICanvas
import net.torvald.terrarum.modulecomputers.ui.UIHomeComputer
import net.torvald.tsvm.*
import net.torvald.tsvm.peripheral.AdapterConfig
import net.torvald.tsvm.peripheral.GraphicsAdapter
import net.torvald.tsvm.peripheral.VMProgramRom
import net.torvald.unicode.*
/**
* Created by minjaesong on 2021-12-04.
@@ -131,77 +122,3 @@ class FixtureHomeComputer : FixtureBase {
}
}
internal class UIHomeComputer : UICanvas(
toggleKeyLiteral = Input.Keys.ESCAPE, // FIXME why do I have specify ESC for it to function? ESC should be work as the default key
toggleButtonLiteral = App.getConfigInt("control_gamepad_start"),
) {
override var width = 640
override var height = 480
override var openCloseTime = 0f
private val drawOffX = (width - 560).div(2).toFloat()
private val drawOffY = (height - 448).div(2).toFloat()
private var batch: FlippingSpriteBatch
private var camera: OrthographicCamera
internal lateinit var vm: VM
internal lateinit var fixture: FixtureHomeComputer
init {
batch = FlippingSpriteBatch()
camera = OrthographicCamera(width.toFloat(), height.toFloat())
//val m = Matrix4()
//m.setToOrtho2D(0f, 0f, width.toFloat(), height.toFloat())
batch.projectionMatrix = camera.combined
}
private val fbo = FrameBuffer(Pixmap.Format.RGBA8888, width, height, false)
private val controlHelp =
"${getKeycapPC(App.getConfigInt("control_key_inventory"))} ${Lang["GAME_ACTION_CLOSE"]}\u3000 " +
"$KEYCAP_CTRL$KEYCAP_SHIFT$KEYCAP_T$KEYCAP_R Terminate\u3000" +
"$KEYCAP_CTRL$KEYCAP_SHIFT$KEYCAP_R$KEYCAP_S Reset\u3000" +
"$KEYCAP_CTRL$KEYCAP_SHIFT$KEYCAP_R$KEYCAP_Q SysRq"
override fun updateUI(delta: Float) {
}
override fun renderUI(otherBatch: SpriteBatch, otherCamera: Camera) {
otherBatch.end()
fbo.inAction(camera, batch) {
Gdx.gl.glClearColor(0f,0f,0f,1f)
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT) // to hide the crap might be there
(vm.peripheralTable[1].peripheral as? GraphicsAdapter)?.let { gpu ->
val clearCol = gpu.getBackgroundColour()
Gdx.gl.glClearColor(clearCol.r, clearCol.g, clearCol.b, clearCol.a)
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT)
gpu.render(Gdx.graphics.deltaTime, batch, drawOffX, drawOffY, true, fbo) // gpu.render will internally end() the fbo then begin() again before using the batch I've fed in
}
}
otherBatch.begin()
otherBatch.shader = null
blendNormalStraightAlpha(otherBatch)
otherBatch.color = Color.WHITE
otherBatch.draw(fbo.colorBufferTexture, posX.toFloat(), posY.toFloat(), width.toFloat(), height.toFloat())
otherBatch.color = Toolkit.Theme.COL_INACTIVE
Toolkit.drawBoxBorder(otherBatch, posX - 1, posY - 1, width + 2, height + 2)
App.fontGame.draw(otherBatch, controlHelp, posX, posY + height + 4)
}
override fun doOpening(delta: Float) {
super.doOpening(delta)
fixture.startVM()
}
override fun dispose() {
fbo.dispose()
}
}

View File

@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulecomputers.gameitems
import com.badlogic.gdx.graphics.Camera
import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.OrthographicCamera
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.graphics.g2d.TextureRegion
import com.badlogic.gdx.utils.Disposable
@@ -118,7 +119,7 @@ class WearableWorldRadarUI(val device: VM) : UICanvas() {
device.update(delta)
}
override fun renderUI(batch: SpriteBatch, camera: Camera) {
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
batch.end()
batch.color = Color.WHITE

View File

@@ -0,0 +1,90 @@
package net.torvald.terrarum.modulecomputers.ui
import com.badlogic.gdx.Gdx
import com.badlogic.gdx.Input
import com.badlogic.gdx.graphics.*
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.graphics.glutils.FrameBuffer
import net.torvald.terrarum.*
import net.torvald.terrarum.langpack.Lang
import net.torvald.terrarum.modulecomputers.gameactors.FixtureHomeComputer
import net.torvald.terrarum.ui.Toolkit
import net.torvald.terrarum.ui.UICanvas
import net.torvald.tsvm.VM
import net.torvald.tsvm.peripheral.GraphicsAdapter
import net.torvald.unicode.*
internal class UIHomeComputer : UICanvas(
toggleKeyLiteral = null,
toggleButtonLiteral = "control_gamepad_start",
) {
override var width = 640
override var height = 480
override var openCloseTime = 0f
private val drawOffX = (width - 560).div(2).toFloat()
private val drawOffY = (height - 448).div(2).toFloat()
private var batch: FlippingSpriteBatch
private var camera: OrthographicCamera
internal lateinit var vm: VM
internal lateinit var fixture: FixtureHomeComputer
init {
batch = FlippingSpriteBatch()
camera = OrthographicCamera(width.toFloat(), height.toFloat())
//val m = Matrix4()
//m.setToOrtho2D(0f, 0f, width.toFloat(), height.toFloat())
batch.projectionMatrix = camera.combined
}
private val fbo = FrameBuffer(Pixmap.Format.RGBA8888, width, height, false)
private val controlHelp =
"${getKeycapPC(ControlPresets.getKey("control_key_inventory"))} ${Lang["GAME_ACTION_CLOSE"]}\u3000 " +
"$KEYCAP_CTRL$KEYCAP_SHIFT$KEYCAP_T$KEYCAP_R Terminate\u3000" +
"$KEYCAP_CTRL$KEYCAP_SHIFT$KEYCAP_R$KEYCAP_S Reset\u3000" +
"$KEYCAP_CTRL$KEYCAP_SHIFT$KEYCAP_R$KEYCAP_Q SysRq"
override fun updateUI(delta: Float) {
}
override fun renderUI(otherBatch: SpriteBatch, otherCamera: OrthographicCamera) {
otherBatch.end()
fbo.inAction(camera, batch) {
Gdx.gl.glClearColor(0f,0f,0f,1f)
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT) // to hide the crap might be there
(vm.peripheralTable[1].peripheral as? GraphicsAdapter)?.let { gpu ->
val clearCol = gpu.getBackgroundColour()
Gdx.gl.glClearColor(clearCol.r, clearCol.g, clearCol.b, clearCol.a)
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT)
gpu.render(Gdx.graphics.deltaTime, batch, drawOffX, drawOffY, true, fbo) // gpu.render will internally end() the fbo then begin() again before using the batch I've fed in
}
}
otherBatch.begin()
otherBatch.shader = null
blendNormalStraightAlpha(otherBatch)
otherBatch.color = Color.WHITE
otherBatch.draw(fbo.colorBufferTexture, posX.toFloat(), posY.toFloat(), width.toFloat(), height.toFloat())
otherBatch.color = Toolkit.Theme.COL_INACTIVE
Toolkit.drawBoxBorder(otherBatch, posX - 1, posY - 1, width + 2, height + 2)
App.fontGame.draw(otherBatch, controlHelp, posX, posY + height + 4)
}
override fun doOpening(delta: Float) {
super.doOpening(delta)
fixture.startVM()
}
override fun dispose() {
fbo.dispose()
}
}

View File

@@ -25,5 +25,6 @@
<orderEntry type="library" name="jetbrains.kotlin.reflect" level="project" />
<orderEntry type="library" name="jetbrains.kotlin.test" level="project" />
<orderEntry type="library" name="io.github.classgraph" level="project" />
<orderEntry type="library" name="apache.commons.math3" level="project" />
</component>
</module>

Binary file not shown.

BIN
assets/graphics/fonts/code.tga LFS Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -8,6 +8,7 @@
"GAME_ACTION_MOVE_VERB" : "Move",
"GAME_ACTION_ZOOM" : "Zoom",
"MENU_IO_AUTOSAVE": "Autosave",
"MENU_IO_CLEAR": "Clear",
"MENU_IO_IMPORT": "Import",
"MENU_IO_MANUAL_SAVE": "Manual Save",
"MENU_LABEL_COPYRIGHT": "Copyright",
@@ -16,6 +17,7 @@
"MENU_LABEL_IME": "IME",
"MENU_LABEL_IME_TOGGLE": "Toggle IME",
"MENU_LABEL_KEYBOARD_LAYOUT": "Keyboard Layout",
"MENU_LABEL_PASTE": "Paste",
"MENU_LABEL_PASTE_FROM_CLIPBOARD": "Paste from Clipboard",
"MENU_LABEL_PRESS_START_SYMBOL": "Press >",
"MENU_LABEL_RESET" : "Reset",
@@ -23,6 +25,7 @@
"MENU_LABEL_STREAMING": "Livestreaming",
"MENU_LABEL_SYSTEM_INFO": "System Info",
"MENU_MODULES" : "Modules",
"MENU_OPTIONS_ATLAS_TEXTURE_SIZE": "Atlas Texture Size",
"MENU_OPTIONS_AUTOSAVE": "Autosave",
"MENU_OPTIONS_BLUR": "Blur",
"MENU_OPTIONS_DEBUG_CONSOLE": "Debug Console",

View File

@@ -1,4 +1,5 @@
{
"ERROR_FILE_NOT_FOUND": "File not found.",
"GAME_32BIT_WARNING1": "It looks like youre running a 32-Bit version of Java.",
"GAME_32BIT_WARNING2": "Please download and install the latest 64-Bit Java at:",
"GAME_32BIT_WARNING3": "https://www.java.com/en/download/",

View File

@@ -7,7 +7,9 @@
"COPYRIGHT_GNU_GPL_3": "GNU GPL 3에 따라 배포됨",
"GAME_ACTION_MOVE_VERB" : "이동하기",
"GAME_ACTION_ZOOM" : "확대·축소",
"GAME_ACTION_ZOOM_OUT" : "화면 축소",
"MENU_IO_AUTOSAVE": "자동 저장",
"MENU_IO_CLEAR": "지우기",
"MENU_IO_IMPORT": "가져오기",
"MENU_IO_MANUAL_SAVE": "수동 저장",
"MENU_LABEL_COPYRIGHT": "저작권",
@@ -16,13 +18,15 @@
"MENU_LABEL_IME": "입력기",
"MENU_LABEL_IME_TOGGLE": "입력기 켜고 끄기",
"MENU_LABEL_KEYBOARD_LAYOUT": "자판 배열",
"MENU_LABEL_PASTE_FROM_CLIPBOARD": "복사한 텍스트 붙여넣기",
"MENU_LABEL_PASTE": "붙여넣기",
"MENU_LABEL_PASTE_FROM_CLIPBOARD": "복사한 문구 붙여넣기",
"MENU_LABEL_PRESS_START_SYMBOL": ">을 누르세요",
"MENU_LABEL_RESET" : "재설정",
"MENU_LABEL_RESTART_REQUIRED": "재시작 필요",
"MENU_LABEL_STREAMING": "실시간 방송",
"MENU_LABEL_SYSTEM_INFO": "시스템 정보",
"MENU_MODULES" : "모듈",
"MENU_OPTIONS_ATLAS_TEXTURE_SIZE": "아틀라스 텍스처 크기",
"MENU_OPTIONS_AUTOSAVE": "자동 저장",
"MENU_OPTIONS_BLUR": "흐림",
"MENU_OPTIONS_DEBUG_CONSOLE": "디버그 콘솔",

View File

@@ -1,4 +1,5 @@
{
"ERROR_FILE_NOT_FOUND": "파일을 찾을 수 없습니다.",
"GAME_32BIT_WARNING1": "32비트 버전의 Java를 사용중인 것 같습니다.",
"GAME_32BIT_WARNING2": "아래 링크에서 최신 64비트 Java를 내려받아 설치해주세요.",
"GAME_32BIT_WARNING3": "https://www.java.com/ko/download/",

Binary file not shown.

Binary file not shown.

View File

@@ -1,5 +1,5 @@
"id";"drop";"spawn";"name";"shdr";"shdg";"shdb";"shduv";"str";"dsty";"mate";"solid";"wall";"grav";"dlfn";"fv";"fr";"lumr";"lumg";"lumb";"lumuv";"colour";"vscs";"refl";"tags"
"0";"0";"0";"BLOCK_AIR";"0.0312";"0.0312";"0.0312";"0.0312";"1";"1";"NULL";"0";"1";"N/A";"0";"0";"4";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";""
"0";"0";"0";"BLOCK_AIR";"0.0312";"0.0312";"0.0312";"0.0312";"1";"1";"NULL";"0";"1";"N/A";"0";"0";"4";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"INCONSEQUENTIAL"
"16";"17";"17";"BLOCK_STONE";"0.1252";"0.1252";"0.1252";"0.1252";"48";"2400";"ROCK";"1";"1";"N/A";"0";"4";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"ROCK,NATURAL"
"17";"17";"17";"BLOCK_STONE_QUARRIED";"0.1252";"0.1252";"0.1252";"0.1252";"48";"2400";"ROCK";"1";"1";"N/A";"0";"4";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"ROCK"
"18";"18";"18";"BLOCK_STONE_TILE_WHITE";"0.1252";"0.1252";"0.1252";"0.1252";"48";"2400";"ROCK";"1";"1";"N/A";"0";"4";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.18";"STONE"
@@ -188,6 +188,7 @@
## Some tags are reserved for internal use, which are:
## - INTERNAL: denotes that the tile is internal-use. Will not be rendered unless debug window is on.
## - DORENDER: this internal tile must go through the standard-issue tile drawing routine.
## - INCONSEQUENTIAL: denotes that this tile can be overwritten without dropping it. Usually used with flower tiles.
#
#
## References ##
Can't render this file because it contains an unexpected character in line 179 and column 37.

View File

@@ -32,4 +32,5 @@ Teleport
ToggleNoClip
Zoom
DynToStatic
DebugFillInventory
DebugFillInventory
Uuid
1 CatStdout
32 ToggleNoClip
33 Zoom
34 DynToStatic
35 DebugFillInventory
36 Uuid

View File

@@ -0,0 +1,34 @@
{
"racename": "",
"racenameplural": "",
"baseheight": 90,
"basemass": 600.0,
"strength": 65535,
"strengthmult": [100,100,100,100,100,100,100],
"accel": 0.67,
"speed": 6.0,
"speedmult": [100,100,100,100,100,100,100],
"vertstride": 40,
"jumppower": 17.6,
"jumppowermult": [100,100,100,100,100,100,100],
"scale": 1.0,
"scalemult": [100,100,100,100,100,100,100],
"encumbrance": 2147483647,
"defence": 65535,
"reach": 226,
"toolsize": 40,
"intelligent": true,
"barehandactionminheight": 40,
"basebarehanddiggingsize": 16,
"__comments__": "This RAW is intended to test the theoretical maximum values for properties (strength, defence, etc.)"
}

Binary file not shown.

View File

@@ -2,12 +2,17 @@ id;classname
1;net.torvald.terrarum.modulebasegame.gameitems.PickaxeCopper
2;net.torvald.terrarum.modulebasegame.gameitems.PickaxeIron
3;net.torvald.terrarum.modulebasegame.gameitems.PickaxeSteel
4;net.torvald.terrarum.modulebasegame.gameitems.SledgehammerIron
5;net.torvald.terrarum.modulebasegame.gameitems.ItemTikiTorch
6;net.torvald.terrarum.modulebasegame.gameitems.ItemStorageChest
7;net.torvald.terrarum.modulebasegame.gameitems.WireGraphDebugger
8;net.torvald.terrarum.modulebasegame.gameitems.ItemLogicSignalEmitter
9;net.torvald.terrarum.modulebasegame.gameitems.WireCutterAll
10;net.torvald.terrarum.modulebasegame.gameitems.ItemTypewriter
11;net.torvald.terrarum.modulebasegame.gameitems.ItemWallCalendar
12;net.torvald.terrarum.modulebasegame.gameitems.SledgehammerCopper
13;net.torvald.terrarum.modulebasegame.gameitems.SledgehammerSteel
256;net.torvald.terrarum.modulebasegame.gameitems.ItemSwingingDoorOak
257;net.torvald.terrarum.modulebasegame.gameitems.ItemSwingingDoorEbony
1 id classname
2 1 net.torvald.terrarum.modulebasegame.gameitems.PickaxeCopper
3 2 net.torvald.terrarum.modulebasegame.gameitems.PickaxeIron
4 3 net.torvald.terrarum.modulebasegame.gameitems.PickaxeSteel
5 4 net.torvald.terrarum.modulebasegame.gameitems.SledgehammerIron
6 5 net.torvald.terrarum.modulebasegame.gameitems.ItemTikiTorch
7 6 net.torvald.terrarum.modulebasegame.gameitems.ItemStorageChest
8 7 net.torvald.terrarum.modulebasegame.gameitems.WireGraphDebugger
9 8 net.torvald.terrarum.modulebasegame.gameitems.ItemLogicSignalEmitter
10 9 net.torvald.terrarum.modulebasegame.gameitems.WireCutterAll
11 10 net.torvald.terrarum.modulebasegame.gameitems.ItemTypewriter
12 11 net.torvald.terrarum.modulebasegame.gameitems.ItemWallCalendar
13 12 net.torvald.terrarum.modulebasegame.gameitems.SledgehammerCopper
14 13 net.torvald.terrarum.modulebasegame.gameitems.SledgehammerSteel
15 256 net.torvald.terrarum.modulebasegame.gameitems.ItemSwingingDoorOak
16 256 257 net.torvald.terrarum.modulebasegame.gameitems.ItemSwingingDoorOak net.torvald.terrarum.modulebasegame.gameitems.ItemSwingingDoorEbony
17 257 258 net.torvald.terrarum.modulebasegame.gameitems.ItemSwingingDoorEbony net.torvald.terrarum.modulebasegame.gameitems.ItemSwingingDoorBirch
18 258 259 net.torvald.terrarum.modulebasegame.gameitems.ItemSwingingDoorBirch net.torvald.terrarum.modulebasegame.gameitems.ItemSwingingDoorRosewood

Binary file not shown.

View File

@@ -1,8 +1,7 @@
{
"GAME_ITEM_CALENDAR": "Calendar",
"MENU_CALENDAR_CALENDAR": "Calendar",
"MENU_CALENDAR_EVENTS": "Events",
"MENU_CALENDAR_ADD_NEW_EVENT": "Add New Event",
"MENU_CALENDAR_ADD_NEW_EVENT": "Add New Event",
"CONTEXT_CALENDAR_SEASON_SPRING": "Spring",
"CONTEXT_CALENDAR_SEASON_SUMMER": "Summer",
"CONTEXT_CALENDAR_SEASON_AUTUMN": "Autumn",
@@ -11,6 +10,9 @@
"CONTEXT_CALENDAR_SEASON_SUMM": "Summ",
"CONTEXT_CALENDAR_SEASON_AUTM": "Autm",
"CONTEXT_CALENDAR_SEASON_WINT": "Wint",
"CONTEXT_CALENDAR_DATE_FORMAT_Y": "Year {0}",
"CONTEXT_CALENDAR_DATE_FORMAT_YMD": "Year {0} {1} {2}",
"CONTEXT_CALENDAR_DATE_FORMAT_YMD_DDD": "Year {0} {1} {2} {3}",
"CONTEXT_CALENDAR_DAY_MONDAG_DNT": "Mondag",
"CONTEXT_CALENDAR_DAY_TYSDAG_DNT": "Tysdag",
@@ -27,5 +29,6 @@
"CONTEXT_CALENDAR_DAY_FRE_DNT": "Fre",
"CONTEXT_CALENDAR_DAY_LAU_DNT": "Lau",
"CONTEXT_CALENDAR_DAY_SUN_DNT": "Sun",
"CONTEXT_CALENDAR_DAY_VER_DNT": "Ver"
"CONTEXT_CALENDAR_DAY_VER_DNT": "Ver",
"CONTEXT_CALENDAR_DATE_FORMAT_YMD_SHORT_DNT": "ɣ{0}-{1}-{2}"
}

View File

@@ -1,23 +1,26 @@
{
"CONTEXT_GENERATOR_SEED": "Seed",
"CONTEXT_ITEM_MAP": "Map",
"CONTEXT_ITEM_TOOL_PLURAL": "Tools",
"CONTEXT_PLACE_COORDINATE": "Coordinate",
"CONTEXT_WORLD_COUNT": "Worlds: ",
"CONTEXT_WORLD_NEW": "New World",
"MENU_LABEL_DELETE_WORLD": "Delete World",
"CONTEXT_WORLD_COUNT": "Worlds: ",
"GAME_INVENTORY_INGREDIENTS": "Ingredients",
"GAME_INVENTORY_POTIONS": "Potions",
"GAME_INVENTORY_BLOCKS": "Blocks",
"GAME_INVENTORY_WALLS": "Walls",
"CONTEXT_ITEM_TOOL_PLURAL": "Tools",
"GAME_INVENTORY_FAVORITES": "Favorites",
"GAME_INVENTORY_REGISTER": "Register",
"CONTEXT_ITEM_MAP": "Map",
"MENU_LABEL_MENU": "Menu",
"CONTEXT_GENERATOR_SEED": "Seed",
"MENU_LABEL_PREV_SAVES": "Previous Saves",
"MENU_LABEL_RENAME": "Rename",
"MENU_LABEL_USE_CODE": "Use Code",
"MENU_MONITOR_CALI_TITLE": "Check Monitor",
"GAME_ACTION_CRAFT": "Craft",
"GAME_ACTION_GRAPPLE": "Grapple",
"GAME_ACTION_QUICKSEL": "Quick Select",
"GAME_ACTION_CRAFT": "Craft",
"GAME_CRAFTING": "Crafting",
"GAME_CRAFTABLE_ITEMS": "Craftable Items",
"MENU_LABEL_RENAME": "Rename",
"GAME_ACTION_TELEPORT": "Teleport",
"CONTEXT_PLACE_COORDINATE": "Coordinate"
"GAME_CRAFTABLE_ITEMS": "Craftable Items",
"GAME_CRAFTING": "Crafting",
"GAME_INVENTORY_BLOCKS": "Blocks",
"GAME_INVENTORY_FAVORITES": "Favorites",
"GAME_INVENTORY_INGREDIENTS": "Ingredients",
"GAME_INVENTORY_POTIONS": "Potions",
"GAME_INVENTORY_REGISTER": "Register",
"GAME_INVENTORY_WALLS": "Walls"
}

View File

@@ -1,18 +1,26 @@
{
"BLOCK_STONE_DEEP": "Deepstone",
"BLOCK_SCAFFOLDING_NORMAL": "Scaffolding",
"BLOCK_STONE_MARBLE": "Marble",
"ITEM_CALENDAR": "Calendar",
"ITEM_LOGIC_SIGNAL_EMITTER": "Logic Signal Emitter",
"ITEM_PICK_COPPER": "Copper Pickaxe",
"ITEM_PICK_IRON": "Iron Pickaxe",
"ITEM_PICK_STEEL": "Steel Pickaxe",
"ITEM_SLEDGEHAMMER_COPPER": "Copper Sledgehammer",
"ITEM_SLEDGEHAMMER_IRON": "Iron Sledgehammer",
"ITEM_SLEDGEHAMMER_STEEL": "Steel Sledgehammer",
"ITEM_STORAGE_CHEST": "Storage Chest",
"ITEM_TIKI_TORCH": "Tiki Torch",
"ITEM_TYPEWRITER": "Typewriter",
"ITEM_WIRE": "Wire",
"ITEM_WIRE_CUTTER": "Wire Cutter",
"ACTORBLOCK_ALLOW_MOVE_DOWN": "Urist Arôlcustith",
"ACTORBLOCK_FULL_COLLISION": "Urist Berdanrifot",
"ACTORBLOCK_NO_COLLISION": "Urist Zafal",
"ACTORBLOCK_NO_PASS_RIGHT": "Urist McPassLeft",
"ACTORBLOCK_NO_PASS_LEFT": "Urist McPassRight",
"ACTORBLOCK_TILING_PLACEHOLDER": "Urist Berdanurdim",
"BLOCK_STONE_DEEP": "Deepstone",
"BLOCK_SCAFFOLDING_NORMAL": "Scaffolding",
"BLOCK_STONE_MARBLE": "Marble",
"ITEM_STORAGE_CHEST": "Storage Chest",
"ITEM_WIRE": "Wire",
"ITEM_WIRE_CUTTER": "Wire Cutter",
"ITEM_LOGIC_SIGNAL_EMITTER": "Logic Signal Emitter",
"ITEM_TIKI_TORCH": "Tiki Torch"
"ACTORBLOCK_TILING_PLACEHOLDER": "Urist Berdanurdim"
}

View File

@@ -1,3 +1,12 @@
{
"CONTEXT_THIS_IS_A_WORLD_CURRENTLY_PLAYING": "This is a world currently playing."
"CONTEXT_THIS_IS_A_WORLD_CURRENTLY_PLAYING": "This is a world currently playing.",
"CONTEXT_IMPORT_AVATAR_INSTRUCTION_1": "1. Place the Avatar file into the following directory:",
"CONTEXT_IMPORT_AVATAR_INSTRUCTION_2": "",
"CONTEXT_IMPORT_AVATAR_INSTRUCTION_3": "2. Enter the name of the file below, then press Import",
"CONTEXT_WORLD_CODE_SHARE_1": "Other people sharing the device can play on this",
"CONTEXT_WORLD_CODE_SHARE_2": "world when you are away.",
"CONTEXT_WORLD_CODE_SHARE_3": "",
"CONTEXT_WORLD_CODE_SHARE_4": "Share the code below so the other people can join!",
"ERROR_AVATAR_ALREADY_EXISTS": "The Avatar already exists.",
"ERROR_WORLD_NOT_FOUND": "World not found."
}

View File

@@ -1,8 +1,7 @@
{
"GAME_ITEM_CALENDAR": "달력",
"MENU_CALENDAR_CALENDAR": "달력",
"MENU_CALENDAR_EVENTS": "일정",
"MENU_CALENDAR_ADD_NEW_EVENT": "새 일정 추가",
"MENU_CALENDAR_ADD_NEW_EVENT": "새 일정 추가",
"CONTEXT_CALENDAR_SEASON_SPRING": "봄",
"CONTEXT_CALENDAR_SEASON_SUMMER": "여름",
"CONTEXT_CALENDAR_SEASON_AUTUMN": "가을",
@@ -10,5 +9,8 @@
"CONTEXT_CALENDAR_SEASON_SPRI": "봄",
"CONTEXT_CALENDAR_SEASON_SUMM": "여름",
"CONTEXT_CALENDAR_SEASON_AUTM": "가을",
"CONTEXT_CALENDAR_SEASON_WINT": "겨울"
"CONTEXT_CALENDAR_SEASON_WINT": "겨울",
"CONTEXT_CALENDAR_DATE_FORMAT_Y": "{0}년",
"CONTEXT_CALENDAR_DATE_FORMAT_YMD": "{0}년 {1} {2}일",
"CONTEXT_CALENDAR_DATE_FORMAT_YMD_DDD": "{0}년 {1} {2}일 {3}"
}

View File

@@ -1,24 +1,26 @@
{
"CONTEXT_GENERATOR_SEED": "시드",
"CONTEXT_ITEM_MAP": "지도",
"CONTEXT_ITEM_TOOL_PLURAL": "도구",
"CONTEXT_PLACE_COORDINATE": "좌표",
"CONTEXT_WORLD_COUNT": "새계: ",
"CONTEXT_WORLD_NEW": "새 세계",
"MENU_LABEL_DELETE_WORLD": "새계 삭제",
"CONTEXT_WORLD_COUNT": "새계: ",
"MENU_MONITOR_CALI_TITLE": "모니터 확인",
"GAME_INVENTORY_INGREDIENTS": "재료",
"GAME_INVENTORY_POTIONS": "물약",
"GAME_INVENTORY_BLOCKS": "블록",
"GAME_INVENTORY_WALLS": "벽지",
"CONTEXT_ITEM_TOOL_PLURAL": "도구",
"GAME_INVENTORY_FAVORITES": "즐겨찾기",
"GAME_INVENTORY_REGISTER": "등록하기",
"MENU_LABEL_MENU": "메뉴",
"CONTEXT_ITEM_MAP": "지도",
"CONTEXT_GENERATOR_SEED": "시드",
"MENU_LABEL_PREV_SAVES": "이전 세이브",
"MENU_LABEL_RENAME": "이름 바꾸기",
"MENU_LABEL_USE_CODE": "코드 사용",
"MENU_MONITOR_CALI_TITLE": "모니터 확인",
"GAME_ACTION_CRAFT": "제작하기",
"GAME_ACTION_GRAPPLE": "매달리기",
"GAME_ACTION_QUICKSEL": "빠른 선택",
"GAME_ACTION_CRAFT": "제작하기",
"GAME_CRAFTING": "제작",
"GAME_CRAFTABLE_ITEMS": "제작 가능한 아이템",
"MENU_LABEL_RENAME": "이름 바꾸기",
"GAME_ACTION_TELEPORT": "텔레포트하기",
"CONTEXT_PLACE_COORDINATE": "좌표"
"GAME_CRAFTABLE_ITEMS": "제작 가능한 아이템",
"GAME_CRAFTING": "제작",
"GAME_INVENTORY_BLOCKS": "블록",
"GAME_INVENTORY_FAVORITES": "즐겨찾기",
"GAME_INVENTORY_INGREDIENTS": "재료",
"GAME_INVENTORY_POTIONS": "물약",
"GAME_INVENTORY_REGISTER": "등록하기",
"GAME_INVENTORY_WALLS": "벽지"
}

View File

@@ -3,9 +3,17 @@
"BLOCK_SCAFFOLDING_NORMAL": "발판",
"BLOCK_STONE_MARBLE": "대리석",
"ITEM_STORAGE_CHEST": "보관상자",
"ITEM_WIRE": "전선",
"ITEM_WIRE_CUTTER": "전선 절단기",
"ITEM_CALENDAR": "달력",
"ITEM_LOGIC_SIGNAL_EMITTER": "신호발생기",
"ITEM_TIKI_TORCH": "티키 토치"
"ITEM_PICK_COPPER": "구리 곡괭이",
"ITEM_PICK_IRON": "철 곡괭이",
"ITEM_PICK_STEEL": "강철 곡괭이",
"ITEM_SLEDGEHAMMER_COPPER": "구리 해머",
"ITEM_SLEDGEHAMMER_IRON": "철 해머",
"ITEM_SLEDGEHAMMER_STEEL": "강철 해머",
"ITEM_STORAGE_CHEST": "보관상자",
"ITEM_TIKI_TORCH": "티키 토치",
"ITEM_TYPEWRITER": "타자기",
"ITEM_WIRE": "전선",
"ITEM_WIRE_CUTTER": "전선 절단기"
}

View File

@@ -1,3 +1,11 @@
{
"CONTEXT_THIS_IS_A_WORLD_CURRENTLY_PLAYING": "현재 플레이 중인 월드입니다."
"CONTEXT_THIS_IS_A_WORLD_CURRENTLY_PLAYING": "현재 플레이 중인 세계입니다.",
"CONTEXT_IMPORT_AVATAR_INSTRUCTION_1": "1. 아바타 파일을 다음 폴더에 넣어주세요",
"CONTEXT_IMPORT_AVATAR_INSTRUCTION_3": "2. 아바타 파일 이름을 아래에 입력하고 가져오기를 눌러주세요",
"CONTEXT_WORLD_CODE_SHARE_1": "자리를 비운 동안 같은 기기를 공유하는 다른 사람이 이 세계를",
"CONTEXT_WORLD_CODE_SHARE_2": "플레이할 수 있도록 합니다.",
"CONTEXT_WORLD_CODE_SHARE_3": "",
"CONTEXT_WORLD_CODE_SHARE_4": "아래의 코드를 공유해 다른 사람을 초대하세요!",
"ERROR_AVATAR_ALREADY_EXISTS": "이미 존재하는 아바타입니다.",
"ERROR_WORLD_NOT_FOUND": "세계를 찾을 수 없습니다."
}

Binary file not shown.

View File

@@ -0,0 +1,48 @@
# complete file name is: SPRITESHEET + bodypart name + EXTENSION
SPRITESHEET=mods/basegame/sprites/test_werebeastf2/taimu_
EXTENSION=.tga
# defines frame size and origin point. Origin point is given as: (originx, 0)
CONFIG=SIZE 64,98;ORIGINX 40
! A skeleton also defines what body parts (images) be used.
! You can also write multiline text using reverse solidus; this is a feature of .properties
! skeleton joints are ordered: foremost-drawn object comes first, which means lowermost object IN THIS LIST
! are painted first, and any object that comes before it will paint over it. In other words, this list is
! first reversed then being iterated.
! Some keywords are considered special within the game, they are:
! HEADGEAR, HELD_ITEM, BOOT_L, BOOT_R, GAUNTLET_L, GAUNTLET_R and ARMOUR_* (star means any number starting from zero)
BODYPARTS=HEADGEAR 13,14;\
HEAD 13,14;\
ARM_REST_RIGHT 10,4;\
ARM_REST_LEFT 9,3;\
LEG_REST_RIGHT 15,6;\
LEG_REST_LEFT 8,6;\
TORSO_0 18,19;\
TORSO_1 18,19;\
TAIL_0 30,2;\
BUST_0 11,2;\
HELD_ITEM 0,0
SKELETON_STAND=HEADGEAR 0,78;\
ARM_REST_RIGHT -16,66;\
HELD_ITEM -11,33;\
HEAD 0,78;\
BUST_0 0,63;\
TORSO_0 0,54;\
TORSO_1 0,54;\
LEG_REST_RIGHT -5,41;\
LEG_REST_LEFT 3,41;\
ARM_REST_LEFT 8,66;\
TAIL_0 2,40
! When you move the arms/hands, make sure you move the HELD_ITEM as well
# RUNNING might need its own skeleton...
ANIM_RUN=DELAY 0.18;ROW 2;SKELETON SKELETON_STAND
ANIM_RUN_1=LEG_REST_RIGHT 2,2;LEG_REST_LEFT -2,0;TAIL_0 1,0;TORSO_1 0,-999
ANIM_RUN_2=ALL 0,2;LEG_REST_RIGHT 0,-2;LEG_REST_LEFT 0,2;TAIL_0 -1,0;TORSO_1 0,-999
ANIM_RUN_3=LEG_REST_RIGHT -2,0;LEG_REST_LEFT 2,2;TAIL_0 -1,0;TORSO_1 0,-999
ANIM_RUN_4=ALL 0,2;LEG_REST_RIGHT 0,2;LEG_REST_LEFT 0,-2;TAIL_0 1,0;TORSO_1 0,-999
ANIM_IDLE=DELAY 2;ROW 1;SKELETON SKELETON_STAND
ANIM_IDLE_1=TORSO_1 0,-999
ANIM_IDLE_2=TORSO_0 0,-999;ARM_REST_LEFT 0,1;ARM_REST_RIGHT 0,1;HELD_ITEM 0,1;BUST_0 0,1;HEAD 0,1

View File

@@ -0,0 +1,48 @@
# complete file name is: SPRITESHEET + bodypart name + EXTENSION
SPRITESHEET=mods/basegame/sprites/test_werebeastf2/taimuglow_
EXTENSION=.tga
# defines frame size and origin point. Origin point is given as: (originx, 0)
CONFIG=SIZE 64,98;ORIGINX 40
! A skeleton also defines what body parts (images) be used.
! You can also write multiline text using reverse solidus; this is a feature of .properties
! skeleton joints are ordered: foremost-drawn object comes first, which means lowermost object IN THIS LIST
! are painted first, and any object that comes before it will paint over it. In other words, this list is
! first reversed then being iterated.
! Some keywords are considered special within the game, they are:
! HEADGEAR, HELD_ITEM, BOOT_L, BOOT_R, GAUNTLET_L, GAUNTLET_R and ARMOUR_* (star means any number starting from zero)
BODYPARTS=HEADGEAR 13,14;\
HEAD 13,14;\
ARM_REST_RIGHT 10,4;\
ARM_REST_LEFT 9,3;\
LEG_REST_RIGHT 15,6;\
LEG_REST_LEFT 8,6;\
TORSO_0 18,19;\
TORSO_1 18,19;\
TAIL_0 30,2;\
BUST_0 11,2;\
HELD_ITEM 0,0
SKELETON_STAND=HEADGEAR 0,78;\
ARM_REST_RIGHT -16,66;\
HELD_ITEM -11,33;\
HEAD 0,78;\
BUST_0 0,63;\
TORSO_0 0,54;\
TORSO_1 0,54;\
LEG_REST_RIGHT -5,41;\
LEG_REST_LEFT 3,41;\
ARM_REST_LEFT 8,66;\
TAIL_0 2,40
! When you move the arms/hands, make sure you move the HELD_ITEM as well
# RUNNING might need its own skeleton...
ANIM_RUN=DELAY 0.18;ROW 2;SKELETON SKELETON_STAND
ANIM_RUN_1=LEG_REST_RIGHT 2,2;LEG_REST_LEFT -2,0;TAIL_0 1,0;TORSO_1 0,-999
ANIM_RUN_2=ALL 0,2;LEG_REST_RIGHT 0,-2;LEG_REST_LEFT 0,2;TAIL_0 -1,0;TORSO_1 0,-999
ANIM_RUN_3=LEG_REST_RIGHT -2,0;LEG_REST_LEFT 2,2;TAIL_0 -1,0;TORSO_1 0,-999
ANIM_RUN_4=ALL 0,2;LEG_REST_RIGHT 0,2;LEG_REST_LEFT 0,-2;TAIL_0 1,0;TORSO_1 0,-999
ANIM_IDLE=DELAY 2;ROW 1;SKELETON SKELETON_STAND
ANIM_IDLE_1=TORSO_1 0,-999
ANIM_IDLE_2=TORSO_0 0,-999;ARM_REST_LEFT 0,1;ARM_REST_RIGHT 0,1;HELD_ITEM 0,1;BUST_0 0,1;HEAD 0,1

Binary file not shown.

View File

@@ -1,8 +1,26 @@
{
"identifier": "generic01",
"skyboxGradColourMap": "generic_skybox.tga",
"daylightClut": "clut_daylight.tga",
"classification": "generic",
"extraImages": [
]
"cloudChance": 125,
"cloudGamma": [0.7, 2.4],
"cloudGammaVariance": [0.143, 0.0],
"windSpeed": 0.35,
"windSpeedVariance": 0.4,
"windSpeedDamping": 0.5,
"clouds": {
"cumulonimbus": {
"filename": "cloud_large.png", "tw": 2048, "th": 1024, "probability": 0.2,
"baseScale": 4.0, "scaleVariance": 0.3333333,
"altLow": 1080, "altHigh": 1120
},
"cumulus": {
"filename": "cloud_normal.png", "tw": 1024, "th": 512, "probability": 1.0,
"baseScale": 2.0, "scaleVariance": 0.6,
"altLow": 1080, "altHigh": 1800
}
},
"atmoTurbidity": 3.5,
"shaderVibrancy": [1.0, 1.0]
}

View File

@@ -0,0 +1,32 @@
{
"identifier": "generic02",
"skyboxGradColourMap": "generic_skybox.tga",
"daylightClut": "clut_daylight.tga",
"classification": "generic2",
"cloudChance": 800,
"cloudGamma": [0.8, 2.4],
"cloudGammaVariance": [0.125, 0.0],
"windSpeed": 0.35,
"windSpeedVariance": 0.4,
"windSpeedDamping": 0.5,
"clouds": {
"cumulonimbus": {
"filename": "cloud_large.png", "tw": 2048, "th": 1024, "probability": 0.02,
"baseScale": 4.0, "scaleVariance": 0.3333333,
"altLow": 1080, "altHigh": 1120
},
"cumulus": {
"filename": "cloud_normal.png", "tw": 1024, "th": 512, "probability": 0.05,
"baseScale": 2.0, "scaleVariance": 0.6,
"altLow": 1080, "altHigh": 1800
},
"altocumulus": {
"filename": "cloud_normal.png", "tw": 1024, "th": 512, "probability": 1.0,
"baseScale": 1.0, "scaleVariance": 0.1,
"altLow": 2600, "altHigh": 3400
}
},
"atmoTurbidity": 3.5,
"shaderVibrancy": [1.0, 1.0],
"__comment__": "Make a texture for altocumulus so that this weather can be realised with less than 1000 sprites"
}

View File

@@ -1,10 +0,0 @@
{
"globalLight": "generic_light.tga",
"skyboxGradColourMap": "generic_skybox.tga",
"classification": "genericrain",
"extraImages": [
"raindrop.tga"
],
"mixFrom": "__CURRENTWEATHER",
"mixPercentage": 80.0
}

View File

@@ -0,0 +1,31 @@
{
"identifier": "overcast01",
"skyboxGradColourMap": "generic_skybox.tga",
"daylightClut": "clut_daylight.tga",
"classification": "overcast",
"cloudChance": 300,
"cloudGamma": [2.0, 1.6],
"cloudGammaVariance": [0.0, 0.0],
"windSpeed": 10.45,
"windSpeedVariance": 0.5,
"windSpeedDamping": 0.5,
"clouds": {
"cumulus": {
"filename": "cloud_normal.png", "tw": 1024, "th": 512, "probability": 0.1,
"baseScale": 1.6, "scaleVariance": 0.6,
"altLow": 580, "altHigh": 1300
},
"cumulonimbus": {
"filename": "cloud_large.png", "tw": 2048, "th": 1024, "probability": 0.4,
"baseScale": 4.0, "scaleVariance": 0.3333333,
"altLow": 1080, "altHigh":1800
},
"nimbostratus": {
"filename": "cloud_wide.png", "tw": 4096, "th": 1024, "probability": 1.0,
"baseScale": 8.0, "scaleVariance": 0.1,
"altLow": 1100, "altHigh": 1500
}
},
"atmoTurbidity": 9.5,
"shaderVibrancy": [0.93, 0.9]
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,26 @@
## actually blending
1. On Krita, load the cloudmap
2. Select and isolate suitable piece of the cloud
3. With liquefying brush, make the bottom flat
4. On new tab, load the solidmap
5. Resize the solidmap to 1024x1024
6. Rotate the solidmap by 30 deg or so
7. Overlay the processed solidmap to the cloudmap, opacity=30%
8. With airbrush tool, manually add the shade (see cloud_normal.kra to get the gist of it)
### cloudmap
1. On GIMP, prepare 4096x4096 canvas
2. Create Simplex Noise with following parameters:
- Scale: arbitrary (0.05 - 0.2)
- Iterations: MAX
- Seed: anything but 0
### solidmap
1. On GIMP, prepare 4096x4096 canvas
2. Create Solid Noise with following parameters:
- XY Size: 16.0
- Detail: MAX
- Tileable: check
- Turbulent: check
- Seed: anything but 0

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -6,6 +6,8 @@ APPIMAGETOOL="appimagetool-x86_64.AppImage"
SRCFILES="terrarumlinux_arm"
DESTDIR="TerrarumLinux.arm"
RUNTIME="runtime-linux-arm"
DESKTOPFILE="../out/build_autogen_linux.desktop"
JARNAME="TerrarumBuild.jar"
if [ ! -d "../assets_release" ]; then
echo "'assets_release' does not exist; prepare the assets for the release and put them into the assets_release directory, exiting now." >&2
@@ -18,7 +20,7 @@ mkdir $DESTDIR
# Prepare an application
cp icns.png $DESTDIR/icns.png
cp $SRCFILES/Terrarum.desktop $DESTDIR/
cp $DESKTOPFILE $DESTDIR/
cp $SRCFILES/AppRun $DESTDIR/AppRun
chmod +x $DESTDIR/AppRun
@@ -30,7 +32,7 @@ mv $DESTDIR/out/$RUNTIME/bin/java $DESTDIR/out/$RUNTIME/bin/Terrarum
# Copy over all the assets and a jarfile
cp -r "../assets_release" $DESTDIR/
mv $DESTDIR/assets_release $DESTDIR/assets
cp "../out/TerrarumBuild.jar" $DESTDIR/out/
cp "../out/$JARNAME" $DESTDIR/out/
# Pack everything to AppImage
ARCH=arm_aarch64 "./$APPIMAGETOOL" $DESTDIR "out/$DESTDIR.AppImage" || { echo 'Building AppImage failed' >&2; exit 1; }

View File

@@ -6,6 +6,8 @@ APPIMAGETOOL="appimagetool-x86_64.AppImage"
SRCFILES="terrarumlinux_x86"
DESTDIR="TerrarumLinux.x86"
RUNTIME="runtime-linux-x86"
DESKTOPFILE="../out/build_autogen_linux.desktop"
JARNAME="TerrarumBuild.jar"
if [ ! -d "../assets_release" ]; then
echo "'assets_release' does not exist; prepare the assets for the release and put them into the assets_release directory, exiting now." >&2
@@ -18,7 +20,7 @@ mkdir $DESTDIR
# Prepare an application
cp icns.png $DESTDIR/icns.png
cp $SRCFILES/Terrarum.desktop $DESTDIR/
cp $DESKTOPFILE $DESTDIR/
cp $SRCFILES/AppRun $DESTDIR/AppRun
chmod +x $DESTDIR/AppRun
@@ -30,7 +32,7 @@ mv $DESTDIR/out/$RUNTIME/bin/java $DESTDIR/out/$RUNTIME/bin/Terrarum
# Copy over all the assets and a jarfile
cp -r "../assets_release" $DESTDIR/
mv $DESTDIR/assets_release $DESTDIR/assets
cp "../out/TerrarumBuild.jar" $DESTDIR/out/
cp "../out/$JARNAME" $DESTDIR/out/
# Pack everything to AppImage
"./$APPIMAGETOOL" $DESTDIR "out/$DESTDIR.AppImage" || { echo 'Building AppImage failed' >&2; exit 1; }

View File

@@ -3,8 +3,11 @@ if (( $EUID == 0 )); then echo "The build process is not meant to be run with ro
cd "${0%/*}"
SRCFILES="terrarummac_arm"
DESTDIR="out/TerrarumMac.arm.app"
APPDIR="./TerrarumMac.arm.app"
DESTDIR="out/$APPDIR"
RUNTIME="runtime-osx-arm"
PLISTFILE="../out/build_autogen_macos_Info.plist"
JARNAME="TerrarumBuild.jar"
if [ ! -d "../assets_release" ]; then
echo "'assets_release' does not exist; prepare the assets for the release and put them into the assets_release directory, exiting now." >&2
@@ -20,9 +23,9 @@ mkdir $DESTDIR/Contents/Resources
# Prepare an application
cp AppIcon.icns $DESTDIR/Contents/Resources/AppIcon.icns
cp $SRCFILES/Info.plist $DESTDIR/Contents/
cp $SRCFILES/Terrarum.sh $DESTDIR/Contents/MacOS/
chmod +x $DESTDIR/Contents/MacOS/Terrarum.sh
cp $PLISTFILE $DESTDIR/Contents/Info.plist
# Copy over a Java runtime
mkdir $DESTDIR/Contents/MacOS/out
@@ -32,6 +35,11 @@ mv $DESTDIR/Contents/MacOS/out/$RUNTIME/bin/java $DESTDIR/Contents/MacOS/out/$RU
# Copy over all the assets and a jarfile
cp -r "../assets_release" $DESTDIR/Contents/MacOS/
mv $DESTDIR/Contents/MacOS/assets_release $DESTDIR/Contents/MacOS/assets
cp "../out/TerrarumBuild.jar" $DESTDIR/Contents/MacOS/out/
cp "../out/$JARNAME" $DESTDIR/Contents/MacOS/out/
# zip everything
cd "out"
rm $APPDIR.zip
7z a -tzip $APPDIR.zip $APPDIR
echo "Build successful: $DESTDIR"

View File

@@ -3,8 +3,11 @@ if (( $EUID == 0 )); then echo "The build process is not meant to be run with ro
cd "${0%/*}"
SRCFILES="terrarummac_x86"
DESTDIR="out/TerrarumMac.x86.app"
APPDIR="./TerrarumMac.x86.app"
DESTDIR="out/$APPDIR"
RUNTIME="runtime-osx-x86"
PLISTFILE="../out/build_autogen_macos_Info.plist"
JARNAME="TerrarumBuild.jar"
if [ ! -d "../assets_release" ]; then
echo "'assets_release' does not exist; prepare the assets for the release and put them into the assets_release directory, exiting now." >&2
@@ -20,9 +23,9 @@ mkdir $DESTDIR/Contents/Resources
# Prepare an application
cp AppIcon.icns $DESTDIR/Contents/Resources/AppIcon.icns
cp $SRCFILES/Info.plist $DESTDIR/Contents/
cp $SRCFILES/Terrarum.sh $DESTDIR/Contents/MacOS/
chmod +x $DESTDIR/Contents/MacOS/Terrarum.sh
cp $PLISTFILE $DESTDIR/Contents/Info.plist
# Copy over a Java runtime
mkdir $DESTDIR/Contents/MacOS/out
@@ -32,6 +35,11 @@ mv $DESTDIR/Contents/MacOS/out/$RUNTIME/bin/java $DESTDIR/Contents/MacOS/out/$RU
# Copy over all the assets and a jarfile
cp -r "../assets_release" $DESTDIR/Contents/MacOS/
mv $DESTDIR/Contents/MacOS/assets_release $DESTDIR/Contents/MacOS/assets
cp "../out/TerrarumBuild.jar" $DESTDIR/Contents/MacOS/out/
cp "../out/$JARNAME" $DESTDIR/Contents/MacOS/out/
# zip everything
cd "out"
rm $APPDIR.zip
7z a -tzip $APPDIR.zip $APPDIR
echo "Build successful: $DESTDIR"

View File

@@ -5,6 +5,8 @@ cd "${0%/*}"
SRCFILES="terrarumwindows_x86"
DESTDIR="TerrarumWindows.x86"
RUNTIME="runtime-windows-x86"
RCFILE="../out/build_autogen_windows.rc"
JARNAME="TerrarumBuild.jar"
if [ ! -d "../assets_release" ]; then
echo "'assets_release' does not exist; prepare the assets for the release and put them into the assets_release directory, exiting now." >&2
@@ -21,8 +23,11 @@ then
echo 'Mingw32 not found; please install mingw64-cross-gcc (or similar) to your system' >&2; exit 1;
fi
x86_64-w64-mingw32-gcc -Os -s -o $DESTDIR/Terrarum.exe $SRCFILES/Terrarum.c || { echo 'Building EXE failed' >&2; exit 1; }
# TODO add icon to the exe (use x86_64-w64-mingw32-windres?)
# Compile .rc
x86_64-w64-mingw32-windres $RCFILE -O coff -o $RCFILE.res
# compile exe
x86_64-w64-mingw32-gcc -Os -s -o $DESTDIR/Terrarum.exe $SRCFILES/Terrarum.c $RCFILE.res || { echo 'Building EXE failed' >&2; exit 1; }
# Copy over a Java runtime
mkdir $DESTDIR/out
@@ -32,9 +37,10 @@ mv $DESTDIR/out/$RUNTIME/bin/java.exe $DESTDIR/out/$RUNTIME/bin/Terrarum.exe
# Copy over all the assets and a jarfile
cp -r "../assets_release" $DESTDIR/
mv $DESTDIR/assets_release $DESTDIR/assets
cp "../out/TerrarumBuild.jar" $DESTDIR/out/
cp "../out/$JARNAME" $DESTDIR/out/
# Temporary solution: zip everything
zip -r -9 -l "out/TerrarumWindows.x86.zip" $DESTDIR
# zip everything
rm "out/$DESTDIR.zip"
zip -r -9 -l "out/$DESTDIR.zip" $DESTDIR
rm -rf $DESTDIR || true
echo "Build successful: $DESTDIR"

BIN
buildapp/icns.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -39,34 +39,20 @@ To build, **cd into the "(project root)/buildapp/", then execute the appropriate
The packaged application can be found on `(project root)/buildapp/out/`
#### OSX .app Packaging
```
Terrarum.*.app
+.icns /* 512x512 PNG */
+Contents
`Info.plist
+MacOS
`start_game_mac_*.sh * permission: +x */
```
`assets/TerrarumBuild.jar` is the artifact built using the TerrarumBuild.
`start_game_*` files are on the root directory of the project; use them to build executable apps.
Hide the `.jar` within the subdirectory; users will think this file is the main executable and will try to execute it using whatever JVM they may (or may not) have.
### OSX .icns creation
Details: https://gist.github.com/jamieweavis/b4c394607641e1280d447deed5fc85fc
0. Do this on a real macOS
1. Create a folder `icon.iconset`, then cp the .png file as `icon_512x512.png`
2. On Terminal, `iconutil -c icns icon.iconset`
https://gist.github.com/jamieweavis/b4c394607641e1280d447deed5fc85fc
It might be possible to create .icns on Linux, haven't tried though. https://dentrassi.de/2014/02/25/creating-mac-os-x-icons-icns-on-linux/
#### Some Notes
### Windows .ico creation
0. Open up the icon (png) file using GIMP
1. Export As... -> *.ico, make sure to select either of 24 bpp (1 bit alpha) or 32 bpp (8 bit alpha)
- Windows EXE creation is not there yet. Maybe use one of [these?](https://sourceforge.net/projects/batch-compiler/)
### Notes to Terrarum Programmers

36
buildapp/make_assets_release.sh Executable file
View File

@@ -0,0 +1,36 @@
#!/bin/bash
if (( $EUID == 0 )); then echo "The build process is not meant to be run with root privilege, exiting now." >&2; exit 1; fi
cd "${0%/*}"
DESTDIR="../assets_release"
rm -r $DESTDIR
cp -r "../assets" $DESTDIR
rm $DESTDIR/loopey.wav
rm $DESTDIR/ktGrepExample.kts
rm $DESTDIR/batchtest.txt
rm $DESTDIR/test_texture.tga
rm $DESTDIR/worldbacktest.tga
rm -r $DESTDIR/books
rm $DESTDIR/clut/skybox.tga
rm $DESTDIR/graphics/*.bat
rm $DESTDIR/keylayout/*.not_ime
rm $DESTDIR/mods/basegame/blocks/*.gz
rm $DESTDIR/mods/basegame/blocks/*.txt
rm $DESTDIR/mods/basegame/weathers/*.txt
rm $DESTDIR/mods/basegame/weathers/*.md
rm $DESTDIR/mods/basegame/weathers/*.kra
rm -r $DESTDIR/mods/basegame/sounds
rm -r $DESTDIR/mods/dwarventech
for s in .directory .DS_Store Thumbs.db thumbs.db; do
rm $DESTDIR/$s
rm $DESTDIR/*/$s
rm $DESTDIR/*/*/$s
rm $DESTDIR/*/*/*/$s
rm $DESTDIR/*/*/*/*/$s
rm $DESTDIR/*/*/*/*/*/$s
rm $DESTDIR/*/*/*/*/*/*/$s
rm $DESTDIR/*/*/*/*/*/*/*/$s
done

View File

@@ -1,6 +0,0 @@
[Desktop Entry]
Name=Terrarum
Exec=AppRun
Icon=icns
Type=Application
Categories=Game;

View File

@@ -1,6 +0,0 @@
[Desktop Entry]
Name=Terrarum
Exec=AppRun
Icon=icns
Type=Application
Categories=Game;

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><dict>
<key>CFBundleExecutable</key><string>Terrarum.sh</string>
<key>CFBundleDisplayName</key><string>Terrarum</string>
<key>CFBundleName</key><string>Terrarum</string>
<key>CFBundleIconFile</key><string>AppIcon.icns</string>
</dict></plist>

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><dict>
<key>CFBundleExecutable</key><string>Terrarum.sh</string>
<key>CFBundleDisplayName</key><string>Terrarum</string>
<key>CFBundleName</key><string>Terrarum</string>
<key>CFBundleIconFile</key><string>AppIcon.icns</string>
</dict></plist>

View File

@@ -1,6 +1,11 @@
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <tchar.h>
int main() {
return system(".\\out\\runtime-windows-x86\\bin\\Terrarum.exe -jar .\\out\\TerrarumBuild.jar");
ShellExecute(NULL, "open", "\".\\out\\runtime-windows-x86\\bin\\Terrarum.exe\"", "-jar \".\\out\\TerrarumBuild.jar\"", NULL, SW_HIDE);
return 0;
//return system(".\\out\\runtime-windows-x86\\bin\\Terrarum.exe -jar .\\out\\TerrarumBuild.jar");
}

Binary file not shown.

Binary file not shown.

BIN
lib/commons-math3-3.6.1.jar LFS Normal file

Binary file not shown.

View File

@@ -0,0 +1,72 @@
package com.badlogic.gdx.graphics.glutils;
import com.badlogic.gdx.Application;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.GL30;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.utils.GdxRuntimeException;
import net.torvald.terrarum.App;
// typealias Float16FrameBuffer = FloatFrameBuffer
/**
* Created by minjaesong on 2023-08-16.
*/
public class Float16FrameBuffer extends FrameBuffer {
Float16FrameBuffer () {
}
/** Creates a GLFrameBuffer from the specifications provided by bufferBuilder
*
* @param bufferBuilder **/
protected Float16FrameBuffer (GLFrameBufferBuilder<? extends GLFrameBuffer<Texture>> bufferBuilder) {
super(bufferBuilder);
}
/** Creates a new FrameBuffer with a float backing texture, having the given dimensions and potentially a depth buffer
* attached.
*
* @param width the width of the framebuffer in pixels
* @param height the height of the framebuffer in pixels
* @param hasDepth whether to attach a depth buffer
* @throws GdxRuntimeException in case the FrameBuffer could not be created */
public Float16FrameBuffer (int width, int height, boolean hasDepth) {
if (App.isAppleM) { // disable float framebuffer for Apple M chips
FrameBufferBuilder bufferBuilder = new FrameBufferBuilder(width, height);
bufferBuilder.addColorTextureAttachment(GL20.GL_RGBA, GL20.GL_RGBA, GL20.GL_UNSIGNED_SHORT); // but 16bpp int works perfectly?!
if (hasDepth) bufferBuilder.addBasicDepthRenderBuffer();
this.bufferBuilder = bufferBuilder;
}
else {
FloatFrameBufferBuilder bufferBuilder = new FloatFrameBufferBuilder(width, height);
bufferBuilder.addFloatAttachment(GL30.GL_RGBA16F, GL30.GL_RGBA, GL30.GL_FLOAT, false);
if (hasDepth) bufferBuilder.addBasicDepthRenderBuffer();
this.bufferBuilder = bufferBuilder;
}
build();
}
@Override
protected Texture createTexture (FrameBufferTextureAttachmentSpec attachmentSpec) {
if (App.isAppleM) {
GLOnlyTextureData data = new GLOnlyTextureData(bufferBuilder.width, bufferBuilder.height, 0, attachmentSpec.internalFormat,
attachmentSpec.format, attachmentSpec.type);
Texture result = new Texture(data);
result.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
result.setWrap(Texture.TextureWrap.ClampToEdge, Texture.TextureWrap.ClampToEdge);
return result;
}
else {
FloatTextureData data = new FloatTextureData(bufferBuilder.width, bufferBuilder.height, attachmentSpec.internalFormat,
attachmentSpec.format, attachmentSpec.type, attachmentSpec.isGpuOnly);
Texture result = new Texture(data);
result.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
result.setWrap(Texture.TextureWrap.ClampToEdge, Texture.TextureWrap.ClampToEdge);
return result;
}
}
}

View File

@@ -248,6 +248,10 @@ final public class FastMath {
return interpolateCatmullRom(u, 0.5f, p0, p1, p2, p3);
}
public static float interpolateCatmullRom(float u, float[] ps) {
return interpolateCatmullRom(u, 0.5f, ps[0], ps[1], ps[2], ps[3]);
}
/**Interpolate a spline between at least 4 control points following the Catmull-Rom equation.
* here is the interpolation matrix
* m = [ 0.0 1.0 0.0 0.0 ]
@@ -331,8 +335,7 @@ final public class FastMath {
return l;
}
public static float interpolateHermite(float scale, float p0, float p1, float p2, float p3) {
/*public static float interpolateHermite(float scale, float p0, float p1, float p2, float p3) {
// return interpolateHermite(scale, p0, p1, p2, p3, 0f, 0f);
float mu2 = scale * scale;
float mu3 = mu2 * scale;
@@ -350,7 +353,7 @@ final public class FastMath {
float a3 = -2*mu3 + 3*mu2 + 0;
return a0*p1 + a1*m0 + a2*m1 + a3*p2;
}
}*/
//public static float interpolateHermite(float scale, float p0, float p1, float p2, float p3, float tension, float bias) {}

View File

@@ -34,6 +34,10 @@ abstract class SpriteAnimation(@Transient val parentActor: ActorWithBody) : Disp
/**
* This class should not be serialised; save its Animation Description Language instead.
*
* Maximum rows: 64
*
* Maximum frames: unlimited
*/
class SheetSpriteAnimation(parentActor: ActorWithBody) : SpriteAnimation(parentActor) {

View File

@@ -26,6 +26,7 @@ import net.torvald.terrarum.gamecontroller.KeyToggler;
import net.torvald.terrarum.gamecontroller.TerrarumKeyboardEvent;
import net.torvald.terrarum.gameitems.GameItem;
import net.torvald.terrarum.gameworld.GameWorld;
import net.torvald.terrarum.imagefont.BigAlphNum;
import net.torvald.terrarum.imagefont.TinyAlphNum;
import net.torvald.terrarum.langpack.Lang;
import net.torvald.terrarum.modulebasegame.IngameRenderer;
@@ -62,9 +63,11 @@ public class App implements ApplicationListener {
public static final String GAME_NAME = TerrarumAppConfiguration.GAME_NAME;
public static final long VERSION_RAW = TerrarumAppConfiguration.VERSION_RAW;
public static final String VERSION_TAG = TerrarumAppConfiguration.VERSION_TAG;
public static final String getVERSION_STRING() {
return String.format("%d.%d.%d", VERSION_RAW >>> 48, (VERSION_RAW & 0xffff000000L) >>> 24, VERSION_RAW & 0xffffffL);
return String.format("%d.%d.%d", VERSION_RAW >>> 48, (VERSION_RAW & 0xffff000000L) >>> 24, VERSION_RAW & 0xffffffL) +
(VERSION_TAG.isBlank() ? "" : "-"+VERSION_TAG);
}
/**
@@ -196,6 +199,7 @@ public class App implements ApplicationListener {
/** Big interchar */
public static TerrarumSansBitmap fontUITitle;
public static TinyAlphNum fontSmallNumbers;
public static BigAlphNum fontBigNumbers;
/** A gamepad. Multiple gamepads may controll this single virtualised gamepad. */
public static TerrarumController gamepad = null;
@@ -267,12 +271,13 @@ public class App implements ApplicationListener {
Gdx.gl20.glViewport(0, 0, width, height);
}
public static final float UPDATE_RATE = 1f / 64f; // apparent framerate will be limited by update rate
public static final int TICK_SPEED = 64;
public static final float UPDATE_RATE = 1f / TICK_SPEED; // apparent framerate will be limited by update rate
private static float loadTimer = 0f;
private static final float showupTime = 100f / 1000f;
private static FloatFrameBuffer renderFBO;
private static Float16FrameBuffer renderFBO;
public static HashSet<File> tempFilePool = new HashSet<>();
@@ -609,19 +614,21 @@ public class App implements ApplicationListener {
private static void processScreenshotRequest(FrameBuffer fb) {
if (screenshotRequested) {
String msg = "Screenshot taken";
FrameBufferManager.begin(fb);
try {
Pixmap p = Pixmap.createFromFrameBuffer(0, 0, fb.getWidth(), fb.getHeight());
PixmapIO.writePNG(Gdx.files.absolute(defaultDir+"/Screenshot-"+String.valueOf(System.currentTimeMillis())+".png"), p, 9, true);
p.dispose();
Terrarum.INSTANCE.getIngame().sendNotification("Screenshot taken");
}
catch (Throwable e) {
e.printStackTrace();
Terrarum.INSTANCE.getIngame().sendNotification("Failed to take screenshot: "+e.getMessage());
msg = ("Failed to take screenshot: "+e.getMessage());
}
FrameBufferManager.end();
screenshotRequested = false;
Terrarum.INSTANCE.getIngame().sendNotification(msg);
}
}
@@ -750,12 +757,12 @@ public class App implements ApplicationListener {
(renderFBO.getWidth() != scr.getWidth() ||
renderFBO.getHeight() != scr.getHeight())
) {
renderFBO = new FloatFrameBuffer(
renderFBO = new Float16FrameBuffer(
scr.getWidth(),
scr.getHeight(),
false
);
postProcessorOutFBO2 = new FloatFrameBuffer(
postProcessorOutFBO2 = new Float16FrameBuffer(
scr.getWidth() * 2,
scr.getHeight() * 2,
false
@@ -823,6 +830,7 @@ public class App implements ApplicationListener {
fontGame.dispose();
fontGameFBO.dispose();
fontSmallNumbers.dispose();
fontBigNumbers.dispose();
ItemSlotImageFactory.INSTANCE.dispose();
logo.getTexture().dispose();
@@ -901,6 +909,7 @@ public class App implements ApplicationListener {
currentScreen.show();
currentScreen.resize(scr.getWidth(), scr.getHeight());
TerrarumGlobalState.INSTANCE.getHAS_KEYBOARD_INPUT_FOCUS().unset();
System.gc();
@@ -1002,6 +1011,7 @@ public class App implements ApplicationListener {
fontSmallNumbers = TinyAlphNum.INSTANCE;
fontBigNumbers = BigAlphNum.INSTANCE;
IME.invoke();
inputStrober = InputStrober.INSTANCE;
@@ -1180,6 +1190,8 @@ public class App implements ApplicationListener {
public static String configDir;
/** defaultDir + "/LoadOrder.txt" */
public static String loadOrderDir;
/** defaultDir + "/Imported" */
public static String importDir;
public static RunningEnvironment environment;
@@ -1219,6 +1231,7 @@ public class App implements ApplicationListener {
loadOrderDir = defaultDir + "/LoadOrder.txt";
recycledPlayersDir = defaultDir + "/Recycled/Players";
recycledWorldsDir = defaultDir + "/Recycled/Worlds";
importDir = defaultDir + "/Imports";
System.out.println(String.format("os.name = %s (with identifier %s)", OSName, operationSystem));
System.out.println(String.format("os.version = %s", OSVersion));
@@ -1234,6 +1247,7 @@ public class App implements ApplicationListener {
new File(worldsDir),
new File(recycledPlayersDir),
new File(recycledWorldsDir),
new File(importDir)
};
for (File it : dirs) {
@@ -1373,6 +1387,8 @@ public class App implements ApplicationListener {
* @throws NullPointerException if the specified config simply does not exist.
*/
public static int getConfigInt(String key) {
if (key == null) return -1;
Object cfg = getConfigMaster(key);
if (cfg instanceof Integer) return ((int) cfg);

View File

@@ -0,0 +1,90 @@
package net.torvald.terrarum
import com.badlogic.gdx.Input
/**
* Created by minjaesong on 2023-08-24.
*/
object ControlPresets {
val wasd = hashMapOf<String, Int>(
"control_key_up" to Input.Keys.W,
"control_key_left" to Input.Keys.A,
"control_key_down" to Input.Keys.S,
"control_key_right" to Input.Keys.D,
"control_key_jump" to Input.Keys.SPACE,
"control_key_movementaux" to Input.Keys.SHIFT_LEFT, // movement-auxiliary, or hookshot
"control_key_inventory" to Input.Keys.Q,
"control_key_interact" to Input.Keys.R,
"control_key_discard" to Input.Keys.F,
"control_key_close" to Input.Keys.X, // this or hard-coded ESC
"control_key_zoom" to Input.Keys.Z,
"control_key_gamemenu" to Input.Keys.TAB,
"control_key_crafting" to Input.Keys.E,
"control_key_quicksel" to Input.Keys.CONTROL_LEFT, // pie menu is now LShift because CapsLock is actually used by the my bespoke keyboard input
)
val esdf = hashMapOf<String, Int>(
"control_key_up" to Input.Keys.E,
"control_key_left" to Input.Keys.S,
"control_key_down" to Input.Keys.D,
"control_key_right" to Input.Keys.F, // ESDF Masterrace
"control_key_jump" to Input.Keys.SPACE,
"control_key_movementaux" to Input.Keys.A, // movement-auxiliary, or hookshot
"control_key_inventory" to Input.Keys.Q,
"control_key_interact" to Input.Keys.R,
"control_key_discard" to Input.Keys.T,
"control_key_close" to Input.Keys.C, // this or hard-coded ESC
"control_key_zoom" to Input.Keys.Z,
"control_key_gamemenu" to Input.Keys.TAB,
"control_key_crafting" to Input.Keys.W,
"control_key_quicksel" to Input.Keys.SHIFT_LEFT, // pie menu is now LShift because CapsLock is actually used by the my bespoke keyboard input
)
val ijkl = hashMapOf<String, Int>(
"control_key_up" to Input.Keys.I,
"control_key_left" to Input.Keys.J,
"control_key_down" to Input.Keys.K,
"control_key_right" to Input.Keys.L,
"control_key_jump" to Input.Keys.SPACE,
"control_key_movementaux" to Input.Keys.SEMICOLON, // movement-auxiliary, or hookshot
"control_key_inventory" to Input.Keys.P,
"control_key_interact" to Input.Keys.U,
"control_key_discard" to Input.Keys.Y,
"control_key_close" to Input.Keys.M, // this or hard-coded ESC
"control_key_zoom" to Input.Keys.SLASH,
"control_key_gamemenu" to Input.Keys.LEFT_BRACKET,
"control_key_crafting" to Input.Keys.O,
"control_key_quicksel" to Input.Keys.APOSTROPHE, // pie menu is now LShift because CapsLock is actually used by the my bespoke keyboard input
)
val empty = hashMapOf<String, Int>()
val presets = hashMapOf( // unordered
"WASD" to wasd,
"ESDF" to esdf,
"IJKL" to ijkl,
"Custom" to empty,
)
val presetLabels = listOf( // ordered
"WASD",
"ESDF",
"IJKL",
"Custom",
)
fun getKey(label: String?): Int {
if (label == null) return -1
val presetName = App.getConfigString("control_preset_keyboard") ?: "Custom"
return (presets[presetName] ?: throw IllegalStateException("No such keyboard preset: $presetName")).getOrDefault(label, App.getConfigInt(label))
}
}

View File

@@ -31,6 +31,8 @@ object DefaultConfig {
"usexinput" to true, // when FALSE, LT+RT input on xbox controller is impossible
"control_preset_keyboard" to "WASD",
"control_gamepad_keyn" to 3,
"control_gamepad_keyw" to 2,
"control_gamepad_keys" to 0,

View File

@@ -1,5 +1,6 @@
package net.torvald.terrarum
import com.badlogic.gdx.Input
import com.badlogic.gdx.utils.Disposable
import com.badlogic.gdx.utils.GdxRuntimeException
import net.torvald.terrarum.App.printdbg
@@ -9,6 +10,7 @@ import net.torvald.terrarum.gameactors.ActorID
import net.torvald.terrarum.gameactors.ActorWithBody
import net.torvald.terrarum.gameactors.ActorWithBody.Companion.PHYS_EPSILON_DIST
import net.torvald.terrarum.gameactors.BlockMarkerActor
import net.torvald.terrarum.gamecontroller.KeyToggler
import net.torvald.terrarum.gamecontroller.TerrarumKeyboardEvent
import net.torvald.terrarum.gameitems.ItemID
import net.torvald.terrarum.gameworld.GameWorld
@@ -165,6 +167,9 @@ open class IngameInstance(val batch: FlippingSpriteBatch, val isMultiplayer: Boo
override fun show() {
// the very basic show() implementation
for (k in Input.Keys.F1..Input.Keys.F12) {
KeyToggler.forceSet(k, false)
}
// add blockmarking_actor into the actorlist
(CommonResourcePool.get("blockmarking_actor") as BlockMarkerActor).let {
@@ -531,6 +536,9 @@ open class IngameInstance(val batch: FlippingSpriteBatch, val isMultiplayer: Boo
else
null
}
fun onConfigChange() {
}
}
inline fun Lock.lock(body: () -> Unit) {

View File

@@ -2,11 +2,13 @@ package net.torvald.terrarum
import com.badlogic.gdx.Gdx
import com.badlogic.gdx.files.FileHandle
import com.badlogic.gdx.graphics.Pixmap
import com.badlogic.gdx.utils.JsonValue
import net.torvald.terrarum.App.*
import net.torvald.terrarum.App.setToGameConfig
import net.torvald.terrarum.blockproperties.BlockCodex
import net.torvald.terrarum.blockproperties.WireCodex
import net.torvald.terrarum.gamecontroller.IME
import net.torvald.terrarum.gameitems.GameItem
import net.torvald.terrarum.gameitems.ItemID
import net.torvald.terrarum.itemproperties.ItemCodex
@@ -15,6 +17,7 @@ import net.torvald.terrarum.langpack.Lang
import net.torvald.terrarum.utils.CSVFetcher
import net.torvald.terrarum.utils.JsonFetcher
import net.torvald.terrarum.utils.forEachSiblings
import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack
import org.apache.commons.codec.digest.DigestUtils
import org.apache.commons.csv.CSVFormat
import org.apache.commons.csv.CSVParser
@@ -211,6 +214,18 @@ object ModMgr {
GameRetextureLoader(moduleName)
}
// add locales if exists
if (hasFile(moduleName, "locales")) {
printdbg(this, "Trying to load Locales on ${moduleName}")
GameLanguageLoader(moduleName)
}
// add keylayouts if exists
if (hasFile(moduleName, "keylayout")) {
printdbg(this, "Trying to load Keyboard Layouts on ${moduleName}")
GameIMELoader(moduleName)
}
// run entry script in entry point
if (entryPoint.isNotBlank()) {
var newClass: Class<*>? = null
@@ -513,6 +528,56 @@ object ModMgr {
}
}
object GameIMELoader {
const val keebPath = "keylayout/"
@JvmStatic operator fun invoke(module: String) {
val FILE = getFile(module, keebPath)
FILE.listFiles { file, s -> s.endsWith(".${IME.KEYLAYOUT_EXTENSION}") }.sortedBy { it.name }.forEach {
printdbg(this, "Registering Low layer ${it.nameWithoutExtension.lowercase()}")
IME.registerLowLayer(it.nameWithoutExtension.lowercase(), IME.parseKeylayoutFile(it))
}
FILE.listFiles { file, s -> s.endsWith(".${IME.IME_EXTENSION}") }.sortedBy { it.name }.forEach {
printdbg(this, "Registering High layer ${it.nameWithoutExtension.lowercase()}")
IME.registerHighLayer(it.nameWithoutExtension.lowercase(), IME.parseImeFile(it))
}
val iconFile = getFile(module, keebPath + "icons.tga").let {
if (it.exists()) it else getFile(module, keebPath + "icons.png")
}
if (iconFile.exists()) {
val iconSheet = TextureRegionPack(iconFile.path, 20, 20)
val iconPixmap = Pixmap(Gdx.files.absolute(iconFile.path))
for (k in 0 until iconPixmap.height step 20) {
val langCode = StringBuilder()
for (c in 0 until 20) {
val x = c
var charnum = 0
for (b in 0 until 7) {
val y = k + b
if (iconPixmap.getPixel(x, y) and 255 != 0) {
charnum = charnum or (1 shl b)
}
}
if (charnum != 0) langCode.append(charnum.toChar())
}
if (langCode.isNotEmpty()) {
printdbg(this, "Icon order #${(k+1) / 20} - icons[\"$langCode\"] = iconSheet.get(1, ${k/20})")
IME.icons["$langCode"] = iconSheet.get(1, k / 20).also { it.flip(false, false) }
}
}
App.disposables.add(iconSheet)
iconPixmap.dispose()
}
}
}
object GameMaterialLoader {
const val matePath = "materials/"

View File

@@ -1,6 +1,7 @@
package net.torvald.terrarum
import com.badlogic.gdx.graphics.Camera
import com.badlogic.gdx.graphics.OrthographicCamera
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import net.torvald.terrarum.modulebasegame.ui.UIRemoCon
import net.torvald.terrarum.ui.UICanvas
@@ -17,7 +18,7 @@ class ModOptionsHost(val remoCon: UIRemoCon) : UICanvas() {
override fun updateUI(delta: Float) {
}
override fun renderUI(batch: SpriteBatch, camera: Camera) {
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
}
override fun dispose() {

View File

@@ -8,6 +8,7 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.graphics.glutils.FrameBuffer
import net.torvald.terrarum.langpack.Lang
import net.torvald.terrarum.ui.Toolkit
import net.torvald.terrarum.utils.OpenFile
import java.awt.Desktop
import java.io.File
@@ -90,7 +91,7 @@ class NoModuleDefaultTitlescreen(batch: FlippingSpriteBatch) : IngameInstance(ba
App.scr.hf - Gdx.input.y in pathButtonY - 12..pathButtonY + pathButtonH + 12)
if (mouseOnLink && Gdx.input.isButtonJustPressed(Input.Buttons.LEFT)) {
Desktop.getDesktop().open(pathFile)
OpenFile(pathFile)
}
fbatch.inUse {

View File

@@ -122,4 +122,6 @@ class Point2i() {
operator fun component1() = x
operator fun component2() = y
fun toVector() = Vector2(this.x.toDouble(), this.y.toDouble())
}

View File

@@ -0,0 +1,72 @@
package net.torvald.terrarum
import java.io.File
/**
* Created by minjaesong on 2023-08-25.
*/
private fun writeWindowsRC(major: Int, minor: Int, patch: Int) {
val s = """1 ICON "icns.ico"
VS_VERSION_INFO VERSIONINFO
FILEVERSION $major,$minor,$patch,0
PRODUCTVERSION $major,$minor,$patch,0
{
BLOCK "StringFileInfo"
{
BLOCK "040904b0"
{
VALUE "FileDescription", "${TerrarumAppConfiguration.GAME_NAME}\0"
VALUE "FileVersion", "${App.getVERSION_STRING()}\0"
VALUE "LegalCopyright", "${TerrarumAppConfiguration.COPYRIGHT_DATE_NAME}\0"
VALUE "OriginalFilename", "${TerrarumAppConfiguration.GAME_NAME}.exe\0"
VALUE "ProductName", "${TerrarumAppConfiguration.GAME_NAME}\0"
VALUE "ProductVersion", "${App.getVERSION_STRING()}\0"
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 0x409, 1200
}
}"""
val f = File("./out/build_autogen_windows.rc")
f.delete()
f.writeText(s)
}
private fun writeOSXPlist(major: Int, minor: Int, patch: Int) {
val s = """<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><dict>
<key>CFBundleExecutable</key><string>${TerrarumAppConfiguration.GAME_NAME}.sh</string>
<key>CFBundleDisplayName</key><string>${TerrarumAppConfiguration.GAME_NAME}</string>
<key>CFBundleName</key><string>${TerrarumAppConfiguration.GAME_NAME}</string>
<key>CFBundleIconFile</key><string>AppIcon.icns</string>
<key>CFBundleVersion</key><string>${App.getVERSION_STRING()}</string>
</dict></plist>"""
val f = File("./out/build_autogen_macos_Info.plist")
f.delete()
f.writeText(s)
}
private fun writeLinuxDesktop(major: Int, minor: Int, patch: Int) {
val s = """[Desktop Entry]
Name=${TerrarumAppConfiguration.GAME_NAME}
Exec=AppRun
Icon=icns
Type=Application
Categories=Game;"""
val f = File("./out/build_autogen_linux.desktop")
f.delete()
f.writeText(s)
}
fun main() {
val major = (App.VERSION_RAW ushr 48).toInt()
val minor = ((App.VERSION_RAW and 0xffff000000L) ushr 24).toInt()
val patch = (App.VERSION_RAW and 0xffffffL).toInt()
writeLinuxDesktop(major, minor, patch)
writeOSXPlist(major, minor, patch)
writeWindowsRC(major, minor, patch)
}

View File

@@ -7,7 +7,7 @@ internal interface RNGConsumer {
val RNG: HQRNG
fun loadFromSave(s0: Long, s1: Long) {
fun loadFromSave(ingame: IngameInstance, s0: Long, s1: Long) {
RNG.setSeed(s0, s1)
}

View File

@@ -167,8 +167,10 @@ class SavegameCollectionPair(private val player: SavegameCollection?, private va
// private var autoPlayer: DiskSkimmer? = null
// private var autoWorld: DiskSkimmer? = null
var isImported: Boolean = false; private set
/* removing auto/manual discrimination: on Local Asynchronous Multiplayer, if newer autosave is available, there is
* no choice but loading one to preserve the data; then why bother having two? */
* no choice but loading one to preserve the data; then why bother having two? */
private var playerDisk: DiskSkimmer? = null; private set
private var worldDisk: DiskSkimmer? = null; private set
@@ -221,6 +223,10 @@ class SavegameCollectionPair(private val player: SavegameCollection?, private va
2
else (player != null && world != null).toInt()
if (player != null) {
isImported = (player.loadable().getSaveOrigin() and VDSaveOrigin.IMPORTED != 0)
}
printdbg(this, "playerDisk = ${playerDisk?.diskFile?.path}")
printdbg(this, "worldDisk = ${worldDisk?.diskFile?.path}")
printdbg(this, "status = $status")
@@ -341,6 +347,22 @@ class SavegameCollectionPair(private val player: SavegameCollection?, private va
return if (status == 0) null
else DiskPair(playerDisk!!, worldDisk!!)
}
fun getImportedPlayer(): DiskSkimmer? {
return if (isImported) player!!.loadable() else null
}
fun getPlayerThumbnailPixmap(width: Int, height: Int, shrinkage: Double): Pixmap? {
return player?.loadable()?.getThumbnailPixmap(width, height, shrinkage)?.let {
if (it.isDisposed) null else it
}
}
fun getWorldThumbnailPixmap(width: Int, height: Int, shrinkage: Double): Pixmap? {
return world?.loadable()?.getThumbnailPixmap(width, height, shrinkage)?.let {
if (it.isDisposed) null else it
}
}
}
data class DiskPair(val player: DiskSkimmer, val world: DiskSkimmer) {

View File

@@ -813,8 +813,8 @@ fun AppUpdateListOfSavegames() {
// if multiple valid savegames with same UUID exist, only the most recent one is retained
if (!App.savegameWorlds.contains(worldUUID)) {
App.savegameWorlds[worldUUID] = collection
App.savegameWorldsName[worldUUID] = it.getDiskName(Common.CHARSET)
App.sortedSavegameWorlds.add(worldUUID)
App.savegameWorldsName[worldUUID] = it.getDiskName(Common.CHARSET)
}
}
@@ -848,8 +848,8 @@ fun AppUpdateListOfSavegames() {
// if multiple valid savegames with same UUID exist, only the most recent one is retained
if (!App.savegamePlayers.contains(playerUUID)) {
App.savegamePlayers[playerUUID] = collection
App.savegamePlayersName[playerUUID] = it.getDiskName(Common.CHARSET)
App.sortedPlayers.add(playerUUID)
App.savegamePlayersName[playerUUID] = it.getDiskName(Common.CHARSET)
}
}

View File

@@ -67,6 +67,8 @@ basegame
// Commit counts up to the Release 0.3.1: 2278
// Commit counts up to the Release 0.3.2: 2732
const val VERSION_TAG: String = "test003"
//////////////////////////////////////////////////////////
// CONFIGURATION FOR TILE MAKER //
// MAKE SURE THESE VALUES ARE UNIQUE IN THE SOURCE CODE //

View File

@@ -0,0 +1,25 @@
package net.torvald.terrarum
/**
* Created by minjaesong on 2023-09-05.
*/
object TerrarumGlobalState {
val HAS_KEYBOARD_INPUT_FOCUS = CountedBool()
}
class CountedBool {
private var counter = 0L
fun set() {
counter += 1
}
fun unset() {
if (counter >= 1) counter -= 1
}
val value: Boolean
get() = counter > 0
fun isOn() = value
fun isOff() = !value
}

View File

@@ -13,6 +13,7 @@ import net.torvald.terrarum.App.IS_DEVELOPMENT_BUILD
import net.torvald.terrarum.gamecontroller.KeyToggler
import net.torvald.terrarum.ui.BasicDebugInfoWindow
import net.torvald.terrarum.ui.Toolkit
import net.torvald.terrarum.weather.WeatherMixer
/**
* Must be called by the App Loader
@@ -236,6 +237,13 @@ object TerrarumPostProcessor : Disposable {
else
shaderPostNoDither
val (vo, vg) = INGAME.world.weatherbox.let {
if (it.currentWeather.identifier == "titlescreen")
1f to 1f
else
it.currentVibrancy.x to it.currentVibrancy.y
}
App.getCurrentDitherTex().bind(1)
fbo.colorBufferTexture.bind(0)
@@ -245,6 +253,7 @@ object TerrarumPostProcessor : Disposable {
shader.setUniformi("rnd", rng.nextInt(8192), rng.nextInt(8192))
shader.setUniformi("u_pattern", 1)
shader.setUniformf("quant", shaderQuant[App.getConfigInt("displaycolourdepth")] ?: 255f)
shader.setUniformf("vibrancy", 1f, vo, vg, 1f)
shader.setUniformMatrix4fv("swizzler", swizzler, rng.nextInt(24), 16*4)
App.fullscreenQuad.render(shader, GL20.GL_TRIANGLES)

View File

@@ -35,7 +35,7 @@ class UIFakeGradOverlay : UICanvas() {
}
override fun updateUI(delta: Float) {}
override fun renderUI(batch: SpriteBatch, camera: Camera) {
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
batch.end()
val dither = App.getConfigBoolean("fx_dither")
@@ -84,7 +84,7 @@ class UIFakeBlurOverlay(val blurRadius: Float, val nodarken: Boolean) : UICanvas
private val batchDrawCol = Color(-1)
override fun updateUI(delta: Float) {}
override fun renderUI(batch: SpriteBatch, camera: Camera) {
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
batchDrawCol.a = openness
batch.color = batchDrawCol
if (App.getConfigBoolean("fx_backgroundblur")) {

View File

@@ -1,9 +1,6 @@
package net.torvald.terrarum
import com.badlogic.gdx.graphics.Camera
import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.Pixmap
import com.badlogic.gdx.graphics.Texture
import com.badlogic.gdx.graphics.*
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import net.torvald.terrarum.gameitems.GameItem
import net.torvald.terrarum.langpack.Lang
@@ -271,7 +268,7 @@ class UIItemInventoryCatBar(
}
}
override fun render(batch: SpriteBatch, camera: Camera) {
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
super.render(batch, camera)
// button

View File

@@ -2,6 +2,7 @@ package net.torvald.terrarum
import com.badlogic.gdx.graphics.Camera
import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.OrthographicCamera
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.graphics.g2d.TextureRegion
import net.torvald.terrarum.gameitems.GameItem
@@ -53,7 +54,7 @@ class UIItemInventoryElemSimple(
private var highlightToMainCol = false
private var highlightToSubCol = false
override fun render(batch: SpriteBatch, camera: Camera) {
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
blendNormalStraightAlpha(batch)
highlightToMainCol = customHighlightRuleMain?.invoke(this) ?: (equippedSlot != null && highlightEquippedItem) || forceHighlighted

View File

@@ -2,6 +2,7 @@ package net.torvald.terrarum
import com.badlogic.gdx.graphics.Camera
import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.OrthographicCamera
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.graphics.g2d.TextureRegion
import net.torvald.terrarum.gameitems.GameItem
@@ -78,7 +79,7 @@ class UIItemInventoryElemWide(
var textHighlightMouseUpCol = Toolkit.Theme.COL_MOUSE_UP
var textHighlightNormalCol = Color.WHITE
override fun render(batch: SpriteBatch, camera: Camera) {
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
blendNormalStraightAlpha(batch)
highlightToMainCol = customHighlightRuleMain?.invoke(this) ?: (equippedSlot != null && highlightEquippedItem) || forceHighlighted

View File

@@ -146,7 +146,10 @@ class BlockCodex {
}
try {
return blockProps[blockID]!!
return if (blockID.startsWith("wall@"))
blockProps[blockID.substring(5)]!!
else
blockProps[blockID]!!
}
catch (e: NullPointerException) {
throw NullPointerException("Blockprop with id $blockID does not exist.")
@@ -209,8 +212,8 @@ class BlockCodex {
prop.isSolid = record.boolVal("solid")
//prop.isClear = record.boolVal("clear")
prop.isPlatform = prop.tags.contains("PLATFORM")
prop.isActorBlock = prop.tags.contains("ACTORBLOCK")
prop.isPlatform = prop.hasTag("PLATFORM")
prop.isActorBlock = prop.hasTag("ACTORBLOCK")
prop.isWallable = record.boolVal("wall")
prop.maxSupport = record.intVal("grav")

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