mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 20:44:05 +09:00
moved white box tex to AppLoader; textButton now has alignment option
This commit is contained in:
@@ -222,10 +222,6 @@ object Terrarum : Screen {
|
||||
lateinit var shaderRGBOnly: ShaderProgram
|
||||
lateinit var shaderAtoGrey: ShaderProgram
|
||||
|
||||
|
||||
lateinit var textureWhiteSquare: Texture
|
||||
|
||||
|
||||
lateinit var testTexture: Texture
|
||||
|
||||
|
||||
@@ -357,10 +353,6 @@ object Terrarum : Screen {
|
||||
fontSmallNumbers = TinyAlphNum
|
||||
|
||||
|
||||
textureWhiteSquare = Texture(Gdx.files.internal("assets/graphics/ortho_line_tex_2px.tga"))
|
||||
textureWhiteSquare.setFilter(Texture.TextureFilter.Nearest, Texture.TextureFilter.Nearest)
|
||||
|
||||
|
||||
ShaderProgram.pedantic = false
|
||||
shaderBlur = ShaderProgram(Gdx.files.internal("assets/blur.vert"), Gdx.files.internal("assets/blur.frag"))
|
||||
|
||||
@@ -788,7 +780,7 @@ fun Float.round(): Float {
|
||||
|
||||
// ShapeRenderer alternative for rects
|
||||
fun SpriteBatch.fillRect(x: Float, y: Float, w: Float, h: Float) {
|
||||
this.draw(Terrarum.textureWhiteSquare, x, y, w, h)
|
||||
this.draw(AppLoader.textureWhiteSquare, x, y, w, h)
|
||||
}
|
||||
inline fun SpriteBatch.drawStraightLine(x: Float, y: Float, otherEnd: Float, thickness: Float, isVertical: Boolean) {
|
||||
if (!isVertical)
|
||||
@@ -840,11 +832,11 @@ object BlendMode {
|
||||
const val NORMAL = "normal"
|
||||
//const val MAX = "GL_MAX" // not supported by GLES -- use shader
|
||||
|
||||
fun resolve(mode: String) {
|
||||
fun resolve(mode: String, batch: SpriteBatch? = null) {
|
||||
when (mode) {
|
||||
SCREEN -> blendScreen()
|
||||
MULTIPLY -> blendMul()
|
||||
NORMAL -> blendNormal()
|
||||
SCREEN -> blendScreen(batch)
|
||||
MULTIPLY -> blendMul(batch)
|
||||
NORMAL -> blendNormal(batch)
|
||||
//MAX -> blendLightenOnly() // not supported by GLES -- use shader
|
||||
else -> throw Error("Unknown blend mode: $mode")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user