удаление упоминаний параллакса
This commit is contained in:
parent
1bffac6014
commit
df4937f1df
@ -130,12 +130,13 @@ class Starbound : ISBFileLocator {
|
||||
// все enum'ы без особых настроек
|
||||
registerTypeAdapterFactory(EnumAdapter.Companion)
|
||||
|
||||
// автоматическое создание BuilderAdapter по @аннотациям
|
||||
// @JsonBuilder
|
||||
registerTypeAdapterFactory(BuilderAdapter.Factory(stringInterner))
|
||||
|
||||
// автоматическое создание FactoryAdapter по @аннотациям
|
||||
// @JsonFactory
|
||||
registerTypeAdapterFactory(FactoryAdapter.Factory(stringInterner))
|
||||
|
||||
// Either<>
|
||||
registerTypeAdapterFactory(EitherTypeAdapter)
|
||||
registerTypeAdapterFactory(SBPattern.Companion)
|
||||
|
||||
|
@ -6,7 +6,6 @@ import ru.dbotthepony.kstarbound.client.gl.vertex.QuadTransformers
|
||||
import ru.dbotthepony.kstarbound.client.gl.vertex.quadZ
|
||||
import ru.dbotthepony.kstarbound.client.render.ILayeredRenderer
|
||||
import ru.dbotthepony.kstarbound.client.render.renderLayeredList
|
||||
import ru.dbotthepony.kstarbound.defs.parallax.ParallaxPrototype
|
||||
import ru.dbotthepony.kstarbound.math.encasingChunkPosAABB
|
||||
import ru.dbotthepony.kstarbound.util.DoubleEdgeProgression
|
||||
import ru.dbotthepony.kstarbound.world.*
|
||||
@ -29,8 +28,6 @@ class ClientWorld(
|
||||
)
|
||||
}
|
||||
|
||||
var parallax: ParallaxPrototype? = null
|
||||
|
||||
/**
|
||||
* Отрисовывает этот с обрезкой невидимой геометрии с точки зрения [size] в Starbound Units
|
||||
*
|
||||
@ -41,65 +38,6 @@ class ClientWorld(
|
||||
size: AABB,
|
||||
isScreenspaceRender: Boolean = true
|
||||
) {
|
||||
val parallax = parallax
|
||||
|
||||
if (parallax != null) {
|
||||
client.gl.matrixStack.push()
|
||||
|
||||
client.gl.matrixStack.translateWithMultiplication(y = parallax.verticalOrigin.toFloat() - 20f)
|
||||
|
||||
client.gl.shaderVertexTexture.use()
|
||||
|
||||
val builder = client.gl.flat2DTexturedQuads.small
|
||||
|
||||
client.gl.activeTexture = 0
|
||||
client.gl.shaderVertexTexture["_texture"] = 0
|
||||
val centre = size.centre
|
||||
|
||||
for (layer in parallax.layers) {
|
||||
client.gl.matrixStack.push()
|
||||
client.gl.matrixStack.translateWithMultiplication(x = layer.offset.x.toFloat() / PIXELS_IN_STARBOUND_UNITf, y = layer.offset.y.toFloat() / PIXELS_IN_STARBOUND_UNITf)
|
||||
|
||||
client.gl.shaderVertexTexture.transform.set(client.gl.matrixStack.last)
|
||||
|
||||
val texture = client.gl.loadNamedTextureSafe("/parallax/images/${layer.kind}/base/1.png")
|
||||
|
||||
texture.bind()
|
||||
texture.textureMagFilter = GL_NEAREST
|
||||
texture.textureMinFilter = GL_NEAREST
|
||||
|
||||
builder.begin()
|
||||
|
||||
for (xPos in DoubleEdgeProgression()) {
|
||||
var x0 = xPos.toFloat() * texture.width / PIXELS_IN_STARBOUND_UNITf
|
||||
var x1 = (xPos + 1f) * texture.width / PIXELS_IN_STARBOUND_UNITf
|
||||
|
||||
val diffx = layer.parallax.x * centre.x - centre.x
|
||||
val diffy = (layer.parallax.y * (centre.y + 20.0) - centre.y - 20.0).toFloat() / PIXELS_IN_STARBOUND_UNITf
|
||||
|
||||
x0 += diffx.toFloat() / PIXELS_IN_STARBOUND_UNITf
|
||||
x1 += diffx.toFloat() / PIXELS_IN_STARBOUND_UNITf
|
||||
|
||||
builder.quadZ(x0, diffy, x1, diffy + texture.height.toFloat() / PIXELS_IN_STARBOUND_UNITf, 1f, QuadTransformers.uv(0f, 1f, 1f, 0f))
|
||||
|
||||
/*if (x1 < size.mins.x) {
|
||||
break
|
||||
}*/
|
||||
|
||||
if (xPos < -40) {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
builder.upload()
|
||||
builder.draw()
|
||||
|
||||
client.gl.matrixStack.pop()
|
||||
}
|
||||
|
||||
client.gl.matrixStack.pop()
|
||||
}
|
||||
|
||||
val determineRenderers = ArrayList<ILayeredRenderer>()
|
||||
|
||||
client.lightRenderer.begin()
|
||||
|
Loading…
Reference in New Issue
Block a user