mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +09:00
prebuild: added macos game mode detection
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
"id";"name";"shdr";"shdg";"shdb";"shduv";"str";"dsty";"mate";"lumr";"lumg";"lumb";"lumuv";"colour";"vscs";"refl";"tags"
|
||||
"1";"BLOCK_WATER";"0.1016";"0.0744";"0.0508";"0.0826";"100";"1000";"WATR";"0.0000";"0.0000";"0.0000";"0.0000";"005599A6";"16";"0.0";"NATURAL"
|
||||
"2";"BLOCK_LAVA";"0.9696";"0.9696";"0.9696";"0.9696";"100";"2600";"ROCK"; "0.7664";"0.2032";"0.0000";"0.0000";"FF4600E6";"32";"0.0";"NATURAL,MOLTEN"
|
||||
"1";"BLOCK_WATER";"0.1016";"0.0744";"0.0508";"0.0826";"100";"1000";"WATR";"0.0000";"0.0000";"0.0000";"0.0000";"005599A6";"5";"0.0";"NATURAL"
|
||||
"2";"BLOCK_LAVA";"0.9696";"0.9696";"0.9696";"0.9696";"100";"2600";"ROCK"; "0.7664";"0.2032";"0.0000";"0.0000";"FF4600E6";"16";"0.0";"NATURAL,MOLTEN"
|
||||
|
||||
|
@@ -17,11 +17,11 @@ VS_VERSION_INFO VERSIONINFO
|
||||
BLOCK "040904b0"
|
||||
{
|
||||
VALUE "FileDescription", "${TerrarumAppConfiguration.GAME_NAME}\0"
|
||||
VALUE "FileVersion", "${App.getVERSION_STRING()}\0"
|
||||
VALUE "FileVersion", "$major.$minor.$patch\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"
|
||||
VALUE "ProductVersion", "$major.$minor.$patch\0"
|
||||
}
|
||||
}
|
||||
BLOCK "VarFileInfo"
|
||||
@@ -42,7 +42,8 @@ private fun writeOSXPlist(major: Int, minor: Int, patch: Int) {
|
||||
<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>
|
||||
<key>CFBundleVersion</key><string>$major.$minor.$patch</string>
|
||||
<key>LSApplicationCategoryType</key><string>public.app-category.games</string>
|
||||
</dict></plist>"""
|
||||
val f = File("./out/build_autogen_macos_Info.plist")
|
||||
f.delete()
|
||||
@@ -55,6 +56,7 @@ Name=${TerrarumAppConfiguration.GAME_NAME}
|
||||
Exec=AppRun
|
||||
Icon=icns
|
||||
Type=Application
|
||||
Version=1.0
|
||||
Categories=Game;"""
|
||||
val f = File("./out/build_autogen_linux.desktop")
|
||||
f.delete()
|
||||
|
||||
@@ -13,6 +13,8 @@ import net.torvald.terrarum.TerrarumAppConfiguration.TILE_SIZED
|
||||
import net.torvald.terrarum.TerrarumAppConfiguration.TILE_SIZEF
|
||||
import net.torvald.terrarum.blockproperties.Block
|
||||
import net.torvald.terrarum.blockproperties.BlockProp
|
||||
import net.torvald.terrarum.blockproperties.FluidCodex
|
||||
import net.torvald.terrarum.blockproperties.FluidProp
|
||||
import net.torvald.terrarum.gamecontroller.KeyToggler
|
||||
import net.torvald.terrarum.gameitems.ItemID
|
||||
import net.torvald.terrarum.gameparticles.createRandomBlockParticle
|
||||
@@ -582,6 +584,10 @@ open class ActorWithBody : Actor {
|
||||
// printdbg(this, "BodyViscosity=$bodyViscosity FeetViscosity=$feetViscosity BodyFriction=$bodyFriction FeetFriction=$feetFriction")
|
||||
// }
|
||||
|
||||
controllerV?.let {
|
||||
it.applyViscoseDrag()
|
||||
}
|
||||
|
||||
val vecSum = (externalV + (controllerV ?: Vector2(0.0, 0.0)))
|
||||
/**
|
||||
* solveCollision()?
|
||||
@@ -1512,8 +1518,6 @@ open class ActorWithBody : Actor {
|
||||
if (world == null) return 0.0
|
||||
val straightGravity = (world!!.gravitation.y > 0)
|
||||
|
||||
val dbgTYLs = HashSet<Int>()
|
||||
|
||||
val txL = (hitbox.startX / TILE_SIZED).floorToInt()
|
||||
val txR = (hitbox.endX / TILE_SIZED).floorToInt()
|
||||
var hL = 0
|
||||
@@ -1523,7 +1527,6 @@ open class ActorWithBody : Actor {
|
||||
val ty = (y / TILE_SIZED).floorToInt()
|
||||
if (world!!.getFluid(txL, ty).amount >= FLUID_MIN_MASS) hL += 1
|
||||
if (world!!.getFluid(txR, ty).amount >= FLUID_MIN_MASS) hR += 1
|
||||
dbgTYLs.add(ty)
|
||||
}
|
||||
|
||||
// returns average of two sides
|
||||
@@ -2026,32 +2029,14 @@ open class ActorWithBody : Actor {
|
||||
if (world == null) return
|
||||
|
||||
|
||||
val fluids = ArrayList<GameWorld.FluidInfo?>()
|
||||
|
||||
// offset 1 pixel to the down so that friction would work
|
||||
// val y = hitbox.endY.plus(1.0).div(TILE_SIZE).floorToInt()
|
||||
val y = intTilewiseHitbox.startY.toInt() + intTilewiseHitbox.height.toInt() + 1
|
||||
|
||||
for (x in hIntTilewiseHitbox.startX.toInt()..hIntTilewiseHitbox.endX.toInt()) {
|
||||
fluids.add(world!!.getFluid(x, y))
|
||||
}
|
||||
|
||||
return fluids.forEach(consumer)
|
||||
}
|
||||
|
||||
fun forEachFeetFluid(consumer: (GameWorld.FluidInfo?) -> Unit) {
|
||||
if (world == null) return
|
||||
|
||||
|
||||
val fluids = ArrayList<GameWorld.FluidInfo?>()
|
||||
|
||||
val tileProps = ArrayList<GameWorld.FluidInfo?>()
|
||||
for (y in hIntTilewiseHitbox.startY.toInt()..hIntTilewiseHitbox.endY.toInt()) {
|
||||
for (x in hIntTilewiseHitbox.startX.toInt()..hIntTilewiseHitbox.endX.toInt()) {
|
||||
fluids.add(world!!.getFluid(x, y))
|
||||
tileProps.add(world!!.getFluid(x, y))
|
||||
}
|
||||
}
|
||||
|
||||
return fluids.forEach(consumer)
|
||||
return tileProps.forEach(consumer)
|
||||
}
|
||||
|
||||
fun forEachOccupyingTilePos(hitbox: Hitbox, consumer: (BlockAddress) -> Unit) {
|
||||
@@ -2131,6 +2116,23 @@ open class ActorWithBody : Actor {
|
||||
return tileProps.forEach(consumer)
|
||||
}
|
||||
|
||||
fun forEachFeetFluid(consumer: (GameWorld.FluidInfo?) -> Unit) {
|
||||
if (world == null) return
|
||||
|
||||
|
||||
val tileProps = ArrayList<GameWorld.FluidInfo?>()
|
||||
|
||||
// offset 1 pixel to the down so that friction would work
|
||||
// val y = hitbox.endY.plus(1.0).div(TILE_SIZE).floorToInt()
|
||||
val y = intTilewiseHitbox.startY.toInt() + intTilewiseHitbox.height.toInt() + 1
|
||||
|
||||
for (x in hIntTilewiseHitbox.startX.toInt()..hIntTilewiseHitbox.endX.toInt()) {
|
||||
tileProps.add(world!!.getFluid(x, y))
|
||||
}
|
||||
|
||||
return tileProps.forEach(consumer)
|
||||
}
|
||||
|
||||
fun forEachFeetTileWithPos(consumer: (Point2i, ItemID) -> Unit) {
|
||||
val y = intTilewiseHitbox.startY.toInt() + intTilewiseHitbox.height.toInt() + 1
|
||||
(hIntTilewiseHitbox.startX.toInt()..hIntTilewiseHitbox.endX.toInt()).map { x ->
|
||||
|
||||
Reference in New Issue
Block a user