mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-06 08:38:30 +09:00
Compare commits
95 Commits
v0.3.3-tes
...
v0.3.3-tes
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81ebf7a8ef | ||
|
|
d5a8d098bb | ||
|
|
cc55e563f0 | ||
|
|
64ef30e445 | ||
|
|
fbc700508f | ||
|
|
37492dc8a0 | ||
|
|
b0e4bd31eb | ||
|
|
0b5e3d7b77 | ||
|
|
b47cc17afd | ||
|
|
6c97a9d5ab | ||
|
|
7259ca616c | ||
|
|
70b9cebbd0 | ||
|
|
274be20e25 | ||
|
|
c576d087b4 | ||
|
|
699cc4dd74 | ||
|
|
8fa9ddeec1 | ||
|
|
c4deba14da | ||
|
|
cf98c13111 | ||
|
|
d0e1555ad0 | ||
|
|
50eac69e3e | ||
|
|
c45cab388e | ||
|
|
7b3ac9cd06 | ||
|
|
08b1d93d54 | ||
|
|
da7ecaa75b | ||
|
|
65b610ce01 | ||
|
|
6a78cf6a41 | ||
|
|
1e98353b50 | ||
|
|
38c91bd8ec | ||
|
|
78075d779b | ||
|
|
721a24d9dc | ||
|
|
66a103bd3a | ||
|
|
abee176ef4 | ||
|
|
ae078024cb | ||
|
|
96af39ab4a | ||
|
|
c75fa73bac | ||
|
|
5eed921288 | ||
|
|
7f3f94e01a | ||
|
|
1fe0ca9e2e | ||
|
|
7cc985b627 | ||
|
|
d17d576e15 | ||
|
|
ced7cf99fc | ||
|
|
c290d5dee7 | ||
|
|
d32d6b8d1c | ||
|
|
9d118aebb0 | ||
|
|
0646425b76 | ||
|
|
a348bac397 | ||
|
|
a9bd032c32 | ||
|
|
349488376d | ||
|
|
ce8c53f740 | ||
|
|
7845146718 | ||
|
|
3cce1c0b65 | ||
|
|
2bbf92d056 | ||
|
|
3d5713cd31 | ||
|
|
f8b6493cdc | ||
|
|
b69689a6be | ||
|
|
cc2c841f76 | ||
|
|
89846db5d3 | ||
|
|
bfd926d7fe | ||
|
|
602d5e046b | ||
|
|
72029ed458 | ||
|
|
a4672a131d | ||
|
|
75fcb5be5b | ||
|
|
eeee1ebdbc | ||
|
|
32e750eb6a | ||
|
|
a2ced31f8f | ||
|
|
b1e45f1743 | ||
|
|
8dda7ac79b | ||
|
|
74b8cc20b7 | ||
|
|
f75a7dd812 | ||
|
|
b2454e4ca2 | ||
|
|
45af955488 | ||
|
|
1f39b9d448 | ||
|
|
26a4cdbce1 | ||
|
|
bf87dc04cb | ||
|
|
8535b0ce13 | ||
|
|
6e0004f165 | ||
|
|
845333f33d | ||
|
|
6988feb731 | ||
|
|
ac2c7b1148 | ||
|
|
d6145fd0da | ||
|
|
194089827c | ||
|
|
d69d032f74 | ||
|
|
a9dbea3d16 | ||
|
|
52938a4b60 | ||
|
|
a21f986f30 | ||
|
|
547158a313 | ||
|
|
0a8b5f33f4 | ||
|
|
da8d620766 | ||
|
|
7dd520393c | ||
|
|
dc83e12170 | ||
|
|
d6b2940d8f | ||
|
|
c5dfe46b76 | ||
|
|
3d3926c08b | ||
|
|
9a90bf69d4 | ||
|
|
0ed5472d8a |
1
.idea/artifacts/TerrarumBuild.xml
generated
1
.idea/artifacts/TerrarumBuild.xml
generated
@@ -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
14
.idea/libraries/apache_commons_math3.xml
generated
Normal 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>
|
||||
11
.idea/runConfigurations/Build_Version_Number.xml
generated
Normal file
11
.idea/runConfigurations/Build_Version_Number.xml
generated
Normal 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>
|
||||
1
.idea/runConfigurations/Terrarum.xml
generated
1
.idea/runConfigurations/Terrarum.xml
generated
@@ -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" />
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -5,10 +5,7 @@ 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.App
|
||||
import net.torvald.terrarum.FlippingSpriteBatch
|
||||
import net.torvald.terrarum.blendNormalStraightAlpha
|
||||
import net.torvald.terrarum.inAction
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
import net.torvald.terrarum.modulecomputers.gameactors.FixtureHomeComputer
|
||||
import net.torvald.terrarum.ui.Toolkit
|
||||
@@ -18,8 +15,8 @@ import net.torvald.tsvm.peripheral.GraphicsAdapter
|
||||
import net.torvald.unicode.*
|
||||
|
||||
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"),
|
||||
toggleKeyLiteral = null,
|
||||
toggleButtonLiteral = "control_gamepad_start",
|
||||
) {
|
||||
override var width = 640
|
||||
override var height = 480
|
||||
@@ -45,7 +42,7 @@ internal class UIHomeComputer : UICanvas(
|
||||
private val fbo = FrameBuffer(Pixmap.Format.RGBA8888, width, height, false)
|
||||
|
||||
private val controlHelp =
|
||||
"${getKeycapPC(App.getConfigInt("control_key_inventory"))} ${Lang["GAME_ACTION_CLOSE"]}\u3000 " +
|
||||
"${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"
|
||||
@@ -53,7 +50,7 @@ internal class UIHomeComputer : UICanvas(
|
||||
override fun updateUI(delta: Float) {
|
||||
}
|
||||
|
||||
override fun renderUI(otherBatch: SpriteBatch, otherCamera: Camera) {
|
||||
override fun renderUI(otherBatch: SpriteBatch, otherCamera: OrthographicCamera) {
|
||||
otherBatch.end()
|
||||
|
||||
fbo.inAction(camera, batch) {
|
||||
|
||||
@@ -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>
|
||||
BIN
assets/clut/skybox.png
LFS
BIN
assets/clut/skybox.png
LFS
Binary file not shown.
BIN
assets/graphics/fonts/code.tga
LFS
Normal file
BIN
assets/graphics/fonts/code.tga
LFS
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"ERROR_FILE_NOT_FOUND": "File not found.",
|
||||
"GAME_32BIT_WARNING1": "It looks like you’re 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/",
|
||||
|
||||
@@ -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,7 +18,8 @@
|
||||
"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": "재시작 필요",
|
||||
|
||||
@@ -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.
@@ -32,4 +32,5 @@ Teleport
|
||||
ToggleNoClip
|
||||
Zoom
|
||||
DynToStatic
|
||||
DebugFillInventory
|
||||
DebugFillInventory
|
||||
Uuid
|
||||
|
@@ -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.
Binary file not shown.
@@ -2,6 +2,7 @@ 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
|
||||
@@ -9,6 +10,9 @@ id;classname
|
||||
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
|
||||
|
||||
|
Binary file not shown.
@@ -9,6 +9,8 @@
|
||||
"MENU_LABEL_MENU": "Menu",
|
||||
"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",
|
||||
|
||||
@@ -5,6 +5,12 @@
|
||||
|
||||
"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",
|
||||
|
||||
@@ -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."
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
"MENU_LABEL_MENU": "메뉴",
|
||||
"MENU_LABEL_PREV_SAVES": "이전 세이브",
|
||||
"MENU_LABEL_RENAME": "이름 바꾸기",
|
||||
"MENU_LABEL_USE_CODE": "코드 사용",
|
||||
"MENU_MONITOR_CALI_TITLE": "모니터 확인",
|
||||
"GAME_ACTION_CRAFT": "제작하기",
|
||||
"GAME_ACTION_GRAPPLE": "매달리기",
|
||||
|
||||
@@ -5,6 +5,12 @@
|
||||
|
||||
"ITEM_CALENDAR": "달력",
|
||||
"ITEM_LOGIC_SIGNAL_EMITTER": "신호발생기",
|
||||
"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": "타자기",
|
||||
|
||||
@@ -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.
48
assets/mods/basegame/sprites/taimu2.properties
Normal file
48
assets/mods/basegame/sprites/taimu2.properties
Normal 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
|
||||
48
assets/mods/basegame/sprites/taimu2_glow.properties
Normal file
48
assets/mods/basegame/sprites/taimu2_glow.properties
Normal 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
|
||||
BIN
assets/mods/basegame/sprites/test_werebeastf2/taimu_arm_rest_left.tga
LFS
Normal file
BIN
assets/mods/basegame/sprites/test_werebeastf2/taimu_arm_rest_left.tga
LFS
Normal file
Binary file not shown.
BIN
assets/mods/basegame/sprites/test_werebeastf2/taimu_arm_rest_right.tga
LFS
Normal file
BIN
assets/mods/basegame/sprites/test_werebeastf2/taimu_arm_rest_right.tga
LFS
Normal file
Binary file not shown.
BIN
assets/mods/basegame/sprites/test_werebeastf2/taimu_bust_0.tga
LFS
Normal file
BIN
assets/mods/basegame/sprites/test_werebeastf2/taimu_bust_0.tga
LFS
Normal file
Binary file not shown.
BIN
assets/mods/basegame/sprites/test_werebeastf2/taimu_head.tga
LFS
Normal file
BIN
assets/mods/basegame/sprites/test_werebeastf2/taimu_head.tga
LFS
Normal file
Binary file not shown.
BIN
assets/mods/basegame/sprites/test_werebeastf2/taimu_leg_rest_left.tga
LFS
Normal file
BIN
assets/mods/basegame/sprites/test_werebeastf2/taimu_leg_rest_left.tga
LFS
Normal file
Binary file not shown.
BIN
assets/mods/basegame/sprites/test_werebeastf2/taimu_leg_rest_right.tga
LFS
Normal file
BIN
assets/mods/basegame/sprites/test_werebeastf2/taimu_leg_rest_right.tga
LFS
Normal file
Binary file not shown.
BIN
assets/mods/basegame/sprites/test_werebeastf2/taimu_tail_0.tga
LFS
Normal file
BIN
assets/mods/basegame/sprites/test_werebeastf2/taimu_tail_0.tga
LFS
Normal file
Binary file not shown.
BIN
assets/mods/basegame/sprites/test_werebeastf2/taimu_torso_0.tga
LFS
Normal file
BIN
assets/mods/basegame/sprites/test_werebeastf2/taimu_torso_0.tga
LFS
Normal file
Binary file not shown.
BIN
assets/mods/basegame/sprites/test_werebeastf2/taimu_torso_1.tga
LFS
Normal file
BIN
assets/mods/basegame/sprites/test_werebeastf2/taimu_torso_1.tga
LFS
Normal file
Binary file not shown.
BIN
assets/mods/basegame/sprites/test_werebeastf2/taimuglow_head.tga
LFS
Normal file
BIN
assets/mods/basegame/sprites/test_werebeastf2/taimuglow_head.tga
LFS
Normal file
Binary file not shown.
@@ -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]
|
||||
}
|
||||
32
assets/mods/basegame/weathers/WeatherGeneric2.json
Normal file
32
assets/mods/basegame/weathers/WeatherGeneric2.json
Normal 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"
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"globalLight": "generic_light.tga",
|
||||
"skyboxGradColourMap": "generic_skybox.tga",
|
||||
"classification": "genericrain",
|
||||
"extraImages": [
|
||||
"raindrop.tga"
|
||||
],
|
||||
"mixFrom": "__CURRENTWEATHER",
|
||||
"mixPercentage": 80.0
|
||||
}
|
||||
31
assets/mods/basegame/weathers/WeatherOvercast.json
Normal file
31
assets/mods/basegame/weathers/WeatherOvercast.json
Normal 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]
|
||||
}
|
||||
BIN
assets/mods/basegame/weathers/cloud_large.kra
LFS
Normal file
BIN
assets/mods/basegame/weathers/cloud_large.kra
LFS
Normal file
Binary file not shown.
BIN
assets/mods/basegame/weathers/cloud_large.png
LFS
Normal file
BIN
assets/mods/basegame/weathers/cloud_large.png
LFS
Normal file
Binary file not shown.
BIN
assets/mods/basegame/weathers/cloud_normal.kra
LFS
Normal file
BIN
assets/mods/basegame/weathers/cloud_normal.kra
LFS
Normal file
Binary file not shown.
BIN
assets/mods/basegame/weathers/cloud_normal.png
LFS
Normal file
BIN
assets/mods/basegame/weathers/cloud_normal.png
LFS
Normal file
Binary file not shown.
26
assets/mods/basegame/weathers/cloud_texture_instruction.md
Normal file
26
assets/mods/basegame/weathers/cloud_texture_instruction.md
Normal 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
|
||||
|
||||
BIN
assets/mods/basegame/weathers/cloud_wide.kra
LFS
Normal file
BIN
assets/mods/basegame/weathers/cloud_wide.kra
LFS
Normal file
Binary file not shown.
BIN
assets/mods/basegame/weathers/cloud_wide.png
LFS
Normal file
BIN
assets/mods/basegame/weathers/cloud_wide.png
LFS
Normal file
Binary file not shown.
BIN
assets/mods/basegame/weathers/clut_daylight.kra
LFS
Normal file
BIN
assets/mods/basegame/weathers/clut_daylight.kra
LFS
Normal file
Binary file not shown.
Binary file not shown.
@@ -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; }
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -6,6 +6,8 @@ SRCFILES="terrarummac_arm"
|
||||
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
|
||||
@@ -21,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
|
||||
@@ -33,8 +35,9 @@ 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
|
||||
|
||||
@@ -6,6 +6,8 @@ SRCFILES="terrarummac_x86"
|
||||
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
|
||||
@@ -21,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
|
||||
@@ -33,8 +35,9 @@ 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
|
||||
|
||||
@@ -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
BIN
buildapp/icns.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
@@ -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
|
||||
|
||||
|
||||
@@ -18,8 +18,19 @@ 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
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Name=Terrarum
|
||||
Exec=AppRun
|
||||
Icon=icns
|
||||
Type=Application
|
||||
Categories=Game;
|
||||
@@ -1,6 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Name=Terrarum
|
||||
Exec=AppRun
|
||||
Icon=icns
|
||||
Type=Application
|
||||
Categories=Game;
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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");
|
||||
}
|
||||
BIN
lib/commons-math3-3.6.1-javadoc.jar
LFS
Normal file
BIN
lib/commons-math3-3.6.1-javadoc.jar
LFS
Normal file
Binary file not shown.
BIN
lib/commons-math3-3.6.1-sources.jar
LFS
Normal file
BIN
lib/commons-math3-3.6.1-sources.jar
LFS
Normal file
Binary file not shown.
BIN
lib/commons-math3-3.6.1.jar
LFS
Normal file
BIN
lib/commons-math3-3.6.1.jar
LFS
Normal file
Binary file not shown.
@@ -41,7 +41,7 @@ public class Float16FrameBuffer extends FrameBuffer {
|
||||
}
|
||||
else {
|
||||
FloatFrameBufferBuilder bufferBuilder = new FloatFrameBufferBuilder(width, height);
|
||||
bufferBuilder.addFloatAttachment(GL30.GL_RGBA16F, GL30.GL_RGBA, GL30.GL_FLOAT, false); // FIXME sporadic black screen on GL_RGBA16F? or maybe it was Plasma bugging out?
|
||||
bufferBuilder.addFloatAttachment(GL30.GL_RGBA16F, GL30.GL_RGBA, GL30.GL_FLOAT, false);
|
||||
if (hasDepth) bufferBuilder.addBasicDepthRenderBuffer();
|
||||
this.bufferBuilder = bufferBuilder;
|
||||
}
|
||||
|
||||
@@ -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) {}
|
||||
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -198,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;
|
||||
@@ -269,8 +271,8 @@ public class App implements ApplicationListener {
|
||||
Gdx.gl20.glViewport(0, 0, width, height);
|
||||
}
|
||||
|
||||
public static final int TICKS = 64;
|
||||
public static final float UPDATE_RATE = 1f / TICKS; // 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;
|
||||
@@ -828,6 +830,7 @@ public class App implements ApplicationListener {
|
||||
fontGame.dispose();
|
||||
fontGameFBO.dispose();
|
||||
fontSmallNumbers.dispose();
|
||||
fontBigNumbers.dispose();
|
||||
ItemSlotImageFactory.INSTANCE.dispose();
|
||||
|
||||
logo.getTexture().dispose();
|
||||
@@ -906,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();
|
||||
|
||||
@@ -1007,6 +1011,7 @@ public class App implements ApplicationListener {
|
||||
|
||||
|
||||
fontSmallNumbers = TinyAlphNum.INSTANCE;
|
||||
fontBigNumbers = BigAlphNum.INSTANCE;
|
||||
|
||||
IME.invoke();
|
||||
inputStrober = InputStrober.INSTANCE;
|
||||
@@ -1185,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;
|
||||
|
||||
@@ -1224,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));
|
||||
@@ -1239,6 +1247,7 @@ public class App implements ApplicationListener {
|
||||
new File(worldsDir),
|
||||
new File(recycledPlayersDir),
|
||||
new File(recycledWorldsDir),
|
||||
new File(importDir)
|
||||
};
|
||||
|
||||
for (File it : dirs) {
|
||||
@@ -1378,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);
|
||||
|
||||
90
src/net/torvald/terrarum/ControlPresets.kt
Normal file
90
src/net/torvald/terrarum/ControlPresets.kt
Normal 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))
|
||||
}
|
||||
}
|
||||
@@ -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,
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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/"
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -122,4 +122,6 @@ class Point2i() {
|
||||
|
||||
operator fun component1() = x
|
||||
operator fun component2() = y
|
||||
|
||||
fun toVector() = Vector2(this.x.toDouble(), this.y.toDouble())
|
||||
}
|
||||
|
||||
72
src/net/torvald/terrarum/Prebuild.kt
Normal file
72
src/net/torvald/terrarum/Prebuild.kt
Normal 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)
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ 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 = "test001"
|
||||
const val VERSION_TAG: String = "test003"
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
// CONFIGURATION FOR TILE MAKER //
|
||||
|
||||
25
src/net/torvald/terrarum/TerrarumGlobalState.kt
Normal file
25
src/net/torvald/terrarum/TerrarumGlobalState.kt
Normal 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
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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")) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.")
|
||||
|
||||
@@ -13,7 +13,7 @@ import net.torvald.terrarum.weather.WeatherMixer
|
||||
*/
|
||||
object BlockPropUtil {
|
||||
//var flickerFuncX: Second = 0f // saves current status (time) of func
|
||||
val flickerFuncDomain: Second = 0.06f // time between two noise sample
|
||||
val flickerFuncDomain: Second = 8f/64f // time between two noise sample
|
||||
val flickerFuncRange = 0.036f // intensity [0, 1]
|
||||
|
||||
//var breathFuncX = 0f
|
||||
@@ -50,7 +50,7 @@ object BlockPropUtil {
|
||||
|
||||
|
||||
/**
|
||||
* Using our own timer so that they flickers for same duration regardless of game's FPS
|
||||
* Must be using ConsistentUpdateRate update governor
|
||||
*/
|
||||
internal fun dynamicLumFuncTickClock() {
|
||||
|
||||
@@ -80,7 +80,7 @@ object BlockPropUtil {
|
||||
|
||||
// FPS-time compensation
|
||||
if (Gdx.graphics.framesPerSecond > 0) {
|
||||
prop.rngBase0 += Gdx.graphics.deltaTime
|
||||
prop.rngBase0 += App.UPDATE_RATE
|
||||
}
|
||||
|
||||
// reset timer
|
||||
@@ -108,7 +108,7 @@ object BlockPropUtil {
|
||||
return when (prop.dynamicLuminosityFunction) {
|
||||
1 -> getTorchFlicker(prop)
|
||||
2 -> (INGAME.world).globalLight.cpy() // current global light
|
||||
3 -> WeatherMixer.getGlobalLightOfTimeOfNoon().cpy() // daylight at noon
|
||||
3 -> WeatherMixer.getGlobalLightOfTimeOfNoon(WeatherMixer.weatherDict["generic01"]!!).cpy() // daylight at noon
|
||||
4 -> getSlowBreath(prop)
|
||||
5 -> getPulsate(prop)
|
||||
else -> prop.baseLumCol
|
||||
|
||||
@@ -74,9 +74,9 @@ fun main() {
|
||||
// println("$yp\t$theta")
|
||||
|
||||
val xyz = CIEXYZ(
|
||||
ArHosekSkyModel.arhosek_tristim_skymodel_radiance(state, theta, (gammaPair * 2f + 1f) * HALF_PI, 0).toFloat(),
|
||||
ArHosekSkyModel.arhosek_tristim_skymodel_radiance(state, theta, (gammaPair * 2f + 1f) * HALF_PI, 1).toFloat(),
|
||||
ArHosekSkyModel.arhosek_tristim_skymodel_radiance(state, theta, (gammaPair * 2f + 1f) * HALF_PI, 2).toFloat()
|
||||
ArHosekSkyModel.arhosek_tristim_skymodel_radiance(state, theta, HALF_PI, 0).toFloat(),
|
||||
ArHosekSkyModel.arhosek_tristim_skymodel_radiance(state, theta, HALF_PI, 1).toFloat(),
|
||||
ArHosekSkyModel.arhosek_tristim_skymodel_radiance(state, theta, HALF_PI, 2).toFloat()
|
||||
)
|
||||
val xyz2 = xyz.scaleToFit(elevationDeg)
|
||||
val rgb = xyz2.toRGB().toColor()
|
||||
|
||||
@@ -60,17 +60,27 @@ object Skybox : Disposable {
|
||||
data class SkyboxRenderInfo(
|
||||
val texture: Texture,
|
||||
val uvs: FloatArray,
|
||||
val turbidityPoint: Float,
|
||||
val albedoPoint: Float,
|
||||
val turbidityThisBlend: Float,
|
||||
val albedoThisBlend: Float,
|
||||
val turbidityOldBlend: Float,
|
||||
val albedoOldBlend: Float,
|
||||
)
|
||||
|
||||
fun getUV(elevationDeg: Double, turbidity: Double, albedo: Double): SkyboxRenderInfo {
|
||||
val turb = turbidity.coerceIn(turbiditiesD.first(), turbiditiesD.last()).minus(1.0).times(turbDivisor)
|
||||
val turbLo = turb.floorToInt()
|
||||
val turbHi = min(turbCnt - 1, turbLo + 1)
|
||||
val alb = albedo.coerceIn(albedos.first(), albedos.last()).times(5.0)
|
||||
val albLo = alb.floorToInt()
|
||||
val albHi = min(albedoCnt - 1, albLo + 1)
|
||||
fun getUV(elevationDeg: Double, oldTurbidity: Double, oldAlbedo: Double, thisTurbidity: Double, thisAlbedo: Double): SkyboxRenderInfo {
|
||||
val turb2 = thisTurbidity.coerceIn(turbiditiesD.first(), turbiditiesD.last()).minus(1.0).times(turbDivisor)
|
||||
val turb2Lo = turb2.floorToInt()
|
||||
val turb2Hi = min(turbCnt - 1, turb2Lo + 1)
|
||||
val alb2 = thisAlbedo.coerceIn(albedos.first(), albedos.last()).times(5.0)
|
||||
val alb2Lo = alb2.floorToInt()
|
||||
val alb2Hi = min(albedoCnt - 1, alb2Lo + 1)
|
||||
|
||||
val turb1 = oldTurbidity.coerceIn(turbiditiesD.first(), turbiditiesD.last()).minus(1.0).times(turbDivisor)
|
||||
val turb1Lo = turb1.floorToInt()
|
||||
val turb1Hi = min(turbCnt - 1, turb1Lo + 1)
|
||||
val alb1 = oldAlbedo.coerceIn(albedos.first(), albedos.last()).times(5.0)
|
||||
val alb1Lo = alb1.floorToInt()
|
||||
val alb1Hi = min(albedoCnt - 1, alb1Lo + 1)
|
||||
|
||||
val elev = elevationDeg.coerceIn(-elevMax, elevMax).plus(elevMax).div(elevations.last.toDouble()).div(albedoCnt * 2).times((elevCnt - 1.0) / elevCnt)
|
||||
|
||||
// A: morn, turbLow, albLow
|
||||
@@ -82,14 +92,14 @@ object Skybox : Disposable {
|
||||
// G: morn, turbHigh, albHigh
|
||||
// H: noon, turbHigh, albHigh
|
||||
|
||||
val regionA = texStripRegions.get(albLo + albedoCnt * 0, turbLo)
|
||||
val regionB = texStripRegions.get(albLo + albedoCnt * 1, turbLo)
|
||||
val regionC = texStripRegions.get(albLo + albedoCnt * 0, turbHi)
|
||||
val regionD = texStripRegions.get(albLo + albedoCnt * 1, turbHi)
|
||||
val regionE = texStripRegions.get(albHi + albedoCnt * 0, turbLo)
|
||||
val regionF = texStripRegions.get(albHi + albedoCnt * 1, turbLo)
|
||||
val regionG = texStripRegions.get(albHi + albedoCnt * 0, turbHi)
|
||||
val regionH = texStripRegions.get(albHi + albedoCnt * 1, turbHi)
|
||||
val regionA = texStripRegions.get(alb1Lo, turb1Lo)
|
||||
val regionB = texStripRegions.get(alb2Lo, turb2Lo)
|
||||
val regionC = texStripRegions.get(alb1Lo, turb1Hi)
|
||||
val regionD = texStripRegions.get(alb2Lo, turb2Hi)
|
||||
val regionE = texStripRegions.get(alb1Hi, turb1Lo)
|
||||
val regionF = texStripRegions.get(alb2Hi, turb2Lo)
|
||||
val regionG = texStripRegions.get(alb1Hi, turb1Hi)
|
||||
val regionH = texStripRegions.get(alb2Hi, turb2Hi)
|
||||
// (0.5f / tex.width): because of the nature of bilinear interpolation, half pixels from the edges must be discarded
|
||||
val uA = regionA.u + (0.5f / tex.width) + elev.toFloat()
|
||||
val uB = regionB.u + (0.5f / tex.width) + elev.toFloat()
|
||||
@@ -112,8 +122,10 @@ object Skybox : Disposable {
|
||||
uG, regionG.v, uG, regionG.v2,
|
||||
uH, regionH.v, uH, regionH.v2,
|
||||
),
|
||||
(turb - turbLo).toFloat(),
|
||||
(alb - albLo).toFloat(),
|
||||
(turb2 - turb2Lo).toFloat(),
|
||||
(alb2 - alb2Lo).toFloat(),
|
||||
(turb1 - turb1Lo).toFloat(),
|
||||
(alb1 - alb1Lo).toFloat(),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -152,7 +164,7 @@ object Skybox : Disposable {
|
||||
val elevations = (0..150)
|
||||
val elevMax = elevations.last / 2.0
|
||||
val elevationsD = elevations.map { -elevMax + it } // -75, -74, -73, ..., 74, 75 // (specifically using whole number of angles because angle units any finer than 1.0 would make "hack" sunsut happen too fast)
|
||||
val turbidities = (0..25) // 1, 1.2, 1.4, 1.6, ..., 6.0
|
||||
val turbidities = (0..45) // 1, 1.2, 1.4, 1.6, ..., 10.0
|
||||
val turbDivisor = 5.0
|
||||
val turbiditiesD = turbidities.map { 1.0 + it / turbDivisor }
|
||||
val albedos = arrayOf(0.0, 0.2, 0.4, 0.6, 0.8, 1.0)
|
||||
|
||||
@@ -688,7 +688,7 @@ open class ActorWithBody : Actor {
|
||||
}
|
||||
|
||||
private fun displaceHitbox() {
|
||||
val printdbg1 = true && App.IS_DEVELOPMENT_BUILD
|
||||
val printdbg1 = false && App.IS_DEVELOPMENT_BUILD
|
||||
// // HOW IT SHOULD WORK // //
|
||||
// ////////////////////////
|
||||
// combineVeloToMoveDelta now
|
||||
@@ -891,15 +891,15 @@ open class ActorWithBody : Actor {
|
||||
|
||||
// points to the EDGE of the tile in world dimension (don't use this directly to get tilewise coord!!)
|
||||
val offendingTileWorldX = if (selfCollisionStatus in listOf(6, 12))
|
||||
newHitbox.endX.div(TILE_SIZE).floorToDouble() * TILE_SIZE - PHYS_EPSILON_DIST
|
||||
newHitbox.endX.div(TILE_SIZE).floorToDouble() * TILE_SIZE - PHYS_EPSILON_DIST // adding/subbing fixes a bug where player stops midair when L/R is held and moving down from the platform
|
||||
else
|
||||
newHitbox.startX.div(TILE_SIZE).ceilToDouble() * TILE_SIZE
|
||||
newHitbox.startX.div(TILE_SIZE).ceilToDouble() * TILE_SIZE + PHYS_EPSILON_DIST // adding/subbing fixes a bug where player stops midair when L/R is held and moving down from the platform
|
||||
|
||||
// points to the EDGE of the tile in world dimension (don't use this directly to get tilewise coord!!)
|
||||
val offendingTileWorldY = if (selfCollisionStatus in listOf(3, 6))
|
||||
newHitbox.endY.div(TILE_SIZE).floorToDouble() * TILE_SIZE - PHYS_EPSILON_DIST
|
||||
newHitbox.endY.div(TILE_SIZE).floorToDouble() * TILE_SIZE - PHYS_EPSILON_DIST // adding/subbing fixes a bug where player stops midair when L/R is held and moving down from the platform
|
||||
else
|
||||
newHitbox.startY.div(TILE_SIZE).ceilToDouble() * TILE_SIZE
|
||||
newHitbox.startY.div(TILE_SIZE).ceilToDouble() * TILE_SIZE + PHYS_EPSILON_DIST // adding/subbing fixes a bug where player stops midair when L/R is held and moving down from the platform
|
||||
|
||||
val offendingHitboxPointX = if (selfCollisionStatus in listOf(6, 12))
|
||||
newHitbox.endX
|
||||
@@ -1108,6 +1108,7 @@ open class ActorWithBody : Actor {
|
||||
}
|
||||
|
||||
private fun Hitbox.getWallDetection(option: Int): List<Double> {
|
||||
val SOME_PIXEL = 1.0 // it really does NOT work if the value is not 1.0
|
||||
val x1: Double
|
||||
val x2: Double
|
||||
val y1: Double
|
||||
@@ -1116,23 +1117,23 @@ open class ActorWithBody : Actor {
|
||||
COLLIDING_TOP -> {
|
||||
x1 = this.startX
|
||||
x2 = this.endX - PHYS_EPSILON_DIST
|
||||
y1 = this.startY - A_PIXEL
|
||||
y1 = this.startY - SOME_PIXEL
|
||||
y2 = y1
|
||||
}
|
||||
COLLIDING_BOTTOM -> {
|
||||
x1 = this.startX
|
||||
x2 = this.endX - PHYS_EPSILON_DIST
|
||||
y1 = this.endY - PHYS_EPSILON_DIST + A_PIXEL
|
||||
y1 = this.endY - PHYS_EPSILON_DIST + SOME_PIXEL
|
||||
y2 = y1
|
||||
}
|
||||
COLLIDING_LEFT -> {
|
||||
x1 = this.startX - A_PIXEL
|
||||
x1 = this.startX - SOME_PIXEL
|
||||
x2 = x1
|
||||
y1 = this.startY
|
||||
y2 = this.endY - PHYS_EPSILON_DIST
|
||||
}
|
||||
COLLIDING_RIGHT -> {
|
||||
x1 = this.endX - PHYS_EPSILON_DIST + A_PIXEL
|
||||
x1 = this.endX - PHYS_EPSILON_DIST + SOME_PIXEL
|
||||
x2 = x1
|
||||
y1 = this.startY
|
||||
y2 = this.endY - PHYS_EPSILON_DIST
|
||||
@@ -1242,6 +1243,8 @@ open class ActorWithBody : Actor {
|
||||
private fun isCollidingInternalStairs(pxStart: Int, pyStart: Int, pxEnd: Int, pyEnd: Int, feet: Boolean = false): Pair<Int, Int> {
|
||||
if (world == null) return 0 to 0
|
||||
|
||||
val cornerSize = minOf((pyEnd - pyStart) / 3, (pxEnd - pyStart) / 3)
|
||||
|
||||
val ys = if (gravitation.y >= 0) pyEnd downTo pyStart else pyStart..pyEnd
|
||||
val yheight = (ys.last - ys.first).absoluteValue
|
||||
var stairHeight = 0
|
||||
@@ -1260,7 +1263,19 @@ open class ActorWithBody : Actor {
|
||||
val isFeetTileHeight = (ty == feetY)
|
||||
var hasFloor = false
|
||||
|
||||
for (x in pxStart..pxEnd) {
|
||||
// octagonal shape
|
||||
val xs = /*if (y < cornerSize) {
|
||||
val sub = cornerSize - y
|
||||
(pxStart + sub)..(pxEnd - sub)
|
||||
}
|
||||
else if (y > pyEnd - cornerSize) {
|
||||
val sub = y - (pyEnd - cornerSize)
|
||||
(pxStart + sub)..(pxEnd - sub)
|
||||
}
|
||||
else*/
|
||||
pxStart..pxEnd
|
||||
|
||||
for (x in xs) {
|
||||
val tx = (x / TILE_SIZED).floorToInt() // round down toward negative infinity
|
||||
val tile = world!!.getTileFromTerrain(tx, ty)
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.torvald.terrarum.gameactors
|
||||
|
||||
import com.jme3.math.FastMath
|
||||
import net.torvald.terrarum.Point2d
|
||||
import net.torvald.terrarum.printStackTrace
|
||||
import org.dyn4j.geometry.Vector2
|
||||
@@ -190,6 +191,15 @@ class Hitbox {
|
||||
companion object {
|
||||
fun fromTwoPoints(x1: Double, y1: Double, x2: Double, y2: Double, nowarn: Boolean = false) =
|
||||
Hitbox(x1, y1, x2 - x1, y2 - y1, nowarn)
|
||||
|
||||
fun lerp(fraction: Double, a: Hitbox, b: Hitbox): Hitbox {
|
||||
return Hitbox(
|
||||
FastMath.interpolateLinear(fraction, a.startX, b.startX),
|
||||
FastMath.interpolateLinear(fraction, a.startY, b.startY),
|
||||
FastMath.interpolateLinear(fraction, a.width, b.width),
|
||||
FastMath.interpolateLinear(fraction, a.height, b.height)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
operator fun minus(other: Hitbox): Vector2 {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user