mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-15 21:14:04 +09:00
spritebatch with hdr colour
This commit is contained in:
@@ -3,13 +3,14 @@ package net.torvald.terrarum
|
||||
import com.badlogic.gdx.graphics.Texture
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion
|
||||
import com.badlogic.gdx.graphics.g2d.UnpackedColourSpriteBatch
|
||||
|
||||
/**
|
||||
* Don't flip the assets! Flip the draw command instead!
|
||||
*
|
||||
* Created by minjaesong on 2021-12-13.
|
||||
*/
|
||||
class FlippingSpriteBatch(size: Int = 1000) : SpriteBatch(size, DefaultGL32Shaders.createSpriteBatchShader()) {
|
||||
class FlippingSpriteBatch(size: Int = 1000) : UnpackedColourSpriteBatch(size, DefaultGL32Shaders.createSpriteBatchShader()) {
|
||||
|
||||
/**
|
||||
* This function draws the flipped version of the image by giving flipped uv-coord to the SpriteBatch
|
||||
@@ -42,6 +43,7 @@ class FlippingSpriteBatch(size: Int = 1000) : SpriteBatch(size, DefaultGL32Shade
|
||||
draw(region.texture, x, y, region.regionWidth.toFloat(), region.regionHeight.toFloat(), region.u, region.v2, region.u2, region.v)
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* NOTE TO SELF:
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user