mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
Houston, we have a render (again)
This commit is contained in:
Binary file not shown.
@@ -590,26 +590,38 @@ class Ingame(val batch: SpriteBatch) : Screen {
|
||||
processBlur(lightmapFboA, lightmapFboB, LightmapRenderer.DRAW_FOR_RGB)
|
||||
|
||||
worldDrawFrameBuffer.inAction(camera, batch) {
|
||||
|
||||
|
||||
// draw-with-poly doesn't want to co-op with peasant spriteBatch...
|
||||
|
||||
batch.inUse {
|
||||
batch.shader = null
|
||||
|
||||
|
||||
|
||||
|
||||
batch.color = Color.WHITE
|
||||
blendNormal()
|
||||
}
|
||||
|
||||
setCameraPosition(0f, 0f)
|
||||
BlocksDrawer.renderWall(batch)
|
||||
|
||||
|
||||
setCameraPosition(0f, 0f)
|
||||
BlocksDrawer.renderWall(batch)
|
||||
|
||||
|
||||
|
||||
batch.inUse {
|
||||
moveCameraToWorldCoord()
|
||||
actorsRenderBehind.forEach { it.drawBody(batch) }
|
||||
particlesContainer.forEach { it.drawBody(batch) }
|
||||
|
||||
setCameraPosition(0f, 0f)
|
||||
BlocksDrawer.renderTerrain(batch)
|
||||
}
|
||||
|
||||
|
||||
|
||||
setCameraPosition(0f, 0f)
|
||||
BlocksDrawer.renderTerrain(batch)
|
||||
|
||||
|
||||
|
||||
batch.inUse {
|
||||
/////////////////
|
||||
// draw actors //
|
||||
/////////////////
|
||||
@@ -626,7 +638,7 @@ class Ingame(val batch: SpriteBatch) : Screen {
|
||||
/////////////////////////////
|
||||
|
||||
setCameraPosition(0f, 0f)
|
||||
BlocksDrawer.renderFront(batch, false)
|
||||
//BlocksDrawer.renderFront(batch, false)
|
||||
|
||||
// --> blendNormal() <-- by BlocksDrawer.renderFront
|
||||
FeaturesDrawer.drawEnvOverlay(batch)
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
package net.torvald.terrarum
|
||||
|
||||
import com.badlogic.gdx.Game
|
||||
import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.Screen
|
||||
import com.badlogic.gdx.backends.lwjgl.LwjglApplication
|
||||
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration
|
||||
import com.badlogic.gdx.graphics.*
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.badlogic.gdx.graphics.glutils.FrameBuffer
|
||||
import com.badlogic.gdx.graphics.glutils.ShaderProgram
|
||||
@@ -14,11 +10,7 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer
|
||||
import com.badlogic.gdx.utils.GdxRuntimeException
|
||||
import com.google.gson.JsonArray
|
||||
import com.google.gson.JsonPrimitive
|
||||
import net.torvald.random.HQRNG
|
||||
import net.torvald.terrarum.Terrarum.RENDER_FPS
|
||||
import net.torvald.terrarum.TerrarumAppLoader
|
||||
import net.torvald.terrarum.gameactors.floorInt
|
||||
import net.torvald.terrarum.gamecontroller.IngameController
|
||||
import net.torvald.terrarum.imagefont.TinyAlphNum
|
||||
import net.torvald.terrarum.imagefont.Watch7SegMain
|
||||
import net.torvald.terrarum.imagefont.WatchDotAlph
|
||||
@@ -35,9 +27,7 @@ import org.lwjgl.BufferUtils
|
||||
import org.lwjgl.input.Controllers
|
||||
import java.io.File
|
||||
import java.io.IOException
|
||||
import java.lang.management.ManagementFactory
|
||||
import java.nio.IntBuffer
|
||||
import java.util.*
|
||||
|
||||
|
||||
/**
|
||||
* Slick2d Version Created by minjaesong on 2015-12-30.
|
||||
|
||||
@@ -272,8 +272,6 @@ class TitleScreen(val batch: SpriteBatch) : Screen {
|
||||
BlocksDrawer.renderWall(batch)
|
||||
BlocksDrawer.renderTerrain(batch)
|
||||
|
||||
Gdx.gl.glActiveTexture(GL20.GL_TEXTURE0) // don't know why it is needed; it really depresses me
|
||||
|
||||
|
||||
FeaturesDrawer.drawEnvOverlay(batch)
|
||||
|
||||
|
||||
@@ -398,6 +398,7 @@ object BlocksDrawer {
|
||||
}
|
||||
|
||||
@Deprecated("It's broken right now; don't use it")
|
||||
// FIXME biatch
|
||||
fun renderFront(batch: SpriteBatch, drawWires: Boolean) {
|
||||
// blend mul
|
||||
Gdx.gl.glEnable(GL20.GL_TEXTURE_2D)
|
||||
@@ -734,15 +735,15 @@ object BlocksDrawer {
|
||||
|
||||
val tilesBufferAsTex = Texture(tilesBuffer)
|
||||
tilesBufferAsTex.setFilter(Texture.TextureFilter.Nearest, Texture.TextureFilter.Nearest)
|
||||
tilesBufferAsTex.bind(2)
|
||||
tileAtlas.texture.bind(1) // for some fuck reason, it must be bound as last
|
||||
tilesBufferAsTex.bind(1) // trying 1 and 0...
|
||||
tileAtlas.texture.bind(0) // for some fuck reason, it must be bound as last
|
||||
|
||||
shader.begin()
|
||||
shader.setUniformMatrix("u_projTrans", projectionMatrix)//camera.combined)
|
||||
shader.setUniformf("colourFilter", vertexColour)
|
||||
shader.setUniformf("screenDimension", Gdx.graphics.width.toFloat(), Gdx.graphics.height.toFloat())
|
||||
shader.setUniformi("tilesAtlas", 1)
|
||||
shader.setUniformi("tilemap", 2)
|
||||
shader.setUniformi("tilesAtlas", 0)
|
||||
shader.setUniformi("tilemap", 1)
|
||||
shader.setUniformi("tilemapDimension", tilesBuffer.width, tilesBuffer.height)
|
||||
shader.setUniformf("tilesInAxes", tilesInHorizontal.toFloat(), tilesInVertical.toFloat())
|
||||
shader.setUniformi("cameraTranslation", WorldCamera.x fmod TILE_SIZE, WorldCamera.y fmod TILE_SIZE)
|
||||
|
||||
BIN
work_files/graphics/fonts/telegraph/5x5_ibm_bcd.psd
LFS
Normal file
BIN
work_files/graphics/fonts/telegraph/5x5_ibm_bcd.psd
LFS
Normal file
Binary file not shown.
BIN
work_files/graphics/fonts/telegraph/5x5_kana.psd
LFS
Normal file
BIN
work_files/graphics/fonts/telegraph/5x5_kana.psd
LFS
Normal file
Binary file not shown.
Reference in New Issue
Block a user