Немного прибираемся
This commit is contained in:
parent
9ae61d6882
commit
215ae8429e
@ -166,7 +166,7 @@ fun main() {
|
|||||||
val item = Starbound.ITEM.values.random()
|
val item = Starbound.ITEM.values.random()
|
||||||
val rand = java.util.Random()
|
val rand = java.util.Random()
|
||||||
|
|
||||||
for (i in 0 .. 240) {
|
for (i in 0 .. 10) {
|
||||||
val item = ItemEntity(client.world!!, item)
|
val item = ItemEntity(client.world!!, item)
|
||||||
|
|
||||||
item.position = Vector2d(600.0 + 16.0 + i, 721.0 + 48.0)
|
item.position = Vector2d(600.0 + 16.0 + i, 721.0 + 48.0)
|
||||||
|
@ -30,6 +30,7 @@ import ru.dbotthepony.kstarbound.defs.item.LeveledStatusEffect
|
|||||||
import ru.dbotthepony.kstarbound.defs.item.LiquidItemPrototype
|
import ru.dbotthepony.kstarbound.defs.item.LiquidItemPrototype
|
||||||
import ru.dbotthepony.kstarbound.defs.item.MaterialItemPrototype
|
import ru.dbotthepony.kstarbound.defs.item.MaterialItemPrototype
|
||||||
import ru.dbotthepony.kstarbound.defs.liquid.LiquidDefinition
|
import ru.dbotthepony.kstarbound.defs.liquid.LiquidDefinition
|
||||||
|
import ru.dbotthepony.kstarbound.defs.parallax.ParallaxPrototype
|
||||||
import ru.dbotthepony.kstarbound.defs.projectile.*
|
import ru.dbotthepony.kstarbound.defs.projectile.*
|
||||||
import ru.dbotthepony.kstarbound.defs.tile.MaterialModifier
|
import ru.dbotthepony.kstarbound.defs.tile.MaterialModifier
|
||||||
import ru.dbotthepony.kstarbound.defs.tile.RenderParameters
|
import ru.dbotthepony.kstarbound.defs.tile.RenderParameters
|
||||||
|
@ -1,32 +1,17 @@
|
|||||||
package ru.dbotthepony.kstarbound.client
|
package ru.dbotthepony.kstarbound.client
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL46.*
|
import org.lwjgl.opengl.GL46.*
|
||||||
import ru.dbotthepony.kstarbound.PIXELS_IN_STARBOUND_UNIT
|
|
||||||
import ru.dbotthepony.kstarbound.PIXELS_IN_STARBOUND_UNITf
|
import ru.dbotthepony.kstarbound.PIXELS_IN_STARBOUND_UNITf
|
||||||
import ru.dbotthepony.kstarbound.client.gl.BlendFunc
|
|
||||||
import ru.dbotthepony.kstarbound.client.gl.GLFrameBuffer
|
|
||||||
import ru.dbotthepony.kstarbound.client.gl.GLTexture2D
|
|
||||||
import ru.dbotthepony.kstarbound.client.gl.vertex.QuadTransformers
|
import ru.dbotthepony.kstarbound.client.gl.vertex.QuadTransformers
|
||||||
import ru.dbotthepony.kstarbound.client.gl.vertex.quad
|
|
||||||
import ru.dbotthepony.kstarbound.client.gl.vertex.quadZ
|
import ru.dbotthepony.kstarbound.client.gl.vertex.quadZ
|
||||||
import ru.dbotthepony.kstarbound.client.render.ILayeredRenderer
|
import ru.dbotthepony.kstarbound.client.render.ILayeredRenderer
|
||||||
import ru.dbotthepony.kstarbound.client.render.renderLayeredList
|
import ru.dbotthepony.kstarbound.client.render.renderLayeredList
|
||||||
import ru.dbotthepony.kstarbound.defs.ParallaxPrototype
|
import ru.dbotthepony.kstarbound.defs.parallax.ParallaxPrototype
|
||||||
import ru.dbotthepony.kstarbound.math.encasingChunkPosAABB
|
import ru.dbotthepony.kstarbound.math.encasingChunkPosAABB
|
||||||
import ru.dbotthepony.kstarbound.util.DoubleEdgeProgression
|
import ru.dbotthepony.kstarbound.util.DoubleEdgeProgression
|
||||||
import ru.dbotthepony.kstarbound.world.*
|
import ru.dbotthepony.kstarbound.world.*
|
||||||
import ru.dbotthepony.kstarbound.world.entities.Entity
|
import ru.dbotthepony.kstarbound.world.entities.Entity
|
||||||
import ru.dbotthepony.kvector.util2d.AABB
|
import ru.dbotthepony.kvector.util2d.AABB
|
||||||
import ru.dbotthepony.kvector.vector.Color
|
|
||||||
import ru.dbotthepony.kvector.vector.ndouble.Vector2d
|
|
||||||
import ru.dbotthepony.kvector.vector.nfloat.Vector2f
|
|
||||||
import ru.dbotthepony.kvector.vector.nint.Vector2i
|
|
||||||
import java.nio.ByteBuffer
|
|
||||||
import java.nio.ByteOrder
|
|
||||||
import kotlin.math.PI
|
|
||||||
import kotlin.math.cos
|
|
||||||
import kotlin.math.roundToInt
|
|
||||||
import kotlin.math.sin
|
|
||||||
|
|
||||||
class ClientWorld(
|
class ClientWorld(
|
||||||
val client: StarboundClient,
|
val client: StarboundClient,
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
package ru.dbotthepony.kstarbound.defs
|
|
||||||
|
|
||||||
import ru.dbotthepony.kvector.vector.nint.Vector2i
|
|
||||||
|
|
||||||
class AnimationDefinitionBuilder {
|
|
||||||
var frames: String? = null
|
|
||||||
var variants: Int? = null
|
|
||||||
var frameNumber: Int? = null
|
|
||||||
var animationCycle: Double? = null
|
|
||||||
var offset: Vector2i? = null
|
|
||||||
}
|
|
||||||
|
|
||||||
class AnimationDefinition {
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
package ru.dbotthepony.kstarbound.defs
|
|
||||||
|
|
||||||
class ParticleDefinitionBuilder {
|
|
||||||
var kind: String? = null
|
|
||||||
var animation: String? = null
|
|
||||||
var size: Double? = null
|
|
||||||
var timeToLive: Double? = null
|
|
||||||
}
|
|
@ -4,6 +4,7 @@ import com.google.common.collect.ImmutableMap
|
|||||||
import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap
|
import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap
|
||||||
import ru.dbotthepony.kstarbound.Starbound
|
import ru.dbotthepony.kstarbound.Starbound
|
||||||
import ru.dbotthepony.kstarbound.defs.util.enrollMap
|
import ru.dbotthepony.kstarbound.defs.util.enrollMap
|
||||||
|
import ru.dbotthepony.kstarbound.defs.util.flattenMap
|
||||||
import ru.dbotthepony.kstarbound.io.json.INativeJsonHolder
|
import ru.dbotthepony.kstarbound.io.json.INativeJsonHolder
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
package ru.dbotthepony.kstarbound.defs.parallax
|
||||||
|
|
||||||
|
import com.google.gson.GsonBuilder
|
||||||
|
import ru.dbotthepony.kstarbound.io.json.BuilderAdapter
|
||||||
|
|
||||||
|
class ParallaxPrototype {
|
||||||
|
var verticalOrigin = 0.0
|
||||||
|
|
||||||
|
var layers = Array(0) { ParallaxPrototypeLayer() }
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
val ADAPTER = BuilderAdapter(
|
||||||
|
::ParallaxPrototype,
|
||||||
|
ParallaxPrototype::verticalOrigin,
|
||||||
|
ParallaxPrototype::layers,
|
||||||
|
)
|
||||||
|
|
||||||
|
fun registerGson(gsonBuilder: GsonBuilder) {
|
||||||
|
gsonBuilder.registerTypeAdapter(ParallaxPrototype::class.java, ADAPTER)
|
||||||
|
gsonBuilder.registerTypeAdapter(ParallaxPrototypeLayer::class.java, ParallaxPrototypeLayer.ADAPTER)
|
||||||
|
gsonBuilder.registerTypeAdapter(
|
||||||
|
ParallaxPrototypeLayer.Parallax::class.java,
|
||||||
|
ParallaxPrototypeLayer.LAYER_PARALLAX_ADAPTER
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,5 @@
|
|||||||
package ru.dbotthepony.kstarbound.defs
|
package ru.dbotthepony.kstarbound.defs.parallax
|
||||||
|
|
||||||
import com.google.gson.GsonBuilder
|
|
||||||
import com.google.gson.JsonSyntaxException
|
import com.google.gson.JsonSyntaxException
|
||||||
import com.google.gson.TypeAdapter
|
import com.google.gson.TypeAdapter
|
||||||
import com.google.gson.stream.JsonReader
|
import com.google.gson.stream.JsonReader
|
||||||
@ -10,25 +9,6 @@ import ru.dbotthepony.kstarbound.io.json.BuilderAdapter
|
|||||||
import ru.dbotthepony.kvector.vector.ndouble.Vector2d
|
import ru.dbotthepony.kvector.vector.ndouble.Vector2d
|
||||||
import kotlin.properties.Delegates
|
import kotlin.properties.Delegates
|
||||||
|
|
||||||
class ParallaxPrototype {
|
|
||||||
var verticalOrigin = 0.0
|
|
||||||
|
|
||||||
var layers = Array(0) { ParallaxPrototypeLayer() }
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
val ADAPTER = BuilderAdapter(::ParallaxPrototype,
|
|
||||||
ParallaxPrototype::verticalOrigin,
|
|
||||||
ParallaxPrototype::layers,
|
|
||||||
)
|
|
||||||
|
|
||||||
fun registerGson(gsonBuilder: GsonBuilder) {
|
|
||||||
gsonBuilder.registerTypeAdapter(ParallaxPrototype::class.java, ADAPTER)
|
|
||||||
gsonBuilder.registerTypeAdapter(ParallaxPrototypeLayer::class.java, ParallaxPrototypeLayer.ADAPTER)
|
|
||||||
gsonBuilder.registerTypeAdapter(ParallaxPrototypeLayer.Parallax::class.java, ParallaxPrototypeLayer.LAYER_PARALLAX_ADAPTER)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class ParallaxPrototypeLayer {
|
class ParallaxPrototypeLayer {
|
||||||
class Parallax(val x: Double, val y: Double)
|
class Parallax(val x: Double, val y: Double)
|
||||||
|
|
||||||
@ -81,23 +61,23 @@ class ParallaxPrototypeLayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val ADAPTER = BuilderAdapter(::ParallaxPrototypeLayer,
|
val ADAPTER = BuilderAdapter(::ParallaxPrototypeLayer,
|
||||||
ParallaxPrototypeLayer::timeOfDayCorrelation,
|
ParallaxPrototypeLayer::timeOfDayCorrelation,
|
||||||
ParallaxPrototypeLayer::offset,
|
ParallaxPrototypeLayer::offset,
|
||||||
ParallaxPrototypeLayer::repeatY,
|
ParallaxPrototypeLayer::repeatY,
|
||||||
ParallaxPrototypeLayer::lightMapped,
|
ParallaxPrototypeLayer::lightMapped,
|
||||||
ParallaxPrototypeLayer::tileLimitTop,
|
ParallaxPrototypeLayer::tileLimitTop,
|
||||||
ParallaxPrototypeLayer::parallax,
|
ParallaxPrototypeLayer::parallax,
|
||||||
ParallaxPrototypeLayer::unlit,
|
ParallaxPrototypeLayer::unlit,
|
||||||
ParallaxPrototypeLayer::nohueshift,
|
ParallaxPrototypeLayer::nohueshift,
|
||||||
ParallaxPrototypeLayer::minSpeed,
|
ParallaxPrototypeLayer::minSpeed,
|
||||||
ParallaxPrototypeLayer::maxSpeed,
|
ParallaxPrototypeLayer::maxSpeed,
|
||||||
ParallaxPrototypeLayer::fadePercent,
|
ParallaxPrototypeLayer::fadePercent,
|
||||||
ParallaxPrototypeLayer::kind,
|
ParallaxPrototypeLayer::kind,
|
||||||
ParallaxPrototypeLayer::baseCount,
|
ParallaxPrototypeLayer::baseCount,
|
||||||
ParallaxPrototypeLayer::noRandomOffset,
|
ParallaxPrototypeLayer::noRandomOffset,
|
||||||
ParallaxPrototypeLayer::directives,
|
ParallaxPrototypeLayer::directives,
|
||||||
ParallaxPrototypeLayer::frequency,
|
ParallaxPrototypeLayer::frequency,
|
||||||
ParallaxPrototypeLayer::modCount,
|
ParallaxPrototypeLayer::modCount,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package ru.dbotthepony.kstarbound.defs
|
package ru.dbotthepony.kstarbound.defs.util
|
||||||
|
|
||||||
import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap
|
import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap
|
||||||
|
|
Loading…
Reference in New Issue
Block a user